Commit 1220ff27 authored by wanglei's avatar wanglei

...

parent e053855e
......@@ -79,18 +79,18 @@ public class MainActivity extends AppCompatActivity {
});
});
binding.ivSetting.setOnClickListener(v -> {
AdmobHelper.INSTANCE.showInterstitialAd(this, () -> {
// AdmobHelper.INSTANCE.showInterstitialAd(this, () -> {
// initSetting();
// return null;
// },
// () -> {
// return null;
// },
// () -> {
// initSetting();
// return null;
// });
initSetting();
return null;
},
() -> {
return null;
},
() -> {
initSetting();
return null;
});
});
binding.cl3CleanJunk.setOnClickListener(v -> {
......
......@@ -35,6 +35,7 @@ public class CustomScoreDialog extends Dialog {
NativeView nativeView = findViewById(R.id.fl_ad);
AdmobHelper.INSTANCE.showNativeAd(activity, (nativeAd) -> {
nativeView.removeAllViews();
nativeView.setNativeAd(nativeAd, R.layout.layout_ad_native);
return null;
}, null, null);
......
......@@ -547,33 +547,34 @@ object AdmobHelper {
maxCompleted: ((nativeAdLoader: MaxNativeAdLoader, nativeMaxAd: MaxAd) -> Unit)? = null,
failed: (() -> Unit?)? = null
) {
if (!isShowAdNative() || isBlacklist()) {
failed?.invoke()
return
}
Log.d(TAG, "native Ad load.")
// if (!isShowAdNative() || isBlacklist()) {
// failed?.invoke()
// return
// }
Log.e(TAG, "showNativeAd")
if (useAdmob) {
var nativeAd: NativeAd? = null
val adLoader = AdLoader.Builder(activity, NATIVE_AD_UNIT_ID)
.forNativeAd { ad: NativeAd ->
completed?.invoke(ad)
Log.e(TAG, "forNativeAd")
ReportAdUtils.showAd(ad.responseInfo, NATIVE_AD_UNIT, activity)
ad.setOnPaidEventListener(ReportAdUtils.EventOnPaidEventListener(ad))
nativeAd = ad
completed?.invoke(ad)
}
.withAdListener(object : AdListener() {
override fun onAdClicked() {
Log.d(TAG, "native Ad clicked.")
Log.e(TAG, "native Ad clicked.")
ReportAdUtils.clickAd(nativeAd?.responseInfo, NATIVE_AD_UNIT)
}
override fun onAdFailedToLoad(loadAdError: LoadAdError) {
Log.d(TAG, "native Ad failed to load. ${loadAdError.message}")
Log.e(TAG, "native Ad failed to load. ${loadAdError.message}")
failed?.invoke()
}
override fun onAdLoaded() {
Log.d(TAG, "native Ad loaded.")
Log.e(TAG, "native Ad loaded.")
}
})
.withNativeAdOptions(NativeAdOptions.Builder().build())
......
......@@ -20,7 +20,6 @@ import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_APP_MANAGER
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_BATTERY
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_CLEAN
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_LARGE_FILE
import com.swiftcleaner.chovey.view.MainActivity
import com.swiftcleaner.chovey.view.activity.StartActivity
class PermanentNotifyService : Service() {
......@@ -31,9 +30,9 @@ class PermanentNotifyService : Service() {
var isRunning = false
fun Context.startOmgNotification() {
val intent = Intent(this, PermanentNotifyService::class.java)
// if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
// return
// }
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment