V1.2(3) TradPlus- Liftoff
This commit is contained in:
parent
77ae2d96ea
commit
01695f49d1
@ -9,6 +9,8 @@ plugins {
|
||||
id("org.jetbrains.kotlin.android")
|
||||
kotlin("kapt")
|
||||
id ("kotlin-android")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
}
|
||||
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||
val keystoreProperties = Properties().apply {
|
||||
@ -22,8 +24,8 @@ android {
|
||||
applicationId = "com.joyful.euphoria.board"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 2
|
||||
versionName = "1.1"
|
||||
versionCode = 3
|
||||
versionName = "1.2"
|
||||
setProperty(
|
||||
"archivesBaseName",
|
||||
"EuphoriaBoard_V" + versionName + "(${versionCode})_$timestamp"
|
||||
@ -100,4 +102,87 @@ dependencies {
|
||||
// Android平台协程支持
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
|
||||
implementation("com.google.firebase:firebase-crashlytics")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
implementation("com.google.firebase:firebase-config")
|
||||
|
||||
|
||||
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": "367366033615",
|
||||
"project_id": "euphoria-board",
|
||||
"storage_bucket": "euphoria-board.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:367366033615:android:2e4373761a528d9a3c67ba",
|
||||
"android_client_info": {
|
||||
"package_name": "com.joyful.euphoria.board"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCukTM4rS_pll5tA_tm6elJHMYUn5KjBDo"
|
||||
}
|
||||
],
|
||||
"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.
@ -13,9 +13,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/MyKeyBoard"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".xmlactivity.CategoryXML"
|
||||
android:exported="false" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".xmlactivity.BeginXML"
|
||||
|
||||
@ -2,6 +2,7 @@ package com.joyful.euphoria.board
|
||||
|
||||
import android.app.Application
|
||||
import android.graphics.Typeface
|
||||
import com.ad.tradpluslibrary.TPAdManager
|
||||
import com.joyful.euphoria.board.beaned.BeanDetails
|
||||
import com.joyful.euphoria.board.beaned.BeanWrapper
|
||||
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
|
||||
@ -29,6 +30,7 @@ class EuphoriaBoard : Application() {
|
||||
euphoriaBoardInstance = this
|
||||
defaultFont = Typeface.createFromAsset(assets, "my_font.ttf")
|
||||
dealFile()
|
||||
|
||||
}
|
||||
private fun dealFile() {
|
||||
val openFile = euphoriaBoardInstance.assets.open("res.json")
|
||||
|
||||
@ -144,8 +144,11 @@ public class ServiceAssistant extends android.inputmethodservice.InputMethodServ
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (videoView != null)
|
||||
if (videoView != null) {
|
||||
videoView.stopPlayback();
|
||||
videoView = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -5,6 +5,8 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.CountDownTimer
|
||||
import android.widget.ProgressBar
|
||||
import com.ad.tradpluslibrary.TPAdManager
|
||||
import com.joyful.euphoria.board.EuphoriaBoard
|
||||
import com.joyful.euphoria.board.R
|
||||
import com.joyful.euphoria.board.utils.Normal
|
||||
import kotlin.math.roundToInt
|
||||
@ -16,7 +18,7 @@ import kotlin.math.roundToInt
|
||||
class BeginXML : Activity() {
|
||||
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private var countTime = 1500L
|
||||
private var countTime = 13000L
|
||||
private lateinit var timer: CountDownTimer
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -29,20 +31,24 @@ class BeginXML : Activity() {
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
TPAdManager.init(
|
||||
this,
|
||||
EuphoriaBoard.TAG,
|
||||
"0050AC0F82A15B4B5CCEC0E7A5B07A11",
|
||||
"5C25F9904EF67322F495A33F1303DB12",
|
||||
"02E0F4693311CCA2990355F2BEF35E12",
|
||||
"5E4C791BFA1E30844C2FE209130B2912"
|
||||
) {
|
||||
|
||||
timer = object : CountDownTimer(countTime, 100) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
}
|
||||
timer = TPAdManager.showWelcomeAd( this@BeginXML,countTime, { millisUntilFinished->
|
||||
val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100
|
||||
val round = percentage.roundToInt()
|
||||
progressBar.progress = round
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
}){
|
||||
progressBar.progress = 100
|
||||
toHome()
|
||||
}
|
||||
|
||||
}
|
||||
timer.start()
|
||||
|
||||
}
|
||||
|
||||
@ -1,172 +0,0 @@
|
||||
package com.joyful.euphoria.board.xmlactivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.joyful.euphoria.board.R;
|
||||
import com.joyful.euphoria.board.recyclerview.RecyclerviewCategory;
|
||||
import com.joyful.euphoria.board.beaned.BeanDetails;
|
||||
import com.joyful.euphoria.board.beaned.BeanWrapper;
|
||||
import com.joyful.euphoria.board.database.CategoryData;
|
||||
import com.joyful.euphoria.board.database.BoardData;
|
||||
import com.joyful.euphoria.board.EuphoriaBoard;
|
||||
import com.joyful.euphoria.board.utils.FileUtils;
|
||||
import com.joyful.euphoria.board.utils.ListDecorationUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CategoryXML extends AppCompatActivity {
|
||||
private static final String TAG = "CategoryActivity";
|
||||
public static final String KEY_CATEGORY_NAME = "category_name";
|
||||
|
||||
private RecyclerView rvCateKeyboard;
|
||||
private View llCateEmpty;
|
||||
private View ivCateBack;
|
||||
private TextView tvCateTitle;
|
||||
private RecyclerviewCategory mCateKeyboardAdapter;
|
||||
private List<BeanDetails> mKeyboardList = new ArrayList<>();
|
||||
private List<CategoryData> mCategoryDataList = new ArrayList<>();
|
||||
private String mCurrentCategoryName;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_category_xml);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.category), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
initView();
|
||||
getIntentData();
|
||||
initAdapter();
|
||||
loadCategoryData();
|
||||
loadKeyboardDataByCategory();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
rvCateKeyboard = findViewById(R.id.rv_cate_keyboard);
|
||||
llCateEmpty = findViewById(R.id.ll_cate_empty);
|
||||
ivCateBack = findViewById(R.id.iv_cate_back);
|
||||
tvCateTitle = findViewById(R.id.tv_cate_title);
|
||||
|
||||
ivCateBack.setOnClickListener(v -> finish());
|
||||
}
|
||||
|
||||
private void getIntentData() {
|
||||
mCurrentCategoryName = getIntent().getStringExtra(KEY_CATEGORY_NAME);
|
||||
tvCateTitle.setText(mCurrentCategoryName == null ? "未知分类" : mCurrentCategoryName);
|
||||
}
|
||||
|
||||
private void initAdapter() {
|
||||
mCateKeyboardAdapter = new RecyclerviewCategory(this, mKeyboardList);
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(this, 1);
|
||||
rvCateKeyboard.setLayoutManager(layoutManager);
|
||||
ListDecorationUtils decoration = new ListDecorationUtils(10, 10, 0);
|
||||
rvCateKeyboard.addItemDecoration(decoration);
|
||||
rvCateKeyboard.setAdapter(mCateKeyboardAdapter);
|
||||
|
||||
// 键盘点击跳转Set界面
|
||||
mCateKeyboardAdapter.setOnCategoryKeyboardClickListener(bean -> {
|
||||
if (bean == null || bean.getTitleName() == null) {
|
||||
Toast.makeText(CategoryXML.this, "键盘数据异常", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(CategoryXML.this, DownloadXML.class);
|
||||
intent.putExtra(DownloadXML.SOURCE_KEY, bean);
|
||||
intent.putExtra(DownloadXML.NAME_KEY, bean.getTitleName());
|
||||
intent.putExtra(DownloadXML.DISPLAY_URL_KEY, bean.getImgPath());
|
||||
intent.putExtra(DownloadXML.GIF_KEY, bean.getImgGif());
|
||||
intent.putExtra(DownloadXML.THUMB_KEY, bean.getThumbUrl());
|
||||
intent.putExtra(DownloadXML.ZIP_URL_KEY, bean.getZipPath());
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
private void loadCategoryData() {
|
||||
try {
|
||||
mCategoryDataList = FileUtils.readCategoryJsonFromAssets(this, "res.json");
|
||||
Log.d(TAG, "加载分类原始数据条数:" + mCategoryDataList.size());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "加载分类原始数据失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadKeyboardDataByCategory() {
|
||||
if (mCurrentCategoryName == null || mCategoryDataList.isEmpty()) {
|
||||
showEmptyState();
|
||||
return;
|
||||
}
|
||||
|
||||
mKeyboardList.clear();
|
||||
// 从JSON原始数据加载
|
||||
for (CategoryData categoryData : mCategoryDataList) {
|
||||
if (categoryData == null || !mCurrentCategoryName.equalsIgnoreCase(categoryData.getParent_name())) {
|
||||
continue;
|
||||
}
|
||||
if (categoryData.getKeyboard_list() != null && !categoryData.getKeyboard_list().isEmpty()) {
|
||||
for (BoardData boardData : categoryData.getKeyboard_list()) {
|
||||
if (boardData == null) {
|
||||
continue;
|
||||
}
|
||||
BeanDetails bean = new BeanDetails();
|
||||
bean.setTitleName(boardData.getTitle() != null ? boardData.getTitle() : "未知键盘");
|
||||
bean.setThumbUrl(boardData.getThumbUrl() != null ? boardData.getThumbUrl() : "");
|
||||
bean.setImgGif(boardData.getThumbUrlGif() != null ? boardData.getThumbUrlGif() : "");
|
||||
if (boardData.getDetail() != null && boardData.getDetail().getThemeContent() != null) {
|
||||
bean.setImgPath(boardData.getDetail().getThemeContent().getImg() != null ?
|
||||
boardData.getDetail().getThemeContent().getImg() : "");
|
||||
bean.setZipPath(boardData.getDetail().getThemeContent().getAndroidRawZipUrl() != null ?
|
||||
boardData.getDetail().getThemeContent().getAndroidRawZipUrl() : "");
|
||||
} else {
|
||||
bean.setImgPath("");
|
||||
bean.setZipPath("");
|
||||
}
|
||||
mKeyboardList.add(bean);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// 备选:从DelightBoard全局数据加载
|
||||
if (mKeyboardList.isEmpty() && EuphoriaBoard.list != null && !EuphoriaBoard.list.isEmpty()) {
|
||||
for (BeanWrapper wrapper : EuphoriaBoard.list) {
|
||||
if (wrapper == null || !mCurrentCategoryName.equals(wrapper.getParentName())) {
|
||||
continue;
|
||||
}
|
||||
mKeyboardList.addAll(wrapper.getKeyboardList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mCateKeyboardAdapter.notifyDataSetChanged();
|
||||
if (mKeyboardList.isEmpty()) {
|
||||
showEmptyState();
|
||||
} else {
|
||||
hideEmptyState();
|
||||
}
|
||||
Log.d(TAG, "分类[" + mCurrentCategoryName + "]下加载键盘条数:" + mKeyboardList.size());
|
||||
}
|
||||
|
||||
private void showEmptyState() {
|
||||
rvCateKeyboard.setVisibility(View.GONE);
|
||||
llCateEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void hideEmptyState() {
|
||||
rvCateKeyboard.setVisibility(View.VISIBLE);
|
||||
llCateEmpty.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@ -13,6 +13,7 @@ import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.OnApplyWindowInsetsListener
|
||||
@ -22,23 +23,24 @@ import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.joyful.euphoria.board.EuphoriaBoard
|
||||
import com.joyful.euphoria.board.R
|
||||
import com.joyful.euphoria.board.beaned.BeanDetails
|
||||
import com.joyful.euphoria.board.remember.OnItemClickRemember
|
||||
import com.joyful.euphoria.board.remember.DownloadBoardRemember
|
||||
import com.joyful.euphoria.board.assistant.DatabaseAssistant
|
||||
import com.joyful.euphoria.board.recyclerview.RecyclerviewDownload
|
||||
import com.joyful.euphoria.board.frag.Dialog
|
||||
import com.joyful.euphoria.board.utils.Normal
|
||||
import com.joyful.euphoria.board.utils.DealZipUtils
|
||||
import com.joyful.euphoria.board.utils.SaveCurrentThemeUtils
|
||||
import com.ad.tradpluslibrary.TPAdManager
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.integration.webp.decoder.WebpDrawable
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.joyful.euphoria.board.EuphoriaBoard
|
||||
import com.joyful.euphoria.board.R
|
||||
import com.joyful.euphoria.board.assistant.DatabaseAssistant
|
||||
import com.joyful.euphoria.board.beaned.BeanDetails
|
||||
import com.joyful.euphoria.board.frag.Dialog
|
||||
import com.joyful.euphoria.board.recyclerview.RecyclerviewDownload
|
||||
import com.joyful.euphoria.board.remember.DownloadBoardRemember
|
||||
import com.joyful.euphoria.board.remember.OnItemClickRemember
|
||||
import com.joyful.euphoria.board.utils.DealZipUtils
|
||||
import com.joyful.euphoria.board.utils.Normal
|
||||
import com.joyful.euphoria.board.utils.SaveCurrentThemeUtils
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
|
||||
@ -61,8 +63,10 @@ class DownloadXML : AppCompatActivity() {
|
||||
|
||||
@JvmField
|
||||
val SOURCE_KEY = "data_key"
|
||||
|
||||
@JvmField
|
||||
val KEYBOARD_ID = "KEYBOARD_ID"
|
||||
|
||||
@JvmField
|
||||
val KEYBOARD_IMG = "KEYBOARD_IMG"
|
||||
|
||||
@ -87,7 +91,6 @@ class DownloadXML : AppCompatActivity() {
|
||||
private lateinit var imgLike: ImageView
|
||||
|
||||
|
||||
|
||||
private var data: BeanDetails? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -101,7 +104,7 @@ class DownloadXML : AppCompatActivity() {
|
||||
v!!.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
})
|
||||
|
||||
TPAdManager.loadAllAd(this)
|
||||
// 检查存储权限
|
||||
checkStoragePermission()
|
||||
|
||||
@ -110,12 +113,30 @@ class DownloadXML : AppCompatActivity() {
|
||||
displayData() // 后使用
|
||||
setApply()
|
||||
onClick()
|
||||
onBackPressedDispatcher.addCallback(
|
||||
this,
|
||||
object : OnBackPressedCallback(true) {
|
||||
|
||||
override fun handleOnBackPressed() {
|
||||
// 物理返回被拦截
|
||||
back()
|
||||
}
|
||||
})
|
||||
|
||||
TPAdManager.showTPAD(this@DownloadXML) {}
|
||||
}
|
||||
|
||||
private fun back() {
|
||||
TPAdManager.showTPAD(this@DownloadXML) {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
// 检查存储权限
|
||||
private fun checkStoragePermission() {
|
||||
if (Environment.getExternalStorageState() != Environment.MEDIA_MOUNTED) {
|
||||
Toast.makeText(this, getString(R.string.storage_not_available), Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(this, getString(R.string.storage_not_available), Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
return
|
||||
}
|
||||
|
||||
@ -222,7 +243,8 @@ class DownloadXML : AppCompatActivity() {
|
||||
|
||||
private fun onClick() {
|
||||
imgBack.setOnClickListener {
|
||||
finish()
|
||||
back()
|
||||
|
||||
}
|
||||
|
||||
imgLike.setOnClickListener {
|
||||
@ -237,7 +259,11 @@ class DownloadXML : AppCompatActivity() {
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("SetActivity", "Like operation error", e)
|
||||
Toast.makeText(this@DownloadXML, getString(R.string.operation_failed), Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(
|
||||
this@DownloadXML,
|
||||
getString(R.string.operation_failed),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -257,8 +283,10 @@ class DownloadXML : AppCompatActivity() {
|
||||
})
|
||||
}
|
||||
|
||||
layoutManager = LinearLayoutManager(this@DownloadXML,
|
||||
LinearLayoutManager.HORIZONTAL, false)
|
||||
layoutManager = LinearLayoutManager(
|
||||
this@DownloadXML,
|
||||
LinearLayoutManager.HORIZONTAL, false
|
||||
)
|
||||
addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
@ -315,13 +343,17 @@ class DownloadXML : AppCompatActivity() {
|
||||
|
||||
private fun setApply() {
|
||||
applyBtn.setOnClickListener {
|
||||
TPAdManager.showTPAD(this@DownloadXML) {
|
||||
val checkEnable = Normal.checkEnable(this)
|
||||
val checkSetDefault = Normal.checkSetDefault(this)
|
||||
if (!checkEnable || !checkSetDefault) {
|
||||
showDialog()
|
||||
return@setOnClickListener
|
||||
return@showTPAD
|
||||
}
|
||||
startDown()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,7 +374,8 @@ class DownloadXML : AppCompatActivity() {
|
||||
|
||||
if (!DealZipUtils.isValidZipUrl(zipUrl)) { // 调用工具类校验
|
||||
runOnUiThread {
|
||||
Toast.makeText(this, getString(R.string.invalid_download_url), Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(this, getString(R.string.invalid_download_url), Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
applyBtn.isEnabled = true
|
||||
loadingLayout.isVisible = false
|
||||
}
|
||||
@ -364,7 +397,8 @@ class DownloadXML : AppCompatActivity() {
|
||||
} else {
|
||||
if (zipUrl.isEmpty()) {
|
||||
runOnUiThread {
|
||||
Toast.makeText(this, getString(R.string.download_url_error), Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(this, getString(R.string.download_url_error), Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
applyBtn.isEnabled = true
|
||||
loadingLayout.isVisible = false
|
||||
}
|
||||
@ -393,7 +427,11 @@ class DownloadXML : AppCompatActivity() {
|
||||
findFirstDirectory?.let {
|
||||
apply("${it}/")
|
||||
} ?: run {
|
||||
Toast.makeText(this@DownloadXML, getString(R.string.file_error), Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(
|
||||
this@DownloadXML,
|
||||
getString(R.string.file_error),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@ -18,6 +19,7 @@ import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.ad.tradpluslibrary.TPAdManager;
|
||||
import com.joyful.euphoria.board.R;
|
||||
import com.joyful.euphoria.board.databinding.ActivityPreviewXmlBinding;
|
||||
import com.joyful.euphoria.board.utils.KeyNamesUtils;
|
||||
@ -30,6 +32,8 @@ import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
|
||||
public class PreviewXML extends AppCompatActivity {
|
||||
@ -49,12 +53,27 @@ public class PreviewXML extends AppCompatActivity {
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
TPAdManager.INSTANCE.loadAllAd(this);
|
||||
onInit();
|
||||
|
||||
getOnBackPressedDispatcher().addCallback(
|
||||
this, new OnBackPressedCallback(true) {
|
||||
@Override
|
||||
public void handleOnBackPressed() {
|
||||
back();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void back() {
|
||||
TPAdManager.INSTANCE.showTPAD(PreviewXML.this, new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
finish();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onInit() {
|
||||
|
||||
@ -66,14 +85,14 @@ public class PreviewXML extends AppCompatActivity {
|
||||
vb.idBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
back();
|
||||
}
|
||||
});
|
||||
if (curPath == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String bgPath = curPath+"res/drawable-xxhdpi-v4/"+ KeyNamesUtils.previewBg;
|
||||
String bgPath = curPath + "res/drawable-xxhdpi-v4/" + KeyNamesUtils.previewBg;
|
||||
|
||||
Drawable bgDraw = Normal.INSTANCE.getBgDrawable(this, bgPath);
|
||||
if (bgDraw != null) {
|
||||
|
||||
@ -3,4 +3,6 @@ plugins {
|
||||
id("com.android.application") version "8.9.2" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.21" apply false
|
||||
kotlin("kapt") version "2.0.0"
|
||||
id("com.google.gms.google-services") version "4.4.2" apply false
|
||||
id ("com.google.firebase.crashlytics") version "3.0.2" apply false
|
||||
}
|
||||
|
||||
@ -12,7 +12,27 @@ dependencyResolutionManagement {
|
||||
google()
|
||||
mavenCentral()
|
||||
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