接入tradplus

This commit is contained in:
yuqian 2025-12-16 15:14:15 +08:00
parent 29541ffbe5
commit 8bfd03961b
11 changed files with 163 additions and 26 deletions

1
.idea/.name generated Normal file
View File

@ -0,0 +1 @@
Lenscape

4
.idea/vcs.xml generated
View File

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings" defaultProject="true" /> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project> </project>

View File

@ -6,6 +6,9 @@ plugins {
alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.android)
id("kotlin-kapt") id("kotlin-kapt")
id("kotlin-parcelize") id("kotlin-parcelize")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
} }
android { android {
@ -19,8 +22,8 @@ android {
applicationId = "com.paperapp.lenscape" applicationId = "com.paperapp.lenscape"
minSdk = 26 minSdk = 26
targetSdk = 36 targetSdk = 36
versionCode = 1 versionCode = 2
versionName = "1.0" versionName = "2.0"
setProperty("archivesBaseName", "Lenscape_V" + versionName + "_${versionCode}_$timestamp") setProperty("archivesBaseName", "Lenscape_V" + versionName + "_${versionCode}_$timestamp")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
@ -67,4 +70,88 @@ dependencies {
implementation(files("libs/TradPlusLibrary_11_25_15_02-release.aar")) implementation(files("libs/TradPlusLibrary_11_25_15_02-release.aar"))
implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar")) implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar"))
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")
} }

View File

@ -17,6 +17,7 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:name=".DApp" android:name=".DApp"
android:theme="@style/Theme.Lenscape"> android:theme="@style/Theme.Lenscape">
<activity <activity
android:name=".preview.MemberAccessActivity" android:name=".preview.MemberAccessActivity"
@ -37,6 +38,9 @@
android:name=".preview.ImagePreviewActivity" android:name=".preview.ImagePreviewActivity"
android:theme="@style/Base.Theme.Lenscape" android:theme="@style/Base.Theme.Lenscape"
android:exported="false" /> android:exported="false" />
<meta-data
android:name="com.startapp.sdk.MIXED_AUDIENCE"
android:value="true"/>
</application> </application>
</manifest> </manifest>

View File

@ -18,7 +18,7 @@ class DApp : Application() {
private val patterns = "Patterns.json" private val patterns = "Patterns.json"
private val street = "Street.json" private val street = "Street.json"
private val travel = "Travel.json" private val travel = "Travel.json"
private val wallpaper = "Elementd.json" private val wallpaper = "Featured.json"
companion object { companion object {
var classificationList: MutableList<String> = mutableListOf() var classificationList: MutableList<String> = mutableListOf()

View File

@ -12,6 +12,7 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import com.ad.tradpluslibrary.TPAdManager.showTPAD
import com.paperapp.lenscape.R import com.paperapp.lenscape.R
import com.paperapp.lenscape.databinding.ActivityBrowseBinding import com.paperapp.lenscape.databinding.ActivityBrowseBinding
import com.paperapp.lenscape.tools.BrowseAdapter import com.paperapp.lenscape.tools.BrowseAdapter
@ -37,17 +38,18 @@ class BrowseActivity : AppCompatActivity(), SetLoveListener {
} }
private fun init() { private fun init() {
showTPAD(this) { null }
viewModel = ViewModelProvider(this)[MainViewModel::class.java] viewModel = ViewModelProvider(this)[MainViewModel::class.java]
adapter = BrowseAdapter() adapter = BrowseAdapter()
adapter.setListener(this) adapter.setListener(this)
binding.list.adapter = adapter binding.list.adapter = adapter
binding.list.layoutManager = GridLayoutManager(this, 2) binding.list.layoutManager = GridLayoutManager(this, 2)
binding.tvStart.setOnClickListener { startSearch() } binding.tvStart.setOnClickListener { showTPAD(this) { startSearch() } }
binding.imageBack.setOnClickListener { finish() } binding.imageBack.setOnClickListener { showTPAD(this) { finish() } }
binding.editText.requestFocus() binding.editText.requestFocus()
binding.editText.setOnEditorActionListener { _, actionId, _ -> binding.editText.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE) {
startSearch() showTPAD(this) { startSearch() }
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false

View File

@ -9,6 +9,7 @@ import android.widget.Toast
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.ad.tradpluslibrary.TPAdManager.showTPAD
import com.paperapp.lenscape.R import com.paperapp.lenscape.R
import com.paperapp.lenscape.element.MainViewModel import com.paperapp.lenscape.element.MainViewModel
import com.paperapp.lenscape.element.Element import com.paperapp.lenscape.element.Element
@ -80,6 +81,7 @@ class ImagePreviewActivity : AppCompatActivity(), OnclickListener {
} }
private fun initializeComponents() { private fun initializeComponents() {
showTPAD(this) { null }
viewModel = ViewModelProvider(this)[MainViewModel::class.java] viewModel = ViewModelProvider(this)[MainViewModel::class.java]
paper = intent?.getParcelableExtra(paperKey)!! paper = intent?.getParcelableExtra(paperKey)!!
fullImageUrl = paper.fullUrl fullImageUrl = paper.fullUrl
@ -105,7 +107,7 @@ class ImagePreviewActivity : AppCompatActivity(), OnclickListener {
) )
) )
.into(binding.image) .into(binding.image)
binding.imageBack.setOnClickListener { finish() } binding.imageBack.setOnClickListener { showTPAD(this) { finish() } }
binding.tvContent.text = paper.description binding.tvContent.text = paper.description
viewModel.isLiked.observe(this) { b -> viewModel.isLiked.observe(this) { b ->
Log.d("initb", b.toString()) Log.d("initb", b.toString())
@ -122,7 +124,7 @@ class ImagePreviewActivity : AppCompatActivity(), OnclickListener {
initiateDownload() initiateDownload()
} }
binding.layoutSet.setOnClickListener { binding.layoutSet.setOnClickListener {
showSetDialog() showTPAD(this) { showSetDialog() }
} }
} }

View File

@ -5,6 +5,8 @@ import android.os.Bundle
import android.os.CountDownTimer import android.os.CountDownTimer
import android.os.Handler import android.os.Handler
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.ad.tradpluslibrary.TPAdManager
import com.paperapp.lenscape.DApp
import com.paperapp.lenscape.databinding.ActivityMemberAccessBinding import com.paperapp.lenscape.databinding.ActivityMemberAccessBinding
import com.paperapp.lenscape.TopBarUtils import com.paperapp.lenscape.TopBarUtils
@ -12,6 +14,7 @@ class MemberAccessActivity : AppCompatActivity() {
lateinit var binding: ActivityMemberAccessBinding lateinit var binding: ActivityMemberAccessBinding
private var handler: Handler = Handler() private var handler: Handler = Handler()
private var countDownTimer: CountDownTimer? = null private var countDownTimer: CountDownTimer? = null
private val time=14000L
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -19,24 +22,37 @@ class MemberAccessActivity : AppCompatActivity() {
setContentView(binding.root) setContentView(binding.root)
TopBarUtils.setStatusBar(this.window) TopBarUtils.setStatusBar(this.window)
TopBarUtils.setLightStatusBar(this.window,true) TopBarUtils.setLightStatusBar(this.window,true)
handler.postDelayed({ TPAdManager.init(
this@MemberAccessActivity,
DApp.TAG,
"6C000EF75603E28FF44B27BBA4A32E11",
"D067789A71596B4925D5C97397EE7712",
"7C75F80B7EA2B803013A08F4A7145B12",
"2CD1AA77B2DB4019DFD9D278A8E54D12"
) {
null
}
countDownTimer = TPAdManager.showWelcomeAd(
this@MemberAccessActivity,
time,
{ aLong ->
val progressPercentage = (100 * aLong) / time
val percentage = 100 - progressPercentage
binding.progressbar.progress = percentage.toInt()
},
{
binding.progressbar.progress = 100
val intent= Intent( val intent= Intent(
this@MemberAccessActivity, this@MemberAccessActivity,
SortActivity::class.java SortActivity::class.java
) )
startActivity(intent) startActivity(intent)
finish() finish()
}, 4000)
countDownTimer = object : CountDownTimer(4000, 100) {
override fun onTick(millisUntilFinished: Long) {
val progress = ((4000 - millisUntilFinished) / 4000f * 100).toInt()
binding.progressbar.progress = progress
} }
)
countDownTimer?.start()
override fun onFinish() {
binding.progressbar.progress = 100
}
}.start()
} }
override fun onDestroy() { override fun onDestroy() {

View File

@ -2,4 +2,7 @@
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
} }

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 -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=U
# 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,26 @@ dependencyResolutionManagement {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
//------------------------- 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 Mediations 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")
}
} }
} }