广告接入
This commit is contained in:
parent
184bdd3846
commit
3edd25a8aa
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ local.properties
|
|||||||
.idea/
|
.idea/
|
||||||
.safedk/
|
.safedk/
|
||||||
app/debug/
|
app/debug/
|
||||||
|
app/release/
|
||||||
|
|||||||
@ -7,6 +7,8 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
kotlin("kapt")
|
kotlin("kapt")
|
||||||
id ("kotlin-android")
|
id ("kotlin-android")
|
||||||
|
id("com.google.gms.google-services")
|
||||||
|
id("com.google.firebase.crashlytics")
|
||||||
}
|
}
|
||||||
|
|
||||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||||
@ -17,8 +19,8 @@ android {
|
|||||||
applicationId = "com.app.wave.keyboard"
|
applicationId = "com.app.wave.keyboard"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 1
|
versionCode = 2
|
||||||
versionName = "1.0"
|
versionName = "1.1"
|
||||||
setProperty(
|
setProperty(
|
||||||
"archivesBaseName",
|
"archivesBaseName",
|
||||||
"WaveBoard_V" + versionName + "(${versionCode})_$timestamp"
|
"WaveBoard_V" + versionName + "(${versionCode})_$timestamp"
|
||||||
@ -80,5 +82,92 @@ dependencies {
|
|||||||
implementation("com.google.android.material:material:1.8.0")
|
implementation("com.google.android.material:material:1.8.0")
|
||||||
|
|
||||||
|
|
||||||
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
|
implementation("com.google.android.gms:play-services-location:21.0.1")
|
||||||
|
implementation("com.google.android.gms:play-services-appset:16.0.1")
|
||||||
|
// Import the Firebase BoM
|
||||||
|
implementation(platform("com.google.firebase:firebase-bom:34.6.0"))
|
||||||
|
implementation("com.google.firebase:firebase-crashlytics-ndk")
|
||||||
|
implementation("com.google.firebase:firebase-analytics")
|
||||||
|
// okhttp
|
||||||
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||||
|
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
||||||
|
|
||||||
|
implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar"))
|
||||||
|
|
||||||
|
implementation(files("libs/TradPlusLibrary_01_04_12_20-release.aar"))
|
||||||
|
// TradPlus
|
||||||
|
implementation("com.tradplusad:tradplus:15.2.0.1")
|
||||||
|
implementation("androidx.legacy:legacy-support-v4:1.0.0")
|
||||||
|
implementation("androidx.appcompat:appcompat:1.3.0-alpha02")
|
||||||
|
|
||||||
|
// IronSource
|
||||||
|
implementation("com.ironsource.sdk:mediationsdk:9.0.0")
|
||||||
|
implementation("com.tradplusad:tradplus-ironsource:10.15.2.0.1")
|
||||||
|
|
||||||
|
// Pangle
|
||||||
|
implementation("com.tradplusad:tradplus-pangle:19.15.2.0.1")
|
||||||
|
implementation("com.pangle.global:pag-sdk:7.8.0.7")
|
||||||
|
|
||||||
|
// UnityAds
|
||||||
|
implementation("com.tradplusad:tradplus-unity:5.15.2.0.1")
|
||||||
|
implementation("com.unity3d.ads:unity-ads:4.16.3")
|
||||||
|
|
||||||
|
// Chartboost
|
||||||
|
// implementation("com.tradplusad:tradplus-chartboostx:15.15.2.0.1")
|
||||||
|
// implementation("com.chartboost:chartboost-sdk:9.10.0")
|
||||||
|
// implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
|
||||||
|
// implementation("com.google.android.gms:play-services-base:17.4.0")
|
||||||
|
|
||||||
|
|
||||||
|
//上面新版本下载失败用旧版本
|
||||||
|
implementation("com.tradplusad:tradplus-chartboostx:15.14.5.0.1")
|
||||||
|
implementation("com.chartboost:chartboost-sdk:9.8.3")
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
|
||||||
|
implementation("com.google.android.gms:play-services-base:17.4.0")
|
||||||
|
|
||||||
|
// InMobi
|
||||||
|
implementation("com.tradplusad:tradplus-inmobix:23.15.2.0.1")
|
||||||
|
implementation("com.inmobi.monetization:inmobi-ads-kotlin:11.0.0")
|
||||||
|
implementation("com.squareup.okhttp3:okhttp:3.14.9")
|
||||||
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
|
||||||
|
implementation("androidx.core:core-ktx:1.5.0")
|
||||||
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.0")
|
||||||
|
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
|
implementation("com.google.android.gms:play-services-location:21.0.1") // optional
|
||||||
|
implementation("androidx.browser:browser:1.8.0")
|
||||||
|
implementation("com.squareup.picasso:picasso:2.8")
|
||||||
|
implementation("androidx.viewpager:viewpager:1.0.0")
|
||||||
|
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
||||||
|
|
||||||
|
// Fyber
|
||||||
|
implementation("com.fyber:marketplace-sdk:8.4.0")
|
||||||
|
implementation("com.tradplusad:tradplus-fyber:24.15.2.0.1")
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
|
||||||
|
implementation("com.google.android.gms:play-services-base:17.4.0")
|
||||||
|
|
||||||
|
// Mintegral
|
||||||
|
implementation("com.tradplusad:tradplus-mintegralx_overseas:18.15.2.0.1")
|
||||||
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.10.11")
|
||||||
|
|
||||||
|
// Liftoff (Vungle)
|
||||||
|
implementation("com.tradplusad:tradplus-vunglex:7.15.2.0.1")
|
||||||
|
implementation("com.vungle:vungle-ads:7.6.0")
|
||||||
|
|
||||||
|
// Bigo
|
||||||
|
implementation("com.bigossp:bigo-ads:5.5.2")
|
||||||
|
implementation("com.tradplusad:tradplus-bigo:57.15.2.0.1")
|
||||||
|
|
||||||
|
// Cross Promotion
|
||||||
|
implementation("com.tradplusad:tradplus-crosspromotion:27.15.2.0.1")
|
||||||
|
|
||||||
|
// TP Exchange(注意与主包版本同步)
|
||||||
|
implementation("com.google.code.gson:gson:2.8.6")
|
||||||
|
implementation("com.tradplusad:tp_exchange:40.15.2.0.1")
|
||||||
|
|
||||||
|
// Google UMP
|
||||||
|
implementation ("com.google.android.ump:user-messaging-platform:3.2.0")
|
||||||
}
|
}
|
||||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "678240667256",
|
||||||
|
"project_id": "waveboard-698b9",
|
||||||
|
"storage_bucket": "waveboard-698b9.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:678240667256:android:cc488bbf270ab8a7ac0f8d",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.app.wave.keyboard"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyAIUbpjQPQBeWpKJVvBSmD2EdJXinxQqsE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
BIN
app/libs/TradPlusLibrary_01_04_12_20-release.aar
Normal file
BIN
app/libs/TradPlusLibrary_01_04_12_20-release.aar
Normal file
Binary file not shown.
BIN
app/libs/UpLoadLibrary_12_03_15_13-release.aar
Normal file
BIN
app/libs/UpLoadLibrary_12_03_15_13-release.aar
Normal file
Binary file not shown.
@ -2,13 +2,18 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.AD_ID" />
|
||||||
|
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/logo"
|
android:icon="@mipmap/logo"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/logo"
|
android:roundIcon="@mipmap/logo"
|
||||||
|
android:networkSecurityConfig="@xml/net"
|
||||||
|
tools:replace="networkSecurityConfig"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/MyKeyBoard"
|
android:theme="@style/MyKeyBoard"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import android.app.Application
|
|||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import com.app.wave.keyboard.bean.DetailsBean
|
import com.app.wave.keyboard.bean.DetailsBean
|
||||||
import com.app.wave.keyboard.bean.WrapperBean
|
import com.app.wave.keyboard.bean.WrapperBean
|
||||||
|
import com.up.uploadlibrary.UpLoadManager
|
||||||
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
|
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
@ -28,6 +29,8 @@ class App : Application() {
|
|||||||
super.onCreate()
|
super.onCreate()
|
||||||
appInstance = this
|
appInstance = this
|
||||||
dealFile()
|
dealFile()
|
||||||
|
|
||||||
|
UpLoadManager.init(this,"ocean"){s,ss->}
|
||||||
}
|
}
|
||||||
private fun dealFile() {
|
private fun dealFile() {
|
||||||
val openFile = appInstance.assets.open("keyboard_res.json")
|
val openFile = appInstance.assets.open("keyboard_res.json")
|
||||||
|
|||||||
@ -22,7 +22,10 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import androidx.core.graphics.Insets;
|
import androidx.core.graphics.Insets;
|
||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
import kotlin.Unit;
|
||||||
|
import kotlin.jvm.functions.Function0;
|
||||||
|
|
||||||
|
import com.ad.tradpluslibrary.TPAdManager;
|
||||||
import com.app.wave.keyboard.R;
|
import com.app.wave.keyboard.R;
|
||||||
import com.app.wave.keyboard.databinding.ActivityApplyBinding;
|
import com.app.wave.keyboard.databinding.ActivityApplyBinding;
|
||||||
import com.app.wave.keyboard.utils.MyKeyName;
|
import com.app.wave.keyboard.utils.MyKeyName;
|
||||||
@ -31,7 +34,7 @@ import com.app.wave.keyboard.utils.FastBlurUtil;
|
|||||||
import com.app.wave.keyboard.utils.SavePresentKB;
|
import com.app.wave.keyboard.utils.SavePresentKB;
|
||||||
|
|
||||||
|
|
||||||
public class ApplyActivity extends AppCompatActivity {
|
public class ApplyActivity extends BaseActivity {
|
||||||
private ActivityApplyBinding vb;
|
private ActivityApplyBinding vb;
|
||||||
public static String key_name = "key_name";
|
public static String key_name = "key_name";
|
||||||
private int mPreviousKeyboardHeight = -1;
|
private int mPreviousKeyboardHeight = -1;
|
||||||
@ -43,6 +46,7 @@ public class ApplyActivity extends AppCompatActivity {
|
|||||||
vb = ActivityApplyBinding.inflate(getLayoutInflater());
|
vb = ActivityApplyBinding.inflate(getLayoutInflater());
|
||||||
EdgeToEdge.enable(this);
|
EdgeToEdge.enable(this);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
TPAdManager.INSTANCE.loadAllAd(this);
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
@ -68,7 +72,7 @@ public class ApplyActivity extends AppCompatActivity {
|
|||||||
vb.idBack.setOnClickListener(new View.OnClickListener() {
|
vb.idBack.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
finish();
|
onInterceptBackPressed();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -198,4 +202,25 @@ public class ApplyActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldInterceptBackPress() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onInterceptBackPressed() {
|
||||||
|
|
||||||
|
TPAdManager.INSTANCE.showTPAD(this, new Function0<Unit>() {
|
||||||
|
@Override
|
||||||
|
public Unit invoke() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (getBackPressedCallback() != null) {
|
||||||
|
getBackPressedCallback().setEnabled(false);
|
||||||
|
}
|
||||||
|
getOnBackPressedDispatcher().onBackPressed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
36
app/src/main/java/com/app/wave/keyboard/ui/BaseActivity.kt
Normal file
36
app/src/main/java/com/app/wave/keyboard/ui/BaseActivity.kt
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package com.app.wave.keyboard.ui
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.activity.OnBackPressedCallback
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
|
||||||
|
open class BaseActivity: AppCompatActivity() {
|
||||||
|
protected var backPressedCallback: OnBackPressedCallback? = null
|
||||||
|
/** 子类是否需要拦截返回 */
|
||||||
|
protected open fun shouldInterceptBackPress(): Boolean = false
|
||||||
|
|
||||||
|
/** 子类定义拦截后的操作(例如弹窗) */
|
||||||
|
protected open fun onInterceptBackPressed() {}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setupBackPressedCallback()//初始化back事件
|
||||||
|
}
|
||||||
|
private fun setupBackPressedCallback() {
|
||||||
|
backPressedCallback = object : OnBackPressedCallback(true) {
|
||||||
|
override fun handleOnBackPressed() {
|
||||||
|
if (shouldInterceptBackPress()) {
|
||||||
|
// 由子类处理拦截动作
|
||||||
|
onInterceptBackPressed()
|
||||||
|
} else {
|
||||||
|
// 不拦截:关闭自己
|
||||||
|
isEnabled = false
|
||||||
|
onBackPressedDispatcher.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onBackPressedDispatcher.addCallback(this, backPressedCallback!!)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -21,6 +21,7 @@ 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.ad.tradpluslibrary.TPAdManager
|
||||||
import com.app.wave.keyboard.App
|
import com.app.wave.keyboard.App
|
||||||
import com.app.wave.keyboard.R
|
import com.app.wave.keyboard.R
|
||||||
import com.app.wave.keyboard.bean.DetailsBean
|
import com.app.wave.keyboard.bean.DetailsBean
|
||||||
@ -79,6 +80,7 @@ class KeyboardPreviewActivity : AppCompatActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_keyboard_preview)
|
setContentView(R.layout.activity_keyboard_preview)
|
||||||
|
TPAdManager.loadAllAd(this)
|
||||||
this.enableEdgeToEdge()
|
this.enableEdgeToEdge()
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(
|
ViewCompat.setOnApplyWindowInsetsListener(
|
||||||
findViewById(R.id.main),
|
findViewById(R.id.main),
|
||||||
@ -94,6 +96,8 @@ class KeyboardPreviewActivity : AppCompatActivity() {
|
|||||||
setApply()
|
setApply()
|
||||||
onClick()
|
onClick()
|
||||||
setupScrollListener() // 添加滚动监听
|
setupScrollListener() // 添加滚动监听
|
||||||
|
|
||||||
|
TPAdManager.showTPAD(this) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findViewId() {
|
private fun findViewId() {
|
||||||
@ -257,15 +261,17 @@ class KeyboardPreviewActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
private fun setApply() {
|
private fun setApply() {
|
||||||
applyBtn.setOnClickListener {
|
applyBtn.setOnClickListener {
|
||||||
|
TPAdManager.showTPAD(this@KeyboardPreviewActivity) {
|
||||||
val checkEnable = Comutils.checkEnable(this)
|
val checkEnable = Comutils.checkEnable(this)
|
||||||
val checkSetDefault = Comutils.checkSetDefault(this)
|
val checkSetDefault = Comutils.checkSetDefault(this)
|
||||||
if (!checkEnable || !checkSetDefault) {
|
if (!checkEnable || !checkSetDefault) {
|
||||||
showDialog()
|
showDialog()
|
||||||
return@setOnClickListener
|
return@showTPAD
|
||||||
}
|
}
|
||||||
startDown()
|
startDown()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun showDialog() {
|
private fun showDialog() {
|
||||||
dialog = dialog ?: KeyboardDialog.newInstance()
|
dialog = dialog ?: KeyboardDialog.newInstance()
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import androidx.core.view.WindowInsetsCompat;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import com.ad.tradpluslibrary.TPAdManager;
|
||||||
import com.app.wave.keyboard.R;
|
import com.app.wave.keyboard.R;
|
||||||
import com.app.wave.keyboard.databinding.ActivityMainBinding;
|
import com.app.wave.keyboard.databinding.ActivityMainBinding;
|
||||||
|
|
||||||
@ -41,6 +42,12 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
TPAdManager.INSTANCE.loadAllAd(this);
|
||||||
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
List<Fragment> listFragment = new ArrayList<>();
|
List<Fragment> listFragment = new ArrayList<>();
|
||||||
listFragment.add(HomepageFragment.newInstance());
|
listFragment.add(HomepageFragment.newInstance());
|
||||||
|
|||||||
@ -10,7 +10,10 @@ import androidx.core.view.ViewCompat;
|
|||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import kotlin.Unit;
|
||||||
|
import kotlin.jvm.functions.Function0;
|
||||||
|
|
||||||
|
import com.ad.tradpluslibrary.TPAdManager;
|
||||||
import com.app.wave.keyboard.App;
|
import com.app.wave.keyboard.App;
|
||||||
import com.app.wave.keyboard.R;
|
import com.app.wave.keyboard.R;
|
||||||
import com.app.wave.keyboard.bean.DetailsBean;
|
import com.app.wave.keyboard.bean.DetailsBean;
|
||||||
@ -21,7 +24,7 @@ import com.app.wave.keyboard.utils.ItemDeco;
|
|||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MoreActivity extends AppCompatActivity {
|
public class MoreActivity extends BaseActivity {
|
||||||
|
|
||||||
private ActivityMoreBinding vb;
|
private ActivityMoreBinding vb;
|
||||||
public static final String KEY_NAME = "class_name";
|
public static final String KEY_NAME = "class_name";
|
||||||
@ -34,6 +37,7 @@ public class MoreActivity extends AppCompatActivity {
|
|||||||
vb = ActivityMoreBinding.inflate(getLayoutInflater());
|
vb = ActivityMoreBinding.inflate(getLayoutInflater());
|
||||||
EdgeToEdge.enable(this);
|
EdgeToEdge.enable(this);
|
||||||
setContentView(vb.getRoot());
|
setContentView(vb.getRoot());
|
||||||
|
TPAdManager.INSTANCE.loadAllAd(this);
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
@ -69,7 +73,7 @@ public class MoreActivity 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) {
|
||||||
finish();
|
onInterceptBackPressed();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -123,4 +127,25 @@ public class MoreActivity extends AppCompatActivity {
|
|||||||
vb.recycler.smoothScrollToPosition(0);
|
vb.recycler.smoothScrollToPosition(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldInterceptBackPress() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onInterceptBackPressed() {
|
||||||
|
|
||||||
|
TPAdManager.INSTANCE.showTPAD(this, new Function0<Unit>() {
|
||||||
|
@Override
|
||||||
|
public Unit invoke() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (getBackPressedCallback() != null) {
|
||||||
|
getBackPressedCallback().setEnabled(false);
|
||||||
|
}
|
||||||
|
getOnBackPressedDispatcher().onBackPressed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -8,6 +8,7 @@ import android.os.Handler
|
|||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import com.ad.tradpluslibrary.TPAdManager
|
||||||
import com.app.wave.keyboard.R
|
import com.app.wave.keyboard.R
|
||||||
import com.app.wave.keyboard.utils.Comutils
|
import com.app.wave.keyboard.utils.Comutils
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ class SplashActivity : Activity() {
|
|||||||
private lateinit var progressPercentText: TextView
|
private lateinit var progressPercentText: TextView
|
||||||
private lateinit var versionText: TextView
|
private lateinit var versionText: TextView
|
||||||
|
|
||||||
private var totalTime = 2000L // 总时间2秒
|
private var totalTime = 15000L // 总时间2秒
|
||||||
private lateinit var timer: CountDownTimer
|
private lateinit var timer: CountDownTimer
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@ -54,8 +55,16 @@ class SplashActivity : Activity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initProgressTimer() {
|
private fun initProgressTimer() {
|
||||||
timer = object : CountDownTimer(totalTime, 100) {
|
TPAdManager.init(
|
||||||
override fun onTick(millisUntilFinished: Long) {
|
this,
|
||||||
|
"ocean",
|
||||||
|
"653761A12E966CCA5CB730718CF41011",
|
||||||
|
"3E25B1686AF335D6D70C4D152B388012",
|
||||||
|
"D718D5267BF72200494214E90AA05712",
|
||||||
|
"D92C25236B923A195FD38AA7939D4C12"
|
||||||
|
) {}
|
||||||
|
timer =
|
||||||
|
TPAdManager.showWelcomeAd(this, totalTime, { millisUntilFinished ->
|
||||||
// 计算进度百分比(递增逻辑)
|
// 计算进度百分比(递增逻辑)
|
||||||
val progressPercentage = (100 * millisUntilFinished / totalTime).toInt()
|
val progressPercentage = (100 * millisUntilFinished / totalTime).toInt()
|
||||||
val countdownPercentage = 100 - progressPercentage
|
val countdownPercentage = 100 - progressPercentage
|
||||||
@ -66,9 +75,8 @@ class SplashActivity : Activity() {
|
|||||||
// 更新进度条和百分比显示
|
// 更新进度条和百分比显示
|
||||||
progressBar.progress = safePercentage
|
progressBar.progress = safePercentage
|
||||||
progressPercentText.text = "$safePercentage%"
|
progressPercentText.text = "$safePercentage%"
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFinish() {
|
}) {
|
||||||
// 完成时设置进度为100%
|
// 完成时设置进度为100%
|
||||||
progressBar.progress = 100
|
progressBar.progress = 100
|
||||||
progressPercentText.text = "100%"
|
progressPercentText.text = "100%"
|
||||||
@ -76,12 +84,10 @@ class SplashActivity : Activity() {
|
|||||||
// 添加一个短暂的延迟,让用户看到100%的完成状态
|
// 添加一个短暂的延迟,让用户看到100%的完成状态
|
||||||
Handler(Looper.getMainLooper()).postDelayed({
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
toHome()
|
toHome()
|
||||||
}, 0)
|
}, 20)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
timer?.start()
|
||||||
|
|
||||||
// 启动计时器
|
|
||||||
timer.start()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun toHome() {
|
private fun toHome() {
|
||||||
|
|||||||
6
app/src/main/res/xml/net.xml
Normal file
6
app/src/main/res/xml/net.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<domain-config cleartextTrafficPermitted="true">
|
||||||
|
<domain tools:ignore="NetworkSecurityConfig">mobile-server.lux-ad.com</domain>
|
||||||
|
</domain-config>
|
||||||
|
</network-security-config>
|
||||||
@ -3,4 +3,6 @@ plugins {
|
|||||||
id("com.android.application") version "8.9.2" apply false
|
id("com.android.application") version "8.9.2" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "2.2.21" apply false
|
id("org.jetbrains.kotlin.android") version "2.2.21" apply false
|
||||||
kotlin("kapt") version "2.0.0"
|
kotlin("kapt") version "2.0.0"
|
||||||
|
id("com.google.gms.google-services") version "4.4.4" apply false
|
||||||
|
id("com.google.firebase.crashlytics") version "3.0.6" apply false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,27 @@ dependencyResolutionManagement {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
|
flatDir {
|
||||||
|
dirs("libs")
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------- TradPlus
|
||||||
|
// Ironsource
|
||||||
|
maven { url = uri("https://android-sdk.is.com/") }
|
||||||
|
// Pangle
|
||||||
|
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
|
||||||
|
// Chartboost
|
||||||
|
maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
|
||||||
|
maven {
|
||||||
|
name = "Chartboost Mediation’s maven repo"
|
||||||
|
url = uri("https://cboost.jfrog.io/artifactory/chartboost-mediation")
|
||||||
|
}
|
||||||
|
// Mintegral
|
||||||
|
//Launch GP market application, Android X Version
|
||||||
|
//If you fail to pull the code using gradle, add the maven warehouse configuration to the project root build.gradle file
|
||||||
|
maven {
|
||||||
|
url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user