V1.0.3(4) TopOn
This commit is contained in:
parent
dd13ebfabf
commit
b8ad1add14
@ -1,8 +1,11 @@
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
id("io.objectbox")
|
||||
}
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
@ -12,12 +15,15 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
//com.nature.free.variouswallpaper
|
||||
applicationId = "com.nature.free.variouswallpaper.test"
|
||||
applicationId = "com.nature.free.variouswallpaper"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 2
|
||||
versionName = "1.0.1"
|
||||
setProperty("archivesBaseName", "Various Wallpapers_V" + versionName + "(${versionCode})_$timestamp")
|
||||
versionCode = 4
|
||||
versionName = "1.0.3"
|
||||
setProperty(
|
||||
"archivesBaseName",
|
||||
"Various Wallpapers_V" + versionName + "(${versionCode})_$timestamp"
|
||||
)
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@ -35,7 +41,7 @@ android {
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
buildFeatures{
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
}
|
||||
@ -48,7 +54,69 @@ dependencies {
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||
annotationProcessor ("com.github.bumptech.glide:compiler:4.16.0")
|
||||
implementation("com.github.bumptech.glide:glide:4.16.0")
|
||||
annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")
|
||||
|
||||
//-----------------------------------------------TopOn(Pangle、IronSource、mintegral、unityads、liftoff(vungle)、Bigo)
|
||||
//Anythink (Necessary)
|
||||
implementation("com.anythink.sdk:core-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:nativead-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:banner-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:interstitial-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:rewardedvideo-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:splash-tpn:6.3.68")
|
||||
|
||||
//Androidx (Necessary)
|
||||
implementation("androidx.appcompat:appcompat:1.1.0")
|
||||
implementation("androidx.browser:browser:1.4.0")
|
||||
|
||||
//Vungle
|
||||
implementation("com.anythink.sdk:adapter-tpn-vungle:6.3.68")
|
||||
implementation("com.vungle:vungle-ads:7.3.2")
|
||||
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.3.68")
|
||||
implementation("com.unity3d.ads:unity-ads:4.9.3")
|
||||
|
||||
//Ironsource
|
||||
implementation("com.anythink.sdk:adapter-tpn-ironsource:6.3.68")
|
||||
implementation("com.ironsource.sdk:mediationsdk:8.1.0")
|
||||
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.3.68")
|
||||
implementation("com.bigossp:bigo-ads:4.7.4")
|
||||
|
||||
//Mintegral
|
||||
implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.3.68")
|
||||
implementation("com.mbridge.msdk.oversea:reward:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbnative:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbsplash:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbanner:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
|
||||
//Pangle
|
||||
implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.3.68.1")
|
||||
implementation( "com.pangle.global:ads-sdk:6.0.0.3")
|
||||
implementation( "com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//Tramini
|
||||
implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68")
|
||||
|
||||
// Debugger UI Tools
|
||||
implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
||||
//----------------------------------------------TopOn()
|
||||
|
||||
//----------------firebase
|
||||
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
||||
implementation("com.google.firebase:firebase-crashlytics")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
}
|
||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "398950054188",
|
||||
"project_id": "various-wallpapers-256cd",
|
||||
"storage_bucket": "various-wallpapers-256cd.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:398950054188:android:1f462416633c2370b49489",
|
||||
"android_client_info": {
|
||||
"package_name": "com.nature.free.variouswallpaper"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBcZY9sGDE_nYutuo7wjS6lcW6GfJLWCQg"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
95
app/proguard-rules.pro
vendored
95
app/proguard-rules.pro
vendored
@ -44,4 +44,97 @@ java.lang.Object writeReplace();
|
||||
|
||||
java.lang.Object readResolve();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------Topon
|
||||
# Vungle
|
||||
-dontwarn com.vungle.ads.**
|
||||
-keepclassmembers 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.** { *; }
|
||||
-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.*{ *; }
|
||||
#---------------------------------------------Topon
|
||||
@ -19,7 +19,7 @@
|
||||
android:theme="@style/Theme.MyWallpaper"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".WelActivity"
|
||||
android:name=".SplashActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@ -37,6 +37,7 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:exported="false">
|
||||
|
||||
</activity>
|
||||
|
||||
@ -19,14 +19,6 @@
|
||||
"preview": "https://resource-sg-public.lux-ad.com/wallpaper/2109145b9dad97d7d50bcbf9c7786b98.jpg",
|
||||
"source": "https://resource-sg-public.lux-ad.com/wallpaper/43f6b1c0003cfdcdf242d2aca2f60d05.jpg"
|
||||
},
|
||||
{
|
||||
"banner": "https://resource-sg-public.lux-ad.com/wallpaper/ebe0ee7221ad19eeb027ef0b426591ec.jpg",
|
||||
"love": false,
|
||||
"porWidthHeight": "1440x2560",
|
||||
"portrait": "https://resource-sg-public.lux-ad.com/wallpaper/a258dc932e307bbce47035da979ce178.jpg",
|
||||
"preview": "https://resource-sg-public.lux-ad.com/wallpaper/7214b4d7f8ed091039562dbdc16b762e.jpg",
|
||||
"source": "https://resource-sg-public.lux-ad.com/wallpaper/39593eba43d5455d2b2d40ca3b0c6780.jpg"
|
||||
},
|
||||
{
|
||||
"banner": "",
|
||||
"love": false,
|
||||
|
||||
@ -13,12 +13,15 @@ import com.nature.free.test.databinding.ActivityInfoBinding;
|
||||
import com.nature.free.test.objectbox.ObjectBox;
|
||||
import com.nature.free.test.other.MyAdapter;
|
||||
import com.nature.free.test.other.MyItemSpace;
|
||||
import com.nature.free.test.topon.AdManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.objectbox.query.Query;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
|
||||
|
||||
@ -30,16 +33,38 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AdManager.loadAllAd();
|
||||
init();
|
||||
mainBinding.back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
showTopOnAd(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
showTopOnAd(false);
|
||||
}
|
||||
|
||||
private void showTopOnAd(Boolean isfinish) {
|
||||
AdManager.showAD(InfoActivity.this, new Function1<Integer, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Integer integer) {
|
||||
if (integer == AdManager.type_no_cache || integer == AdManager.type_show_close || integer == AdManager.type_show_fail) {
|
||||
if(isfinish){
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActivityInfoBinding getMainBinding() {
|
||||
return ActivityInfoBinding.inflate(getLayoutInflater());
|
||||
@ -50,7 +75,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
|
||||
ClassData classData = getData();
|
||||
if (classData != null) {
|
||||
mainBinding.tvName.setText(classData.getTitle());
|
||||
myAdapter = new MyAdapter(this,false);
|
||||
myAdapter = new MyAdapter(this,false,false);
|
||||
myAdapter.refresh(classData.info);
|
||||
mainBinding.recycler.setLayoutManager(new GridLayoutManager(this, 2));
|
||||
mainBinding.recycler.setAdapter(myAdapter);
|
||||
|
||||
@ -18,6 +18,7 @@ import com.google.android.material.tabs.TabLayout;
|
||||
import com.nature.free.test.base.BaseActivity;
|
||||
import com.nature.free.test.databinding.ActivityMainBinding;
|
||||
import com.nature.free.test.objectbox.ObjectBox;
|
||||
import com.nature.free.test.topon.AdManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -67,7 +67,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> {
|
||||
@Override
|
||||
protected void initView() {
|
||||
List<Wallpaper> info = new ArrayList<>();
|
||||
myAdapter = new MyAdapter(requireContext(),love);
|
||||
myAdapter = new MyAdapter(requireContext(),love,true);
|
||||
if (love) {
|
||||
info.addAll(getLoves());
|
||||
myAdapter.onClickAction(new Function0<Unit>() {
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package com.nature.free.test
|
||||
|
||||
import android.app.Application
|
||||
import android.util.Log
|
||||
import com.anythink.core.api.ATSDK
|
||||
import com.anythink.core.api.NetTrafficeCallback
|
||||
import com.nature.free.test.data.ClassData
|
||||
import com.nature.free.test.objectbox.ObjectBox
|
||||
import com.nature.free.test.topon.AdManager.loadAllAd
|
||||
|
||||
|
||||
class MyWallpaper : Application() {
|
||||
@ -22,17 +26,23 @@ class MyWallpaper : Application() {
|
||||
const val TYPE_BOTH = 3
|
||||
|
||||
const val BITMAP_FILE_DIRECTORY = "MyWallpaper"
|
||||
const val isMainEnterSetKey = "main_enter"
|
||||
|
||||
const val TAG ="------------------TAG"
|
||||
}
|
||||
|
||||
private val APPId="h66a0cc207140e"
|
||||
private val AppKey="acce079c140b9d4db923f8dac460dcec8"
|
||||
private val debug_Key="4e26d6fdb6029c920a512f4d896f6331f47c82d0"
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
globalContext = this
|
||||
initTopOnSDk()
|
||||
ObjectBox.init(this)
|
||||
if (ObjectBox.getBoxBean().all.size <= 0) {
|
||||
init()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
@ -40,4 +50,23 @@ class MyWallpaper : Application() {
|
||||
data = Utils.getData(openFile)
|
||||
|
||||
}
|
||||
|
||||
private fun initTopOnSDk(){
|
||||
ATSDK.checkIsEuTraffic(this, object : NetTrafficeCallback {
|
||||
override fun onResultCallback(isEU: Boolean) {
|
||||
Log.e(TAG, "onResultCallback:$isEU")
|
||||
if (isEU && ATSDK.getGDPRDataLevel(this@MyWallpaper) == ATSDK.UNKNOWN) {
|
||||
ATSDK.showGdprAuth(this@MyWallpaper)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCallback(errorMsg: String) {
|
||||
Log.e(TAG, "onErrorCallback:$errorMsg")
|
||||
}
|
||||
})
|
||||
ATSDK.init( this, APPId, AppKey)
|
||||
loadAllAd()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
76
app/src/main/java/com/nature/free/test/SplashActivity.java
Normal file
76
app/src/main/java/com/nature/free/test/SplashActivity.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.nature.free.test;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.util.Log;
|
||||
|
||||
import com.nature.free.test.base.BaseActivity;
|
||||
import com.nature.free.test.databinding.ActivityWelBinding;
|
||||
import com.nature.free.test.topon.AdManager;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
public class SplashActivity extends BaseActivity<ActivityWelBinding> {
|
||||
|
||||
private long time = 10000;
|
||||
private CountDownTimer countDownTimer;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
countDownTimer = AdManager.showWelcomeAd(SplashActivity.this, time, new Function1<Long, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Long aLong) {
|
||||
long number = time - aLong;
|
||||
Double s = calculatePercentage(number, time);
|
||||
|
||||
mainBinding.customProgress.setProgress(s.floatValue());
|
||||
if(AdManager.INSTANCE.getPlace1LoadFail()&&AdManager.INSTANCE.getPlace2LoadFail()&&AdManager.INSTANCE.getPlace3LoadFail()){
|
||||
countDownTimer.cancel();
|
||||
goMain();
|
||||
Log.d(MyWallpaper.TAG,"-------------cancel" );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}, new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
Log.d(MyWallpaper.TAG,"-------------gomain" );
|
||||
goMain();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
countDownTimer.start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void goMain(){
|
||||
mainBinding.customProgress.setProgress(100);
|
||||
startActivity(new Intent(SplashActivity.this, MainActivity.class));
|
||||
finish();
|
||||
}
|
||||
public Double calculatePercentage(long number, long total) {
|
||||
if (total == 0) {
|
||||
return 0.00; // 防止除以0错误
|
||||
}
|
||||
return ((double) number / total) * 100;
|
||||
}
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActivityWelBinding getMainBinding() {
|
||||
return ActivityWelBinding.inflate(getLayoutInflater());
|
||||
}
|
||||
}
|
||||
@ -33,6 +33,8 @@ import com.nature.free.test.data.Wallpaper_;
|
||||
import com.nature.free.test.databinding.ActivityWallpaperBinding;
|
||||
import com.nature.free.test.objectbox.ObjectBox;
|
||||
import com.nature.free.test.other.DialogSet;
|
||||
import com.nature.free.test.other.MyAdapter;
|
||||
import com.nature.free.test.topon.AdManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -66,12 +68,17 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
|
||||
private Bitmap curBitMap;
|
||||
|
||||
private Boolean isMainEnter;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
statusbar();
|
||||
int intExtra = getIntent().getIntExtra(MyWallpaper.KEY_COLOR, getColor(R.color.main_bg));
|
||||
AdManager.loadAllAd();
|
||||
tempId = getIntent().getLongExtra(MyWallpaper.KEY_WALLPAPER, 1);
|
||||
isMainEnter = getIntent().getBooleanExtra(MyWallpaper.isMainEnterSetKey, false);
|
||||
Log.d(MyWallpaper.TAG, "--------isMainEnter" + isMainEnter);
|
||||
mWallpaper = getmWallpaper();
|
||||
mainBinding.love.setSelected(mWallpaper.getLove());
|
||||
|
||||
@ -83,7 +90,6 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
wallpaperManager = WallpaperManager.getInstance(this);
|
||||
mHandler = new Handler();
|
||||
|
||||
int maxHeapSize = (int) (Runtime.getRuntime().maxMemory() / 1024 / 1024);
|
||||
|
||||
}
|
||||
|
||||
@ -133,33 +139,40 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
}
|
||||
|
||||
private void apply(int which) {
|
||||
mainBinding.load.setVisibility(View.VISIBLE);
|
||||
if (mainBinding.check1.isSelected()) {
|
||||
setmWallpaper(which, mBitmapPro1);
|
||||
} else if (mainBinding.check2.isSelected()) {
|
||||
setmWallpaper(which, mBitmapSource);
|
||||
}
|
||||
AdManager.showAD(WallPaperActivity.this, new Function1<Integer, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Integer integer) {
|
||||
if (integer == AdManager.type_no_cache || integer == AdManager.type_show_close || integer == AdManager.type_show_fail) {
|
||||
mainBinding.load.setVisibility(View.VISIBLE);
|
||||
if (mainBinding.check1.isSelected()) {
|
||||
setmWallpaper(which, mBitmapPro1);
|
||||
} else if (mainBinding.check2.isSelected()) {
|
||||
setmWallpaper(which, mBitmapSource);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void setmWallpaper(int which, Bitmap bitmap) {
|
||||
if (bitmap == null) {
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false,mainBinding.load);
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false, mainBinding.load);
|
||||
return;
|
||||
}
|
||||
// FileInputStream fileInputStream = new FileInputStream(bitmap.getAbsolutePath());
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
|
||||
try {
|
||||
wallpaperManager.setBitmap(bitmap);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, true,mainBinding.load);
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, true, mainBinding.load);
|
||||
|
||||
} catch (IOException e) {
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false,mainBinding.load);
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false, mainBinding.load);
|
||||
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
@ -174,11 +187,9 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
|
||||
);
|
||||
}
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, true,mainBinding.load);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, true, mainBinding.load);
|
||||
} catch (IOException e) {
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false,mainBinding.load);
|
||||
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false, mainBinding.load);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -194,7 +205,7 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
int indexLast = source.lastIndexOf(".");
|
||||
String substring = source.substring(index + 1, indexLast);
|
||||
SuffixSource = source.substring(indexLast);
|
||||
Log.d("--------------tt", "-----------source SuffixSource=" + SuffixSource);
|
||||
Log.d(MyWallpaper.TAG, "-----------source SuffixSource=" + SuffixSource);
|
||||
mainBinding.tvWh2.setText(substring);
|
||||
}
|
||||
if (!mWallpaper.getPortrait().equals("null")) {
|
||||
@ -203,7 +214,7 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
int indexLast = portrait.lastIndexOf(".");
|
||||
String substring = portrait.substring(index + 1, indexLast);
|
||||
SuffixPortrait = portrait.substring(indexLast);
|
||||
Log.d("--------------tt", "-----------getPortrait SuffixPortrait=" + SuffixPortrait);
|
||||
Log.d(MyWallpaper.TAG, "-----------getPortrait SuffixPortrait=" + SuffixPortrait);
|
||||
mainBinding.tvWh1.setText(mWallpaper.getPorWidthHeight());
|
||||
loadIM1();
|
||||
}
|
||||
@ -265,7 +276,7 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(@NonNull Bitmap resource, @NonNull Object model, Target<Bitmap> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
// mBitmapPro1 = Utils.INSTANCE.fileToBitMap(mFilePro1.getAbsolutePath());
|
||||
|
||||
if (curBitMap != null && !curBitMap.isRecycled())
|
||||
curBitMap.recycle();
|
||||
curBitMap = resource.copy(Bitmap.Config.ARGB_8888, true);
|
||||
@ -274,17 +285,6 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
mainBinding.load.setVisibility(View.GONE);
|
||||
mainBinding.image.setImageBitmap(mBitmapPro1);
|
||||
|
||||
|
||||
// if (mBitmapPro1 != null) {
|
||||
//
|
||||
// } else {
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
// Toast.makeText(
|
||||
// WallPaperActivity.this,
|
||||
// getString(R.string.load_fail),
|
||||
// Toast.LENGTH_SHORT
|
||||
// ).show();
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -294,57 +294,6 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
}
|
||||
|
||||
|
||||
// private void loadBitMap2() {
|
||||
// mainBinding.load.setVisibility(View.VISIBLE);
|
||||
// Glide.with(this)
|
||||
// .asBitmap()
|
||||
// .load(mWallpaper.getSource())
|
||||
// .thumbnail(0.1f)
|
||||
// .addListener(new RequestListener<Bitmap>() {
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Bitmap> target, boolean isFirstResource) {
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
// Toast.makeText(
|
||||
// WallPaperActivity.this,
|
||||
// getString(R.string.load_fail),
|
||||
// Toast.LENGTH_SHORT
|
||||
// ).show();
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean onResourceReady(@NonNull Bitmap resource, @NonNull Object model, Target<Bitmap> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
//// mBitmapPro1 = Utils.INSTANCE.fileToBitMap(mFilePro1.getAbsolutePath());
|
||||
// mBitmapSource = resource;
|
||||
// if (curBitMap != null && !curBitMap.isRecycled())
|
||||
// curBitMap.recycle();
|
||||
// curBitMap = resource.copy(Bitmap.Config.ARGB_8888, true);
|
||||
// setCheckPos(1);
|
||||
// mainBinding.load.setVisibility(View.GONE);
|
||||
// mainBinding.image.setImageBitmap(mBitmapSource);
|
||||
//
|
||||
//
|
||||
//// if (mBitmapPro1 != null) {
|
||||
////
|
||||
//// } else {
|
||||
//// mainBinding.load.setVisibility(View.GONE);
|
||||
//// Toast.makeText(
|
||||
//// WallPaperActivity.this,
|
||||
//// getString(R.string.load_fail),
|
||||
//// Toast.LENGTH_SHORT
|
||||
//// ).show();
|
||||
//// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// }).preload();
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
private void setCheckPos(int pos) {
|
||||
if (pos == 0) {
|
||||
mainBinding.check1.setSelected(true);
|
||||
@ -358,7 +307,12 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.equals(mainBinding.back)) {
|
||||
finish();
|
||||
if (isMainEnter) {
|
||||
showTopOnAd();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
} else if (v.equals(mainBinding.check1)) {
|
||||
if (mBitmapPro1 != null) {
|
||||
setCheckPos(0);
|
||||
@ -421,4 +375,16 @@ public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> im
|
||||
mainBinding.load.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void showTopOnAd() {
|
||||
AdManager.showAD(WallPaperActivity.this, new Function1<Integer, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Integer integer) {
|
||||
if (integer == AdManager.type_no_cache || integer == AdManager.type_show_close || integer == AdManager.type_show_fail) {
|
||||
finish();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.nature.free.test;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
|
||||
import com.nature.free.test.base.BaseActivity;
|
||||
import com.nature.free.test.databinding.ActivityWelBinding;
|
||||
|
||||
public class WelActivity extends BaseActivity<ActivityWelBinding> {
|
||||
|
||||
private long time = 2000;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
new CountDownTimer(time,500){
|
||||
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
startActivity(new Intent(WelActivity.this,MainActivity.class));
|
||||
finish();
|
||||
|
||||
}
|
||||
}.start();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActivityWelBinding getMainBinding() {
|
||||
return ActivityWelBinding.inflate(getLayoutInflater());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.nature.free.test.other
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Paint
|
||||
import android.graphics.RectF
|
||||
import android.graphics.Shader
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
|
||||
class CustomProgressBar(context: Context, attrs: AttributeSet?) : View(context, attrs) {
|
||||
private var progress = 0f // 当前进度
|
||||
private val maxProgress = 100f // 最大进度
|
||||
private val progressBarHeight = 20f // 进度条高度
|
||||
private val cornerRadius = 10f // 圆角半径
|
||||
private val backgroundColor = Color.parseColor("#26FFFFFF")
|
||||
private val startColor = Color.parseColor("#FF9ce8ff") // 起始颜色
|
||||
private val middleColor = Color.parseColor("#FFa4c4fb") // 中间颜色
|
||||
private val endColor = Color.parseColor("#FFbfa4ee") // 结束颜色
|
||||
private val paint = Paint()
|
||||
private val paintTow = Paint()
|
||||
|
||||
init {
|
||||
paint.style = Paint.Style.FILL
|
||||
paint.isAntiAlias = true
|
||||
paintTow.style = Paint.Style.FILL
|
||||
paintTow.isAntiAlias = true
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
// 绘制底色矩形
|
||||
paint.shader = null // 重置着色器
|
||||
paint.color = backgroundColor
|
||||
val backgroundRect = RectF(0f, (height / 2 - progressBarHeight / 2), width.toFloat(), (height / 2 + progressBarHeight / 2))
|
||||
canvas.drawRoundRect(backgroundRect, cornerRadius, cornerRadius, paint)
|
||||
|
||||
|
||||
// 计算进度条的宽度
|
||||
val progressBarWidth = (width * progress / maxProgress)
|
||||
|
||||
// 创建颜色渐变对象
|
||||
val gradient = LinearGradient(0f, 0f, width.toFloat(), 0f, intArrayOf(startColor, middleColor, endColor), null, Shader.TileMode.CLAMP)
|
||||
paintTow.shader = gradient
|
||||
|
||||
// 绘制带圆角的进度条矩形
|
||||
val rect = RectF(0f, (height / 2 - progressBarHeight / 2), progressBarWidth.toFloat(), (height / 2 + progressBarHeight / 2))
|
||||
canvas.drawRoundRect(rect, cornerRadius, cornerRadius, paintTow)
|
||||
}
|
||||
|
||||
fun getProgress():Float{
|
||||
return progress
|
||||
}
|
||||
|
||||
// 设置进度
|
||||
fun setProgress(progress: Float) {
|
||||
this.progress = progress
|
||||
invalidate() // 请求重绘
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,7 @@ import com.nature.free.test.data.Wallpaper
|
||||
import com.nature.free.test.databinding.ItemMyAdapterBinding
|
||||
import com.nature.free.test.objectbox.ObjectBox
|
||||
|
||||
class MyAdapter constructor(private var context: Context, private var mLove: Boolean = false) :
|
||||
class MyAdapter constructor(private var context: Context, private var mLove: Boolean = false,private var mainEnter:Boolean = false) :
|
||||
RecyclerView.Adapter<MyAdapter.MyVh>() {
|
||||
|
||||
|
||||
@ -117,6 +117,7 @@ class MyAdapter constructor(private var context: Context, private var mLove: Boo
|
||||
holder.vb.root.setOnClickListener {
|
||||
context.startActivity(Intent(context, WallPaperActivity::class.java).apply {
|
||||
putExtra(MyWallpaper.KEY_COLOR, color)
|
||||
putExtra(MyWallpaper.isMainEnterSetKey,mainEnter)
|
||||
putExtra(MyWallpaper.KEY_WALLPAPER, wallpaper.id)
|
||||
})
|
||||
}
|
||||
|
||||
13
app/src/main/java/com/nature/free/test/topon/AdListener.kt
Normal file
13
app/src/main/java/com/nature/free/test/topon/AdListener.kt
Normal file
@ -0,0 +1,13 @@
|
||||
package com.nature.free.test.topon
|
||||
|
||||
import com.anythink.core.api.AdError
|
||||
|
||||
interface AdListener {
|
||||
|
||||
fun loadFail(placeId: String)
|
||||
fun showSuccess()
|
||||
|
||||
fun showFail()
|
||||
|
||||
fun showClose()
|
||||
}
|
||||
207
app/src/main/java/com/nature/free/test/topon/AdManager.kt
Normal file
207
app/src/main/java/com/nature/free/test/topon/AdManager.kt
Normal file
@ -0,0 +1,207 @@
|
||||
package com.nature.free.test.topon
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.CountDownTimer
|
||||
import android.util.Log
|
||||
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.nature.free.test.MyWallpaper
|
||||
|
||||
|
||||
object AdManager {
|
||||
|
||||
|
||||
const val type_no_cache = 0
|
||||
const val type_has_cache = 1
|
||||
const val type_show_success = 2
|
||||
const val type_show_close = 3
|
||||
const val type_show_fail = 4
|
||||
|
||||
|
||||
/**
|
||||
* 广告位ID:n66a0ccb3f4084
|
||||
* n66a0ccb3bcb32
|
||||
* n66a0ccb38879b
|
||||
*/
|
||||
|
||||
const val place1Id = "n66a0ccb3f4084"
|
||||
const val place2Id = "n66a0ccb3bcb32"
|
||||
const val place3Id = "n66a0ccb38879b"
|
||||
|
||||
val list = mutableListOf<ATInterstitial>()
|
||||
|
||||
var place1LoadFail = false
|
||||
var place2LoadFail = false
|
||||
var place3LoadFail = false
|
||||
|
||||
@JvmStatic
|
||||
fun loadAllAd() {
|
||||
if (list.size <= 0) {
|
||||
val mInterstitialAd1 = ATInterstitial(MyWallpaper.globalContext, place1Id)
|
||||
val mInterstitialAd2 = ATInterstitial(MyWallpaper.globalContext, place2Id)
|
||||
val mInterstitialAd3 = ATInterstitial(MyWallpaper.globalContext, place3Id)
|
||||
list.add(mInterstitialAd1)
|
||||
list.add(mInterstitialAd2)
|
||||
list.add(mInterstitialAd3)
|
||||
}
|
||||
for (ad in list) {
|
||||
if (!ad.isAdReady) {
|
||||
setCallBack(ad,object : AdListener {
|
||||
override fun loadFail(placeId: String) {
|
||||
if(placeId == place1Id){
|
||||
place1LoadFail = true
|
||||
}
|
||||
if(placeId == place2Id){
|
||||
place2LoadFail = true
|
||||
}
|
||||
if(placeId == place3Id){
|
||||
place3LoadFail = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun showSuccess() {
|
||||
|
||||
}
|
||||
|
||||
override fun showFail() {
|
||||
|
||||
}
|
||||
|
||||
override fun showClose() {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
Log.d(MyWallpaper.TAG, " start load ad=${ad.mPlacementId}")
|
||||
ad.load(MyWallpaper.globalContext)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@JvmStatic
|
||||
fun getReadyAd(): ATInterstitial? {
|
||||
list.shuffle()
|
||||
for (ad in list) {
|
||||
if (ad.isAdReady) {
|
||||
return ad
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun showWelcomeAd(activity: Activity,totalTim: Long,countAction:(millisUntilFinished: Long)->Unit, goMain: () -> Unit): CountDownTimer {
|
||||
var alreadyShow = false
|
||||
var timer = object : CountDownTimer(totalTim, 50) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
countAction.invoke(millisUntilFinished)
|
||||
if (!alreadyShow) {
|
||||
showAD(activity) {
|
||||
if(it== type_no_cache){
|
||||
Log.d(MyWallpaper.TAG, " ${millisUntilFinished} type_no_cache")
|
||||
}
|
||||
if (it == type_has_cache) {
|
||||
alreadyShow = true
|
||||
}
|
||||
if (it == type_show_close || it == type_show_fail) {
|
||||
goMain.invoke()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun onFinish() {
|
||||
Log.d(MyWallpaper.TAG, " ---onFinish")
|
||||
if (!alreadyShow) {
|
||||
showAD(activity) {
|
||||
if (it == type_show_close || it == type_show_fail || it == type_no_cache) {
|
||||
goMain.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return timer
|
||||
}
|
||||
|
||||
private fun setCallBack(ad: ATInterstitial, listener: AdListener) {
|
||||
ad.setAdListener(object : ATInterstitialListener {
|
||||
override fun onInterstitialAdLoaded() {
|
||||
Log.d(MyWallpaper.TAG, "LoadLoaded ${ad.mPlacementId}")
|
||||
}
|
||||
|
||||
override fun onInterstitialAdLoadFail(p0: AdError?) {
|
||||
listener.loadFail(ad.mPlacementId)
|
||||
Log.d(MyWallpaper.TAG, "LoadFail:${ad.mPlacementId} ${p0?.code} ${p0?.fullErrorInfo}")
|
||||
}
|
||||
|
||||
override fun onInterstitialAdClicked(p0: ATAdInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onInterstitialAdShow(p0: ATAdInfo?) {
|
||||
Log.d(MyWallpaper.TAG, "AdShow ${p0?.placementId} ${p0?.segmentId}")
|
||||
listener.showSuccess()
|
||||
ad.load()
|
||||
}
|
||||
|
||||
override fun onInterstitialAdClose(p0: ATAdInfo?) {
|
||||
Log.d(MyWallpaper.TAG, "AdClose ${p0?.placementId} ${p0?.segmentId}")
|
||||
listener.showClose()
|
||||
}
|
||||
|
||||
override fun onInterstitialAdVideoStart(p0: ATAdInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onInterstitialAdVideoEnd(p0: ATAdInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onInterstitialAdVideoError(p0: AdError?) {
|
||||
listener.showFail()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun showAD(activity: Activity, action: (type: Int) -> Unit) {
|
||||
val readyAd = getReadyAd()
|
||||
if (readyAd!= null) {
|
||||
Log.d(MyWallpaper.TAG, "readyAd ${readyAd.mPlacementId} ")
|
||||
action.invoke(type_has_cache)
|
||||
setCallBack(readyAd,object : AdListener {
|
||||
override fun loadFail(placeId: String) {
|
||||
|
||||
}
|
||||
|
||||
override fun showSuccess() {
|
||||
action.invoke(type_show_success)
|
||||
}
|
||||
|
||||
override fun showFail() {
|
||||
action.invoke(type_show_fail)
|
||||
}
|
||||
|
||||
override fun showClose() {
|
||||
action.invoke(type_show_close)
|
||||
}
|
||||
|
||||
})
|
||||
readyAd.show(activity)
|
||||
} else {
|
||||
action.invoke(type_no_cache)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
5
app/src/main/res/drawable/wel_bg.xml
Normal file
5
app/src/main/res/drawable/wel_bg.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
|
||||
</level-list>
|
||||
@ -5,34 +5,37 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/main_bg"
|
||||
tools:context=".WelActivity">
|
||||
tools:context=".SplashActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="124dp"
|
||||
android:layout_height="124dp"
|
||||
android:src="@mipmap/icon"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="260dp" />
|
||||
android:layout_marginTop="260dp"
|
||||
android:src="@mipmap/icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/logo"
|
||||
android:textColor="@color/white"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="22dp"
|
||||
android:textSize="19sp"
|
||||
android:text="@string/app_name" />
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="19sp" />
|
||||
|
||||
<ProgressBar
|
||||
<com.nature.free.test.other.CustomProgressBar
|
||||
android:id="@+id/customProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv"
|
||||
android:indeterminateTint="@color/white"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="85dp" />
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginTop="85dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:indeterminateTint="@color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@ -6,5 +6,8 @@
|
||||
<item name="android:statusBarColor">@color/main_bg</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.MyWallpaper" parent="Base.Theme.MyWallpaper" />
|
||||
<style name="Theme.MyWallpaper" parent="Base.Theme.MyWallpaper" >
|
||||
<item name="android:windowBackground">@color/main_bg</item>
|
||||
<!-- <item name="windowNoTitle">true</item>-->
|
||||
</style>
|
||||
</resources>
|
||||
@ -10,6 +10,17 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
//Anythink(Core)
|
||||
maven("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||
//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")
|
||||
//TopOn集成测试工具
|
||||
maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user