接入topon(依赖已更新,来自婷婷姐)
This commit is contained in:
parent
f184b3ce43
commit
2bb7083379
@ -6,6 +6,8 @@ import java.io.FileInputStream
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id ("org.jetbrains.kotlin.android")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
|
||||
}
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
@ -26,8 +28,8 @@ android {
|
||||
applicationId = "com.draw.painting.line"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 2
|
||||
versionName = "1.1"
|
||||
versionCode = 3
|
||||
versionName = "3.1"
|
||||
setProperty("archivesBaseName", "Ar Drawing Space_V" + versionName + "(${versionCode})_$timestamp")
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -68,7 +70,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation("com.google.guava:guava:31.1-android")
|
||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||
implementation("androidx.activity:activity:1.8.2")
|
||||
implementation("com.google.android.material:material:1.13.0")
|
||||
@ -87,9 +89,99 @@ dependencies {
|
||||
implementation ("androidx.camera:camera-extensions:${camerax_version}")
|
||||
|
||||
|
||||
//sdk
|
||||
implementation(files("libs/TopOnLibrary_11_06_18_02-release.aar"))
|
||||
implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar"))
|
||||
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Bigo)
|
||||
//TU (Necessary)
|
||||
implementation("com.thinkup.sdk:core-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:nativead-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:banner-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:interstitial-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:rewardedvideo-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:splash-tpn:6.5.36")
|
||||
|
||||
//Androidx (Necessary)
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("androidx.browser:browser:1.4.0")
|
||||
|
||||
//StartApp
|
||||
implementation("com.thinkup.sdk:adapter-tpn-startapp:6.5.36")
|
||||
implementation("com.startapp:inapp-sdk:5.2.4")
|
||||
|
||||
//Vungle
|
||||
implementation("com.thinkup.sdk:adapter-tpn-vungle:6.5.36")
|
||||
implementation("com.vungle:vungle-ads:7.5.0")
|
||||
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//UnityAds
|
||||
implementation("com.thinkup.sdk:adapter-tpn-unityads:6.5.36")
|
||||
implementation("com.unity3d.ads:unity-ads:4.16.1")
|
||||
|
||||
//Ironsource
|
||||
implementation("com.thinkup.sdk:adapter-tpn-ironsource:6.5.36")
|
||||
implementation("com.ironsource.sdk:mediationsdk:8.10.0")
|
||||
implementation("com.google.android.gms:play-services-appset:16.0.2")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||
|
||||
//Bigo
|
||||
implementation("com.thinkup.sdk:adapter-tpn-bigo:6.5.36")
|
||||
implementation("com.bigossp:bigo-ads:5.5.1")
|
||||
|
||||
//Pangle
|
||||
implementation("com.thinkup.sdk:adapter-tpn-pangle:6.5.36")
|
||||
implementation("com.pangle.global:pag-sdk:7.6.0.2")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
|
||||
|
||||
//Inmobi
|
||||
implementation("com.thinkup.sdk:adapter-tpn-inmobi:6.5.36")
|
||||
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.8.7")
|
||||
|
||||
//TU Adx SDK(Necessary)
|
||||
implementation("com.thinkup.sdk:adapter-tpn-sdm:6.5.36.4")
|
||||
implementation("com.smartdigimkttech.sdk:smartdigimkttech-sdk:6.5.40")
|
||||
|
||||
//Mintegral
|
||||
implementation("com.thinkup.sdk:adapter-tpn-mintegral:6.5.36")
|
||||
implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.91")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
|
||||
//Chartboost
|
||||
implementation("com.thinkup.sdk:adapter-tpn-chartboost:6.5.36")
|
||||
implementation("com.chartboost:chartboost-sdk:9.8.3")
|
||||
implementation("com.chartboost:chartboost-mediation-sdk:4.9.2")
|
||||
implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.8.1.0")
|
||||
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||
implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
|
||||
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
|
||||
|
||||
//Fyber
|
||||
implementation("com.thinkup.sdk:adapter-tpn-fyber:6.5.36")
|
||||
implementation("com.fyber:marketplace-sdk:8.3.7")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//Tramini
|
||||
implementation("com.thinkup.sdk:tramini-plugin-tpn:6.5.36")
|
||||
// Debugger UI Tools
|
||||
implementation("com.thinkup.sdk:debugger-ui:1.1.2")
|
||||
|
||||
//firebase
|
||||
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
|
||||
implementation("com.google.firebase:firebase-crashlytics")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
implementation("com.google.firebase:firebase-config")
|
||||
|
||||
//upload
|
||||
implementation ("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
||||
|
||||
implementation ("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
|
||||
|
||||
|
||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "16958905312",
|
||||
"project_id": "ardrawingspacec",
|
||||
"storage_bucket": "ardrawingspacec.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:16958905312:android:7db92dc45f5d5fb2f82985",
|
||||
"android_client_info": {
|
||||
"package_name": "com.draw.painting.line"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyB4FQIn9S3sfWa9EswDmgzX9p_LQzbM_JM"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
app/libs/TopOnLibrary_11_06_18_02-release.aar
Normal file
BIN
app/libs/TopOnLibrary_11_06_18_02-release.aar
Normal file
Binary file not shown.
BIN
app/libs/UpLoadLibrary_12_03_15_13-release.aar
Normal file
BIN
app/libs/UpLoadLibrary_12_03_15_13-release.aar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,9 +11,9 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "Ar Drawing Space_V1.0(1)_12_17_11_29-release.apk"
|
||||
"versionCode": 3,
|
||||
"versionName": "3.1",
|
||||
"outputFile": "Ar Drawing Space_V3.1(3)_01_05_13_51-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File",
|
||||
@ -22,14 +22,14 @@
|
||||
"minApi": 28,
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/Ar Drawing Space_V1.0(1)_12_17_11_29-release.dm"
|
||||
"baselineProfiles/1/Ar Drawing Space_V3.1(3)_01_05_13_51-release.dm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minApi": 31,
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/Ar Drawing Space_V1.0(1)_12_17_11_29-release.dm"
|
||||
"baselineProfiles/0/Ar Drawing Space_V3.1(3)_01_05_13_51-release.dm"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
|
||||
<application
|
||||
@ -18,8 +19,21 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/logo"
|
||||
android:supportsRtl="true"
|
||||
android:name=".DrawingApp"
|
||||
android:theme="@style/Theme.PaintingHelper"
|
||||
android:networkSecurityConfig="@xml/net"
|
||||
tools:replace="android:networkSecurityConfig"
|
||||
tools:targetApi="31">
|
||||
|
||||
<!--start.io-->
|
||||
<meta-data
|
||||
android:name="com.startapp.sdk.SPLASH_ENABLED"
|
||||
android:value="false" />
|
||||
|
||||
<!--start.io-->
|
||||
<meta-data
|
||||
android:name="com.startapp.sdk.RETURN_ADS_ENABLED"
|
||||
android:value="false" />
|
||||
<activity
|
||||
android:name=".ui.GalleryActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
package com.draw.painting.line;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.up.uploadlibrary.UpLoadManager;
|
||||
|
||||
public class DrawingApp extends Application {
|
||||
|
||||
@ -8,6 +12,9 @@ public class DrawingApp extends Application {
|
||||
|
||||
public static String Key_Camera = "camera_data";
|
||||
|
||||
public static final String TAG = "DrawingApp";
|
||||
private static DrawingApp app;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -15,8 +22,14 @@ public class DrawingApp extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
|
||||
app = this;
|
||||
UpLoadManager.INSTANCE.init(app,TAG,(k1, k2)-> null);
|
||||
AdManager.INSTANCE.init(TAG,app,"h695a24ac29479","a3d7e73522fa3eef29c138c2a7b798ffa",
|
||||
"d0a434af69020f58cd1c246da4adb0630eb18a02",
|
||||
"n695a24d9be227",
|
||||
"n695a24d979a2b",
|
||||
"n695a24d9334a8",false);//测试开true
|
||||
Log.d(TAG, "onCreate: sdk init success");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -267,7 +267,7 @@ public class DeerVectorDrawView extends View {
|
||||
isAnimating = true;
|
||||
|
||||
mainAnimator = ValueAnimator.ofFloat(0f, 1f);
|
||||
mainAnimator.setDuration(2200); // 总时长 2.2 秒
|
||||
mainAnimator.setDuration(12000); // 总时长 2.2 秒
|
||||
mainAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
mainAnimator.addUpdateListener(animation -> {
|
||||
animationProgress = (float) animation.getAnimatedValue();
|
||||
|
||||
@ -36,10 +36,11 @@ import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.draw.painting.line.DrawingApp;
|
||||
import com.draw.painting.line.R;
|
||||
import com.draw.painting.line.manager.AppHelper;
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -82,6 +83,8 @@ public class DrawActivity extends AppCompatActivity implements View.OnTouchListe
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AppHelper.enableEdgeToEdge(this);
|
||||
AdManager.loadAllAd();
|
||||
AdManager.showTopOn(this, () -> {});
|
||||
setContentView(R.layout.activity_draw);
|
||||
previewView = findViewById(R.id.preview);
|
||||
imageView = findViewById(R.id.image);
|
||||
@ -184,7 +187,7 @@ public class DrawActivity extends AppCompatActivity implements View.OnTouchListe
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.equals(imBack)) {
|
||||
finish();
|
||||
AdManager.showTopOn(this, () -> { finish();});
|
||||
} else {
|
||||
if (!hasPermission) {
|
||||
showNoPermission();
|
||||
@ -194,9 +197,11 @@ public class DrawActivity extends AppCompatActivity implements View.OnTouchListe
|
||||
if (camera == null) {
|
||||
return;
|
||||
}
|
||||
boolean selected = flashIm.isSelected();
|
||||
flashIm.setSelected(!selected);
|
||||
camera.getCameraControl().enableTorch(!selected);
|
||||
AdManager.showTopOn(this, () -> {
|
||||
boolean selected = flashIm.isSelected();
|
||||
flashIm.setSelected(!selected);
|
||||
camera.getCameraControl().enableTorch(!selected);
|
||||
});
|
||||
} else if (v.equals(imPhoto)) {
|
||||
pickImageLauncher.launch(
|
||||
new PickVisualMediaRequest.Builder()
|
||||
|
||||
@ -8,6 +8,7 @@ import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.draw.painting.line.DrawingApp;
|
||||
import com.draw.painting.line.adapter.ImageListAdapter;
|
||||
import com.draw.painting.line.databinding.ActivityGalleryBinding;
|
||||
@ -50,6 +51,8 @@ public class GalleryActivity extends AppCompatActivity {
|
||||
AppHelper.enableEdgeToEdge(this);
|
||||
preViewBinding = ActivityGalleryBinding.inflate(getLayoutInflater());
|
||||
setContentView(preViewBinding.getRoot());
|
||||
AdManager.loadAllAd();
|
||||
AdManager.showTopOn(this, () -> {});
|
||||
// AppHelper.setupWindowInsetsListener(preViewBinding.getRoot());
|
||||
|
||||
AppHelper.setupBottomNavPadding(preViewBinding.getRoot());
|
||||
@ -117,7 +120,7 @@ public class GalleryActivity extends AppCompatActivity {
|
||||
preViewBinding.back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
AdManager.showTopOn(GalleryActivity.this, () -> {finish();});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.draw.painting.line.R;
|
||||
import com.draw.painting.line.databinding.ActivityMainBinding;
|
||||
import com.draw.painting.line.manager.AppHelper;
|
||||
|
||||
@ -6,29 +6,37 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.draw.painting.line.databinding.ActivitySplashBinding;
|
||||
import com.draw.painting.line.manager.AppHelper;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
|
||||
private ActivitySplashBinding binding;
|
||||
private Handler handler = new Handler();
|
||||
private boolean isAnimationComplete = false;
|
||||
private CountDownTimer countDownTimer;
|
||||
|
||||
private static final long SPLASH_TIME_OUT = 15000; // 总时长15秒
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
AppHelper.enableEdgeToEdge(this);
|
||||
binding = ActivitySplashBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
AppHelper.setupWindowInsetsListener(binding.getRoot());
|
||||
|
||||
|
||||
// 等待布局完成后再启动动画
|
||||
binding.getRoot().post(new Runnable() {
|
||||
@Override
|
||||
@ -39,86 +47,97 @@ public class SplashActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void startLaunchAnimation() {
|
||||
countDownTimer = AdManager.showWelcomeAd(this, SPLASH_TIME_OUT, new Function1<Long, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Long aLong) {
|
||||
int progressPercentage = (int) ((100 * aLong) / SPLASH_TIME_OUT);
|
||||
int Percentage = 100 - progressPercentage;
|
||||
binding.progressbar.setProgress(Percentage);
|
||||
return null;
|
||||
}
|
||||
|
||||
}, new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
countDownTimer.start();
|
||||
// 启动鹿的绘制动画(使用XML Vector Drawable路径)
|
||||
binding.deerView.startAnimation();
|
||||
|
||||
|
||||
// 同步加载条:0-80% 与鹿的动画同步
|
||||
// 新版可爱小鹿动画总时长 2.2s,加载条在鹿画到约80%时到达80%
|
||||
animateProgressBar(0f, 0.8f, 2200, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 等待真实加载完成(这里可以添加实际的加载逻辑)
|
||||
waitForLoading();
|
||||
}
|
||||
});
|
||||
// animateProgressBar(0f, 0.8f, 15000, new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// // 等待真实加载完成(这里可以添加实际的加载逻辑)
|
||||
// waitForLoading();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void animateProgressBar(float from, float to, long duration, Runnable onComplete) {
|
||||
ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
||||
int maxWidth = binding.progressContainer.getWidth();
|
||||
|
||||
ValueAnimator animator = ValueAnimator.ofFloat(from, to);
|
||||
animator.setDuration(duration);
|
||||
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
float progress = (float) animation.getAnimatedValue();
|
||||
params.width = (int) (maxWidth * progress);
|
||||
binding.progressBar.setLayoutParams(params);
|
||||
}
|
||||
});
|
||||
|
||||
if (onComplete != null) {
|
||||
animator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
onComplete.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
animator.start();
|
||||
}
|
||||
// private void animateProgressBar(float from, float to, long duration, Runnable onComplete) {
|
||||
// ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
||||
// int maxWidth = binding.progressContainer.getWidth();
|
||||
//
|
||||
// ValueAnimator animator = ValueAnimator.ofFloat(from, to);
|
||||
// animator.setDuration(duration);
|
||||
// animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
// @Override
|
||||
// public void onAnimationUpdate(ValueAnimator animation) {
|
||||
// float progress = (float) animation.getAnimatedValue();
|
||||
// params.width = (int) (maxWidth * progress);
|
||||
// binding.progressBar.setLayoutParams(params);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// if (onComplete != null) {
|
||||
// animator.addListener(new AnimatorListenerAdapter() {
|
||||
// @Override
|
||||
// public void onAnimationEnd(Animator animation) {
|
||||
// onComplete.run();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// animator.start();
|
||||
// }
|
||||
|
||||
private void waitForLoading() {
|
||||
// 模拟等待真实加载(实际项目中这里应该是真实的加载逻辑)
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
completeLoading();
|
||||
}
|
||||
}, 500); // 等待500ms
|
||||
}
|
||||
|
||||
private void completeLoading() {
|
||||
if (isAnimationComplete) return;
|
||||
isAnimationComplete = true;
|
||||
|
||||
// 快速完成加载条到100%
|
||||
ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
||||
int maxWidth = binding.progressContainer.getWidth();
|
||||
|
||||
ValueAnimator animator = ValueAnimator.ofFloat(0.8f, 1.0f);
|
||||
animator.setDuration(200);
|
||||
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
float progress = (float) animation.getAnimatedValue();
|
||||
params.width = (int) (maxWidth * progress);
|
||||
binding.progressBar.setLayoutParams(params);
|
||||
}
|
||||
});
|
||||
|
||||
animator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
// 0.2s 淡出
|
||||
fadeOutAndEnter();
|
||||
}
|
||||
});
|
||||
|
||||
animator.start();
|
||||
}
|
||||
|
||||
// private void completeLoading() {
|
||||
// if (isAnimationComplete) return;
|
||||
// isAnimationComplete = true;
|
||||
//
|
||||
// // 快速完成加载条到100%
|
||||
// ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
||||
// int maxWidth = binding.progressContainer.getWidth();
|
||||
//
|
||||
// ValueAnimator animator = ValueAnimator.ofFloat(0.8f, 1.0f);
|
||||
// animator.setDuration(200);
|
||||
// animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
// @Override
|
||||
// public void onAnimationUpdate(ValueAnimator animation) {
|
||||
// float progress = (float) animation.getAnimatedValue();
|
||||
// params.width = (int) (maxWidth * progress);
|
||||
// binding.progressBar.setLayoutParams(params);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// animator.addListener(new AnimatorListenerAdapter() {
|
||||
// @Override
|
||||
// public void onAnimationEnd(Animator animation) {
|
||||
// // 0.2s 淡出
|
||||
// fadeOutAndEnter();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// animator.start();
|
||||
// }
|
||||
|
||||
private void fadeOutAndEnter() {
|
||||
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(binding.getRoot(), "alpha", 1f, 0f);
|
||||
|
||||
@ -1,7 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#8DD4C0" />
|
||||
<corners android:radius="999dp" />
|
||||
</shape>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="10dp" />
|
||||
<solid android:color="#EAF5F0" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="10dp" />
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#8DD4C0"
|
||||
android:centerColor="#8DD4C0"
|
||||
android:startColor="#8DD4C0" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@ -46,19 +46,30 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- 背景条 -->
|
||||
<View
|
||||
<!-- <!– 背景条 –>-->
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="6dp"-->
|
||||
<!-- android:background="@drawable/progress_bg" />-->
|
||||
|
||||
<!-- <!– 进度条 –>-->
|
||||
<!-- <View-->
|
||||
<!-- android:id="@+id/progress_bar"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="6dp"-->
|
||||
<!-- android:background="@drawable/progress_fill"-->
|
||||
<!-- android:layout_gravity="start|center_vertical" />-->
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:background="@drawable/progress_bg" />
|
||||
android:layout_centerHorizontal="true"
|
||||
android:max="100"
|
||||
android:progress="1"
|
||||
android:progressDrawable="@drawable/progress_fill"
|
||||
android:layout_marginTop="1dp"/>
|
||||
|
||||
<!-- 进度条 -->
|
||||
<View
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="6dp"
|
||||
android:background="@drawable/progress_fill"
|
||||
android:layout_gravity="start|center_vertical" />
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
6
app/src/main/res/xml/net.xml
Normal file
6
app/src/main/res/xml/net.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config xmlns:tools="http://schemas.android.com/tools">
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain tools:ignore="NetworkSecurityConfig">mobile-server.lux-ad.com</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
@ -2,4 +2,6 @@
|
||||
plugins {
|
||||
id("com.android.application") version "8.11.1" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.21" apply false
|
||||
id("com.google.gms.google-services") version "4.4.2" apply false
|
||||
id ("com.google.firebase.crashlytics") version "3.0.2" apply false
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Mon Dec 15 10:39:56 CST 2025
|
||||
#Sun Jan 04 17:49:22 CST 2026
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@ -10,6 +10,28 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// flatDir {
|
||||
// dirs("libs")
|
||||
// }
|
||||
|
||||
//TU(Core)
|
||||
maven ( "https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||
|
||||
//Ironsource
|
||||
maven ( "https://android-sdk.is.com/")
|
||||
|
||||
//Pangle
|
||||
maven ("https://artifact.bytedance.com/repository/pangle")
|
||||
|
||||
//Mintegral
|
||||
maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
||||
|
||||
//Chartboost
|
||||
maven ( "https://cboost.jfrog.io/artifactory/chartboost-ads")
|
||||
maven ("https://cboost.jfrog.io/artifactory/chartboost-mediation")
|
||||
|
||||
//TopOn集成测试工具
|
||||
maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user