This commit is contained in:
litingting 2025-07-22 09:57:40 +08:00
parent 437abf7a73
commit 34e4472c92
10 changed files with 207 additions and 38 deletions

View File

@ -5,6 +5,8 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("io.objectbox")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
val timeStamp: String = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
@ -15,8 +17,8 @@ android {
applicationId = "com.apps.chillscreen"
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = "1.0"
versionCode = 2
versionName = "1.1"
setProperty(
"archivesBaseName",
"Chill Screen_V" + versionName + "(${versionCode})_$timeStamp"
@ -62,4 +64,91 @@ dependencies {
implementation(libs.objectbox.android)
annotationProcessor(libs.objectbox.processor)
implementation(libs.okhttp)
implementation(files("libs/TopOnLibrary_06_27_16_00-release.aar"))
implementation(files("libs/UpLoadLibrary_07_03_11_54-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")
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Bigo)
//TU (Necessary)
implementation("com.thinkup.sdk:core-tpn:6.4.90")
implementation("com.thinkup.sdk:nativead-tpn:6.4.90")
implementation("com.thinkup.sdk:banner-tpn:6.4.90")
implementation("com.thinkup.sdk:interstitial-tpn:6.4.90")
implementation("com.thinkup.sdk:rewardedvideo-tpn:6.4.90")
implementation("com.thinkup.sdk:splash-tpn:6.4.90")
//Androidx (Necessary)
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.browser:browser:1.4.0")
//StartApp
implementation("com.thinkup.sdk:adapter-tpn-startapp:6.4.90")
implementation("com.startapp:inapp-sdk:5.0.2")
//Vungle
implementation("com.thinkup.sdk:adapter-tpn-vungle:6.4.90")
implementation("com.vungle:vungle-ads:7.5.0")
implementation("com.google.android.gms:play-services-basement:18.1.0")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//UnityAds
implementation("com.thinkup.sdk:adapter-tpn-unityads:6.4.90")
implementation("com.unity3d.ads:unity-ads:4.14.0")
//Ironsource
implementation("com.thinkup.sdk:adapter-tpn-ironsource:6.4.90")
implementation("com.ironsource.sdk:mediationsdk:8.7.0")
implementation("com.google.android.gms:play-services-appset:16.0.2")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
implementation("com.google.android.gms:play-services-basement:18.1.0")
//Bigo
implementation("com.thinkup.sdk:adapter-tpn-bigo:6.4.90")
implementation("com.bigossp:bigo-ads:5.3.0")
//Pangle
implementation("com.thinkup.sdk:adapter-tpn-pangle:6.4.90.1")
implementation("com.pangle.global:pag-sdk:7.2.0.6")
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
//Inmobi
implementation("com.thinkup.sdk:adapter-tpn-inmobi:6.4.90")
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.8.2")
//Mintegral
implementation("com.thinkup.sdk:adapter-tpn-mintegral:6.4.90")
implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.71")
implementation("androidx.recyclerview:recyclerview:1.1.0")
//Chartboost
implementation("com.thinkup.sdk:adapter-tpn-chartboost:6.4.90")
implementation("com.chartboost:chartboost-sdk:9.8.3")
implementation("com.chartboost:chartboost-mediation-sdk:4.9.2")
implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.8.1.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.thinkup.sdk:adapter-tpn-fyber:6.4.90")
implementation("com.fyber:marketplace-sdk:8.3.7")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//Tramini
implementation("com.thinkup.sdk:tramini-plugin-tpn:6.4.90")
// Debugger UI Tools
implementation("com.anythink.sdk:debugger-ui:1.1.0")
//----------------------------------------------TopOn
}

View File

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

View File

@ -4,9 +4,11 @@ import android.app.Application;
import android.content.Context;
import android.util.Log;
import com.ad.toponlibrary.AdManager;
import com.apps.chillscreen.tool.PictureManager;
import com.apps.chillscreen.tool.JsonConvert;
import com.apps.chillscreen.tool.OpenUtil;
import com.up.uploadlibrary.UpLoadManager;
import java.io.IOException;
import java.io.InputStream;
@ -35,7 +37,12 @@ public class BaseApplication extends Application {
PictureManager.init(this);
executorService = Executors.newFixedThreadPool(8);//开启8个线程的线程池
String[] names = {animaLs, experiment, film, nature, patterns, street, travel, wallpaper};
AdManager.INSTANCE.init("TAG",this,"h687de4865cef8","a3e080462348b3222e1bc9afe4fe6c50a",
"d0a434af69020f58cd1c246da4adb0630eb18a02",
"n687de501cb85f",
"n687de4f81a79c",
"n687de4ee06429",false);
UpLoadManager.INSTANCE.init(this,"TAG");
try {
for (String name : names) {
InputStream inputStream = getAssets().open(name);

View File

@ -14,6 +14,8 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import com.ad.toponlibrary.AdManager;
import com.ad.toponlibrary.onActionListener;
import com.apps.chillscreen.R;
import com.apps.chillscreen.adapter.GirdAdapter;
import com.apps.chillscreen.bean.Picture;
@ -34,6 +36,13 @@ private String searchKey="";
binding=ActivityExploreBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
init();
AdManager.loadAllAd();
AdManager.showTopOn(this, new onActionListener() {
@Override
public void onAction() {
}
});
}
@Override
protected void onResume() {

View File

@ -10,6 +10,8 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.ad.toponlibrary.AdManager;
import com.ad.toponlibrary.onActionListener;
import com.apps.chillscreen.R;
import com.apps.chillscreen.bean.Picture;
import com.apps.chillscreen.databinding.ActivityExtendInfoBinding;
@ -38,7 +40,7 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
private Call call;
private SetPaperFragment setPaperFragment;
private WallpaperManager wallpaperManager;
private boolean isSetting=false;
private boolean isSetting = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -46,6 +48,13 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
binding = ActivityExtendInfoBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
init();
AdManager.loadAllAd();
AdManager.showTopOn(this, new onActionListener() {
@Override
public void onAction() {
}
});
}
@Override
@ -80,8 +89,19 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
binding.imageBack.setOnClickListener(v -> finish());
binding.tvContent.setText(picture.getDescription());
binding.imageFavorite.setOnClickListener(v -> setCollectStatus());
binding.imageDownload.setOnClickListener(v -> startDownLoad());
binding.layoutSet.setOnClickListener(v -> showSetDialog());
binding.imageDownload.setOnClickListener(v -> AdManager.showTopOn(ExtendedInfoActivity.this, new onActionListener() {
@Override
public void onAction() {
startDownLoad();
}
})
);
binding.layoutSet.setOnClickListener(v -> AdManager.showTopOn(ExtendedInfoActivity.this, new onActionListener() {
@Override
public void onAction() {
showSetDialog();
}
}));
boolean b = PictureManager.queryIsLike(picture.getImId());
binding.imageFavorite.setSelected(b);
}
@ -134,7 +154,7 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
}
private void showSetDialog() {
if(isSetting) return;
if (isSetting) return;
if (setPaperFragment == null) {
setPaperFragment = new SetPaperFragment();
setPaperFragment.setListener(ExtendedInfoActivity.this);
@ -153,16 +173,17 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
binding.imageDownload.setVisibility(View.VISIBLE);
}
}
private void showSetWallpaperLoading(boolean show) {
Log.d("YYYYYY", "-----------showSetWallpaperLoading" + show);
if (show) {
isSetting=true;
isSetting = true;
binding.pbSet.setVisibility(View.VISIBLE);
binding.txApply.setVisibility(View.GONE);
binding.buttonSet.setVisibility(View.GONE);
} else {
isSetting=false;
isSetting = false;
binding.pbSet.setVisibility(View.GONE);
binding.txApply.setVisibility(View.VISIBLE);
binding.buttonSet.setVisibility(View.VISIBLE);
@ -172,7 +193,7 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
@Override
public void onSelectType(int type) {
showSetWallpaperLoading(true);
if (downloadFile != null&&downloadFile.exists()) {
if (downloadFile != null && downloadFile.exists()) {
new Thread(() -> {
Log.d("YYYYYY", "skip download and set");
setWallPaper(downloadFile, type);
@ -221,20 +242,20 @@ public class ExtendedInfoActivity extends AppCompatActivity implements ShowFragm
getString(R.string.set_success),
Toast.LENGTH_SHORT).show();
});
} catch(Exception e){
runOnUiThread(()->{
} catch (Exception e) {
runOnUiThread(() -> {
showSetWallpaperLoading(false);
Toast.makeText(ExtendedInfoActivity.this,
getString(R.string.set_fail),
Toast.LENGTH_SHORT).show();
});
}
}
}
private void deleteCacheFile() {
private void deleteCacheFile() {
if (downloadFile != null && downloadFile.exists()) {
boolean delete = downloadFile.delete();
Log.d("YYYYYY", "--------delete=" + delete);
}
}
}
}

View File

@ -6,6 +6,8 @@ import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import com.ad.toponlibrary.AdManager;
import com.ad.toponlibrary.onActionListener;
import com.apps.chillscreen.adapter.GirdAdapter;
import com.apps.chillscreen.bean.Picture;
import com.apps.chillscreen.databinding.ActivityGenerBinding;
@ -23,7 +25,15 @@ public class GeneraActivity extends AppCompatActivity implements CardClickListen
super.onCreate(savedInstanceState);
binding=ActivityGenerBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
AdManager.loadAllAd();
init();
AdManager.showTopOn(this, new onActionListener() {
@Override
public void onAction() {
}
});
}
private void init(){
name = getIntent().getStringExtra(name);

View File

@ -7,41 +7,51 @@ import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import com.ad.toponlibrary.AdManager;
import com.apps.chillscreen.databinding.ActivityLaunchBinding;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
public class LaunchActivity extends AppCompatActivity {
ActivityLaunchBinding binding;
Handler handler=new Handler();
CountDownTimer countDownTimer;
private long time = 12000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding=ActivityLaunchBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
handler.postDelayed(() -> {
countDownTimer = AdManager.showWelcomeAd(this, time, new Function1<Long, Unit>() {
@Override
public Unit invoke(Long aLong) {
float v = 100 - (float) aLong / time * 100;
int v1 = (int) v;
binding.progressbar.setProgress(v1);
return null;
}
}, new Function0<Unit>() {
@Override
public Unit invoke() {
binding.progressbar.setProgress(100);
Intent intent = new Intent(LaunchActivity.this, BaseActivity.class);
startActivity(intent);
finish();
}, 4000);
countDownTimer=new CountDownTimer(4000, 100) {
public void onTick(long millisUntilFinished) {
int progress = (int) ((4000 - millisUntilFinished) / 4000f * 100);
binding.progressbar.setProgress(progress);
return null;
}
});
countDownTimer.start();
public void onFinish() {
binding.progressbar.setProgress(100);
}
}.start();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
if (countDownTimer != null) {
countDownTimer.cancel();
}

View File

@ -2,6 +2,9 @@
plugins {
alias(libs.plugins.android.application) 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 {
repositories {

View File

@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# 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.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects

View File

@ -16,6 +16,25 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
//TU(Core)
maven ( "https://jfrog.anythinktech.com/artifactory/overseas_sdk")
//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")
}
}