集成topon
This commit is contained in:
parent
250f9237d1
commit
cb795ec8e0
@ -4,6 +4,8 @@ plugins {
|
|||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
id("io.objectbox")
|
id("io.objectbox")
|
||||||
|
id("com.google.firebase.crashlytics")
|
||||||
|
id("com.google.gms.google-services")
|
||||||
}
|
}
|
||||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||||
android {
|
android {
|
||||||
@ -15,8 +17,8 @@ android {
|
|||||||
applicationId = "com.prank.master"
|
applicationId = "com.prank.master"
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 1
|
versionCode = 2
|
||||||
versionName = "1.0.0"
|
versionName = "1.0.1"
|
||||||
setProperty("archivesBaseName", "Prank Master_V" + versionName + "(${versionCode})_$timestamp")
|
setProperty("archivesBaseName", "Prank Master_V" + versionName + "(${versionCode})_$timestamp")
|
||||||
testInstrumentationRunner = "androidx.sounds.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.sounds.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
@ -65,20 +67,99 @@ implementation("androidx.appcompat:appcompat:1.6.1")
|
|||||||
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
||||||
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||||
|
|
||||||
// implementation ("org.greenrobot:greendao:3.2.2")
|
|
||||||
// implementation("androidx.core:core-ktx:1.9.0")
|
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
|
||||||
// implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0")
|
// When using the BoM, you don't specify versions in Firebase library dependencies
|
||||||
// implementation("androidx.activity:activity-compose:1.9.0")
|
// Add the dependency for the Firebase SDK for Google Analytics
|
||||||
// implementation(platform("androidx.compose:compose-bom:2023.03.00"))
|
implementation("com.google.firebase:firebase-analytics")
|
||||||
// implementation("androidx.compose.ui:ui")
|
implementation("com.google.firebase:firebase-crashlytics")
|
||||||
// implementation("androidx.compose.ui:ui-graphics")
|
implementation("com.google.firebase:firebase-config")
|
||||||
// implementation("androidx.compose.ui:ui-tooling-preview")
|
|
||||||
// implementation("androidx.compose.material3:material3")
|
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Appnext、Bigo)
|
||||||
// testImplementation("junit:junit:4.13.2")
|
|
||||||
// androidTestImplementation("androidx.sounds.ext:junit:1.1.5")
|
//Anythink (Necessary)
|
||||||
// androidTestImplementation("androidx.sounds.espresso:espresso-core:3.5.1")
|
implementation("com.anythink.sdk:core-tpn:6.4.07")
|
||||||
// androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
|
implementation("com.anythink.sdk:nativead-tpn:6.4.07")
|
||||||
// androidTestImplementation("androidx.compose.ui:ui-sounds-junit4")
|
implementation("com.anythink.sdk:banner-tpn:6.4.07")
|
||||||
// debugImplementation("androidx.compose.ui:ui-tooling")
|
implementation("com.anythink.sdk:interstitial-tpn:6.4.07")
|
||||||
// debugImplementation("androidx.compose.ui:ui-sounds-manifest")
|
implementation("com.anythink.sdk:rewardedvideo-tpn:6.4.07")
|
||||||
|
implementation("com.anythink.sdk:splash-tpn:6.4.07")
|
||||||
|
|
||||||
|
//Androidx (Necessary)
|
||||||
|
implementation("androidx.appcompat:appcompat:1.1.0")
|
||||||
|
implementation("androidx.browser:browser:1.4.0")
|
||||||
|
|
||||||
|
//StartApp
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-startapp:6.4.07")
|
||||||
|
implementation("com.startapp:inapp-sdk:5.0.2")
|
||||||
|
|
||||||
|
//Appnext
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-appnext:6.4.07")
|
||||||
|
implementation("com.appnext.sdk:ads:2.7.1.473")
|
||||||
|
implementation("com.appnext.sdk:banners:2.7.1.473")
|
||||||
|
implementation("com.appnext.sdk:native-ads2:2.7.1.473")
|
||||||
|
implementation("com.appnext.sdk:actions:2.4.6.472")
|
||||||
|
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
|
||||||
|
|
||||||
|
//Vungle
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-vungle:6.4.07")
|
||||||
|
implementation("com.vungle:vungle-ads:7.4.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.anythink.sdk:adapter-tpn-unityads:6.4.07")
|
||||||
|
implementation("com.unity3d.ads:unity-ads:4.12.2")
|
||||||
|
|
||||||
|
//Ironsource
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-ironsource:6.4.07")
|
||||||
|
implementation("com.ironsource.sdk:mediationsdk:8.2.1")
|
||||||
|
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.anythink.sdk:adapter-tpn-bigo:6.4.07")
|
||||||
|
implementation("com.bigossp:bigo-ads:4.9.0")
|
||||||
|
|
||||||
|
//Pangle
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.4.07")
|
||||||
|
implementation("com.pangle.global:ads-sdk:6.1.0.9")
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
|
|
||||||
|
//Inmobi
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-inmobi:6.4.07")
|
||||||
|
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.7.5")
|
||||||
|
|
||||||
|
//Mintegral
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.4.07")
|
||||||
|
implementation("com.mbridge.msdk.oversea:reward:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:newinterstitial:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbnative:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbsplash:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbbanner:16.8.11")
|
||||||
|
implementation("com.mbridge.msdk.oversea:mbbid:16.8.11")
|
||||||
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||||
|
|
||||||
|
//Chartboost
|
||||||
|
implementation("com.anythink.sdk:adapter-tpn-chartboost:6.4.07")
|
||||||
|
implementation("com.chartboost:chartboost-sdk:9.7.0")
|
||||||
|
implementation("com.chartboost:chartboost-mediation-sdk:4.9.1")
|
||||||
|
implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.7.0.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.anythink.sdk:adapter-tpn-fyber:6.4.07")
|
||||||
|
implementation("com.fyber:marketplace-sdk:8.3.0")
|
||||||
|
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||||
|
|
||||||
|
// Debugger UI Tools
|
||||||
|
//implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
||||||
}
|
}
|
||||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "622165874567",
|
||||||
|
"project_id": "prank-master-29155",
|
||||||
|
"storage_bucket": "prank-master-29155.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:622165874567:android:f8d0d7a1e83edaf39a2522",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.prank.master"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyBttFRVSslhxtI4bkFYLM1LMVTYcGNNGJE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
132
app/proguard-rules.pro
vendored
132
app/proguard-rules.pro
vendored
@ -48,4 +48,134 @@ java.lang.Object readResolve();
|
|||||||
-keepclassmembers class * extends io.objectbox.Box {
|
-keepclassmembers class * extends io.objectbox.Box {
|
||||||
<init>(...);
|
<init>(...);
|
||||||
<methods>;
|
<methods>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------Topon
|
||||||
|
-keep class com.startapp.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keep class com.truenet.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
|
||||||
|
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile,
|
||||||
|
LineNumberTable, *Annotation*, EnclosingMethod
|
||||||
|
-dontwarn android.webkit.JavascriptInterface
|
||||||
|
-dontwarn com.startapp.**
|
||||||
|
|
||||||
|
-dontwarn org.jetbrains.annotations.**
|
||||||
|
-keep class com.appnext.** { *; }
|
||||||
|
-dontwarn com.appnext.**
|
||||||
|
# Vungle
|
||||||
|
-dontwarn com.vungle.ads.**
|
||||||
|
-keepclassmembers class com.vungle.ads.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
-keep class com.vungle.ads.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Google
|
||||||
|
-keep class com.google.android.gms.** { *; }
|
||||||
|
-dontwarn com.google.android.gms.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# START OkHttp + Okio
|
||||||
|
# JSR 305 annotations are for embedding nullability information.
|
||||||
|
-dontwarn javax.annotation.**
|
||||||
|
|
||||||
|
|
||||||
|
# A resource is loaded with a relative path so the package of this class must be preserved.
|
||||||
|
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
|
||||||
|
|
||||||
|
|
||||||
|
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||||
|
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||||
|
|
||||||
|
|
||||||
|
# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
|
||||||
|
-dontwarn okhttp3.internal.platform.**
|
||||||
|
-dontwarn org.conscrypt.**
|
||||||
|
-dontwarn org.bouncycastle.**
|
||||||
|
-dontwarn org.openjsse.**
|
||||||
|
|
||||||
|
|
||||||
|
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||||
|
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||||
|
|
||||||
|
|
||||||
|
# END OkHttp + Okio
|
||||||
|
|
||||||
|
|
||||||
|
# START Protobuf
|
||||||
|
-dontwarn com.google.protobuf.**
|
||||||
|
-keepclassmembers class com.google.protobuf.** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
|
||||||
|
|
||||||
|
|
||||||
|
# END Protobuf
|
||||||
|
-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface {
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
-keepclassmembers class * implements android.os.Parcelable {
|
||||||
|
public static final android.os.Parcelable$Creator *;
|
||||||
|
}
|
||||||
|
-keep public class com.google.android.gms.ads.** {
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
-keep class com.ironsource.adapters.** { *;
|
||||||
|
}
|
||||||
|
-dontwarn com.ironsource.mediationsdk.**
|
||||||
|
-dontwarn com.ironsource.adapters.**
|
||||||
|
-keepattributes JavascriptInterface
|
||||||
|
-keepclassmembers class * {
|
||||||
|
@android.webkit.JavascriptInterface <methods>;
|
||||||
|
}
|
||||||
|
-keep class com.bytedance.sdk.** { *; }
|
||||||
|
-keep class com.inmobi.** { *; }
|
||||||
|
-keep public class com.google.android.gms.**
|
||||||
|
-dontwarn com.google.android.gms.**
|
||||||
|
-dontwarn com.squareup.picasso.**
|
||||||
|
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
|
||||||
|
public *;
|
||||||
|
}
|
||||||
|
# skip the Picasso library classes
|
||||||
|
-keep class com.squareup.picasso.** {*;}
|
||||||
|
-dontwarn com.squareup.okhttp.**
|
||||||
|
# skip Moat classes
|
||||||
|
-keep class com.moat.** {*;}
|
||||||
|
-dontwarn com.moat.**
|
||||||
|
# skip IAB classes
|
||||||
|
-keep class com.iab.** {*;}
|
||||||
|
-dontwarn com.iab.**
|
||||||
|
-keepattributes Signature
|
||||||
|
-keepattributes *Annotation*
|
||||||
|
-keep class com.mbridge.** {*; }
|
||||||
|
-keep interface com.mbridge.** {*; }
|
||||||
|
-keep class android.support.v4.** { *; }
|
||||||
|
-dontwarn com.mbridge.**
|
||||||
|
-keep class **.R$* { public static final int mbridge*; }
|
||||||
|
-keep public class com.mbridge.* extends androidx.** { *; }
|
||||||
|
-keep public class androidx.viewpager.widget.PagerAdapter{ *; }
|
||||||
|
-keep public class androidx.viewpager.widget.ViewPager.OnPageChangeListener{ *; }
|
||||||
|
-keep interface androidx.annotation.IntDef{ *; }
|
||||||
|
-keep interface androidx.annotation.Nullable{ *; }
|
||||||
|
-keep interface androidx.annotation.CheckResult{ *; }
|
||||||
|
-keep interface androidx.annotation.NonNull{ *; }
|
||||||
|
-keep public class androidx.fragment.app.Fragment{ *; }
|
||||||
|
-keep public class androidx.core.content.FileProvider{ *; }
|
||||||
|
-keep public class androidx.core.app.NotificationCompat{ *; }
|
||||||
|
-keep public class androidx.appcompat.widget.AppCompatImageView { *; }
|
||||||
|
-keep public class androidx.recyclerview.*{ *; }
|
||||||
|
-keep class com.chartboost.** { *; }
|
||||||
|
|
||||||
|
#---------------------------------------------Topon
|
||||||
@ -44,7 +44,7 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.MySplashActivity"
|
android:name=".ui.MySplasActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@ -4,9 +4,12 @@ import android.app.Application;
|
|||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
|
||||||
|
import com.anythink.core.api.ATSDK;
|
||||||
|
import com.anythink.core.api.NetTrafficeCallback;
|
||||||
import com.prank.master.db.Bean;
|
import com.prank.master.db.Bean;
|
||||||
import com.prank.master.db.Category;
|
import com.prank.master.db.Category;
|
||||||
import com.prank.master.db.ObManager;
|
import com.prank.master.db.ObManager;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
import com.prank.master.utils.CommonUtils;
|
import com.prank.master.utils.CommonUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -19,10 +22,17 @@ public class MyApp extends Application {
|
|||||||
public static Typeface defaultFont;
|
public static Typeface defaultFont;
|
||||||
public static List<Category> bean;
|
public static List<Category> bean;
|
||||||
|
|
||||||
|
public static String TAG = "---------Prank Master-----";
|
||||||
|
|
||||||
|
private String APPId ="";
|
||||||
|
|
||||||
|
private String AppKey ="";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
app = this;
|
app = this;
|
||||||
|
initSDk();
|
||||||
AssetManager assets = getAssets();
|
AssetManager assets = getAssets();
|
||||||
defaultFont = Typeface.createFromAsset(assets, "115_Black.ttf");
|
defaultFont = Typeface.createFromAsset(assets, "115_Black.ttf");
|
||||||
ObManager.init(this);
|
ObManager.init(this);
|
||||||
@ -44,4 +54,25 @@ public class MyApp extends Application {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initSDk(){
|
||||||
|
ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResultCallback(boolean isEU) {
|
||||||
|
if (isEU && ATSDK.getGDPRDataLevel(MyApp.this) == ATSDK.UNKNOWN) {
|
||||||
|
ATSDK.showGdprAuth(MyApp.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onErrorCallback(String errorMsg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ATSDK.init( this, APPId, AppKey);
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.prank.master.adapter;
|
package com.prank.master.adapter;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -11,9 +12,12 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.prank.master.databinding.ItemHomeBinding;
|
import com.prank.master.databinding.ItemHomeBinding;
|
||||||
import com.prank.master.db.Category;
|
import com.prank.master.db.Category;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
|
import com.prank.master.topon.onActionListener;
|
||||||
import com.prank.master.ui.AllActivity;
|
import com.prank.master.ui.AllActivity;
|
||||||
import com.prank.master.utils.ConstValues;
|
import com.prank.master.utils.ConstValues;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -21,11 +25,12 @@ public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.ViewHolder> {
|
|||||||
|
|
||||||
private final List<Category> mValues;
|
private final List<Category> mValues;
|
||||||
|
|
||||||
private Context mCon;
|
|
||||||
|
|
||||||
public HomeAdapter(Context context, List<Category> items) {
|
private WeakReference<Activity> mCon;
|
||||||
|
|
||||||
|
public HomeAdapter(Activity context, List<Category> items) {
|
||||||
mValues = items;
|
mValues = items;
|
||||||
this.mCon = context;
|
this.mCon = new WeakReference<>(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -39,14 +44,24 @@ public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.ViewHolder> {
|
|||||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||||
Category category = mValues.get(position);
|
Category category = mValues.get(position);
|
||||||
String covert = category.getCovert();
|
String covert = category.getCovert();
|
||||||
Glide.with(mCon).load(covert).into(holder.vb.image);
|
Glide.with(mCon.get()).load(covert).into(holder.vb.image);
|
||||||
holder.vb.name.setText(category.getName());
|
holder.vb.name.setText(category.getName());
|
||||||
holder.vb.relative.setOnClickListener(new View.OnClickListener() {
|
holder.vb.relative.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(mCon, AllActivity.class);
|
Activity activity = mCon.get();
|
||||||
intent.putExtra(ConstValues.KEY_LIST_DATA, category);
|
if(activity!= null){
|
||||||
mCon.startActivity(intent);
|
AdManager.showTopOn(activity, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
Intent intent = new Intent(activity, AllActivity.class);
|
||||||
|
intent.putExtra(ConstValues.KEY_LIST_DATA, category);
|
||||||
|
activity.startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
10
app/src/main/java/com/prank/master/topon/AdListener.java
Normal file
10
app/src/main/java/com/prank/master/topon/AdListener.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package com.prank.master.topon;
|
||||||
|
|
||||||
|
public interface AdListener {
|
||||||
|
void loadFail(String placeId);
|
||||||
|
void showSuccess();
|
||||||
|
|
||||||
|
void showFail();
|
||||||
|
|
||||||
|
void showClose();
|
||||||
|
}
|
||||||
245
app/src/main/java/com/prank/master/topon/AdManager.java
Normal file
245
app/src/main/java/com/prank/master/topon/AdManager.java
Normal file
@ -0,0 +1,245 @@
|
|||||||
|
package com.prank.master.topon;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.anythink.core.api.ATAdInfo;
|
||||||
|
import com.anythink.core.api.AdError;
|
||||||
|
import com.anythink.interstitial.api.ATInterstitial;
|
||||||
|
import com.anythink.interstitial.api.ATInterstitialListener;
|
||||||
|
import com.prank.master.MyApp;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AdManager {
|
||||||
|
|
||||||
|
private static final int type_no_cache = 0;
|
||||||
|
private static final int type_has_cache = 1;
|
||||||
|
private static final int type_show_success = 2;
|
||||||
|
private static final int type_show_close = 3;
|
||||||
|
private static final int type_show_fail = 4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static final String place1Id = "";
|
||||||
|
private static final String place2Id = "";
|
||||||
|
private static final String place3Id = "";
|
||||||
|
|
||||||
|
|
||||||
|
private static boolean place1LoadFail = false;
|
||||||
|
private static boolean place2LoadFail = false;
|
||||||
|
private static boolean place3LoadFail = false;
|
||||||
|
|
||||||
|
private static boolean alreadyShow = false;
|
||||||
|
|
||||||
|
private static List<ATInterstitial> list = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
public static void loadAllAd() {
|
||||||
|
if (list.size() == 0) {
|
||||||
|
ATInterstitial mInterstitialAd1 = new ATInterstitial(MyApp.app, place1Id);
|
||||||
|
ATInterstitial mInterstitialAd2 = new ATInterstitial(MyApp.app, place2Id);
|
||||||
|
ATInterstitial mInterstitialAd3 = new ATInterstitial(MyApp.app, place3Id);
|
||||||
|
list.add(mInterstitialAd1);
|
||||||
|
list.add(mInterstitialAd2);
|
||||||
|
list.add(mInterstitialAd3);
|
||||||
|
}
|
||||||
|
for (ATInterstitial ad : list) {
|
||||||
|
if (!ad.isAdReady()) {
|
||||||
|
setCallBack(ad, new AdListener() {
|
||||||
|
@Override
|
||||||
|
public void loadFail(@NonNull String placeId) {
|
||||||
|
if (placeId.equals(place1Id)) {
|
||||||
|
place1LoadFail = true;
|
||||||
|
}
|
||||||
|
if (placeId.equals(place2Id)) {
|
||||||
|
place2LoadFail = true;
|
||||||
|
}
|
||||||
|
if (placeId.equals(place3Id)) {
|
||||||
|
place3LoadFail = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showSuccess() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showFail() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showClose() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ad.load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ATInterstitial getReadyAd() {
|
||||||
|
Collections.shuffle(list);
|
||||||
|
for (ATInterstitial ad : list) {
|
||||||
|
if (ad.isAdReady()) {
|
||||||
|
Log.d(MyApp.TAG, "-has Cache------------");
|
||||||
|
return ad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d(MyApp.TAG, "-No Cache------------");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setCallBack(ATInterstitial ad, AdListener listener) {
|
||||||
|
ad.setAdListener(new ATInterstitialListener() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdLoaded() {
|
||||||
|
Log.d(MyApp.TAG, "LoadLoaded " + ad.mPlacementId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdLoadFail(AdError adError) {
|
||||||
|
listener.loadFail(ad.mPlacementId);
|
||||||
|
Log.d(MyApp.TAG, "LoadFail:--" + ad.mPlacementId + "--" + adError.getCode() + "---" + adError.getDesc());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdClicked(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
|
||||||
|
Log.d(MyApp.TAG, "AdShow " + atAdInfo.getShowId());
|
||||||
|
listener.showSuccess();
|
||||||
|
ad.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdClose(ATAdInfo atAdInfo) {
|
||||||
|
listener.showClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdVideoStart(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdVideoEnd(ATAdInfo atAdInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInterstitialAdVideoError(AdError adError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static CountDownTimer showWelcomeAd(
|
||||||
|
Activity activity,
|
||||||
|
Long totalTim,
|
||||||
|
CountAction countAction,
|
||||||
|
GoMainAction goMain
|
||||||
|
) {
|
||||||
|
Log.d(MyApp.TAG,"----------alreadyShow="+alreadyShow);
|
||||||
|
alreadyShow = false;
|
||||||
|
CountDownTimer timer = new CountDownTimer(totalTim, 100) {
|
||||||
|
@Override
|
||||||
|
public void onTick(long millisUntilFinished) {
|
||||||
|
countAction.onCount(millisUntilFinished);
|
||||||
|
if (!alreadyShow) {
|
||||||
|
showAD(activity, new AdStatusAction() {
|
||||||
|
@Override
|
||||||
|
public void onStatus(int adType) {
|
||||||
|
if (adType == type_has_cache) {
|
||||||
|
alreadyShow = true;
|
||||||
|
}
|
||||||
|
if (adType == type_show_close || adType == type_show_fail) {
|
||||||
|
goMain.onGo();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
if (!alreadyShow) {
|
||||||
|
showTopOn(activity, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
goMain.onGo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
return timer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static void showAD(Activity activity, AdStatusAction action) {
|
||||||
|
ATInterstitial readyAd = getReadyAd();
|
||||||
|
if (readyAd != null) {
|
||||||
|
action.onStatus(type_has_cache);
|
||||||
|
setCallBack(readyAd, new AdListener() {
|
||||||
|
@Override
|
||||||
|
public void loadFail(@NonNull String placeId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showSuccess() {
|
||||||
|
action.onStatus(type_show_success);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showFail() {
|
||||||
|
action.onStatus(type_show_fail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showClose() {
|
||||||
|
action.onStatus(type_show_close);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
readyAd.show(activity);
|
||||||
|
} else {
|
||||||
|
action.onStatus(type_no_cache);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void showTopOn(Activity activity, onActionListener listener) {
|
||||||
|
showAD(activity, new AdStatusAction() {
|
||||||
|
@Override
|
||||||
|
public void onStatus(int adType) {
|
||||||
|
if (adType == type_no_cache || adType == type_show_close || adType == type_show_fail) {
|
||||||
|
listener.onAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.prank.master.topon;
|
||||||
|
|
||||||
|
public interface AdStatusAction {
|
||||||
|
void onStatus(int adType);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.prank.master.topon;
|
||||||
|
|
||||||
|
public interface CountAction {
|
||||||
|
void onCount(long millisUntilFinished);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.prank.master.topon;
|
||||||
|
|
||||||
|
public interface GoMainAction {
|
||||||
|
void onGo();
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.prank.master.topon;
|
||||||
|
|
||||||
|
public interface onActionListener {
|
||||||
|
|
||||||
|
void onAction();
|
||||||
|
}
|
||||||
@ -9,6 +9,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
import com.prank.master.adapter.AllAdapter;
|
import com.prank.master.adapter.AllAdapter;
|
||||||
import com.prank.master.databinding.ActivityAllBinding;
|
import com.prank.master.databinding.ActivityAllBinding;
|
||||||
import com.prank.master.db.Category;
|
import com.prank.master.db.Category;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
import com.prank.master.utils.CommonUtils;
|
import com.prank.master.utils.CommonUtils;
|
||||||
import com.prank.master.utils.ConstValues;
|
import com.prank.master.utils.ConstValues;
|
||||||
import com.prank.master.utils.MyDecoration;
|
import com.prank.master.utils.MyDecoration;
|
||||||
@ -22,6 +23,7 @@ public class AllActivity extends AppCompatActivity implements View.OnClickListen
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
CommonUtils.setStatusBarTextColor(this,true);
|
CommonUtils.setStatusBarTextColor(this,true);
|
||||||
|
AdManager.loadAllAd();
|
||||||
activityListBinding = ActivityAllBinding.inflate(getLayoutInflater());
|
activityListBinding = ActivityAllBinding.inflate(getLayoutInflater());
|
||||||
setContentView(activityListBinding.getRoot());
|
setContentView(activityListBinding.getRoot());
|
||||||
data = (Category) getIntent().getSerializableExtra(ConstValues.KEY_LIST_DATA);
|
data = (Category) getIntent().getSerializableExtra(ConstValues.KEY_LIST_DATA);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public class HomeFragment extends Fragment {
|
|||||||
MyDecoration myDecoration = new MyDecoration(10, 10, 5);
|
MyDecoration myDecoration = new MyDecoration(10, 10, 5);
|
||||||
binding.recyclerView.addItemDecoration(myDecoration);
|
binding.recyclerView.addItemDecoration(myDecoration);
|
||||||
binding.recyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 3));
|
binding.recyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 3));
|
||||||
binding.recyclerView.setAdapter(new HomeAdapter(requireContext(), MyApp.bean));
|
binding.recyclerView.setAdapter(new HomeAdapter(requireActivity(), MyApp.bean));
|
||||||
initAudioData();
|
initAudioData();
|
||||||
binding.linearPlay.setOnClickListener(new View.OnClickListener() {
|
binding.linearPlay.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.prank.master.R;
|
import com.prank.master.R;
|
||||||
import com.prank.master.databinding.ActivityMainBinding;
|
import com.prank.master.databinding.ActivityMainBinding;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
import com.prank.master.utils.CommonUtils;
|
import com.prank.master.utils.CommonUtils;
|
||||||
import com.prank.master.utils.ConstValues;
|
import com.prank.master.utils.ConstValues;
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater());
|
activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||||
setContentView(activityMainBinding.getRoot());
|
setContentView(activityMainBinding.getRoot());
|
||||||
CommonUtils.setStatusBarTextColor(this, true);
|
CommonUtils.setStatusBarTextColor(this, true);
|
||||||
|
AdManager.loadAllAd();
|
||||||
initVp2();
|
initVp2();
|
||||||
activityMainBinding.frameHome.setOnClickListener(this);
|
activityMainBinding.frameHome.setOnClickListener(this);
|
||||||
activityMainBinding.frameAdd.setOnClickListener(this);
|
activityMainBinding.frameAdd.setOnClickListener(this);
|
||||||
@ -67,23 +69,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// audioPickerLauncher = registerForActivityResult(
|
|
||||||
// new ActivityResultContracts.StartActivityForResult(),
|
|
||||||
// result -> {
|
|
||||||
// if (result.getResultCode() == Activity.RESULT_OK && result.getData() != null) {
|
|
||||||
// Intent data = result.getData();
|
|
||||||
// Uri selectedAudioUri = data.getData();
|
|
||||||
// if (selectedAudioUri != null) {
|
|
||||||
// long duration = CommonUtils.getAudioDuration(MainActivity.this, selectedAudioUri);
|
|
||||||
// Intent intent = new Intent(MainActivity.this, SaveActivity.class);
|
|
||||||
// intent.putExtra(SaveActivity.KEY_Path, selectedAudioUri.toString());
|
|
||||||
// intent.putExtra(SaveActivity.KEY_Time, duration);
|
|
||||||
// startActivity(intent);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initVp2() {
|
private void initVp2() {
|
||||||
|
|||||||
@ -7,10 +7,13 @@ import android.os.CountDownTimer;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.prank.master.databinding.ActivitySplashBinding;
|
import com.prank.master.databinding.ActivitySplashBinding;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
|
import com.prank.master.topon.CountAction;
|
||||||
|
import com.prank.master.topon.GoMainAction;
|
||||||
|
|
||||||
public class MySplashActivity extends AppCompatActivity {
|
public class MySplasActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private long time = 1000;
|
private long time = 11000;
|
||||||
private ActivitySplashBinding binding;
|
private ActivitySplashBinding binding;
|
||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
|
|
||||||
@ -20,19 +23,19 @@ public class MySplashActivity extends AppCompatActivity {
|
|||||||
binding = ActivitySplashBinding.inflate(getLayoutInflater());
|
binding = ActivitySplashBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
countDownTimer = new CountDownTimer(time, 200) {
|
countDownTimer = AdManager.showWelcomeAd(MySplasActivity.this, time, new CountAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onTick(long millisUntilFinished) {
|
public void onCount(long millisUntilFinished) {
|
||||||
int progressPercentage = (int) ((100 * millisUntilFinished) / time);
|
int progressPercentage = (int) ((100 * millisUntilFinished) / time);
|
||||||
int Percentage = 100 - progressPercentage;
|
int Percentage = 100 - progressPercentage;
|
||||||
binding.loadingPb.setProgress(Percentage);
|
binding.loadingPb.setProgress(Percentage);
|
||||||
}
|
}
|
||||||
|
}, new GoMainAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onGo() {
|
||||||
welcomeMain();
|
welcomeMain();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
countDownTimer.start();
|
countDownTimer.start();
|
||||||
}
|
}
|
||||||
@ -19,6 +19,8 @@ import com.prank.master.R;
|
|||||||
import com.prank.master.databinding.ActivityPlayBinding;
|
import com.prank.master.databinding.ActivityPlayBinding;
|
||||||
import com.prank.master.db.Bean;
|
import com.prank.master.db.Bean;
|
||||||
import com.prank.master.db.ObManager;
|
import com.prank.master.db.ObManager;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
|
import com.prank.master.topon.onActionListener;
|
||||||
import com.prank.master.utils.CommonUtils;
|
import com.prank.master.utils.CommonUtils;
|
||||||
import com.prank.master.utils.ConstValues;
|
import com.prank.master.utils.ConstValues;
|
||||||
import com.prank.master.utils.OnClickTimer;
|
import com.prank.master.utils.OnClickTimer;
|
||||||
@ -45,6 +47,13 @@ public class PlayActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
setContentView(playBinding.getRoot());
|
setContentView(playBinding.getRoot());
|
||||||
CommonUtils.setStatusBarTextColor(this, true);
|
CommonUtils.setStatusBarTextColor(this, true);
|
||||||
bean = (Bean) getIntent().getSerializableExtra(ConstValues.KEY_PLAY_DATA);
|
bean = (Bean) getIntent().getSerializableExtra(ConstValues.KEY_PLAY_DATA);
|
||||||
|
AdManager.loadAllAd();
|
||||||
|
AdManager.showTopOn(this, new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
initAudio();
|
initAudio();
|
||||||
String covert = bean.getCovert();
|
String covert = bean.getCovert();
|
||||||
if (covert != null && !covert.isEmpty()) {
|
if (covert != null && !covert.isEmpty()) {
|
||||||
@ -166,26 +175,39 @@ public class PlayActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
if (v.equals(playBinding.back)) {
|
if (v.equals(playBinding.back)) {
|
||||||
finish();
|
finish();
|
||||||
} else if (v.equals(playBinding.linearPlay)) {
|
} else if (v.equals(playBinding.linearPlay)) {
|
||||||
boolean selected = playBinding.btnPlay.isSelected();
|
|
||||||
if (selected) {
|
AdManager.showTopOn(PlayActivity.this, new onActionListener() {
|
||||||
if (mediaPlayer.isPlaying()) {
|
@Override
|
||||||
mediaPlayer.pause();
|
public void onAction() {
|
||||||
|
boolean selected = playBinding.btnPlay.isSelected();
|
||||||
|
if (selected) {
|
||||||
|
if (mediaPlayer.isPlaying()) {
|
||||||
|
mediaPlayer.pause();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!mediaPlayer.isPlaying()) {
|
||||||
|
mediaPlayer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playBinding.btnPlay.setSelected(!selected);
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
if (!mediaPlayer.isPlaying()) {
|
|
||||||
mediaPlayer.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
playBinding.btnPlay.setSelected(!selected);
|
|
||||||
|
|
||||||
} else if (v.equals(playBinding.imLike)) {
|
} else if (v.equals(playBinding.imLike)) {
|
||||||
playBinding.imLike.setSelected(!playBinding.imLike.isSelected());
|
AdManager.showTopOn(PlayActivity.this, new onActionListener() {
|
||||||
boolean selected = playBinding.imLike.isSelected();
|
@Override
|
||||||
if (selected) {
|
public void onAction() {
|
||||||
ObManager.addLike(bean);
|
playBinding.imLike.setSelected(!playBinding.imLike.isSelected());
|
||||||
} else {
|
boolean selected = playBinding.imLike.isSelected();
|
||||||
ObManager.removeLike(bean);
|
if (selected) {
|
||||||
}
|
ObManager.addLike(bean);
|
||||||
|
} else {
|
||||||
|
ObManager.removeLike(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} else if (v.equals(playBinding.imLoop)) {
|
} else if (v.equals(playBinding.imLoop)) {
|
||||||
playBinding.imLoop.setSelected(!playBinding.imLoop.isSelected());
|
playBinding.imLoop.setSelected(!playBinding.imLoop.isSelected());
|
||||||
mediaPlayer.setLooping(playBinding.imLoop.isSelected());
|
mediaPlayer.setLooping(playBinding.imLoop.isSelected());
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
|
|
||||||
import com.prank.master.R;
|
import com.prank.master.R;
|
||||||
import com.prank.master.databinding.ActivityRecordAudioBinding;
|
import com.prank.master.databinding.ActivityRecordAudioBinding;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
import com.prank.master.utils.AudioRecorder;
|
import com.prank.master.utils.AudioRecorder;
|
||||||
import com.prank.master.utils.CommonUtils;
|
import com.prank.master.utils.CommonUtils;
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ public class RecordAudioActivity extends AppCompatActivity {
|
|||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
CommonUtils.setStatusBarTextColor(this, true);
|
CommonUtils.setStatusBarTextColor(this, true);
|
||||||
audioRecorder = new AudioRecorder(this);
|
audioRecorder = new AudioRecorder(this);
|
||||||
|
AdManager.loadAllAd();
|
||||||
binding.audioTime.setText(R.string.time_init);
|
binding.audioTime.setText(R.string.time_init);
|
||||||
|
|
||||||
initEvent();
|
initEvent();
|
||||||
|
|||||||
@ -19,6 +19,8 @@ import com.prank.master.adapter.likeAdapter;
|
|||||||
import com.prank.master.databinding.FragmentRecordBinding;
|
import com.prank.master.databinding.FragmentRecordBinding;
|
||||||
import com.prank.master.db.Bean;
|
import com.prank.master.db.Bean;
|
||||||
import com.prank.master.db.ObManager;
|
import com.prank.master.db.ObManager;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
|
import com.prank.master.topon.onActionListener;
|
||||||
import com.prank.master.utils.ConstValues;
|
import com.prank.master.utils.ConstValues;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -82,7 +84,13 @@ public class RecordFragment extends Fragment {
|
|||||||
binding.recordBtn.setOnClickListener(new View.OnClickListener() {
|
binding.recordBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
checkAndRequestAudioPermission();
|
AdManager.showTopOn(requireActivity(), new onActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
checkAndRequestAudioPermission();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import com.prank.master.R;
|
|||||||
import com.prank.master.databinding.ActivitySaveBinding;
|
import com.prank.master.databinding.ActivitySaveBinding;
|
||||||
import com.prank.master.db.Bean;
|
import com.prank.master.db.Bean;
|
||||||
import com.prank.master.db.ObManager;
|
import com.prank.master.db.ObManager;
|
||||||
|
import com.prank.master.topon.AdManager;
|
||||||
|
import com.prank.master.topon.onActionListener;
|
||||||
import com.prank.master.utils.CommonUtils;
|
import com.prank.master.utils.CommonUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -48,7 +50,7 @@ public class SaveAudioActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
binding = ActivitySaveBinding.inflate(getLayoutInflater());
|
binding = ActivitySaveBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
AdManager.loadAllAd();
|
||||||
CommonUtils.setStatusBarTextColor(this, true);
|
CommonUtils.setStatusBarTextColor(this, true);
|
||||||
binding.audioTime.setText(R.string.time_init);
|
binding.audioTime.setText(R.string.time_init);
|
||||||
initData();
|
initData();
|
||||||
@ -137,20 +139,28 @@ public class SaveAudioActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.save.setOnClickListener(v -> {
|
binding.save.setOnClickListener(v -> {
|
||||||
String name = binding.saveEdit.getText().toString().trim();
|
|
||||||
boolean b = ObManager.checkName(name);
|
AdManager.showTopOn(SaveAudioActivity.this, new onActionListener() {
|
||||||
if (!TextUtils.isEmpty(name)) {
|
@Override
|
||||||
if(!b){
|
public void onAction() {
|
||||||
binding.saveEdit.setText("");
|
String name = binding.saveEdit.getText().toString().trim();
|
||||||
Toast.makeText(SaveAudioActivity.this, getString(R.string.name_hint), Toast.LENGTH_SHORT).show();
|
boolean b = ObManager.checkName(name);
|
||||||
return;
|
if (!TextUtils.isEmpty(name)) {
|
||||||
|
if(!b){
|
||||||
|
binding.saveEdit.setText("");
|
||||||
|
Toast.makeText(SaveAudioActivity.this, getString(R.string.name_hint), Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
saveData(name);
|
||||||
|
Toast.makeText(SaveAudioActivity.this, getString(R.string.save_tips), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(SaveAudioActivity.this, getString(R.string.save_tip), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
saveData(name);
|
});
|
||||||
Toast.makeText(SaveAudioActivity.this, getString(R.string.save_tips), Toast.LENGTH_SHORT).show();
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(SaveAudioActivity.this, getString(R.string.save_tip), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".ui.MySplashActivity">
|
tools:context=".ui.MySplasActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.1.3" apply false
|
id("com.android.application") version "8.1.3" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
|
id("org.jetbrains.kotlin.android") version "1.8.10" 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
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|||||||
@ -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 -Dfile.encoding=UTF-8
|
||||||
# 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. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
|||||||
@ -12,6 +12,28 @@ dependencyResolutionManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
||||||
|
//Anythink(Core)
|
||||||
|
maven ("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||||
|
|
||||||
|
//Appnext
|
||||||
|
maven ("https://dl.appnext.com")
|
||||||
|
|
||||||
|
//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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user