V1.0.2(3)集成topon
This commit is contained in:
parent
b307c4b9a9
commit
b2fab8fffc
@ -5,8 +5,8 @@ import java.text.SimpleDateFormat
|
|||||||
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.gms.google-services")
|
||||||
// id("com.google.firebase.crashlytics")
|
id("com.google.firebase.crashlytics")
|
||||||
kotlin("kapt")
|
kotlin("kapt")
|
||||||
id ("kotlin-android")
|
id ("kotlin-android")
|
||||||
}
|
}
|
||||||
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId = "com.blue.running.keyboard"
|
applicationId = "com.blue.running.keyboard"
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 2
|
versionCode = 3
|
||||||
versionName = "1.0.1"
|
versionName = "1.0.2"
|
||||||
setProperty(
|
setProperty(
|
||||||
"archivesBaseName",
|
"archivesBaseName",
|
||||||
"Running Keyboard_V" + versionName + "(${versionCode})_$timestamp"
|
"Running Keyboard_V" + versionName + "(${versionCode})_$timestamp"
|
||||||
@ -60,10 +60,7 @@ dependencies {
|
|||||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||||
implementation("com.google.android.material:material:1.10.0")
|
implementation("com.google.android.material:material:1.10.0")
|
||||||
|
|
||||||
// implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
|
||||||
// testImplementation("junit:junit:4.13.2")
|
|
||||||
// androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
||||||
// androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
||||||
|
|
||||||
|
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||||
@ -80,69 +77,103 @@ dependencies {
|
|||||||
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
|
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
|
||||||
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
|
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
|
||||||
|
|
||||||
// implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
|
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
|
||||||
// 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(pangle、IronSource、mintegral、unityads、liftoff(vungle)、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.3.68")
|
implementation("com.anythink.sdk:core-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:nativead-tpn:6.3.68")
|
implementation("com.anythink.sdk:nativead-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:banner-tpn:6.3.68")
|
implementation("com.anythink.sdk:banner-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:interstitial-tpn:6.3.68")
|
implementation("com.anythink.sdk:interstitial-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:rewardedvideo-tpn:6.3.68")
|
implementation("com.anythink.sdk:rewardedvideo-tpn:6.4.07")
|
||||||
// implementation("com.anythink.sdk:splash-tpn:6.3.68")
|
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")
|
||||||
//
|
|
||||||
// //Vungle
|
//StartApp
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-vungle:6.3.68")
|
implementation("com.anythink.sdk:adapter-tpn-startapp:6.4.07")
|
||||||
// implementation("com.vungle:vungle-ads:7.3.2")
|
implementation("com.startapp:inapp-sdk:5.0.2")
|
||||||
// implementation("com.google.android.gms:play-services-basement:18.1.0")
|
|
||||||
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
//Appnext
|
||||||
//
|
implementation("com.anythink.sdk:adapter-tpn-appnext:6.4.07")
|
||||||
// //UnityAds
|
implementation("com.appnext.sdk:ads:2.7.1.473")
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-unityads:6.3.68")
|
implementation("com.appnext.sdk:banners:2.7.1.473")
|
||||||
// implementation("com.unity3d.ads:unity-ads:4.9.3")
|
implementation("com.appnext.sdk:native-ads2:2.7.1.473")
|
||||||
//
|
implementation("com.appnext.sdk:actions:2.4.6.472")
|
||||||
// //Ironsource
|
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-ironsource:6.3.68")
|
|
||||||
// implementation("com.ironsource.sdk:mediationsdk:8.1.0")
|
//Vungle
|
||||||
// implementation("com.google.android.gms:play-services-appset:16.0.2")
|
implementation("com.anythink.sdk:adapter-tpn-vungle:6.4.07")
|
||||||
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
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")
|
||||||
// //Bigo
|
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-bigo:6.3.68")
|
//UnityAds
|
||||||
// implementation("com.bigossp:bigo-ads:4.7.4")
|
implementation("com.anythink.sdk:adapter-tpn-unityads:6.4.07")
|
||||||
//
|
implementation("com.unity3d.ads:unity-ads:4.12.2")
|
||||||
// //Pangle
|
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.3.68.1")
|
//Ironsource
|
||||||
// implementation( "com.pangle.global:ads-sdk:6.0.0.3")
|
implementation("com.anythink.sdk:adapter-tpn-ironsource:6.4.07")
|
||||||
// implementation( "com.google.android.gms:play-services-ads-identifier:18.0.1")
|
implementation("com.ironsource.sdk:mediationsdk:8.2.1")
|
||||||
//
|
implementation("com.google.android.gms:play-services-appset:16.0.2")
|
||||||
// //Mintegral
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
// implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.3.68")
|
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||||
// implementation("com.mbridge.msdk.oversea:reward:16.7.51")
|
|
||||||
// implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
|
//Bigo
|
||||||
// implementation("com.mbridge.msdk.oversea:mbnative:16.7.51")
|
implementation("com.anythink.sdk:adapter-tpn-bigo:6.4.07")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.7.51")
|
implementation("com.bigossp:bigo-ads:4.9.0")
|
||||||
// implementation("com.mbridge.msdk.oversea:mbsplash:16.7.51")
|
|
||||||
// implementation("com.mbridge.msdk.oversea:mbbanner:16.7.51")
|
//Pangle
|
||||||
// implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
|
implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.4.07")
|
||||||
// implementation("androidx.recyclerview:recyclerview:1.1.0")
|
implementation("com.pangle.global:ads-sdk:6.1.0.9")
|
||||||
//
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
// //Tramini
|
|
||||||
// implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68")
|
//Inmobi
|
||||||
//
|
implementation("com.anythink.sdk:adapter-tpn-inmobi:6.4.07")
|
||||||
// // Debugger UI Tools
|
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.7.5")
|
||||||
|
|
||||||
|
//Mintegral
|
||||||
|
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:newinterstitial: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:mbsplash:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbbanner:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbbid:16.8.11")
|
||||||
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||||
|
|
||||||
|
//Chartboost
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-chartboost:6.4.07")
|
||||||
|
implementation("com.chartboost:chartboost-sdk:9.7.0")
|
||||||
|
implementation("com.chartboost:chartboost-mediation-sdk:4.9.1")
|
||||||
|
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.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.anythink.sdk:adapter-tpn-fyber:6.4.07")
|
||||||
|
implementation("com.fyber:marketplace-sdk:8.3.0")
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
|
|
||||||
|
// Debugger UI Tools
|
||||||
//implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
//implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
||||||
|
|
||||||
//----------------------------------------------TopOn
|
//----------------------------------------------TopOn
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "6833554574",
|
||||||
|
"project_id": "running-keyboard-f2d41",
|
||||||
|
"storage_bucket": "running-keyboard-f2d41.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:6833554574:android:bbe3aaf58ec158664db5df",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.blue.running.keyboard"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyA4J9VyVf7T36p-qCVp1xFjAI9njUgjyLw"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
131
app/proguard-rules.pro
vendored
131
app/proguard-rules.pro
vendored
@ -43,3 +43,134 @@
|
|||||||
-keep class com.omicronapplications.** { *; }
|
-keep class com.omicronapplications.** { *; }
|
||||||
-keep class net.sf.sevenzipjbinding.** { *; }
|
-keep class net.sf.sevenzipjbinding.** { *; }
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,9 @@ package com.blue.running.keyboard
|
|||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
|
import com.anythink.core.api.ATSDK
|
||||||
|
import com.anythink.core.api.NetTrafficeCallback
|
||||||
|
import com.blue.running.keyboard.ad.AdManager
|
||||||
import com.blue.running.keyboard.run_jsonbean.ClassData
|
import com.blue.running.keyboard.run_jsonbean.ClassData
|
||||||
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
|
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
@ -27,9 +30,9 @@ class RunningApp : Application() {
|
|||||||
super.onCreate()
|
super.onCreate()
|
||||||
runningAppInstance = this
|
runningAppInstance = this
|
||||||
defaultFont = Typeface.createFromAsset(assets, "font5.ttf")
|
defaultFont = Typeface.createFromAsset(assets, "font5.ttf")
|
||||||
|
initTopon()
|
||||||
dealFile()
|
dealFile()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun dealFile() {
|
private fun dealFile() {
|
||||||
@ -48,7 +51,8 @@ class RunningApp : Application() {
|
|||||||
jsonData.getJSONObject(i).run {
|
jsonData.getJSONObject(i).run {
|
||||||
val pName = getString("parent_name")
|
val pName = getString("parent_name")
|
||||||
val listArray = getJSONArray("keyboard_list")
|
val listArray = getJSONArray("keyboard_list")
|
||||||
var childDataList: MutableList<com.blue.running.keyboard.run_jsonbean.ChildData> = mutableListOf()
|
var childDataList: MutableList<com.blue.running.keyboard.run_jsonbean.ChildData> =
|
||||||
|
mutableListOf()
|
||||||
for (listIndex in 0 until listArray.length()) {
|
for (listIndex in 0 until listArray.length()) {
|
||||||
listArray.getJSONObject(listIndex).also {
|
listArray.getJSONObject(listIndex).also {
|
||||||
val title = it.getString("title")
|
val title = it.getString("title")
|
||||||
@ -100,6 +104,7 @@ class RunningApp : Application() {
|
|||||||
list = mainList
|
list = mainList
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getJsonString(fileInputStream: InputStream): String? {
|
private fun getJsonString(fileInputStream: InputStream): String? {
|
||||||
return try {
|
return try {
|
||||||
val charArray = CharArray(fileInputStream.available())
|
val charArray = CharArray(fileInputStream.available())
|
||||||
@ -117,5 +122,24 @@ class RunningApp : Application() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun initTopon() {
|
||||||
|
ATSDK.checkIsEuTraffic(this, object : NetTrafficeCallback {
|
||||||
|
override fun onResultCallback(isEU: Boolean) {
|
||||||
|
if (isEU && ATSDK.getGDPRDataLevel(this@RunningApp) == ATSDK.UNKNOWN) {
|
||||||
|
ATSDK.showGdprAuth(this@RunningApp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onErrorCallback(errorMsg: String) {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
val APPId: String = "h67edee061c026"
|
||||||
|
val AppKey: String = "ae80dc43dec54c7c2dbe022640ccd2083"
|
||||||
|
ATSDK.init(this, APPId, AppKey)
|
||||||
|
//测试工具
|
||||||
|
// ATDebuggerUITest.showDebuggerUI(this,"d0a434af69020f58cd1c246da4adb0630eb18a02");
|
||||||
|
AdManager.loadAllAd()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.blue.running.keyboard.ad;
|
||||||
|
|
||||||
|
public interface AdListener {
|
||||||
|
void loadFail(String placeId);
|
||||||
|
void showSuccess();
|
||||||
|
|
||||||
|
void showFail();
|
||||||
|
|
||||||
|
void showClose();
|
||||||
|
}
|
||||||
254
app/src/main/java/com/blue/running/keyboard/ad/AdManager.java
Normal file
254
app/src/main/java/com/blue/running/keyboard/ad/AdManager.java
Normal file
@ -0,0 +1,254 @@
|
|||||||
|
package com.blue.running.keyboard.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.blue.running.keyboard.RunningApp;
|
||||||
|
|
||||||
|
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 = "n67edee59d196b";
|
||||||
|
private static final String place2Id = "n67edee4dcb520";
|
||||||
|
private static final String place3Id = "n67edee3f21cfb";
|
||||||
|
|
||||||
|
|
||||||
|
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<>();
|
||||||
|
|
||||||
|
|
||||||
|
private static String Ad_TAG = RunningApp.TAG;
|
||||||
|
public static void loadAllAd() {
|
||||||
|
place1LoadFail = false;
|
||||||
|
place2LoadFail = false;
|
||||||
|
place3LoadFail = false;
|
||||||
|
if (list.size() == 0) {
|
||||||
|
ATInterstitial mInterstitialAd1 = new ATInterstitial(RunningApp.runningAppInstance, place1Id);
|
||||||
|
ATInterstitial mInterstitialAd2 = new ATInterstitial(RunningApp.runningAppInstance, place2Id);
|
||||||
|
ATInterstitial mInterstitialAd3 = new ATInterstitial(RunningApp.runningAppInstance, 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(Ad_TAG, "-has Cache------------");
|
||||||
|
return ad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d(Ad_TAG, "-No Cache------------");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setCallBack(ATInterstitial ad, AdListener listener) {
|
||||||
|
ad.setAdListener(new ATInterstitialListener() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdLoaded() {
|
||||||
|
Log.d(Ad_TAG, "LoadLoaded " + ad.mPlacementId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdLoadFail(AdError adError) {
|
||||||
|
listener.loadFail(ad.mPlacementId);
|
||||||
|
Log.d(Ad_TAG, "LoadFail:--" + ad.mPlacementId + "--" + adError.getCode() + "---" + adError.getDesc());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdClicked(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
|
||||||
|
Log.d(Ad_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(Ad_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(place1LoadFail&&place2LoadFail&&place3LoadFail){
|
||||||
|
Log.d(Ad_TAG,"------------all load fail");
|
||||||
|
alreadyShow = true;
|
||||||
|
goMain.onGo();
|
||||||
|
}
|
||||||
|
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.blue.running.keyboard.ad;
|
||||||
|
|
||||||
|
public interface AdStatusAction {
|
||||||
|
void onStatus(int adType);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.blue.running.keyboard.ad;
|
||||||
|
|
||||||
|
public interface CountAction {
|
||||||
|
void onCount(long millisUntilFinished);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.blue.running.keyboard.ad;
|
||||||
|
|
||||||
|
public interface GoMainAction {
|
||||||
|
void onGo();
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.blue.running.keyboard.ad;
|
||||||
|
|
||||||
|
public interface onActionListener {
|
||||||
|
|
||||||
|
void onAction();
|
||||||
|
}
|
||||||
@ -7,6 +7,8 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
|
||||||
import com.blue.running.keyboard.RunningApp;
|
import com.blue.running.keyboard.RunningApp;
|
||||||
|
import com.blue.running.keyboard.ad.AdManager;
|
||||||
|
import com.blue.running.keyboard.ad.onActionListener;
|
||||||
import com.blue.running.keyboard.databinding.ActListBinding;
|
import com.blue.running.keyboard.databinding.ActListBinding;
|
||||||
import com.blue.running.keyboard.run_adapter.AdapterMainChild;
|
import com.blue.running.keyboard.run_adapter.AdapterMainChild;
|
||||||
import com.blue.running.keyboard.run_jsonbean.ChildData;
|
import com.blue.running.keyboard.run_jsonbean.ChildData;
|
||||||
@ -27,10 +29,16 @@ public class ActivityList extends AppCompatActivity {
|
|||||||
vb = ActListBinding.inflate(getLayoutInflater());
|
vb = ActListBinding.inflate(getLayoutInflater());
|
||||||
ComUttils.INSTANCE.initFullScreen(this, true);
|
ComUttils.INSTANCE.initFullScreen(this, true);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
name = getIntent().getStringExtra(KEY_NAME);
|
name = getIntent().getStringExtra(KEY_NAME);
|
||||||
initData();
|
initData();
|
||||||
initClick();
|
initClick();
|
||||||
|
AdManager.showTopOn(ActivityList.this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData(){
|
private void initData(){
|
||||||
@ -51,9 +59,15 @@ public class ActivityList extends AppCompatActivity {
|
|||||||
vb.back.setOnClickListener(new View.OnClickListener() {
|
vb.back.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
AdManager.showTopOn(ActivityList.this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -15,6 +15,7 @@ import androidx.viewpager2.widget.ViewPager2;
|
|||||||
|
|
||||||
import com.blue.running.keyboard.R;
|
import com.blue.running.keyboard.R;
|
||||||
import com.blue.running.keyboard.RunningApp;
|
import com.blue.running.keyboard.RunningApp;
|
||||||
|
import com.blue.running.keyboard.ad.AdManager;
|
||||||
import com.blue.running.keyboard.databinding.ActMainBinding;
|
import com.blue.running.keyboard.databinding.ActMainBinding;
|
||||||
import com.blue.running.keyboard.run_frag.FragLike;
|
import com.blue.running.keyboard.run_frag.FragLike;
|
||||||
import com.blue.running.keyboard.run_frag.FragMain;
|
import com.blue.running.keyboard.run_frag.FragMain;
|
||||||
|
|||||||
@ -15,22 +15,23 @@ import androidx.core.view.isVisible
|
|||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.blue.running.keyboard.R
|
||||||
|
import com.blue.running.keyboard.RunningApp
|
||||||
|
import com.blue.running.keyboard.ad.AdManager
|
||||||
|
import com.blue.running.keyboard.run_adapter.AdapterOther
|
||||||
|
import com.blue.running.keyboard.run_api.ApiClickItem
|
||||||
|
import com.blue.running.keyboard.run_api.ApiSetThemes
|
||||||
|
import com.blue.running.keyboard.run_db.DbHelper
|
||||||
|
import com.blue.running.keyboard.run_frag.DialogActive
|
||||||
|
import com.blue.running.keyboard.run_manager.ComUttils
|
||||||
|
import com.blue.running.keyboard.run_manager.CurrentThemeSave
|
||||||
|
import com.blue.running.keyboard.run_manager.ZipUtils
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.integration.webp.decoder.WebpDrawable
|
import com.bumptech.glide.integration.webp.decoder.WebpDrawable
|
||||||
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
|
||||||
import com.bumptech.glide.request.RequestListener
|
import com.bumptech.glide.request.RequestListener
|
||||||
import com.bumptech.glide.request.target.Target
|
import com.bumptech.glide.request.target.Target
|
||||||
import com.blue.running.keyboard.RunningApp
|
|
||||||
import com.blue.running.keyboard.R
|
|
||||||
import com.blue.running.keyboard.run_adapter.AdapterOther
|
|
||||||
import com.blue.running.keyboard.run_db.DbHelper
|
|
||||||
import com.blue.running.keyboard.run_frag.DialogActive
|
|
||||||
import com.blue.running.keyboard.run_api.ApiSetThemes
|
|
||||||
import com.blue.running.keyboard.run_api.ApiClickItem
|
|
||||||
import com.blue.running.keyboard.run_manager.ComUttils
|
|
||||||
import com.blue.running.keyboard.run_manager.CurrentThemeSave
|
|
||||||
import com.blue.running.keyboard.run_manager.ZipUtils
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@ -87,31 +88,26 @@ class ActivitySetThemes : AppCompatActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.act_set_themes)
|
setContentView(R.layout.act_set_themes)
|
||||||
ComUttils.initFullScreen(this,true)
|
ComUttils.initFullScreen(this,true)
|
||||||
|
AdManager.loadAllAd()
|
||||||
findViewId()
|
findViewId()
|
||||||
getExtraData()
|
getExtraData()
|
||||||
displayData()
|
displayData()
|
||||||
setApply()
|
setApply()
|
||||||
onClick()
|
onClick()
|
||||||
|
AdManager.showTopOn(this@ActivitySetThemes){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun getExtraData() {
|
private fun getExtraData() {
|
||||||
data = intent.getSerializableExtra(SOURCE_KEY) as com.blue.running.keyboard.run_jsonbean.ChildData
|
data = intent.getSerializableExtra(SOURCE_KEY) as com.blue.running.keyboard.run_jsonbean.ChildData
|
||||||
|
|
||||||
displayUrl = data.imgPath
|
displayUrl = data.imgPath
|
||||||
// displayUrl = intent.getStringExtra(DISPLAY_URL_KEY).toString()
|
|
||||||
|
|
||||||
zipUrl = data.zipPath
|
zipUrl = data.zipPath
|
||||||
// zipUrl = intent.getStringExtra(ZIP_URL_KEY).toString()
|
|
||||||
|
|
||||||
|
|
||||||
name = data.titleName
|
name = data.titleName
|
||||||
// name = intent.getStringExtra(NAME_KEY).toString()
|
|
||||||
|
|
||||||
|
|
||||||
gifUrl = data.imgGif
|
gifUrl = data.imgGif
|
||||||
// gifUrl = intent.getStringExtra(GIF_KEY).toString()
|
|
||||||
|
|
||||||
data.thumbGif?.let {
|
data.thumbGif?.let {
|
||||||
thumb = it
|
thumb = it
|
||||||
@ -119,7 +115,7 @@ class ActivitySetThemes : AppCompatActivity() {
|
|||||||
data.thumbUrl?.let {
|
data.thumbUrl?.let {
|
||||||
thumb = it
|
thumb = it
|
||||||
}
|
}
|
||||||
// thumb = intent.getStringExtra(THUMB_KEY).toString()
|
|
||||||
|
|
||||||
val serviceZipName = ZipUtils.getServiceZipName(zipUrl)
|
val serviceZipName = ZipUtils.getServiceZipName(zipUrl)
|
||||||
Log.d(RunningApp.TAG, "--------serviceZipName=$serviceZipName")
|
Log.d(RunningApp.TAG, "--------serviceZipName=$serviceZipName")
|
||||||
@ -148,7 +144,6 @@ class ActivitySetThemes : AppCompatActivity() {
|
|||||||
imgBack = findViewById(R.id.back)
|
imgBack = findViewById(R.id.back)
|
||||||
textName = findViewById(R.id.textview_data_name)
|
textName = findViewById(R.id.textview_data_name)
|
||||||
recommendedRecycler = findViewById(R.id.recommended_recycler)
|
recommendedRecycler = findViewById(R.id.recommended_recycler)
|
||||||
// viewAllLayout = findViewById(R.id.layout_view_all)
|
|
||||||
|
|
||||||
imgLike = findViewById(R.id.im_like)
|
imgLike = findViewById(R.id.im_like)
|
||||||
loadingLayout = findViewById(R.id.loading)
|
loadingLayout = findViewById(R.id.loading)
|
||||||
@ -176,6 +171,8 @@ class ActivitySetThemes : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
imgLike.setOnClickListener {
|
imgLike.setOnClickListener {
|
||||||
|
|
||||||
|
AdManager.showTopOn(this@ActivitySetThemes){
|
||||||
imgLike.isSelected = !imgLike.isSelected
|
imgLike.isSelected = !imgLike.isSelected
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
@ -186,6 +183,8 @@ class ActivitySetThemes : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
val forYouList = RunningApp.list.filter {
|
val forYouList = RunningApp.list.filter {
|
||||||
it.parentName == getString(R.string.recommend_name)
|
it.parentName == getString(R.string.recommend_name)
|
||||||
|
|
||||||
@ -248,14 +247,15 @@ class ActivitySetThemes : AppCompatActivity() {
|
|||||||
|
|
||||||
private fun setApply() {
|
private fun setApply() {
|
||||||
applyBtn.setOnClickListener {
|
applyBtn.setOnClickListener {
|
||||||
|
AdManager.showTopOn(this@ActivitySetThemes){
|
||||||
val checkEnable = ComUttils.checkEnable(this)
|
val checkEnable = ComUttils.checkEnable(this)
|
||||||
val checkSetDefault = ComUttils.checkSetDefault(this)
|
val checkSetDefault = ComUttils.checkSetDefault(this)
|
||||||
if (!checkEnable || !checkSetDefault) {
|
if (!checkEnable || !checkSetDefault) {
|
||||||
showDialog()
|
showDialog()
|
||||||
return@setOnClickListener
|
return@showTopOn
|
||||||
}
|
}
|
||||||
startDown()
|
startDown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,14 @@ import android.os.CountDownTimer
|
|||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.blue.running.keyboard.R
|
import com.blue.running.keyboard.R
|
||||||
|
import com.blue.running.keyboard.ad.AdManager
|
||||||
import com.blue.running.keyboard.run_manager.ComUttils
|
import com.blue.running.keyboard.run_manager.ComUttils
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
class ActivitySplash : AppCompatActivity() {
|
class ActivitySplash : AppCompatActivity() {
|
||||||
|
|
||||||
private lateinit var progressBar: ProgressBar
|
private lateinit var progressBar: ProgressBar
|
||||||
private var countTime = 1000L
|
private var countTime = 12000L
|
||||||
private lateinit var timer: CountDownTimer
|
private lateinit var timer: CountDownTimer
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@ -25,19 +26,14 @@ class ActivitySplash : AppCompatActivity() {
|
|||||||
|
|
||||||
private fun init() {
|
private fun init() {
|
||||||
|
|
||||||
timer = object : CountDownTimer(countTime, 100) {
|
timer = AdManager.showWelcomeAd(this@ActivitySplash, countTime, { millisUntilFinished ->
|
||||||
override fun onTick(millisUntilFinished: Long) {
|
|
||||||
val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100
|
val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100
|
||||||
val round = percentage.roundToInt()
|
val round = percentage.roundToInt()
|
||||||
progressBar.progress = round
|
progressBar.progress = round
|
||||||
}
|
}) {
|
||||||
|
|
||||||
override fun onFinish() {
|
|
||||||
progressBar.progress = 100
|
progressBar.progress = 100
|
||||||
toHome()
|
toHome()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
timer.start()
|
timer.start()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.blue.running.keyboard.ad.AdManager;
|
||||||
import com.blue.running.keyboard.databinding.ActSuccessBinding;
|
import com.blue.running.keyboard.databinding.ActSuccessBinding;
|
||||||
import com.blue.running.keyboard.run_manager.ComUttils;
|
import com.blue.running.keyboard.run_manager.ComUttils;
|
||||||
import com.blue.running.keyboard.run_manager.CurrentThemeSave;
|
import com.blue.running.keyboard.run_manager.CurrentThemeSave;
|
||||||
@ -39,7 +40,7 @@ public class ActivitySuccess extends AppCompatActivity {
|
|||||||
ComUttils.INSTANCE.initFullScreen(this,true);
|
ComUttils.INSTANCE.initFullScreen(this,true);
|
||||||
vb = ActSuccessBinding.inflate(getLayoutInflater());
|
vb = ActSuccessBinding.inflate(getLayoutInflater());
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
onInit();
|
onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.1.0" apply false
|
id("com.android.application") version "8.1.0" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
|
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
|
||||||
// id("com.google.gms.google-services") version "4.4.2" 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
|
id ("com.google.firebase.crashlytics") version "3.0.2" apply false
|
||||||
kotlin("kapt") version "2.0.0"
|
kotlin("kapt") version "2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -13,6 +13,28 @@ dependencyResolutionManagement {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
|
|
||||||
|
//Anythink(Core)
|
||||||
|
maven ("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||||
|
|
||||||
|
//Appnext
|
||||||
|
maven ("https://dl.appnext.com")
|
||||||
|
|
||||||
|
//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