接入tradplus
This commit is contained in:
parent
cb8dcf2f0c
commit
09551fccb4
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@ -5,7 +5,9 @@
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="D:\gradle\gradle-8.11.1-bin\gradle-8.11.1" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
@ -13,7 +15,6 @@
|
||||
<option value="$PROJECT_DIR$/test2" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,4 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) 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
|
||||
|
||||
}
|
||||
|
||||
@ -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 -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=U
|
||||
# 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
|
||||
|
||||
@ -20,6 +20,26 @@ dependencyResolutionManagement {
|
||||
google() // 用于依赖
|
||||
mavenCentral()
|
||||
maven { url = uri("https://jitpack.io") }
|
||||
//------------------------- 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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@ import java.util.Date
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
}
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
|
||||
@ -14,8 +16,8 @@ android {
|
||||
applicationId = "com.wall.exquisite.wallpaper"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
versionCode = 2
|
||||
versionName = "2.0"
|
||||
setProperty("archivesBaseName","Wallpaper Exquisite_v"+versionName+"(${versionCode})_$timestamp")
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -76,4 +78,88 @@ dependencies {
|
||||
|
||||
implementation(files("libs/TradPlusLibrary_11_25_15_02-release.aar"))
|
||||
implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar"))
|
||||
implementation ("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
||||
|
||||
implementation ("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
// TradPlus
|
||||
implementation("com.tradplusad:tradplus:14.5.0.1")
|
||||
//noinspection GradleCompatible
|
||||
implementation("androidx.legacy:legacy-support-v4:1.0.0")
|
||||
implementation("androidx.appcompat:appcompat:1.3.0-alpha02")
|
||||
// Meta
|
||||
implementation("com.facebook.android:audience-network-sdk:6.20.0")
|
||||
implementation("com.tradplusad:tradplus-facebook:1.14.5.0.1")
|
||||
// Applovin
|
||||
implementation("com.applovin:applovin-sdk:13.3.1")
|
||||
implementation("com.tradplusad:tradplus-applovin:9.14.5.0.1")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
|
||||
// Ironsource
|
||||
implementation("com.ironsource.sdk:mediationsdk:8.10.0")
|
||||
implementation("com.tradplusad:tradplus-ironsource:10.14.5.0.1")
|
||||
implementation("com.google.android.gms:play-services-appset:16.0.0")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
|
||||
implementation("com.google.android.gms:play-services-basement:17.5.0")
|
||||
// Adcolony
|
||||
implementation("com.adcolony:sdk:4.8.0")
|
||||
implementation("com.tradplusad:tradplus-adcolony:4.14.5.0.1")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:17.0.0")
|
||||
// Pangle
|
||||
implementation("com.tradplusad:tradplus-pangle:19.14.5.0.1")
|
||||
implementation("com.pangle.global:pag-sdk:7.3.0.3")
|
||||
// UnityAds
|
||||
implementation("com.tradplusad:tradplus-unity:5.14.5.0.1")
|
||||
implementation("com.unity3d.ads:unity-ads:4.15.1")
|
||||
// Chartboost
|
||||
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.14.5.0.1")
|
||||
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.8.3")
|
||||
implementation("androidx.core:core-ktx:1.5.0")
|
||||
implementation("com.inmobi.omsdk:inmobi-omsdk:1.5.2.0")
|
||||
// Fyber
|
||||
implementation("com.fyber:marketplace-sdk:8.3.7")
|
||||
implementation("com.tradplusad:tradplus-fyber:24.14.5.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")
|
||||
// Start.io
|
||||
implementation("com.startapp:inapp-sdk:5.2.3")
|
||||
implementation("com.tradplusad:tradplus-startapp:28.14.5.0.1")
|
||||
// Mintegral
|
||||
implementation("com.tradplusad:tradplus-mintegralx_overseas:18.14.5.0.1")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.71")
|
||||
// Liftoff
|
||||
implementation("com.tradplusad:tradplus-vunglex:7.14.5.0.1")
|
||||
implementation("com.vungle:vungle-ads:7.5.0")
|
||||
// Yandex
|
||||
implementation("com.yandex.android:mobileads:7.13.0") {
|
||||
exclude(group = "com.caverock", module = "androidsvg-aar")
|
||||
}
|
||||
implementation("com.tradplusad:tradplus-yandex:50.14.6.10.1")
|
||||
// Bigo
|
||||
implementation("com.bigossp:bigo-ads:5.4.0")
|
||||
implementation("com.tradplusad:tradplus-bigo:57.14.5.0.1")
|
||||
// Cross Promotion
|
||||
implementation("com.tradplusad:tradplus-crosspromotion:27.14.5.0.1")
|
||||
// TP Exchange
|
||||
// 请注意保持与主包版本同步更新
|
||||
implementation("com.google.code.gson:gson:2.8.6")
|
||||
implementation("com.tradplusad:tp_exchange:40.14.5.0.1")
|
||||
|
||||
// Google UMP
|
||||
implementation ("com.google.android.ump:user-messaging-platform:3.2.0")
|
||||
|
||||
// TradPlus Tools
|
||||
// implementation 'com.tradplusad:tradplus-tool:1.1.4'
|
||||
|
||||
//firebase
|
||||
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")
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,9 +11,9 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "Wallpaper Exquisite_v1.0(1)_12_05_14_18-release.apk"
|
||||
"versionCode": 2,
|
||||
"versionName": "2.0",
|
||||
"outputFile": "Wallpaper Exquisite_v2.0(2)_12_16_14_45-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File",
|
||||
@ -22,14 +22,14 @@
|
||||
"minApi": 28,
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/Wallpaper Exquisite_v1.0(1)_12_05_14_18-release.dm"
|
||||
"baselineProfiles/1/Wallpaper Exquisite_v2.0(2)_12_16_14_45-release.dm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minApi": 31,
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/Wallpaper Exquisite_v1.0(1)_12_05_14_18-release.dm"
|
||||
"baselineProfiles/0/Wallpaper Exquisite_v2.0(2)_12_16_14_45-release.dm"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -37,6 +37,9 @@
|
||||
android:name=".CollectionActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<meta-data
|
||||
android:name="com.startapp.sdk.MIXED_AUDIENCE"
|
||||
android:value="true"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -13,6 +13,9 @@ import androidx.core.view.WindowCompat;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.ad.tradpluslibrary.TPAdManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -30,6 +33,7 @@ public class CollectionActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_collection);
|
||||
|
||||
setupStatusBar();
|
||||
TPAdManager.INSTANCE.showTPAD(this,()-> null);
|
||||
initViews();
|
||||
setupRecyclerView();
|
||||
loadFavoriteData();
|
||||
@ -61,7 +65,10 @@ public class CollectionActivity extends AppCompatActivity {
|
||||
rvFavoriteImages = findViewById(R.id.rv_favorite_images);
|
||||
tvEmpty = findViewById(R.id.tv_empty);
|
||||
|
||||
findViewById(R.id.btn_back).setOnClickListener(v -> finish());
|
||||
findViewById(R.id.btn_back).setOnClickListener(v -> TPAdManager.INSTANCE.showTPAD(this,()-> {
|
||||
finish();
|
||||
return null;
|
||||
}));
|
||||
|
||||
favoriteManager = new CollectionManager(this);
|
||||
favoriteList = new ArrayList<>();
|
||||
|
||||
@ -27,6 +27,7 @@ import androidx.core.view.WindowCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
|
||||
import com.ad.tradpluslibrary.TPAdManager;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestManager;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
@ -217,16 +218,26 @@ public class FullImageActivity extends AppCompatActivity implements WallpaperTyp
|
||||
*/
|
||||
private void initClick() {
|
||||
// 返回按钮(关闭当前页面)
|
||||
binding.imageviewBack.setOnClickListener(v -> finish());
|
||||
binding.imageviewBack.setOnClickListener(v -> TPAdManager.INSTANCE.showTPAD(this,()-> {
|
||||
finish();
|
||||
return null;
|
||||
}));
|
||||
|
||||
// 下载按钮(保存图片到相册,无需权限)
|
||||
binding.layoutDownload.setOnClickListener(v -> startDownload());
|
||||
binding.layoutDownload.setOnClickListener(v -> TPAdManager.INSTANCE.showTPAD(this,()-> {
|
||||
startDownload();
|
||||
return null;
|
||||
}));
|
||||
|
||||
// 设置壁纸按钮(弹出选择弹窗)
|
||||
binding.buttonSet1.setOnClickListener(v -> showWallpaperTypeDialog());
|
||||
|
||||
// 点赞按钮(收藏/取消收藏)
|
||||
binding.imageFavorite.setOnClickListener(v -> toggleFavorite());
|
||||
binding.imageFavorite.setOnClickListener(v -> TPAdManager.INSTANCE.showTPAD(this,()-> {
|
||||
toggleFavorite();
|
||||
return null;
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -11,6 +11,12 @@ import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.ad.tradpluslibrary.TPAdManager;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
public class StartuppageActivity extends AppCompatActivity {
|
||||
|
||||
private ProgressBar progressBar;
|
||||
@ -19,6 +25,7 @@ public class StartuppageActivity extends AppCompatActivity {
|
||||
// 倒计时间隔(毫秒),每15ms更新一次进度,和原逻辑匹配
|
||||
private static final long COUNT_DOWN_INTERVAL = 15;
|
||||
private CountDownTimer countDownTimer;
|
||||
private long totalTime = 14000;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -28,6 +35,20 @@ public class StartuppageActivity extends AppCompatActivity {
|
||||
|
||||
// 初始化控件
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
TPAdManager.INSTANCE.init(
|
||||
this,
|
||||
WallpaperApplication.TAG,
|
||||
"11AFE68410E60AB7D990BD9CBA814411",
|
||||
"83D1FF0E14FCB01E5F26038F91114512",
|
||||
"BB1B407D3DC75FE8C6E3205D2E6B3E12",
|
||||
"FB5CA4DF6B924ADF06C3C0C25C880212",
|
||||
new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
) ;
|
||||
|
||||
// 初始化并启动CountDownTimer倒计时
|
||||
initCountDownTimer();
|
||||
@ -47,27 +68,23 @@ public class StartuppageActivity extends AppCompatActivity {
|
||||
// CountDownTimer参数说明:
|
||||
// 第一个参数:总倒计时时长(ms)
|
||||
// 第二个参数:倒计时间隔(ms),每隔这个时间回调一次onTick
|
||||
countDownTimer = new CountDownTimer(TOTAL_COUNT_DOWN_TIME, COUNT_DOWN_INTERVAL) {
|
||||
countDownTimer = TPAdManager.INSTANCE.showWelcomeAd(this, totalTime, aLong -> {
|
||||
Long progressPercentage = (100 * aLong) / totalTime;
|
||||
Long percentage = 100 - progressPercentage;
|
||||
progressBar.setProgress(Integer.parseInt(percentage.toString()));
|
||||
return null;
|
||||
}, new Function0<Unit>() {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
// 计算当前进度:(总时长 - 剩余时长) / 总时长 * 100
|
||||
int progress = (int) ((TOTAL_COUNT_DOWN_TIME - millisUntilFinished) * 100 / TOTAL_COUNT_DOWN_TIME);
|
||||
// 更新进度条(CountDownTimer的回调默认在主线程,可直接更新UI)
|
||||
progressBar.setProgress(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
public Unit invoke() {
|
||||
// 倒计时结束,设置进度条为100
|
||||
progressBar.setProgress(100);
|
||||
// 跳转到MainActivity2
|
||||
Intent intent = new Intent(StartuppageActivity.this, FirstMainActivity.class);
|
||||
startActivity(intent);
|
||||
finish(); // 关闭启动页,避免返回键回到此页面
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
// 启动倒计时
|
||||
}) ;
|
||||
countDownTimer.start();
|
||||
}
|
||||
|
||||
|
||||
@ -5,9 +5,14 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import com.up.uploadlibrary.UpLoadManager;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
// 导入你的收藏工具类
|
||||
|
||||
|
||||
@ -20,10 +25,17 @@ public class WallpaperApplication extends Application {
|
||||
private Handler mMainHandler;
|
||||
// 全局单例的收藏工具
|
||||
private static CollectionManager favoriteManager;
|
||||
public static final String TAG = "WallpaperApplication";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
UpLoadManager.INSTANCE.init(this, TAG, new Function2<String, String, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(String s, String s2) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
instance = this;
|
||||
// 初始化基础工具(主线程)
|
||||
initBasicTools();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user