This commit is contained in:
litingting 2025-09-09 15:36:38 +08:00
parent a5e90bbdb1
commit e54894eb39
13 changed files with 150 additions and 60 deletions

View File

@ -6,8 +6,13 @@ plugins {
alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.android)
id ("kotlin-parcelize") id ("kotlin-parcelize")
id("io.objectbox") id("io.objectbox")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("applovin-quality-service")
}
applovin {
apiKey = "4yWSuJdlSBRrsgCT2fEzZvNoBH0M1hzyqNP9ZiCTn0an2TBTdxk01Ips4aov__5L4dU8_sQpVw0_GOMLgIfJu_"
} }
android { android {
namespace = "com.video.mobile.wallpaper" namespace = "com.video.mobile.wallpaper"
compileSdk = 35 compileSdk = 35
@ -16,8 +21,8 @@ android {
applicationId = "com.video.mobile.wallpaper" applicationId = "com.video.mobile.wallpaper"
minSdk = 24 minSdk = 24
targetSdk = 35 targetSdk = 35
versionCode = 1 versionCode = 2
versionName = "1.0" versionName = "1.1"
setProperty( setProperty(
"archivesBaseName", "archivesBaseName",
"Dynamic Cartoon Wallpaper_V" + versionName + "(${versionCode})_$timestamp" "Dynamic Cartoon Wallpaper_V" + versionName + "(${versionCode})_$timestamp"
@ -76,4 +81,27 @@ dependencies {
implementation("com.squareup.retrofit2:retrofit:2.9.0") implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:adapter-rxjava2:2.9.0") implementation("com.squareup.retrofit2:adapter-rxjava2:2.9.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
implementation(files("libs/UpLoadLibrary_07_03_11_54-release.aar"))
implementation(files("libs/MaxLibrary_08_08_15_08-release.aar"))
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")
//Max(BIGO Ads、Chartboost、DT Exchange、InMobi、ironSource、Liftoff Monetize、Mintegral、Pangle)
implementation("com.applovin:applovin-sdk:+")
implementation("com.applovin.mediation:bigoads-adapter:+")
implementation("com.applovin.mediation:chartboost-adapter:+")
implementation("com.google.android.gms:play-services-base:16.1.0")
implementation("com.applovin.mediation:fyber-adapter:+")
implementation("com.applovin.mediation:inmobi-adapter:+")
implementation("com.squareup.picasso:picasso:2.8")
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("com.applovin.mediation:ironsource-adapter:+")
implementation("com.applovin.mediation:vungle-adapter:+")
implementation("com.applovin.mediation:mintegral-adapter:+")
implementation("com.applovin.mediation:bytedance-adapter:+")
} }

29
app/google-services.json Normal file
View File

@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "887597693398",
"project_id": "dynamic-cartoon-wallapper",
"storage_bucket": "dynamic-cartoon-wallapper.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:887597693398:android:a0462cb5206a323e8b4c77",
"android_client_info": {
"package_name": "com.video.mobile.wallpaper"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBg4-5ATxqT6RGNxCOtpnMbbA5XXpZQfDI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

Binary file not shown.

Binary file not shown.

View File

@ -17,6 +17,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/logo" android:roundIcon="@mipmap/logo"
android:supportsRtl="true" android:supportsRtl="true"
android:networkSecurityConfig="@xml/net"
android:theme="@style/Theme.DynamicCartoonWallpaper" android:theme="@style/Theme.DynamicCartoonWallpaper"
tools:targetApi="31"> tools:targetApi="31">
<activity <activity

View File

@ -1,6 +1,8 @@
package com.video.mobile.wallpaper package com.video.mobile.wallpaper
import android.app.Application import android.app.Application
import com.ad.maxlibrary.MaxInitManager
import com.up.uploadlibrary.UpLoadManager
import com.video.mobile.wallpaper.database.DataBaseManager import com.video.mobile.wallpaper.database.DataBaseManager
class App : Application(){ class App : Application(){
@ -13,6 +15,15 @@ class App : Application(){
mApp = this mApp = this
DataBaseManager.init(this) DataBaseManager.init(this)
Helper.loadJson(this) Helper.loadJson(this)
UpLoadManager.init(this,TAG);
MaxInitManager.init(
this,
"VVN64VW3_CeQrIZ9sSUMQAWAS4XI14L2etylkN_E2IkJpZrsF6Xt26aMuwBGOboUiFvkTVJ28EbPW53NL_6SPT",
"40b1960f1460e5d7",
"5d13ec7aad589713",
"f926e0b99d6b40d3",
TAG
)
} }

View File

@ -11,21 +11,20 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsCompat
import com.ad.maxlibrary.WelComManager
import com.video.mobile.wallpaper.main.MainActivity import com.video.mobile.wallpaper.main.MainActivity
class SplashActivity : AppCompatActivity() { class SplashActivity : AppCompatActivity() {
private var countDownTimer: CountDownTimer? = null private var countDownTimer: CountDownTimer? = null
private val timer = 2000L private val timer = 14000L
private lateinit var progressBar: ProgressBar private lateinit var progressBar: ProgressBar
private lateinit var textProgress: TextView private lateinit var textProgress: TextView
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// installSplashScreen()
// }
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge() enableEdgeToEdge()
setContentView(R.layout.activity_splash) setContentView(R.layout.activity_splash)
@ -36,21 +35,16 @@ class SplashActivity : AppCompatActivity() {
} }
progressBar = findViewById(R.id.progress_bar) progressBar = findViewById(R.id.progress_bar)
textProgress = findViewById(R.id.textview_progress) textProgress = findViewById(R.id.textview_progress)
countDownTimer = object : CountDownTimer(timer, 100) { countDownTimer = WelComManager.initTimer(this, timer, { millisUntilFinished ->
override fun onTick(millisUntilFinished: Long) { val v: Float =
val v: Float = 100 - millisUntilFinished.toFloat() / timer * 100
100 - millisUntilFinished.toFloat() / timer * 100 val v1 = v.toInt()
val v1 = v.toInt() progressBar.progress = v1
progressBar.progress = v1 textProgress.text = getString(R.string.splash_progress_text, v1)
textProgress.text = getString(R.string.splash_progress_text, v1) }) {
} launchMain()
override fun onFinish() {
launchMain()
}
} }
countDownTimer?.start()
} }
private fun launchMain() { private fun launchMain() {

View File

@ -20,6 +20,7 @@ import androidx.paging.liveData
import androidx.paging.map import androidx.paging.map
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.ad.maxlibrary.MaxManager
import com.video.mobile.wallpaper.Helper import com.video.mobile.wallpaper.Helper
import com.video.mobile.wallpaper.R import com.video.mobile.wallpaper.R
import com.video.mobile.wallpaper.database.DataBaseManager import com.video.mobile.wallpaper.database.DataBaseManager
@ -60,9 +61,10 @@ class FavoriteActivity : AppCompatActivity() {
imageBack.setOnClickListener { finish() } imageBack.setOnClickListener { finish() }
recyclerView = findViewById(R.id.favorite_recyclerview) recyclerView = findViewById(R.id.favorite_recyclerview)
layoutEmpty = findViewById(R.id.layout_empty) layoutEmpty = findViewById(R.id.layout_empty)
MaxManager.onLoadAd()
init() init()
MaxManager.startShowMaxAd(this) { }
} }

View File

@ -28,6 +28,7 @@ import androidx.media3.common.Player
import androidx.media3.common.util.UnstableApi import androidx.media3.common.util.UnstableApi
import androidx.media3.exoplayer.ExoPlayer import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.ui.PlayerView import androidx.media3.ui.PlayerView
import com.ad.maxlibrary.MaxManager
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.load.engine.GlideException
@ -103,11 +104,11 @@ class DisplayVideoActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge() enableEdgeToEdge()
setContentView(R.layout.activity_display_video) setContentView(R.layout.activity_display_video)
MaxManager.onLoadAd()
backFrameLayout = findViewById(R.id.back_btn) backFrameLayout = findViewById(R.id.back_btn)
bottomLayout = findViewById(R.id.layout_btn) bottomLayout = findViewById(R.id.layout_btn)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
// v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
val params = backFrameLayout.layoutParams as ViewGroup.MarginLayoutParams val params = backFrameLayout.layoutParams as ViewGroup.MarginLayoutParams
params.topMargin = systemBars.top params.topMargin = systemBars.top
backFrameLayout.layoutParams = params backFrameLayout.layoutParams = params
@ -119,6 +120,8 @@ class DisplayVideoActivity : AppCompatActivity() {
Helper.showMyLog("---systemBars.top--${systemBars.top} bottom = ${systemBars.bottom}") Helper.showMyLog("---systemBars.top--${systemBars.top} bottom = ${systemBars.bottom}")
insets insets
} }
MaxManager.startShowMaxAd(this) { }
downloadingProgressLayout = findViewById(R.id.download_progress_layout) downloadingProgressLayout = findViewById(R.id.download_progress_layout)
downloadProgressbar = findViewById(R.id.horizontal_progressbar) downloadProgressbar = findViewById(R.id.horizontal_progressbar)
progressBar = findViewById(R.id.normal_progress) progressBar = findViewById(R.id.normal_progress)
@ -161,52 +164,58 @@ class DisplayVideoActivity : AppCompatActivity() {
} }
textBtnSet.setOnClickListener { textBtnSet.setOnClickListener {
if (cacheFile.exists()) { MaxManager.startShowMaxAd(this@DisplayVideoActivity) {
setVideoWallpaper() if (cacheFile.exists()) {
} else { setVideoWallpaper()
Helper.showToast(this@DisplayVideoActivity, getString(R.string.cache_file_no_lost)) } else {
Helper.showToast(this@DisplayVideoActivity, getString(R.string.cache_file_no_lost))
}
} }
} }
textRetry.setOnClickListener { textRetry.setOnClickListener {
getNetWorkVideo(cachePath) getNetWorkVideo(cachePath)
} }
frameFavorite.setOnClickListener { frameFavorite.setOnClickListener {
showCircleLoading(true, loadingType_circle) MaxManager.startShowMaxAd(this@DisplayVideoActivity){
val newStatus = !imageFavorite.isSelected showCircleLoading(true, loadingType_circle)
if (newStatus) { val newStatus = !imageFavorite.isSelected
intentVideoWallpaper?.let { if (newStatus) {
Helper.showMyLog("--- Video --insertLike ") intentVideoWallpaper?.let {
DataBaseManager.insertLike(LikeWallpaper().apply { Helper.showMyLog("--- Video --insertLike ")
id = it.id DataBaseManager.insertLike(LikeWallpaper().apply {
description = it.description id = it.id
image = it.image description = it.description
wallpapertype = it.wallpapertype image = it.image
thumbnail = it.thumbnail wallpapertype = it.wallpapertype
}) thumbnail = it.thumbnail
} })
intentLikeWallpaper?.let { }
Helper.showMyLog("---Like --insertLike ") intentLikeWallpaper?.let {
DataBaseManager.insertLike(it) Helper.showMyLog("---Like --insertLike ")
} DataBaseManager.insertLike(it)
imageFavorite.isSelected = newStatus }
showCircleLoading(false) imageFavorite.isSelected = newStatus
} else {
DataBaseManager.deleteLike(wallpaperId) { deleteOk ->
showCircleLoading(false) showCircleLoading(false)
if (deleteOk) { } else {
imageFavorite.isSelected = newStatus DataBaseManager.deleteLike(wallpaperId) { deleteOk ->
Helper.showToast( showCircleLoading(false)
this@DisplayVideoActivity, if (deleteOk) {
getString(R.string.remove_favorite_ok) imageFavorite.isSelected = newStatus
) Helper.showToast(
} else { this@DisplayVideoActivity,
Helper.showToast( getString(R.string.remove_favorite_ok)
this@DisplayVideoActivity, )
getString(R.string.remove_favorite_fail) } else {
) Helper.showToast(
this@DisplayVideoActivity,
getString(R.string.remove_favorite_fail)
)
}
} }
} }
} }
} }
} }

View 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>

View File

@ -2,9 +2,16 @@
plugins { plugins {
alias(libs.plugins.android.application) apply false alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.android) 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
} }
buildscript { buildscript {
repositories {
maven { url = uri("https://artifacts.applovin.com/android") }
}
dependencies { dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:4.0.3") classpath("io.objectbox:objectbox-gradle-plugin:4.0.3")
classpath ("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
} }
} }

View File

@ -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. For more details, visit # This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects

View File

@ -16,6 +16,9 @@ dependencyResolutionManagement {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
} }
} }