From 5947f23b9e41022b2cd3e5b6cf9dacc10538940d Mon Sep 17 00:00:00 2001 From: litingting Date: Fri, 12 Jul 2024 16:20:12 +0800 Subject: [PATCH] V_1.0.3(4) Liftoff SDK --- app/PaintingHelper.jks | Bin 0 -> 2576 bytes app/build.gradle.kts | 48 +++--- .../com/draw/painting/test/PaintingApp.java | 27 ++- .../painting/test/adapter/HomeAdapter.java | 1 - .../draw/painting/test/ironad/IronListener.kt | 12 -- .../draw/painting/test/ironad/IronSourceAd.kt | 157 ------------------ .../painting/test/ui/ALaucherActivity.java | 34 ++-- .../draw/painting/test/ui/HomeFragment.java | 64 +++---- app/src/main/res/values/strings.xml | 2 +- build.gradle.kts | 2 +- settings.gradle.kts | 12 +- 11 files changed, 103 insertions(+), 256 deletions(-) create mode 100644 app/PaintingHelper.jks delete mode 100644 app/src/main/java/com/draw/painting/test/ironad/IronListener.kt delete mode 100644 app/src/main/java/com/draw/painting/test/ironad/IronSourceAd.kt diff --git a/app/PaintingHelper.jks b/app/PaintingHelper.jks new file mode 100644 index 0000000000000000000000000000000000000000..042f47b5812d55a9dbe90eb3f0a31aafcf10d318 GIT binary patch literal 2576 zcma);XE+<|8po4J%xF=gYBWY;)Cd}*X4@3CULzz{>|Lr>Yin8|f?83fL{ZdMV$`Uj zG*+ouHLB{hU;DM%I?lM->wG%r!~MUn=XXE<``h!s9t55l3Ift0@Jw~|Op*j$!aggI z0ho(tDgxt~@=q}ZfroVc*9cM%#zSgOaph^1(zE=>1!V?;a`6zYQ>cb;{pEnLA}kTg zzmHJFWiV&ANJB6uQ_K`{O}?XO@r(1r@ho-_NQ?~xgdw2xjQ`#UVuAn=0`yGw1YMvD z9T+GHW@|4fdoTzVx(Vkob=XcD`3S~?2S3Xx^b9SKcG$u&7@e9%pSsIjADk2IIun9f zXbsP`Z#kwpVXX}z5=YHaigNWaRQT>((bezdS!Vb85%dfFp`4yw8fC1SDt$=%C=<~`7o@5I=@aRFs>ZhH4y{#E)3muVJdUbJ;wW!V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iMl zv6=sjn#r;JMm(;;yGTTIsd6R?eq-~c{qof|hoHIO`A$6}tl`=>^sEY?Hr1RvTlvo^)6Z7;AozLNCo92}m+QKi z0TUz1K8qe*9uwD?_5j_}S|NQ+?1ubXO5IVzGwtBv)Lm?#9dX{lGjNE zO*>k~bMgCrea<}vIiG^{NmKG*{#*WZL&cS*SrXCsppCNtCQIIH(+-B;rk~YhpMc&~ z6H9wOs|d=09dj{)?-ixO$HWpy=CQQgu~LuMeM?0tsVQ>}hi7?#FsfS!KLk+bV59mF zcKP|Tu>IaLW4M&Mp*(9Z%N;2zz3qK>s4Ydq4vSt59GNgDr>g4ir$P9lhnwp+_+8sm z*{l^uE@(G#&C8M?spoGeKs)!{^_iPX54PXSwt{zs zgW+b;AC>W5Lak%G$hx(Q>s6+)TcLqBjGuC^80XKgzj`(+P5(_*oiZcGd|ttX z6Q;htTF1=WpA;~U^|DLc|Eo_KXTpp#w^%gQq@qZVuClp`;Dix|2ss4nuU`@f2myd$ z8cE$E)?O>o!YW5u*j7$fbZ5o@eY~g5R^#F^K#;l%=HweS#cIWj!Ou^tRr9^etX0X) J^8e=({s&VpmrDQu literal 0 HcmV?d00001 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ab86493..841e530 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,7 +14,7 @@ android { defaultConfig { //com.draw.painting.helper - applicationId = "com.draw.painting.test" + applicationId = "com.draw.painting.helper" minSdk = 23 targetSdk = 34 versionCode = 1 @@ -68,32 +68,32 @@ dependencies { implementation ("androidx.camera:camera-extensions:${camerax_version}") - implementation(platform("com.google.firebase:firebase-bom:33.1.1")) - implementation("com.google.firebase:firebase-crashlytics") - implementation("com.google.firebase:firebase-analytics") +// implementation(platform("com.google.firebase:firebase-bom:33.1.1")) +// implementation("com.google.firebase:firebase-crashlytics") +// implementation("com.google.firebase:firebase-analytics") - implementation ("com.ironsource.sdk:mediationsdk:8.1.0") - implementation ("com.ironsource:adqualitysdk:7.20.2") - - // Add Vungle Network(Liftoff Moneti) - implementation ("com.ironsource.adapters:vungleadapter:4.3.24") - implementation ("com.vungle:vungle-ads:7.3.2") - - //Mintegral - implementation ("com.mbridge.msdk.oversea:mbbid:16.7.71") - implementation ("com.mbridge.msdk.oversea:reward:16.7.71") - implementation ("com.mbridge.msdk.oversea:mbbanner:16.7.71") - implementation ("com.mbridge.msdk.oversea:newinterstitial:16.7.71") - - // Add Pangle Network - implementation ("com.ironsource.adapters:pangleadapter:4.3.26") - implementation ("com.pangle.global:ads-sdk:5.8.0.8") - - // Add UnityAds Network - implementation ("com.ironsource.adapters:unityadsadapter:4.3.40") - implementation ("com.unity3d.ads:unity-ads:4.12.0") +// implementation ("com.ironsource.sdk:mediationsdk:8.1.0") +// implementation ("com.ironsource:adqualitysdk:7.20.2") +// +// // Add Vungle Network(Liftoff Moneti) +// implementation ("com.ironsource.adapters:vungleadapter:4.3.24") +// implementation ("com.vungle:vungle-ads:7.3.2") +// +// //Mintegral +// implementation ("com.mbridge.msdk.oversea:mbbid:16.7.71") +// implementation ("com.mbridge.msdk.oversea:reward:16.7.71") +// implementation ("com.mbridge.msdk.oversea:mbbanner:16.7.71") +// implementation ("com.mbridge.msdk.oversea:newinterstitial:16.7.71") +// +// // Add Pangle Network +// implementation ("com.ironsource.adapters:pangleadapter:4.3.26") +// implementation ("com.pangle.global:ads-sdk:5.8.0.8") +// +// // Add UnityAds Network +// implementation ("com.ironsource.adapters:unityadsadapter:4.3.40") +// implementation ("com.unity3d.ads:unity-ads:4.12.0") diff --git a/app/src/main/java/com/draw/painting/test/PaintingApp.java b/app/src/main/java/com/draw/painting/test/PaintingApp.java index 7c48784..3e1b803 100644 --- a/app/src/main/java/com/draw/painting/test/PaintingApp.java +++ b/app/src/main/java/com/draw/painting/test/PaintingApp.java @@ -3,10 +3,7 @@ package com.draw.painting.test; import android.app.Application; -import com.draw.painting.test.ironad.IronSourceAd; -import com.ironsource.mediationsdk.IronSource; -import com.ironsource.mediationsdk.integration.IntegrationHelper; -import com.ironsource.mediationsdk.sdk.InitializationListener; + public class PaintingApp extends Application { @@ -26,17 +23,17 @@ public class PaintingApp extends Application { } private void initSDk() { - IronSource.init(this, APP_KEY, new InitializationListener() { - @Override - public void onInitializationComplete() { - // ironSource SDK is initialized - //加载插页广告 - IronSourceAd.loadAd(); - } - }); - - //验证集成的成功 ,release的时候需要删除 - IntegrationHelper.validateIntegration(this); +// IronSource.init(this, APP_KEY, new InitializationListener() { +// @Override +// public void onInitializationComplete() { +// // ironSource SDK is initialized +// //加载插页广告 +// IronSourceAd.loadAd(); +// } +// }); +// +// //验证集成的成功 ,release的时候需要删除 +// IntegrationHelper.validateIntegration(this); } diff --git a/app/src/main/java/com/draw/painting/test/adapter/HomeAdapter.java b/app/src/main/java/com/draw/painting/test/adapter/HomeAdapter.java index 133856f..b0c2d51 100644 --- a/app/src/main/java/com/draw/painting/test/adapter/HomeAdapter.java +++ b/app/src/main/java/com/draw/painting/test/adapter/HomeAdapter.java @@ -14,7 +14,6 @@ import androidx.recyclerview.widget.RecyclerView; import com.draw.painting.test.PaintingApp; import com.draw.painting.test.R; -import com.draw.painting.test.ironad.IronSourceAd; import com.draw.painting.test.manager.Keys; import com.draw.painting.test.onClickListener; import com.draw.painting.test.ui.CameraActivity; diff --git a/app/src/main/java/com/draw/painting/test/ironad/IronListener.kt b/app/src/main/java/com/draw/painting/test/ironad/IronListener.kt deleted file mode 100644 index 424b2c3..0000000 --- a/app/src/main/java/com/draw/painting/test/ironad/IronListener.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.draw.painting.test.ironad - -interface IronListener { - fun onLoaded() - fun onLoadFail() - - fun onClose() - - fun onShowFail() - - fun onShowSuccess() -} \ No newline at end of file diff --git a/app/src/main/java/com/draw/painting/test/ironad/IronSourceAd.kt b/app/src/main/java/com/draw/painting/test/ironad/IronSourceAd.kt deleted file mode 100644 index d78769d..0000000 --- a/app/src/main/java/com/draw/painting/test/ironad/IronSourceAd.kt +++ /dev/null @@ -1,157 +0,0 @@ -package com.draw.painting.test.ironad - -import android.app.Activity -import android.os.CountDownTimer -import android.util.Log -import com.ironsource.mediationsdk.IronSource -import com.ironsource.mediationsdk.adunit.adapter.utility.AdInfo -import com.ironsource.mediationsdk.logger.IronSourceError -import com.ironsource.mediationsdk.sdk.LevelPlayInterstitialListener - -object IronSourceAd { - - const val NO_CACHE = 0 - const val HAS_CACHE = 1 - const val SHOW_FAIL = 2 - const val SHOW_SUCCESS = 3 - const val SHOW_CLOSE = 4 - const val TAG = "-=================" - const val adPlace1 = "" - const val adPlace2 = "" - const val adPlace3 = "" - - - private fun setAdCallBack(listener: IronListener) { - IronSource.setLevelPlayInterstitialListener(object : LevelPlayInterstitialListener { - // Invoked when the interstitial ad was loaded successfully. - // AdInfo parameter includes information about the loaded ad - override fun onAdReady(adInfo: AdInfo) { - listener.onLoaded() - Log.d(TAG, "----onAdReady adInfo=${adInfo.instanceName}") - - } - - // Indicates that the ad failed to be loaded - override fun onAdLoadFailed(error: IronSourceError) { - listener.onLoadFail() - Log.d(TAG, "----onAdLoadFailed error=${error.errorMessage}") - } - - // Invoked when the Interstitial Ad Unit has opened, and user left the application screen. - // This is the impression indication. - override fun onAdOpened(adInfo: AdInfo) { -// Log.d(TAG, "----onAdOpened adInfo=${adInfo.adUnit}") - } - - // Invoked when the interstitial ad closed and the user went back to the application screen. - override fun onAdClosed(adInfo: AdInfo) { - listener.onClose() -// Log.d(TAG, "----onAdClosed adInfo=${adInfo.adUnit}") - } - - // Invoked when the ad failed to show - override fun onAdShowFailed(error: IronSourceError, adInfo: AdInfo) { - listener.onShowFail() -// Log.d(TAG, "----onAdShowFailed error=${error.errorMessage}") - } - - // Invoked when end user clicked on the interstitial ad - override fun onAdClicked(adInfo: AdInfo) { -// Log.d(TAG, "----onAdClicked adInfo=${adInfo.adUnit}") - } - - // Invoked before the interstitial ad was opened, and before the InterstitialOnAdOpenedEvent is reported. - // This callback is not supported by all networks, and we recommend using it only if - // it's supported by all networks you included in your build. - override fun onAdShowSucceeded(adInfo: AdInfo) { - listener.onShowSuccess() -// Log.d(TAG, "----onAdShowSucceeded adInfo=${adInfo.adUnit}") - } - }) - } - - - @JvmStatic - fun loadAd() { - IronSource.loadInterstitial() - } - - @JvmStatic - fun showWelComeAd(totalTim: Long, activity: Activity, place: String, actionGoMain: () -> Unit):CountDownTimer { - var needShow = true - val myTimer = object : CountDownTimer(totalTim, 100) { - override fun onTick(millisUntilFinished: Long) { - if (needShow) { - showAd(activity, place) { - if (it == HAS_CACHE) { - needShow = false - } - if (it == SHOW_FAIL) { - needShow = true - } - if (it == SHOW_CLOSE) { - actionGoMain.invoke() - } - } - } - - } - - override fun onFinish() { - if (needShow) { - showAd(activity, place) { - if (it == SHOW_FAIL || it == NO_CACHE || it == SHOW_CLOSE) { - actionGoMain.invoke() - } - - } - } - - } - } - myTimer.start() - - return myTimer - - - } - - @JvmStatic - fun showAd(activity: Activity, place: String, action: (result: Int) -> Unit) { - if (IronSource.isInterstitialReady()) { - action.invoke(HAS_CACHE) - Log.d(TAG, "----isInterstitialReady") - setAdCallBack(object : IronListener { - override fun onLoaded() { - } - - override fun onLoadFail() { - } - - override fun onClose() { - Log.d(TAG, "----onClose=" + Thread.currentThread().name) - loadAd() - action.invoke(SHOW_CLOSE) - - } - - override fun onShowFail() { - action.invoke(SHOW_FAIL) - Log.d(TAG, "----onShowFail=" + Thread.currentThread().name) - } - - override fun onShowSuccess() { - action.invoke(SHOW_SUCCESS) - } - - }) - IronSource.showInterstitial(activity, place) - } else { - Log.d(TAG, "----no cache") - action.invoke(NO_CACHE) - } - - - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/draw/painting/test/ui/ALaucherActivity.java b/app/src/main/java/com/draw/painting/test/ui/ALaucherActivity.java index f73a395..7142c58 100644 --- a/app/src/main/java/com/draw/painting/test/ui/ALaucherActivity.java +++ b/app/src/main/java/com/draw/painting/test/ui/ALaucherActivity.java @@ -8,7 +8,6 @@ import android.os.CountDownTimer; import com.draw.painting.test.R; import com.draw.painting.test.databinding.ActivityAlaucherBinding; -import com.draw.painting.test.ironad.IronSourceAd; import com.draw.painting.test.manager.Utils; import kotlin.Unit; @@ -17,26 +16,39 @@ import kotlin.jvm.functions.Function0; public class ALaucherActivity extends AppCompatActivity { private ActivityAlaucherBinding binding; - private long time = 11000; - private CountDownTimer countDownTimer; + private long time = 2000; + private CountDownTimer countDownTimer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivityAlaucherBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - Utils.setStatusBarTextColor(this,true); + Utils.setStatusBarTextColor(this, true); - countDownTimer = IronSourceAd.showWelComeAd(time, ALaucherActivity.this, IronSourceAd.adPlace1, new Function0() { +// countDownTimer = IronSourceAd.showWelComeAd(time, ALaucherActivity.this, IronSourceAd.adPlace1, new Function0() { +// @Override +// public Unit invoke() { +// enterMain(); +// return null; +// } +// }); + + countDownTimer = new CountDownTimer(time, 200) { @Override - public Unit invoke() { - enterMain(); - return null; + public void onTick(long millisUntilFinished) { + } - }); + + @Override + public void onFinish() { + enterMain(); + } + }; + countDownTimer.start(); } - private void enterMain(){ + private void enterMain() { Intent intent = new Intent(ALaucherActivity.this, HomeActivity.class); startActivity(intent); finish(); @@ -45,7 +57,7 @@ public class ALaucherActivity extends AppCompatActivity { @Override protected void onDestroy() { super.onDestroy(); - if(countDownTimer!= null){ + if (countDownTimer != null) { countDownTimer.cancel(); } } diff --git a/app/src/main/java/com/draw/painting/test/ui/HomeFragment.java b/app/src/main/java/com/draw/painting/test/ui/HomeFragment.java index fe3d295..5a494b2 100644 --- a/app/src/main/java/com/draw/painting/test/ui/HomeFragment.java +++ b/app/src/main/java/com/draw/painting/test/ui/HomeFragment.java @@ -2,23 +2,18 @@ package com.draw.painting.test.ui; import android.content.Intent; import android.os.Bundle; - -import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; - import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; + import com.draw.painting.test.PaintingApp; import com.draw.painting.test.adapter.HomeAdapter; import com.draw.painting.test.databinding.FragmentHomeBinding; -import com.draw.painting.test.ironad.IronSourceAd; import com.draw.painting.test.onClickListener; -import kotlin.Unit; -import kotlin.jvm.functions.Function1; - public class HomeFragment extends Fragment implements onClickListener { private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; @@ -63,31 +58,44 @@ public class HomeFragment extends Fragment implements onClickListener { @Override public void onClickItem(boolean viewAll,String dir) { - String place; + + Intent intent; if(viewAll){ - place = IronSourceAd.adPlace2; + intent = new Intent(requireContext(), PreViewActivity.class); + intent.putExtra(PaintingApp.Key_ViewDir, dir); }else { - place = IronSourceAd.adPlace3; + intent = new Intent(requireContext(), CameraActivity.class); + intent.putExtra(PaintingApp.Key_Camera,dir); } - IronSourceAd.showAd(requireActivity(), place, new Function1() { - @Override - public Unit invoke(Integer integer) { - if (integer == IronSourceAd.SHOW_FAIL || integer == IronSourceAd.NO_CACHE || integer == IronSourceAd.SHOW_CLOSE){ + startActivity(intent); - Intent intent; - if(viewAll){ - intent = new Intent(requireContext(), PreViewActivity.class); - intent.putExtra(PaintingApp.Key_ViewDir, dir); - }else { - intent = new Intent(requireContext(), CameraActivity.class); - intent.putExtra(PaintingApp.Key_Camera,dir); - } - startActivity(intent); - } - return null; - } - }); +// String place; +// if(viewAll){ +// place = IronSourceAd.adPlace2; +// }else { +// place = IronSourceAd.adPlace3; +// } +// IronSourceAd.showAd(requireActivity(), place, new Function1() { +// @Override +// public Unit invoke(Integer integer) { +// if (integer == IronSourceAd.SHOW_FAIL || integer == IronSourceAd.NO_CACHE || integer == IronSourceAd.SHOW_CLOSE){ +// +// Intent intent; +// if(viewAll){ +// intent = new Intent(requireContext(), PreViewActivity.class); +// intent.putExtra(PaintingApp.Key_ViewDir, dir); +// }else { +// intent = new Intent(requireContext(), CameraActivity.class); +// intent.putExtra(PaintingApp.Key_Camera,dir); +// } +// startActivity(intent); +// +// } +// +// return null; +// } +// }); } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5142430..0eea267 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -10,5 +10,5 @@ Version V%s Please grant the relevant permissions and try again. - https://play.google.com/store/apps/details?id=com.draw.painting.helper + https://sites.google.com/view/httpprivates \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 32e98b4..0594b97 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.1.3" apply false + id("com.android.application") version "8.1.0" apply false id("org.jetbrains.kotlin.android") version "1.8.20" apply false id("com.google.gms.google-services") version "4.3.15" apply false id ("com.google.firebase.crashlytics") version "2.9.2" apply false diff --git a/settings.gradle.kts b/settings.gradle.kts index 0fc5abd..ac44ef4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,14 +10,14 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - maven ("https://android-sdk.is.com/") - //Mintegral - maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") - //Pangle - maven ("https://artifact.bytedance.com/repository/pangle") +// maven ("https://android-sdk.is.com/") +// //Mintegral +// maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") +// //Pangle +// maven ("https://artifact.bytedance.com/repository/pangle") } } -rootProject.name = "Painting Helper" +rootProject.name = "Painting_Helper" include(":app") \ No newline at end of file