V1.0.1(2)集成topon
This commit is contained in:
parent
dbcbbb3d26
commit
f1ac3cf46e
@ -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.photo.wallpaper.category"
|
applicationId = "com.photo.wallpaper.category"
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 1
|
versionCode = 2
|
||||||
versionName = "1.0.0"
|
versionName = "1.0.1"
|
||||||
|
|
||||||
setProperty("archivesBaseName", "Photo Wallpaper_V" + versionName + "(${versionCode})_$timestamp")
|
setProperty("archivesBaseName", "Photo Wallpaper_V" + versionName + "(${versionCode})_$timestamp")
|
||||||
testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
|
||||||
@ -62,100 +62,100 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
//------------------firebase
|
//------------------firebase
|
||||||
// implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
||||||
// implementation("com.google.firebase:firebase-crashlytics")
|
implementation("com.google.firebase:firebase-crashlytics")
|
||||||
// implementation("com.google.firebase:firebase-analytics")
|
implementation("com.google.firebase:firebase-analytics")
|
||||||
// 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
|
// Debugger UI Tools
|
||||||
// implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
// 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": "719580020320",
|
||||||
|
"project_id": "photo-wallpaper-32a12",
|
||||||
|
"storage_bucket": "photo-wallpaper-32a12.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:719580020320:android:b438d0d20b0c5f80bd0d05",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.photo.wallpaper.category"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyAR9oLYHYHjl-UEe9js620-FaID-9MYFW0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
130
app/proguard-rules.pro
vendored
130
app/proguard-rules.pro
vendored
@ -25,4 +25,134 @@
|
|||||||
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------Topon
|
||||||
|
-keep class com.startapp.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keep class com.truenet.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile,
|
||||||
|
LineNumberTable, *Annotation*, EnclosingMethod
|
||||||
|
-dontwarn android.webkit.JavascriptInterface
|
||||||
|
-dontwarn com.startapp.**
|
||||||
|
|
||||||
|
-dontwarn org.jetbrains.annotations.**
|
||||||
|
-keep class com.appnext.** { *; }
|
||||||
|
-dontwarn com.appnext.**
|
||||||
|
# Vungle
|
||||||
|
-dontwarn com.vungle.ads.**
|
||||||
|
-keepclassmembers class com.vungle.ads.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
-keep class com.vungle.ads.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Google
|
||||||
|
-keep class com.google.android.gms.** { *; }
|
||||||
|
-dontwarn com.google.android.gms.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# START OkHttp + Okio
|
||||||
|
# JSR 305 annotations are for embedding nullability information.
|
||||||
|
-dontwarn javax.annotation.**
|
||||||
|
|
||||||
|
|
||||||
|
# A resource is loaded with a relative path so the package of this class must be preserved.
|
||||||
|
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
|
||||||
|
|
||||||
|
|
||||||
|
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||||
|
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||||
|
|
||||||
|
|
||||||
|
# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
|
||||||
|
-dontwarn okhttp3.internal.platform.**
|
||||||
|
-dontwarn org.conscrypt.**
|
||||||
|
-dontwarn org.bouncycastle.**
|
||||||
|
-dontwarn org.openjsse.**
|
||||||
|
|
||||||
|
|
||||||
|
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||||
|
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||||
|
|
||||||
|
|
||||||
|
# END OkHttp + Okio
|
||||||
|
|
||||||
|
|
||||||
|
# START Protobuf
|
||||||
|
-dontwarn com.google.protobuf.**
|
||||||
|
-keepclassmembers class com.google.protobuf.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
|
||||||
|
|
||||||
|
|
||||||
|
# END Protobuf
|
||||||
|
-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface {
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
-keepclassmembers class * implements android.os.Parcelable {
|
||||||
|
public static final android.os.Parcelable$Creator *;
|
||||||
|
}
|
||||||
|
-keep public class com.google.android.gms.ads.** {
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
-keep class com.ironsource.adapters.** { *;
|
||||||
|
}
|
||||||
|
-dontwarn com.ironsource.mediationsdk.**
|
||||||
|
-dontwarn com.ironsource.adapters.**
|
||||||
|
-keepattributes JavascriptInterface
|
||||||
|
-keepclassmembers class * {
|
||||||
|
@android.webkit.JavascriptInterface <methods>;
|
||||||
|
}
|
||||||
|
-keep class com.bytedance.sdk.** { *; }
|
||||||
|
-keep class com.inmobi.** { *; }
|
||||||
|
-keep public class com.google.android.gms.**
|
||||||
|
-dontwarn com.google.android.gms.**
|
||||||
|
-dontwarn com.squareup.picasso.**
|
||||||
|
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
# skip the Picasso library classes
|
||||||
|
-keep class com.squareup.picasso.** {*;}
|
||||||
|
-dontwarn com.squareup.okhttp.**
|
||||||
|
# skip Moat classes
|
||||||
|
-keep class com.moat.** {*;}
|
||||||
|
-dontwarn com.moat.**
|
||||||
|
# skip IAB classes
|
||||||
|
-keep class com.iab.** {*;}
|
||||||
|
-dontwarn com.iab.**
|
||||||
|
-keepattributes Signature
|
||||||
|
-keepattributes *Annotation*
|
||||||
|
-keep class com.mbridge.** {*; }
|
||||||
|
-keep interface com.mbridge.** {*; }
|
||||||
|
-keep class android.support.v4.** { *; }
|
||||||
|
-dontwarn com.mbridge.**
|
||||||
|
-keep class **.R$* { public static final int mbridge*; }
|
||||||
|
-keep public class com.mbridge.* extends androidx.** { *; }
|
||||||
|
-keep public class androidx.viewpager.widget.PagerAdapter{ *; }
|
||||||
|
-keep public class androidx.viewpager.widget.ViewPager.OnPageChangeListener{ *; }
|
||||||
|
-keep interface androidx.annotation.IntDef{ *; }
|
||||||
|
-keep interface androidx.annotation.Nullable{ *; }
|
||||||
|
-keep interface androidx.annotation.CheckResult{ *; }
|
||||||
|
-keep interface androidx.annotation.NonNull{ *; }
|
||||||
|
-keep public class androidx.fragment.app.Fragment{ *; }
|
||||||
|
-keep public class androidx.core.content.FileProvider{ *; }
|
||||||
|
-keep public class androidx.core.app.NotificationCompat{ *; }
|
||||||
|
-keep public class androidx.appcompat.widget.AppCompatImageView { *; }
|
||||||
|
-keep public class androidx.recyclerview.*{ *; }
|
||||||
|
-keep class com.chartboost.** { *; }
|
||||||
|
|
||||||
|
#---------------------------------------------Topon
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,9 @@ import android.content.Context;
|
|||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.anythink.core.api.ATSDK;
|
||||||
|
import com.anythink.core.api.NetTrafficeCallback;
|
||||||
|
import com.photo.wallpaper.category.ad.AdManager;
|
||||||
import com.photo.wallpaper.category.utils.CommonHelper;
|
import com.photo.wallpaper.category.utils.CommonHelper;
|
||||||
import com.photo.wallpaper.category.utils.ParseData;
|
import com.photo.wallpaper.category.utils.ParseData;
|
||||||
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
||||||
@ -40,7 +43,7 @@ public class MyApp extends Application {
|
|||||||
super.onCreate();
|
super.onCreate();
|
||||||
mAppContext = this;
|
mAppContext = this;
|
||||||
defaultFont = Typeface.createFromAsset(getAssets(), "custfont.ttf");
|
defaultFont = Typeface.createFromAsset(getAssets(), "custfont.ttf");
|
||||||
|
initAd();
|
||||||
DataBaseHelper.init(this);
|
DataBaseHelper.init(this);
|
||||||
executor = Executors.newFixedThreadPool(8);
|
executor = Executors.newFixedThreadPool(8);
|
||||||
String[] names = {wallpaperName, animasName, exName, filmName, natureName, pattName, streetName, travelName};
|
String[] names = {wallpaperName, animasName, exName, filmName, natureName, pattName, streetName, travelName};
|
||||||
@ -81,28 +84,28 @@ public class MyApp extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// private void initTop(){
|
private void initAd() {
|
||||||
// ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
|
String APPId = "h67cff355ac03b";
|
||||||
//
|
String AppKey = "a51ae85bffe9009f8e1129e5576b7cac4";
|
||||||
// @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);
|
// ATDebuggerUITest.showDebuggerUI(this,debug_Key);
|
||||||
// AdManager.loadAllAd();
|
AdManager.loadAllAd();
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,8 @@ import com.bumptech.glide.request.target.Target;
|
|||||||
import com.photo.wallpaper.category.MyApp;
|
import com.photo.wallpaper.category.MyApp;
|
||||||
|
|
||||||
import com.photo.wallpaper.category.R;
|
import com.photo.wallpaper.category.R;
|
||||||
|
import com.photo.wallpaper.category.ad.AdManager;
|
||||||
|
import com.photo.wallpaper.category.ad.onActionListener;
|
||||||
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
||||||
import com.photo.wallpaper.category.bean.Data;
|
import com.photo.wallpaper.category.bean.Data;
|
||||||
import com.photo.wallpaper.category.api.ApiDialogType;
|
import com.photo.wallpaper.category.api.ApiDialogType;
|
||||||
@ -69,8 +71,16 @@ public class ActivityApply extends AppCompatActivity implements ApiDialogType {
|
|||||||
vb = ActivityLayoutSetBinding.inflate(getLayoutInflater());
|
vb = ActivityLayoutSetBinding.inflate(getLayoutInflater());
|
||||||
CommonHelper.initFull(this, true);
|
CommonHelper.initFull(this, true);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
AdManager.showTopOn(ActivityApply.this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
weakReference = new WeakReference<>(this);
|
weakReference = new WeakReference<>(this);
|
||||||
data = (Data) getIntent().getSerializableExtra(CommonHelper.key_info);
|
data = (Data) getIntent().getSerializableExtra(CommonHelper.key_info);
|
||||||
|
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -85,10 +95,7 @@ public class ActivityApply extends AppCompatActivity implements ApiDialogType {
|
|||||||
private void loadDetail() {
|
private void loadDetail() {
|
||||||
String previewUrl400 = data.getPreviewUrl400();
|
String previewUrl400 = data.getPreviewUrl400();
|
||||||
String previewUrl1080 = data.getPreviewUrl1080();
|
String previewUrl1080 = data.getPreviewUrl1080();
|
||||||
// String previewUrl200 = data.getPreviewUrl200();
|
|
||||||
// String authorHeader = data.getAuthorHeader();
|
|
||||||
// String authorName = data.getAuthorName();
|
|
||||||
// String authorHtml = data.getAuthorHtml();
|
|
||||||
fullUrl = data.getFullUrl();
|
fullUrl = data.getFullUrl();
|
||||||
|
|
||||||
File file = new File(mSavePath);
|
File file = new File(mSavePath);
|
||||||
@ -97,7 +104,7 @@ public class ActivityApply extends AppCompatActivity implements ApiDialogType {
|
|||||||
|
|
||||||
|
|
||||||
int[] screenWidthHeight = CommonHelper.getScreenWidthHeight(this);
|
int[] screenWidthHeight = CommonHelper.getScreenWidthHeight(this);
|
||||||
Log.d(MyApp.TAG, "--------width=" + screenWidthHeight[0] + "----height=" + screenWidthHeight[1]);
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
.load(file)
|
.load(file)
|
||||||
@ -158,13 +165,19 @@ public class ActivityApply extends AppCompatActivity implements ApiDialogType {
|
|||||||
});
|
});
|
||||||
|
|
||||||
vb.buttonSet.setOnClickListener(v -> {
|
vb.buttonSet.setOnClickListener(v -> {
|
||||||
if (fragSetType == null) {
|
AdManager.showTopOn(ActivityApply.this, new onActionListener() {
|
||||||
fragSetType = new FragSetType();
|
@Override
|
||||||
fragSetType.setListener(ActivityApply.this);
|
public void onAction() {
|
||||||
}
|
if (fragSetType == null) {
|
||||||
if (!fragSetType.isAdded()) {
|
fragSetType = new FragSetType();
|
||||||
fragSetType.show(getSupportFragmentManager(), "");
|
fragSetType.setListener(ActivityApply.this);
|
||||||
}
|
}
|
||||||
|
if (!fragSetType.isAdded()) {
|
||||||
|
fragSetType.show(getSupportFragmentManager(), "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -186,8 +199,12 @@ public class ActivityApply extends AppCompatActivity implements ApiDialogType {
|
|||||||
if (!permission) {
|
if (!permission) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startSaveToAlbum();
|
AdManager.showTopOn(ActivityApply.this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
startSaveToAlbum();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import android.view.View;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
|
||||||
|
import com.photo.wallpaper.category.ad.AdManager;
|
||||||
|
import com.photo.wallpaper.category.ad.onActionListener;
|
||||||
import com.photo.wallpaper.category.api.ApiItemClick;
|
import com.photo.wallpaper.category.api.ApiItemClick;
|
||||||
import com.photo.wallpaper.category.bean.Data;
|
import com.photo.wallpaper.category.bean.Data;
|
||||||
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
||||||
@ -29,6 +31,7 @@ public class ActivityCategory extends AppCompatActivity implements ApiItemClick
|
|||||||
vb = ActivityLayoutClassBinding.inflate(getLayoutInflater());
|
vb = ActivityLayoutClassBinding.inflate(getLayoutInflater());
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
CommonHelper.initFull(this, false);
|
CommonHelper.initFull(this, false);
|
||||||
|
AdManager.loadAllAd();
|
||||||
categoryName = getIntent().getStringExtra(key_index);
|
categoryName = getIntent().getStringExtra(key_index);
|
||||||
vb.name.setText(categoryName);
|
vb.name.setText(categoryName);
|
||||||
initList();
|
initList();
|
||||||
@ -38,6 +41,12 @@ public class ActivityCategory extends AppCompatActivity implements ApiItemClick
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
AdManager.showTopOn(ActivityCategory.this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initList() {
|
private void initList() {
|
||||||
|
|||||||
@ -7,6 +7,9 @@ import android.os.CountDownTimer;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.photo.wallpaper.category.ad.AdManager;
|
||||||
|
import com.photo.wallpaper.category.ad.CountAction;
|
||||||
|
import com.photo.wallpaper.category.ad.GoMainAction;
|
||||||
import com.photo.wallpaper.category.databinding.ActivityLayoutLaunherBinding;
|
import com.photo.wallpaper.category.databinding.ActivityLayoutLaunherBinding;
|
||||||
import com.photo.wallpaper.category.utils.CommonHelper;
|
import com.photo.wallpaper.category.utils.CommonHelper;
|
||||||
|
|
||||||
@ -15,7 +18,7 @@ public class ActivityLauncher extends AppCompatActivity {
|
|||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
private ActivityLayoutLaunherBinding vb;
|
private ActivityLayoutLaunherBinding vb;
|
||||||
|
|
||||||
private long totalTime = 1600;
|
private long totalTime = 11600;
|
||||||
|
|
||||||
@SuppressLint("MissingInflatedId")
|
@SuppressLint("MissingInflatedId")
|
||||||
@Override
|
@Override
|
||||||
@ -24,45 +27,27 @@ public class ActivityLauncher extends AppCompatActivity {
|
|||||||
vb = ActivityLayoutLaunherBinding.inflate(getLayoutInflater());
|
vb = ActivityLayoutLaunherBinding.inflate(getLayoutInflater());
|
||||||
CommonHelper.initFull(this,false);
|
CommonHelper.initFull(this,false);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
|
||||||
|
countDownTimer = AdManager.showWelcomeAd(ActivityLauncher.this, totalTime, new CountAction() {
|
||||||
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(ActivityLauncher.this, ActivityMain.class);
|
Intent intent = new Intent(ActivityLauncher.this, ActivityMain.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
// 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.start();
|
countDownTimer.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import androidx.viewpager2.adapter.FragmentStateAdapter;
|
|||||||
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
import com.photo.wallpaper.category.R;
|
import com.photo.wallpaper.category.R;
|
||||||
|
import com.photo.wallpaper.category.ad.AdManager;
|
||||||
import com.photo.wallpaper.category.databinding.ActivityLayoutMainBinding;
|
import com.photo.wallpaper.category.databinding.ActivityLayoutMainBinding;
|
||||||
import com.photo.wallpaper.category.databinding.LayoutTabCustomViewBinding;
|
import com.photo.wallpaper.category.databinding.LayoutTabCustomViewBinding;
|
||||||
import com.photo.wallpaper.category.utils.CommonHelper;
|
import com.photo.wallpaper.category.utils.CommonHelper;
|
||||||
@ -30,7 +31,7 @@ public class ActivityMain extends AppCompatActivity {
|
|||||||
CommonHelper.initFull(this,false);
|
CommonHelper.initFull(this,false);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
|
||||||
|
AdManager.loadAllAd();
|
||||||
List<Fragment> list = new ArrayList<>();
|
List<Fragment> list = new ArrayList<>();
|
||||||
list.add(FragHome.newInstance(0));
|
list.add(FragHome.newInstance(0));
|
||||||
list.add(FragSearch.newInstance());
|
list.add(FragSearch.newInstance());
|
||||||
|
|||||||
@ -18,6 +18,8 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
|
|
||||||
import com.photo.wallpaper.category.MyApp;
|
import com.photo.wallpaper.category.MyApp;
|
||||||
import com.photo.wallpaper.category.R;
|
import com.photo.wallpaper.category.R;
|
||||||
|
import com.photo.wallpaper.category.ad.AdManager;
|
||||||
|
import com.photo.wallpaper.category.ad.onActionListener;
|
||||||
import com.photo.wallpaper.category.api.ApiItemClick;
|
import com.photo.wallpaper.category.api.ApiItemClick;
|
||||||
import com.photo.wallpaper.category.bean.Data;
|
import com.photo.wallpaper.category.bean.Data;
|
||||||
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
import com.photo.wallpaper.category.bean.DataBaseHelper;
|
||||||
@ -100,29 +102,35 @@ public class FragSearch extends Fragment implements ApiItemClick {
|
|||||||
imm.hideSoftInputFromWindow(vb.et.getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(vb.et.getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
private void startSearch() {
|
private void startSearch() {
|
||||||
closeKeyboard();
|
AdManager.showTopOn(requireActivity(), new onActionListener() {
|
||||||
vb.searchPb.setVisibility(View.VISIBLE);
|
@Override
|
||||||
String string = vb.et.getText().toString();
|
public void onAction() {
|
||||||
if (!string.isEmpty()) {
|
closeKeyboard();
|
||||||
List<Data> search = DataBaseHelper.search(string);
|
vb.searchPb.setVisibility(View.VISIBLE);
|
||||||
if (search.size() > 0) {
|
String string = vb.et.getText().toString();
|
||||||
showEmpty(false);
|
if (!string.isEmpty()) {
|
||||||
adapterWallapper.setDataInfo(search);
|
List<Data> search = DataBaseHelper.search(string);
|
||||||
|
if (search.size() > 0) {
|
||||||
|
showEmpty(false);
|
||||||
|
adapterWallapper.setDataInfo(search);
|
||||||
|
|
||||||
vb.searchPb.setVisibility(View.GONE);
|
vb.searchPb.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
vb.searchPb.setVisibility(View.GONE);
|
vb.searchPb.setVisibility(View.GONE);
|
||||||
showEmpty(true);
|
showEmpty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d(MyApp.TAG, "--------------size=" + search.size());
|
Log.d(MyApp.TAG, "--------------size=" + search.size());
|
||||||
for (Data data : search) {
|
for (Data data : search) {
|
||||||
Log.d(MyApp.TAG, "--------------data=" + data.getDescription());
|
Log.d(MyApp.TAG, "--------------data=" + data.getDescription());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vb.searchPb.setVisibility(View.GONE);
|
||||||
|
Toast.makeText(requireContext(), getString(R.string.please_input_keyword), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
vb.searchPb.setVisibility(View.GONE);
|
|
||||||
Toast.makeText(requireContext(), getString(R.string.please_input_keyword), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showEmpty(boolean showEmpty) {
|
private void showEmpty(boolean showEmpty) {
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.photo.wallpaper.category.ad;
|
||||||
|
|
||||||
|
public interface AdListener {
|
||||||
|
void loadFail(String placeId);
|
||||||
|
void showSuccess();
|
||||||
|
|
||||||
|
void showFail();
|
||||||
|
|
||||||
|
void showClose();
|
||||||
|
}
|
||||||
244
app/src/main/java/com/photo/wallpaper/category/ad/AdManager.java
Normal file
244
app/src/main/java/com/photo/wallpaper/category/ad/AdManager.java
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
package com.photo.wallpaper.category.ad;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
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 com.photo.wallpaper.category.MyApp;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
private static final String place1Id = "n67cff3a06f580";
|
||||||
|
private static final String place2Id = "n67cff39f9d237";
|
||||||
|
private static final String place3Id = "n67cff39e4008c";
|
||||||
|
|
||||||
|
|
||||||
|
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.photo.wallpaper.category.ad;
|
||||||
|
|
||||||
|
public interface AdStatusAction {
|
||||||
|
void onStatus(int adType);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.photo.wallpaper.category.ad;
|
||||||
|
|
||||||
|
public interface CountAction {
|
||||||
|
void onCount(long millisUntilFinished);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.photo.wallpaper.category.ad;
|
||||||
|
|
||||||
|
public interface GoMainAction {
|
||||||
|
void onGo();
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.photo.wallpaper.category.ad;
|
||||||
|
|
||||||
|
public interface onActionListener {
|
||||||
|
|
||||||
|
void onAction();
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
app_name=Life Wallpaper
|
app_name=Photo Wallpaper
|
||||||
package_name=com.free.life.wallpaper
|
package_name=com.photo.wallpaper.category
|
||||||
keystoreFile=app/LifeWallpaper.jks
|
keystoreFile=app/PhotoWallpaper.jks
|
||||||
key_alias=LifeWallpaperkey0
|
key_alias=PhotoWallpaperkey0
|
||||||
key_store_password=LifeWallpaper
|
key_store_password=PhotoWallpaper
|
||||||
key_password=LifeWallpaper
|
key_password=PhotoWallpaper
|
||||||
@ -11,25 +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集成测试工具
|
// //TopOn集成测试工具
|
||||||
// maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
// maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user