接入topon(依赖已更新,来自婷婷姐)
This commit is contained in:
parent
f184b3ce43
commit
2bb7083379
@ -6,6 +6,8 @@ import java.io.FileInputStream
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id ("org.jetbrains.kotlin.android")
|
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())
|
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||||
@ -26,8 +28,8 @@ android {
|
|||||||
applicationId = "com.draw.painting.line"
|
applicationId = "com.draw.painting.line"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 2
|
versionCode = 3
|
||||||
versionName = "1.1"
|
versionName = "3.1"
|
||||||
setProperty("archivesBaseName", "Ar Drawing Space_V" + versionName + "(${versionCode})_$timestamp")
|
setProperty("archivesBaseName", "Ar Drawing Space_V" + versionName + "(${versionCode})_$timestamp")
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@ -68,7 +70,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation("com.google.guava:guava:31.1-android")
|
||||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||||
implementation("androidx.activity:activity:1.8.2")
|
implementation("androidx.activity:activity:1.8.2")
|
||||||
implementation("com.google.android.material:material:1.13.0")
|
implementation("com.google.android.material:material:1.13.0")
|
||||||
@ -87,9 +89,99 @@ dependencies {
|
|||||||
implementation ("androidx.camera:camera-extensions:${camerax_version}")
|
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",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 3,
|
||||||
"versionName": "1.0",
|
"versionName": "3.1",
|
||||||
"outputFile": "Ar Drawing Space_V1.0(1)_12_17_11_29-release.apk"
|
"outputFile": "Ar Drawing Space_V3.1(3)_01_05_13_51-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File",
|
"elementType": "File",
|
||||||
@ -22,14 +22,14 @@
|
|||||||
"minApi": 28,
|
"minApi": 28,
|
||||||
"maxApi": 30,
|
"maxApi": 30,
|
||||||
"baselineProfiles": [
|
"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,
|
"minApi": 31,
|
||||||
"maxApi": 2147483647,
|
"maxApi": 2147483647,
|
||||||
"baselineProfiles": [
|
"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.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
@ -18,8 +19,21 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/logo"
|
android:roundIcon="@mipmap/logo"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
|
android:name=".DrawingApp"
|
||||||
android:theme="@style/Theme.PaintingHelper"
|
android:theme="@style/Theme.PaintingHelper"
|
||||||
|
android:networkSecurityConfig="@xml/net"
|
||||||
|
tools:replace="android:networkSecurityConfig"
|
||||||
tools:targetApi="31">
|
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
|
<activity
|
||||||
android:name=".ui.GalleryActivity"
|
android:name=".ui.GalleryActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
package com.draw.painting.line;
|
package com.draw.painting.line;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.ad.toponlibrary.AdManager;
|
||||||
|
import com.up.uploadlibrary.UpLoadManager;
|
||||||
|
|
||||||
public class DrawingApp extends Application {
|
public class DrawingApp extends Application {
|
||||||
|
|
||||||
@ -8,6 +12,9 @@ public class DrawingApp extends Application {
|
|||||||
|
|
||||||
public static String Key_Camera = "camera_data";
|
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
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.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;
|
isAnimating = true;
|
||||||
|
|
||||||
mainAnimator = ValueAnimator.ofFloat(0f, 1f);
|
mainAnimator = ValueAnimator.ofFloat(0f, 1f);
|
||||||
mainAnimator.setDuration(2200); // 总时长 2.2 秒
|
mainAnimator.setDuration(12000); // 总时长 2.2 秒
|
||||||
mainAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
mainAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||||
mainAnimator.addUpdateListener(animation -> {
|
mainAnimator.addUpdateListener(animation -> {
|
||||||
animationProgress = (float) animation.getAnimatedValue();
|
animationProgress = (float) animation.getAnimatedValue();
|
||||||
|
|||||||
@ -36,10 +36,11 @@ import android.widget.ImageView;
|
|||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.Toast;
|
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.DrawingApp;
|
||||||
import com.draw.painting.line.R;
|
import com.draw.painting.line.R;
|
||||||
import com.draw.painting.line.manager.AppHelper;
|
import com.draw.painting.line.manager.AppHelper;
|
||||||
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -82,6 +83,8 @@ public class DrawActivity extends AppCompatActivity implements View.OnTouchListe
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
AppHelper.enableEdgeToEdge(this);
|
AppHelper.enableEdgeToEdge(this);
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
AdManager.showTopOn(this, () -> {});
|
||||||
setContentView(R.layout.activity_draw);
|
setContentView(R.layout.activity_draw);
|
||||||
previewView = findViewById(R.id.preview);
|
previewView = findViewById(R.id.preview);
|
||||||
imageView = findViewById(R.id.image);
|
imageView = findViewById(R.id.image);
|
||||||
@ -184,7 +187,7 @@ public class DrawActivity extends AppCompatActivity implements View.OnTouchListe
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v.equals(imBack)) {
|
if (v.equals(imBack)) {
|
||||||
finish();
|
AdManager.showTopOn(this, () -> { finish();});
|
||||||
} else {
|
} else {
|
||||||
if (!hasPermission) {
|
if (!hasPermission) {
|
||||||
showNoPermission();
|
showNoPermission();
|
||||||
@ -194,9 +197,11 @@ public class DrawActivity extends AppCompatActivity implements View.OnTouchListe
|
|||||||
if (camera == null) {
|
if (camera == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
AdManager.showTopOn(this, () -> {
|
||||||
boolean selected = flashIm.isSelected();
|
boolean selected = flashIm.isSelected();
|
||||||
flashIm.setSelected(!selected);
|
flashIm.setSelected(!selected);
|
||||||
camera.getCameraControl().enableTorch(!selected);
|
camera.getCameraControl().enableTorch(!selected);
|
||||||
|
});
|
||||||
} else if (v.equals(imPhoto)) {
|
} else if (v.equals(imPhoto)) {
|
||||||
pickImageLauncher.launch(
|
pickImageLauncher.launch(
|
||||||
new PickVisualMediaRequest.Builder()
|
new PickVisualMediaRequest.Builder()
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import android.graphics.Bitmap;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.ad.toponlibrary.AdManager;
|
||||||
import com.draw.painting.line.DrawingApp;
|
import com.draw.painting.line.DrawingApp;
|
||||||
import com.draw.painting.line.adapter.ImageListAdapter;
|
import com.draw.painting.line.adapter.ImageListAdapter;
|
||||||
import com.draw.painting.line.databinding.ActivityGalleryBinding;
|
import com.draw.painting.line.databinding.ActivityGalleryBinding;
|
||||||
@ -50,6 +51,8 @@ public class GalleryActivity extends AppCompatActivity {
|
|||||||
AppHelper.enableEdgeToEdge(this);
|
AppHelper.enableEdgeToEdge(this);
|
||||||
preViewBinding = ActivityGalleryBinding.inflate(getLayoutInflater());
|
preViewBinding = ActivityGalleryBinding.inflate(getLayoutInflater());
|
||||||
setContentView(preViewBinding.getRoot());
|
setContentView(preViewBinding.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
AdManager.showTopOn(this, () -> {});
|
||||||
// AppHelper.setupWindowInsetsListener(preViewBinding.getRoot());
|
// AppHelper.setupWindowInsetsListener(preViewBinding.getRoot());
|
||||||
|
|
||||||
AppHelper.setupBottomNavPadding(preViewBinding.getRoot());
|
AppHelper.setupBottomNavPadding(preViewBinding.getRoot());
|
||||||
@ -117,7 +120,7 @@ public class GalleryActivity extends AppCompatActivity {
|
|||||||
preViewBinding.back.setOnClickListener(new View.OnClickListener() {
|
preViewBinding.back.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
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.adapter.FragmentStateAdapter;
|
||||||
import androidx.viewpager2.widget.ViewPager2;
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
|
import com.ad.toponlibrary.AdManager;
|
||||||
import com.draw.painting.line.R;
|
import com.draw.painting.line.R;
|
||||||
import com.draw.painting.line.databinding.ActivityMainBinding;
|
import com.draw.painting.line.databinding.ActivityMainBinding;
|
||||||
import com.draw.painting.line.manager.AppHelper;
|
import com.draw.painting.line.manager.AppHelper;
|
||||||
|
|||||||
@ -6,20 +6,28 @@ import android.animation.ObjectAnimator;
|
|||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.ad.toponlibrary.AdManager;
|
||||||
import com.draw.painting.line.databinding.ActivitySplashBinding;
|
import com.draw.painting.line.databinding.ActivitySplashBinding;
|
||||||
import com.draw.painting.line.manager.AppHelper;
|
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 {
|
public class SplashActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private ActivitySplashBinding binding;
|
private ActivitySplashBinding binding;
|
||||||
private Handler handler = new Handler();
|
private Handler handler = new Handler();
|
||||||
private boolean isAnimationComplete = false;
|
private boolean isAnimationComplete = false;
|
||||||
|
private CountDownTimer countDownTimer;
|
||||||
|
|
||||||
|
private static final long SPLASH_TIME_OUT = 15000; // 总时长15秒
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -39,86 +47,97 @@ public class SplashActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startLaunchAnimation() {
|
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路径)
|
// 启动鹿的绘制动画(使用XML Vector Drawable路径)
|
||||||
binding.deerView.startAnimation();
|
binding.deerView.startAnimation();
|
||||||
|
|
||||||
// 同步加载条:0-80% 与鹿的动画同步
|
// 同步加载条:0-80% 与鹿的动画同步
|
||||||
// 新版可爱小鹿动画总时长 2.2s,加载条在鹿画到约80%时到达80%
|
// 新版可爱小鹿动画总时长 2.2s,加载条在鹿画到约80%时到达80%
|
||||||
animateProgressBar(0f, 0.8f, 2200, new Runnable() {
|
// animateProgressBar(0f, 0.8f, 15000, new Runnable() {
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
// 等待真实加载完成(这里可以添加实际的加载逻辑)
|
// // 等待真实加载完成(这里可以添加实际的加载逻辑)
|
||||||
waitForLoading();
|
// waitForLoading();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void animateProgressBar(float from, float to, long duration, Runnable onComplete) {
|
// private void animateProgressBar(float from, float to, long duration, Runnable onComplete) {
|
||||||
ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
// ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
||||||
int maxWidth = binding.progressContainer.getWidth();
|
// 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();
|
||||||
|
// }
|
||||||
|
|
||||||
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 completeLoading() {
|
||||||
}
|
// if (isAnimationComplete) return;
|
||||||
|
// isAnimationComplete = true;
|
||||||
private void waitForLoading() {
|
//
|
||||||
// 模拟等待真实加载(实际项目中这里应该是真实的加载逻辑)
|
// // 快速完成加载条到100%
|
||||||
handler.postDelayed(new Runnable() {
|
// ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
||||||
@Override
|
// int maxWidth = binding.progressContainer.getWidth();
|
||||||
public void run() {
|
//
|
||||||
completeLoading();
|
// ValueAnimator animator = ValueAnimator.ofFloat(0.8f, 1.0f);
|
||||||
}
|
// animator.setDuration(200);
|
||||||
}, 500); // 等待500ms
|
// animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
}
|
// @Override
|
||||||
|
// public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
private void completeLoading() {
|
// float progress = (float) animation.getAnimatedValue();
|
||||||
if (isAnimationComplete) return;
|
// params.width = (int) (maxWidth * progress);
|
||||||
isAnimationComplete = true;
|
// binding.progressBar.setLayoutParams(params);
|
||||||
|
// }
|
||||||
// 快速完成加载条到100%
|
// });
|
||||||
ViewGroup.LayoutParams params = binding.progressBar.getLayoutParams();
|
//
|
||||||
int maxWidth = binding.progressContainer.getWidth();
|
// animator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
// @Override
|
||||||
ValueAnimator animator = ValueAnimator.ofFloat(0.8f, 1.0f);
|
// public void onAnimationEnd(Animator animation) {
|
||||||
animator.setDuration(200);
|
// // 0.2s 淡出
|
||||||
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
// fadeOutAndEnter();
|
||||||
@Override
|
// }
|
||||||
public void onAnimationUpdate(ValueAnimator animation) {
|
// });
|
||||||
float progress = (float) animation.getAnimatedValue();
|
//
|
||||||
params.width = (int) (maxWidth * progress);
|
// animator.start();
|
||||||
binding.progressBar.setLayoutParams(params);
|
// }
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
animator.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
// 0.2s 淡出
|
|
||||||
fadeOutAndEnter();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
animator.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void fadeOutAndEnter() {
|
private void fadeOutAndEnter() {
|
||||||
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(binding.getRoot(), "alpha", 1f, 0f);
|
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(binding.getRoot(), "alpha", 1f, 0f);
|
||||||
|
|||||||
@ -1,7 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
android:shape="rectangle">
|
<item android:id="@android:id/background">
|
||||||
<solid android:color="#8DD4C0" />
|
<shape>
|
||||||
<corners android:radius="999dp" />
|
<corners android:radius="10dp" />
|
||||||
</shape>
|
<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_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="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_width="match_parent"
|
||||||
android:layout_height="6dp"
|
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>
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</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 {
|
plugins {
|
||||||
id("com.android.application") version "8.11.1" apply false
|
id("com.android.application") version "8.11.1" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "2.2.21" 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
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# 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.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# 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
|
# 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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@ -10,6 +10,28 @@ dependencyResolutionManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
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