V1.0.1(2) 集成topon
This commit is contained in:
parent
108faedd18
commit
2f00d73110
@ -6,8 +6,8 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
id("io.objectbox")
|
id("io.objectbox")
|
||||||
kotlin("kapt")
|
kotlin("kapt")
|
||||||
// id("com.google.gms.google-services")
|
id("com.google.gms.google-services")
|
||||||
// id("com.google.firebase.crashlytics")
|
id("com.google.firebase.crashlytics")
|
||||||
}
|
}
|
||||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||||
android {
|
android {
|
||||||
@ -19,8 +19,8 @@ android {
|
|||||||
applicationId = "com.animal.wallpaper.camera"
|
applicationId = "com.animal.wallpaper.camera"
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 1
|
versionCode = 2
|
||||||
versionName = "1.0.0"
|
versionName = "1.0.1"
|
||||||
|
|
||||||
setProperty("archivesBaseName", "Animal Wallpapers_V" + versionName + "(${versionCode})_$timestamp")
|
setProperty("archivesBaseName", "Animal Wallpapers_V" + versionName + "(${versionCode})_$timestamp")
|
||||||
testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
|
||||||
@ -59,100 +59,97 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
//------------------firebase
|
//------------------firebase
|
||||||
// implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
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-analytics")
|
implementation("com.google.firebase:firebase-crashlytics")
|
||||||
// implementation("com.google.firebase:firebase-config")
|
implementation("com.google.firebase:firebase-config")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Appnext、Bigo)
|
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Appnext、Bigo)
|
||||||
|
|
||||||
//Anythink (Necessary)
|
//Anythink (Necessary)
|
||||||
// implementation("com.anythink.sdk:core-tpn:6.4.07")
|
implementation("com.anythink.sdk:core-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:nativead-tpn:6.4.07")
|
implementation("com.anythink.sdk:nativead-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:banner-tpn:6.4.07")
|
implementation("com.anythink.sdk:banner-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:interstitial-tpn:6.4.07")
|
implementation("com.anythink.sdk:interstitial-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:rewardedvideo-tpn:6.4.07")
|
implementation("com.anythink.sdk:rewardedvideo-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:splash-tpn:6.4.07")
|
implementation("com.anythink.sdk:splash-tpn:6.4.07")
|
||||||
//
|
|
||||||
// //Androidx (Necessary)
|
//Androidx (Necessary)
|
||||||
// implementation("androidx.appcompat:appcompat:1.1.0")
|
implementation("androidx.appcompat:appcompat:1.1.0")
|
||||||
// implementation("androidx.browser:browser:1.4.0")
|
implementation("androidx.browser:browser:1.4.0")
|
||||||
//
|
|
||||||
// //StartApp
|
//StartApp
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-startapp:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-startapp:6.4.07")
|
||||||
// implementation("com.startapp:inapp-sdk:5.0.2")
|
implementation("com.startapp:inapp-sdk:5.0.2")
|
||||||
//
|
|
||||||
// //Appnext
|
//Appnext
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-appnext:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-appnext:6.4.07")
|
||||||
// implementation("com.appnext.sdk:ads:2.7.1.473")
|
implementation("com.appnext.sdk:ads:2.7.1.473")
|
||||||
// implementation("com.appnext.sdk:banners:2.7.1.473")
|
implementation("com.appnext.sdk:banners:2.7.1.473")
|
||||||
// implementation("com.appnext.sdk:native-ads2:2.7.1.473")
|
implementation("com.appnext.sdk:native-ads2:2.7.1.473")
|
||||||
// implementation("com.appnext.sdk:actions:2.4.6.472")
|
implementation("com.appnext.sdk:actions:2.4.6.472")
|
||||||
// implementation("androidx.constraintlayout:constraintlayout:2.0.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
|
||||||
//
|
|
||||||
// //Vungle
|
//Vungle
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-vungle:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-vungle:6.4.07")
|
||||||
// implementation("com.vungle:vungle-ads:7.4.0")
|
implementation("com.vungle:vungle-ads:7.4.0")
|
||||||
// implementation("com.google.android.gms:play-services-basement:18.1.0")
|
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||||
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
//
|
|
||||||
// //UnityAds
|
//UnityAds
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-unityads:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-unityads:6.4.07")
|
||||||
// implementation("com.unity3d.ads:unity-ads:4.12.2")
|
implementation("com.unity3d.ads:unity-ads:4.12.2")
|
||||||
//
|
|
||||||
// //Ironsource
|
//Ironsource
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-ironsource:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-ironsource:6.4.07")
|
||||||
// implementation("com.ironsource.sdk:mediationsdk:8.2.1")
|
implementation("com.ironsource.sdk:mediationsdk:8.2.1")
|
||||||
// implementation("com.google.android.gms:play-services-appset:16.0.2")
|
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-ads-identifier:18.0.1")
|
||||||
// implementation("com.google.android.gms:play-services-basement:18.1.0")
|
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||||
//
|
|
||||||
// //Bigo
|
//Bigo
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-bigo:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-bigo:6.4.07")
|
||||||
// implementation("com.bigossp:bigo-ads:4.9.0")
|
implementation("com.bigossp:bigo-ads:4.9.0")
|
||||||
//
|
|
||||||
// //Pangle
|
//Pangle
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.4.07")
|
||||||
// implementation("com.pangle.global:ads-sdk:6.1.0.9")
|
implementation("com.pangle.global:ads-sdk:6.1.0.9")
|
||||||
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
//
|
|
||||||
// //Inmobi
|
//Inmobi
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-inmobi:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-inmobi:6.4.07")
|
||||||
// implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.7.5")
|
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.7.5")
|
||||||
//
|
|
||||||
// //Mintegral
|
//Mintegral
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.4.07")
|
||||||
// implementation("com.mbridge.msdk.oversea:reward:16.8.11")
|
implementation("com.mbridge.msdk.oversea:reward:16.8.11")
|
||||||
// implementation("com.mbridge.msdk.oversea:newinterstitial:16.8.11")
|
implementation("com.mbridge.msdk.oversea:newinterstitial:16.8.11")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbnative:16.8.11")
|
implementation("com.mbridge.msdk.oversea:mbnative:16.8.11")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.8.11")
|
implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.8.11")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbsplash:16.8.11")
|
implementation("com.mbridge.msdk.oversea:mbsplash:16.8.11")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbbanner:16.8.11")
|
implementation("com.mbridge.msdk.oversea:mbbanner:16.8.11")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbbid:16.8.11")
|
implementation("com.mbridge.msdk.oversea:mbbid:16.8.11")
|
||||||
// implementation("androidx.recyclerview:recyclerview:1.1.0")
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||||
//
|
|
||||||
// //Chartboost
|
//Chartboost
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-chartboost:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-chartboost:6.4.07")
|
||||||
// implementation("com.chartboost:chartboost-sdk:9.7.0")
|
implementation("com.chartboost:chartboost-sdk:9.7.0")
|
||||||
// implementation("com.chartboost:chartboost-mediation-sdk:4.9.1")
|
implementation("com.chartboost:chartboost-mediation-sdk:4.9.1")
|
||||||
// implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.7.0.0")
|
implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.7.0.0")
|
||||||
// implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.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:logging-interceptor:4.10.0")
|
||||||
// implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||||
// implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
|
implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
|
||||||
// implementation("com.squareup.retrofit2:retrofit: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-coroutines-android:1.7.1")
|
||||||
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
|
||||||
//
|
|
||||||
// //Fyber
|
//Fyber
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-fyber:6.4.07")
|
implementation("com.anythink.sdk:adapter-tpn-fyber:6.4.07")
|
||||||
// implementation("com.fyber:marketplace-sdk:8.3.0")
|
implementation("com.fyber:marketplace-sdk:8.3.0")
|
||||||
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
//
|
|
||||||
// // Debugger UI Tools
|
|
||||||
// implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
|
||||||
|
|
||||||
}
|
}
|
||||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "842146408473",
|
||||||
|
"project_id": "animal-wallpapers-9437a",
|
||||||
|
"storage_bucket": "animal-wallpapers-9437a.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:842146408473:android:ad012cea34534bbba4a288",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.animal.wallpaper.camera"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyBB2FbQUWW7hFNsNbRHsGGJOu9AAIBZXRc"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
@ -4,9 +4,12 @@ import android.app.Application;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
//import com.google.firebase.FirebaseApp;
|
//import com.google.firebase.FirebaseApp;
|
||||||
|
import com.animal.wallpaper.ad.AdManager;
|
||||||
import com.animal.wallpaper.utils.Common;
|
import com.animal.wallpaper.utils.Common;
|
||||||
import com.animal.wallpaper.utils.CommonKt;
|
import com.animal.wallpaper.utils.CommonKt;
|
||||||
import com.animal.wallpaper.utils.DbManager;
|
import com.animal.wallpaper.utils.DbManager;
|
||||||
|
import com.anythink.core.api.ATSDK;
|
||||||
|
import com.anythink.core.api.NetTrafficeCallback;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -16,16 +19,14 @@ import java.util.List;
|
|||||||
public class MyApp extends Application {
|
public class MyApp extends Application {
|
||||||
public static Context mAppContext;
|
public static Context mAppContext;
|
||||||
|
|
||||||
private static List<Data> natureList;
|
|
||||||
private static List<Data> animalsList;
|
private static List<Data> animalsList;
|
||||||
public static String TAG = "-------MyApp---------";
|
public static String TAG = "-------MyApp---------";
|
||||||
public static final String key_info = "key_info";
|
public static final String key_info = "key_info";
|
||||||
|
|
||||||
public static final String key_type = "key_source";
|
public static final String key_type = "key_source";
|
||||||
|
|
||||||
// private String APPId="h673ddf8ae8467";
|
|
||||||
// private String AppKey="a17cd7a62720b00498a8dc5c538c92303";
|
|
||||||
// private String debug_Key="";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
@ -36,12 +37,6 @@ public class MyApp extends Application {
|
|||||||
DbManager.init(this);
|
DbManager.init(this);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// InputStream open = getAssets().open("Nature.json");
|
|
||||||
// String covertStr = Common.getCovertStr(open);
|
|
||||||
// if (!covertStr.isEmpty()) {
|
|
||||||
// natureList = CommonKt.INSTANCE.getData(this, covertStr);
|
|
||||||
// }
|
|
||||||
|
|
||||||
InputStream open1 = getAssets().open("Animals.json");
|
InputStream open1 = getAssets().open("Animals.json");
|
||||||
String covert = Common.getCovertStr(open1);
|
String covert = Common.getCovertStr(open1);
|
||||||
if (!covert.isEmpty()) {
|
if (!covert.isEmpty()) {
|
||||||
@ -61,27 +56,28 @@ public class MyApp extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initTop(){
|
private void initTop(){
|
||||||
// ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
|
String APPId = "h67b59334bf9c4";
|
||||||
//
|
String AppKey = "a9ce5289ceae6f3c33f6fb5d36201219c";
|
||||||
// @Override
|
ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
|
||||||
// public void onResultCallback(boolean isEU) {
|
|
||||||
// Log.e(TAG, "onResultCallback:" + isEU);
|
@Override
|
||||||
// if (isEU && ATSDK.getGDPRDataLevel( MyApp.mAppContext) == ATSDK.UNKNOWN) {
|
public void onResultCallback(boolean isEU) {
|
||||||
// ATSDK.showGdprAuth(MyApp.mAppContext);
|
if (isEU && ATSDK.getGDPRDataLevel( MyApp.mAppContext) == ATSDK.UNKNOWN) {
|
||||||
// }
|
ATSDK.showGdprAuth(MyApp.mAppContext);
|
||||||
//
|
}
|
||||||
// }
|
|
||||||
//
|
}
|
||||||
// @Override
|
|
||||||
// public void onErrorCallback(String errorMsg) {
|
@Override
|
||||||
// Log.e(TAG, "onErrorCallback:" + errorMsg);
|
public void onErrorCallback(String errorMsg) {
|
||||||
// }
|
|
||||||
// });
|
}
|
||||||
//
|
});
|
||||||
// ATSDK.init( this, APPId, AppKey);
|
|
||||||
// //测试工具
|
ATSDK.init( this, APPId, AppKey);
|
||||||
//// ATDebuggerUITest.showDebuggerUI(this,debug_Key);
|
//测试工具
|
||||||
// AdManager.loadAllAd();
|
// ATDebuggerUITest.showDebuggerUI(this,debug_Key);
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
app/src/main/java/com/animal/wallpaper/ad/AdListener.java
Normal file
10
app/src/main/java/com/animal/wallpaper/ad/AdListener.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package com.animal.wallpaper.ad;
|
||||||
|
|
||||||
|
public interface AdListener {
|
||||||
|
void loadFail(String placeId);
|
||||||
|
void showSuccess();
|
||||||
|
|
||||||
|
void showFail();
|
||||||
|
|
||||||
|
void showClose();
|
||||||
|
}
|
||||||
254
app/src/main/java/com/animal/wallpaper/ad/AdManager.java
Normal file
254
app/src/main/java/com/animal/wallpaper/ad/AdManager.java
Normal file
@ -0,0 +1,254 @@
|
|||||||
|
package com.animal.wallpaper.ad;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.animal.wallpaper.MyApp;
|
||||||
|
import com.anythink.core.api.ATAdInfo;
|
||||||
|
import com.anythink.core.api.AdError;
|
||||||
|
import com.anythink.interstitial.api.ATInterstitial;
|
||||||
|
import com.anythink.interstitial.api.ATInterstitialListener;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AdManager {
|
||||||
|
|
||||||
|
private static final int type_no_cache = 0;
|
||||||
|
private static final int type_has_cache = 1;
|
||||||
|
private static final int type_show_success = 2;
|
||||||
|
private static final int type_show_close = 3;
|
||||||
|
private static final int type_show_fail = 4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Animal_INST_3
|
||||||
|
n67b5935e6a8a3
|
||||||
|
Animal_INST_2
|
||||||
|
n67b5935e1cb52
|
||||||
|
Animal_INST_1
|
||||||
|
n67b5935daf7a4
|
||||||
|
*/
|
||||||
|
|
||||||
|
private static final String place1Id = "n67b5935e6a8a3";
|
||||||
|
private static final String place2Id = "n67b5935e1cb52";
|
||||||
|
private static final String place3Id = "n67b5935daf7a4";
|
||||||
|
|
||||||
|
|
||||||
|
private static boolean place1LoadFail = false;
|
||||||
|
private static boolean place2LoadFail = false;
|
||||||
|
private static boolean place3LoadFail = false;
|
||||||
|
|
||||||
|
private static boolean alreadyShow = false;
|
||||||
|
|
||||||
|
private static List<ATInterstitial> list = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
public static void loadAllAd() {
|
||||||
|
if (list.size() == 0) {
|
||||||
|
ATInterstitial mInterstitialAd1 = new ATInterstitial(MyApp.mAppContext, place1Id);
|
||||||
|
ATInterstitial mInterstitialAd2 = new ATInterstitial(MyApp.mAppContext, place2Id);
|
||||||
|
ATInterstitial mInterstitialAd3 = new ATInterstitial(MyApp.mAppContext, place3Id);
|
||||||
|
list.add(mInterstitialAd1);
|
||||||
|
list.add(mInterstitialAd2);
|
||||||
|
list.add(mInterstitialAd3);
|
||||||
|
}
|
||||||
|
for (ATInterstitial ad : list) {
|
||||||
|
if (!ad.isAdReady()) {
|
||||||
|
setCallBack(ad, new AdListener() {
|
||||||
|
@Override
|
||||||
|
public void loadFail(@NonNull String placeId) {
|
||||||
|
if (placeId.equals(place1Id)) {
|
||||||
|
place1LoadFail = true;
|
||||||
|
}
|
||||||
|
if (placeId.equals(place2Id)) {
|
||||||
|
place2LoadFail = true;
|
||||||
|
}
|
||||||
|
if (placeId.equals(place3Id)) {
|
||||||
|
place3LoadFail = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showSuccess() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showFail() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showClose() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ad.load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ATInterstitial getReadyAd() {
|
||||||
|
Collections.shuffle(list);
|
||||||
|
for (ATInterstitial ad : list) {
|
||||||
|
if (ad.isAdReady()) {
|
||||||
|
Log.d(MyApp.TAG, "-has Cache------------");
|
||||||
|
return ad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d(MyApp.TAG, "-No Cache------------");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setCallBack(ATInterstitial ad, AdListener listener) {
|
||||||
|
ad.setAdListener(new ATInterstitialListener() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdLoaded() {
|
||||||
|
Log.d(MyApp.TAG, "LoadLoaded " + ad.mPlacementId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdLoadFail(AdError adError) {
|
||||||
|
listener.loadFail(ad.mPlacementId);
|
||||||
|
Log.d(MyApp.TAG, "LoadFail:--" + ad.mPlacementId + "--" + adError.getCode() + "---" + adError.getDesc());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdClicked(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
|
||||||
|
Log.d(MyApp.TAG, "AdShow " + atAdInfo.getShowId());
|
||||||
|
listener.showSuccess();
|
||||||
|
ad.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdClose(ATAdInfo atAdInfo) {
|
||||||
|
listener.showClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdVideoStart(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdVideoEnd(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdVideoError(AdError adError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static CountDownTimer showWelcomeAd(
|
||||||
|
Activity activity,
|
||||||
|
Long totalTim,
|
||||||
|
CountAction countAction,
|
||||||
|
GoMainAction goMain
|
||||||
|
) {
|
||||||
|
Log.d(MyApp.TAG,"----------alreadyShow="+alreadyShow);
|
||||||
|
alreadyShow = false;
|
||||||
|
CountDownTimer timer = new CountDownTimer(totalTim, 100) {
|
||||||
|
@Override
|
||||||
|
public void onTick(long millisUntilFinished) {
|
||||||
|
countAction.onCount(millisUntilFinished);
|
||||||
|
if (!alreadyShow) {
|
||||||
|
showAD(activity, new AdStatusAction() {
|
||||||
|
@Override
|
||||||
|
public void onStatus(int adType) {
|
||||||
|
if (adType == type_has_cache) {
|
||||||
|
alreadyShow = true;
|
||||||
|
}
|
||||||
|
if (adType == type_show_close || adType == type_show_fail) {
|
||||||
|
goMain.onGo();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
if (!alreadyShow) {
|
||||||
|
showTopOn(activity, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
goMain.onGo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
return timer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static void showAD(Activity activity, AdStatusAction action) {
|
||||||
|
ATInterstitial readyAd = getReadyAd();
|
||||||
|
if (readyAd != null) {
|
||||||
|
action.onStatus(type_has_cache);
|
||||||
|
setCallBack(readyAd, new AdListener() {
|
||||||
|
@Override
|
||||||
|
public void loadFail(@NonNull String placeId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showSuccess() {
|
||||||
|
action.onStatus(type_show_success);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showFail() {
|
||||||
|
action.onStatus(type_show_fail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showClose() {
|
||||||
|
action.onStatus(type_show_close);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
readyAd.show(activity);
|
||||||
|
} else {
|
||||||
|
action.onStatus(type_no_cache);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void showTopOn(Activity activity, onActionListener listener) {
|
||||||
|
showAD(activity, new AdStatusAction() {
|
||||||
|
@Override
|
||||||
|
public void onStatus(int adType) {
|
||||||
|
if (adType == type_no_cache || adType == type_show_close || adType == type_show_fail) {
|
||||||
|
listener.onAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.animal.wallpaper.ad;
|
||||||
|
|
||||||
|
public interface AdStatusAction {
|
||||||
|
void onStatus(int adType);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.animal.wallpaper.ad;
|
||||||
|
|
||||||
|
public interface CountAction {
|
||||||
|
void onCount(long millisUntilFinished);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.animal.wallpaper.ad;
|
||||||
|
|
||||||
|
public interface GoMainAction {
|
||||||
|
void onGo();
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.animal.wallpaper.ad;
|
||||||
|
|
||||||
|
public interface onActionListener {
|
||||||
|
|
||||||
|
void onAction();
|
||||||
|
}
|
||||||
@ -14,6 +14,8 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.animal.wallpaper.ad.AdManager;
|
||||||
|
import com.animal.wallpaper.ad.onActionListener;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.bumptech.glide.load.DataSource;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
@ -65,13 +67,13 @@ public class DetailInfoActivity extends AppCompatActivity implements OnSelectLis
|
|||||||
vb = ActivityInfoBinding.inflate(getLayoutInflater());
|
vb = ActivityInfoBinding.inflate(getLayoutInflater());
|
||||||
Common.initFull(this, true);
|
Common.initFull(this, true);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
// AdManager.showTopOn(this, new onActionListener() {
|
AdManager.loadAllAd();
|
||||||
// @Override
|
AdManager.showTopOn(this, new onActionListener() {
|
||||||
// public void onAction() {
|
@Override
|
||||||
//
|
public void onAction() {
|
||||||
// }
|
|
||||||
// });
|
}
|
||||||
// AdManager.loadAllAd();
|
});
|
||||||
data = (Data) getIntent().getSerializableExtra(MyApp.key_info);
|
data = (Data) getIntent().getSerializableExtra(MyApp.key_info);
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return;
|
return;
|
||||||
@ -90,8 +92,7 @@ public class DetailInfoActivity extends AppCompatActivity implements OnSelectLis
|
|||||||
String authorHtml = data.getAuthorHtml();
|
String authorHtml = data.getAuthorHtml();
|
||||||
fullUrl = data.getFullUrl();
|
fullUrl = data.getFullUrl();
|
||||||
|
|
||||||
int width = vb.imageviewPreview.getWidth();
|
|
||||||
int height = vb.imageviewPreview.getHeight();
|
|
||||||
|
|
||||||
// vb.imageviewPreview.setScaleType(ImageView.ScaleType.FIT_START);
|
// vb.imageviewPreview.setScaleType(ImageView.ScaleType.FIT_START);
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
@ -141,13 +142,20 @@ public class DetailInfoActivity extends AppCompatActivity implements OnSelectLis
|
|||||||
});
|
});
|
||||||
|
|
||||||
vb.buttonSet.setOnClickListener(v -> {
|
vb.buttonSet.setOnClickListener(v -> {
|
||||||
if (dialogSet == null) {
|
|
||||||
dialogSet = new DialogSet();
|
AdManager.showTopOn(DetailInfoActivity.this, new onActionListener() {
|
||||||
dialogSet.setListener(DetailInfoActivity.this);
|
@Override
|
||||||
}
|
public void onAction() {
|
||||||
if(!dialogSet.isAdded()){
|
if (dialogSet == null) {
|
||||||
dialogSet.show(getSupportFragmentManager(), "");
|
dialogSet = new DialogSet();
|
||||||
}
|
dialogSet.setListener(DetailInfoActivity.this);
|
||||||
|
}
|
||||||
|
if(!dialogSet.isAdded()){
|
||||||
|
dialogSet.show(getSupportFragmentManager(), "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -167,53 +175,60 @@ public class DetailInfoActivity extends AppCompatActivity implements OnSelectLis
|
|||||||
vb.layoutDownload.setOnClickListener(new View.OnClickListener() {
|
vb.layoutDownload.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
showDownloadLoading(true);
|
|
||||||
File file = new File(mSavePath);
|
|
||||||
if (file.exists()) {
|
|
||||||
Log.d(MyApp.TAG, "-----------Download 1");
|
|
||||||
startSave(file);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (downloadFile != null && downloadFile.exists()) {
|
|
||||||
Log.d(MyApp.TAG, "-----------Download 2");
|
|
||||||
startSave(downloadFile);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (fullDrawable == null) {
|
|
||||||
Log.d(MyApp.TAG, "-----------Download 3");
|
|
||||||
CommonKt.INSTANCE.downloadFile(fullUrl, mSavePath, new Function2<Boolean, InputStream, Unit>() {
|
|
||||||
@Override
|
|
||||||
public Unit invoke(Boolean aBoolean, InputStream inputStream) {
|
|
||||||
File file = new File(mSavePath);
|
|
||||||
if (aBoolean && file.exists()) {
|
|
||||||
downloadFile = file;
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Glide.with(DetailInfoActivity.this)
|
|
||||||
.load(downloadFile)
|
|
||||||
.into(vb.imageviewPreview);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
startSave(downloadFile);
|
|
||||||
} else {
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
showDownloadLoading(false);
|
|
||||||
Toast.makeText(DetailInfoActivity.this, getString(R.string.download_fail), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
AdManager.showTopOn(DetailInfoActivity.this, new onActionListener() {
|
||||||
return null;
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
showDownloadLoading(true);
|
||||||
|
File file = new File(mSavePath);
|
||||||
|
if (file.exists()) {
|
||||||
|
Log.d(MyApp.TAG, "-----------Download 1");
|
||||||
|
startSave(file);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
if (downloadFile != null && downloadFile.exists()) {
|
||||||
return;
|
Log.d(MyApp.TAG, "-----------Download 2");
|
||||||
}
|
startSave(downloadFile);
|
||||||
Log.d(MyApp.TAG, "-----------Download 4");
|
return;
|
||||||
Common.saveDrawableToFile(fullDrawable, mSavePath);
|
}
|
||||||
startSave(file);
|
if (fullDrawable == null) {
|
||||||
|
Log.d(MyApp.TAG, "-----------Download 3");
|
||||||
|
CommonKt.INSTANCE.downloadFile(fullUrl, mSavePath, new Function2<Boolean, InputStream, Unit>() {
|
||||||
|
@Override
|
||||||
|
public Unit invoke(Boolean aBoolean, InputStream inputStream) {
|
||||||
|
File file = new File(mSavePath);
|
||||||
|
if (aBoolean && file.exists()) {
|
||||||
|
downloadFile = file;
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Glide.with(DetailInfoActivity.this)
|
||||||
|
.load(downloadFile)
|
||||||
|
.into(vb.imageviewPreview);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
startSave(downloadFile);
|
||||||
|
} else {
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
showDownloadLoading(false);
|
||||||
|
Toast.makeText(DetailInfoActivity.this, getString(R.string.download_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Log.d(MyApp.TAG, "-----------Download 4");
|
||||||
|
Common.saveDrawableToFile(fullDrawable, mSavePath);
|
||||||
|
startSave(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,8 @@ import androidx.fragment.app.Fragment;
|
|||||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
import com.animal.wallpaper.R;
|
import com.animal.wallpaper.R;
|
||||||
|
import com.animal.wallpaper.ad.AdManager;
|
||||||
|
import com.animal.wallpaper.ad.onActionListener;
|
||||||
import com.animal.wallpaper.databinding.ActivityMainBinding;
|
import com.animal.wallpaper.databinding.ActivityMainBinding;
|
||||||
import com.animal.wallpaper.databinding.TabCustomViewBinding;
|
import com.animal.wallpaper.databinding.TabCustomViewBinding;
|
||||||
import com.animal.wallpaper.utils.Common;
|
import com.animal.wallpaper.utils.Common;
|
||||||
@ -30,7 +32,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
vb = ActivityMainBinding.inflate(getLayoutInflater());
|
vb = ActivityMainBinding.inflate(getLayoutInflater());
|
||||||
Common.initFull(this,false);
|
Common.initFull(this,false);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
|
||||||
List<Fragment> list = new ArrayList<>();
|
List<Fragment> list = new ArrayList<>();
|
||||||
// list.add(SearchFragment.newInstance());
|
// list.add(SearchFragment.newInstance());
|
||||||
@ -69,7 +71,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public void onTabSelected(TabLayout.Tab tab) {
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
int position = tab.getPosition();
|
int position = tab.getPosition();
|
||||||
vb.viewpager2.setCurrentItem(position);
|
vb.viewpager2.setCurrentItem(position);
|
||||||
|
|
||||||
View customView = tab.getCustomView();
|
View customView = tab.getCustomView();
|
||||||
View imageIndicator = customView.findViewById(R.id.image_indicator);
|
View imageIndicator = customView.findViewById(R.id.image_indicator);
|
||||||
imageIndicator.setVisibility(View.VISIBLE);
|
imageIndicator.setVisibility(View.VISIBLE);
|
||||||
@ -91,11 +92,16 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
vb.btnSearch.setOnClickListener(new View.OnClickListener() {
|
vb.btnSearch.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(MainActivity.this, SearchActivity.class);
|
AdManager.showTopOn(MainActivity.this, new onActionListener() {
|
||||||
startActivity(intent);
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
Intent intent = new Intent(MainActivity.this, SearchActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,8 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.animal.wallpaper.MyApp;
|
import com.animal.wallpaper.MyApp;
|
||||||
import com.animal.wallpaper.R;
|
import com.animal.wallpaper.R;
|
||||||
|
import com.animal.wallpaper.ad.AdManager;
|
||||||
|
import com.animal.wallpaper.ad.onActionListener;
|
||||||
import com.animal.wallpaper.listener.ItemCLickListener;
|
import com.animal.wallpaper.listener.ItemCLickListener;
|
||||||
import com.animal.wallpaper.databinding.ActivitySearchBinding;
|
import com.animal.wallpaper.databinding.ActivitySearchBinding;
|
||||||
import com.animal.wallpaper.utils.Common;
|
import com.animal.wallpaper.utils.Common;
|
||||||
@ -37,6 +39,7 @@ public class SearchActivity extends AppCompatActivity implements ItemCLickListen
|
|||||||
vb = ActivitySearchBinding.inflate(getLayoutInflater());
|
vb = ActivitySearchBinding.inflate(getLayoutInflater());
|
||||||
Common.initFull(this, false);
|
Common.initFull(this, false);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
initList();
|
initList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +72,13 @@ public class SearchActivity extends AppCompatActivity implements ItemCLickListen
|
|||||||
vb.back.setOnClickListener(new View.OnClickListener() {
|
vb.back.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
finish();
|
AdManager.showTopOn(SearchActivity.this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,9 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.animal.wallpaper.ad.AdManager;
|
||||||
|
import com.animal.wallpaper.ad.CountAction;
|
||||||
|
import com.animal.wallpaper.ad.GoMainAction;
|
||||||
import com.animal.wallpaper.databinding.ActivityWelcomeBinding;
|
import com.animal.wallpaper.databinding.ActivityWelcomeBinding;
|
||||||
import com.animal.wallpaper.utils.Common;
|
import com.animal.wallpaper.utils.Common;
|
||||||
|
|
||||||
@ -16,7 +19,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
private ActivityWelcomeBinding vb;
|
private ActivityWelcomeBinding vb;
|
||||||
|
|
||||||
private long totalTime = 1000;
|
private long totalTime = 11000;
|
||||||
|
|
||||||
@SuppressLint("MissingInflatedId")
|
@SuppressLint("MissingInflatedId")
|
||||||
@Override
|
@Override
|
||||||
@ -25,41 +28,27 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||||||
vb = ActivityWelcomeBinding.inflate(getLayoutInflater());
|
vb = ActivityWelcomeBinding.inflate(getLayoutInflater());
|
||||||
Common.initFull(this,false);
|
Common.initFull(this,false);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
|
||||||
// countDownTimer = AdManager.showWelcomeAd(this, totalTime, new CountAction() {
|
countDownTimer = AdManager.showWelcomeAd(this, totalTime, new CountAction() {
|
||||||
// @Override
|
|
||||||
// public void onCount(long millisUntilFinished) {
|
|
||||||
// int progressPercentage = (int) ((100 * millisUntilFinished) / totalTime);
|
|
||||||
//
|
|
||||||
// int countdownPercentage = 100 - progressPercentage;
|
|
||||||
//
|
|
||||||
// vb.progressbar.setProgress(countdownPercentage);
|
|
||||||
// }
|
|
||||||
// }, new GoMainAction() {
|
|
||||||
// @Override
|
|
||||||
// public void onGo() {
|
|
||||||
// vb.progressbar.setProgress(100);
|
|
||||||
// Intent intent = new Intent(WElActivity.this, HomeActivity.class);
|
|
||||||
// startActivity(intent);
|
|
||||||
// finish();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
countDownTimer = new CountDownTimer(totalTime,100) {
|
|
||||||
@Override
|
@Override
|
||||||
public void onTick(long millisUntilFinished) {
|
public void onCount(long millisUntilFinished) {
|
||||||
int progressPercentage = (int) ((100 * millisUntilFinished) / totalTime);
|
int progressPercentage = (int) ((100 * millisUntilFinished) / totalTime);
|
||||||
|
|
||||||
int countdownPercentage = 100 - progressPercentage;
|
int countdownPercentage = 100 - progressPercentage;
|
||||||
|
|
||||||
vb.progressbar.setProgress(countdownPercentage);
|
vb.progressbar.setProgress(countdownPercentage);
|
||||||
}
|
}
|
||||||
|
}, new GoMainAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onGo() {
|
||||||
vb.progressbar.setProgress(100);
|
vb.progressbar.setProgress(100);
|
||||||
Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
|
Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
countDownTimer.start();
|
countDownTimer.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,8 @@ plugins {
|
|||||||
id("com.android.application") version "8.1.3" apply false
|
id("com.android.application") version "8.1.3" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
|
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
|
||||||
kotlin("kapt") version "1.9.0"
|
kotlin("kapt") version "1.9.0"
|
||||||
// id("com.google.gms.google-services") version "4.3.15" apply false
|
id("com.google.gms.google-services") version "4.4.2" apply false
|
||||||
// id ("com.google.firebase.crashlytics") version "2.9.2" apply false
|
id ("com.google.firebase.crashlytics") version "3.0.2" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|||||||
@ -11,28 +11,24 @@ dependencyResolutionManagement {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
||||||
|
|
||||||
//Anythink(Core)
|
//Anythink(Core)
|
||||||
// maven ("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
maven ("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||||
//
|
|
||||||
// //Appnext
|
//Appnext
|
||||||
// maven ("https://dl.appnext.com")
|
maven ("https://dl.appnext.com")
|
||||||
//
|
|
||||||
// //Ironsource
|
//Ironsource
|
||||||
// maven ("https://android-sdk.is.com/")
|
maven ("https://android-sdk.is.com/")
|
||||||
//
|
|
||||||
// //Pangle
|
//Pangle
|
||||||
// maven ("https://artifact.bytedance.com/repository/pangle")
|
maven ("https://artifact.bytedance.com/repository/pangle")
|
||||||
//
|
|
||||||
// //Mintegral
|
//Mintegral
|
||||||
// maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
||||||
//
|
|
||||||
// //Chartboost
|
//Chartboost
|
||||||
// maven ("https://cboost.jfrog.io/artifactory/chartboost-ads")
|
maven ("https://cboost.jfrog.io/artifactory/chartboost-ads")
|
||||||
// maven ("https://cboost.jfrog.io/artifactory/chartboost-mediation")
|
maven ("https://cboost.jfrog.io/artifactory/chartboost-mediation")
|
||||||
//
|
|
||||||
// //TopOn集成测试工具
|
|
||||||
// maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user