Commit 851618ea authored by jyx's avatar jyx

开屏页代码优化,更新穿山甲版本

parent 37863e7a
......@@ -346,11 +346,9 @@ dependencies {
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// 穿山甲广告 4.0.11
// implementation 'com.pangle.cn:ads-sdk-pro:4.0.1.9'
// implementation 'com.pangle.cn:ads-sdk-pro:3.9.0.5'
implementation 'com.pangle.cn:ads-sdk-pro:4.0.0.6'
implementation(name: 'tools_release', ext: 'aar')
// 穿山甲广告
implementation 'com.pangle.cn:ads-sdk-pro:4.0.1.9'
// implementation(name: 'tools_release', ext: 'aar')
// 广点通广告 腾讯
implementation(name: 'GDTSDK.unionNormal.4.420.1290', ext: 'aar')
// 快手
......
......@@ -202,6 +202,7 @@
<activity
android:name=".ui.activitys.SplashCsjADActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/NormalSplash">
<intent-filter>
......@@ -379,8 +380,8 @@
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
tools:replace="android:resource"
android:resource="@xml/file_paths" />
android:resource="@xml/file_paths"
tools:replace="android:resource" />
</provider>
<provider
android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
......
package com.mints.goodmoney.ui.activitys
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.view.KeyEvent
import android.view.View
......@@ -33,6 +35,26 @@ class SplashCsjADActivity : BaseActivity() {
private var mTTAdNative: TTAdNative? = null
companion object {
const val IS_FROM_BACKGROUND = "IS_FROM_BACKGROUND"
}
private var isFromBackground = false
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
intent?.let {
isFromBackground = it.extras?.getBoolean(IS_FROM_BACKGROUND, false) ?: false
}
}
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
isFromBackground = it.getBoolean(IS_FROM_BACKGROUND, false)
}
}
override fun getContentViewLayoutID(): Int {
return R.layout.activity_splash_ylh
}
......@@ -61,10 +83,10 @@ class SplashCsjADActivity : BaseActivity() {
private fun loadSplashAd() {
//step3:创建开屏广告请求参数AdSlot
var adSlot: AdSlot? = AdSlot.Builder()
.setCodeId(TtCsjAdManager.TT_AD_SPLASH)
.setImageAcceptedSize(1080, 1920)
.build()
val adSlot: AdSlot? = AdSlot.Builder()
.setCodeId(TtCsjAdManager.TT_AD_SPLASH)
.setImageAcceptedSize(1080, 1920)
.build()
mTTAdNative!!.loadSplashAd(adSlot, object : TTAdNative.SplashAdListener {
override fun onError(p0: Int, p1: String?) {
......@@ -152,13 +174,20 @@ class SplashCsjADActivity : BaseActivity() {
}
private fun readyGoOtherActivity() {
if (isFromBackground) {
finish()
return
}
val customVersion: Int = ps.getInt(Constant.CUSTOM_VERSION, 0)
val isFirstEnter: Boolean = ps.getBoolean(Constant.ISFIRSTENTER + customVersion, true)
if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java)
} else {
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance()
.userIsLogin()
) {
readyGo(WxLoginActivity::class.java)
} else {
readyGoThenKill(MainActivity::class.java)
......
......@@ -14,7 +14,6 @@ import android.widget.GridView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.viewpager.widget.ViewPager
import com.bytedance.tools.ui.ToolsActivity
import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import com.fly.scenemodule.SceneUtil
import com.mints.goodmoney.BuildConfig
......@@ -1057,15 +1056,12 @@ class MyFragment : BaseFragment(),
jumpQQGroup()
}
R.id.item_title_id -> {
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// }
awardVideo(0,"")
if (!userManager.userIsLogin()) {
readyGo(WxLoginActivity::class.java)
}
}
R.id.iv_right_icon -> {
// readyGo(SettingsActivity::class.java)
readyGo(ToolsActivity::class.java)
readyGo(SettingsActivity::class.java)
}
R.id.btn_withdraw -> {
if (userConfig == null) {
......
......@@ -30,8 +30,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
private static WeakReference<Activity> app_activity;
private VersionUpdatePresenter vup;
private WeakReference<Activity> reference;
private Intent ylhIntent;
private Intent groIntent;
private Intent csjIntent;
public static ForegroundOrBackground init(Application application) {
......@@ -99,35 +97,14 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return;
}
if (count == 0) {
// LogUtil.d("ForegroundOrBackground", System.currentTimeMillis() - leaveTime + " onActivityStarted");
if (count == 0 && !(activity instanceof SplashCsjADActivity)) {
// 60秒后打开应用 显示开屏广告
if (System.currentTimeMillis() - leaveTime >= 30000) {
// if (AppConfig.groMoreVideoAdCount > 0) {
if (groIntent == null) {
groIntent = new Intent(activity, SplashCsjADActivity.class);
if (csjIntent == null) {
csjIntent = new Intent(activity, SplashCsjADActivity.class);
}
activity.startActivity(groIntent);
// } else {
// if (isYlhSplash) {
// isYlhSplash = false;
//
// if (ylhIntent == null) {
// // 优量汇广告
// ylhIntent = new Intent(activity, SplashADActivity.class);
// }
// activity.startActivity(ylhIntent);
// } else {
// isYlhSplash = true;
//
// if (csjIntent == null) {
// // 快手广告
// csjIntent = new Intent(activity, SplashCsjADActivity.class);
// }
// activity.startActivity(csjIntent);
// }
// }
csjIntent.putExtra(SplashCsjADActivity.IS_FROM_BACKGROUND, true);
activity.startActivity(csjIntent);
}
}
count++;
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- <style name="AppTheme" parent="AppTheme.Base" />-->
......@@ -33,9 +33,19 @@
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="NormalSplash" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_bg</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<style name="NormalSplash" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowFullscreen">true</item><!--可选-->
<item name="android:windowContentOverlay">@null</item><!--可选-->
<item name="android:windowTranslucentStatus">true</item><!--沉浸透明状态栏 可选-->
<item name="android:windowBackground">@drawable/splash_bg</item><!--必须,整个核心都在这里-->
<!--其他的属性都不要加了 特别不要开启 windowIsTranslucent/windowDisablePreview 混用,或者关闭即可-->
<!-- 否则效果不对,达不到秒开效果-->
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowDisablePreview">false</item>
<item name="android:navigationBarColor">@color/white</item>
<item name="android:statusBarColor">@color/white</item>
<item name="android:windowLightStatusBar" tools:ignore="NewApi">true</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item>
</style>
</resources>
\ No newline at end of file
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