V_1.0.3(4) Liftoff SDK
This commit is contained in:
parent
870308eb50
commit
5947f23b9e
BIN
app/PaintingHelper.jks
Normal file
BIN
app/PaintingHelper.jks
Normal file
Binary file not shown.
@ -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")
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
package com.draw.painting.test.ironad
|
||||
|
||||
interface IronListener {
|
||||
fun onLoaded()
|
||||
fun onLoadFail()
|
||||
|
||||
fun onClose()
|
||||
|
||||
fun onShowFail()
|
||||
|
||||
fun onShowSuccess()
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<Unit>() {
|
||||
// countDownTimer = IronSourceAd.showWelComeAd(time, ALaucherActivity.this, IronSourceAd.adPlace1, new Function0<Unit>() {
|
||||
// @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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<Integer, Unit>() {
|
||||
@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<Integer, Unit>() {
|
||||
// @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;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
@ -10,5 +10,5 @@
|
||||
<string name="version">Version</string>
|
||||
<string name="version_code">V%s</string>
|
||||
<string name="permission_fail">Please grant the relevant permissions and try again.</string>
|
||||
<string name="url_privacy">https://play.google.com/store/apps/details?id=com.draw.painting.helper</string>
|
||||
<string name="url_privacy">https://sites.google.com/view/httpprivates</string>
|
||||
</resources>
|
||||
@ -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
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user