Commit e3a0a7be authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :1.1.3
[实现方案] :加入红包列表
parent 45e6e0be
...@@ -54,6 +54,14 @@ ...@@ -54,6 +54,14 @@
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true">
<activity android:name=".activity.InitActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity <activity
android:name=".activity.MainActivity" android:name=".activity.MainActivity"
android:launchMode="singleTop"> android:launchMode="singleTop">
......
...@@ -13,7 +13,6 @@ import com.zxhl.cms.common.Constant ...@@ -13,7 +13,6 @@ import com.zxhl.cms.common.Constant
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.utils.EventUtils.onEvent import com.zxhl.cms.utils.EventUtils.onEvent
import com.zxhl.cms.utils.MiitHelper import com.zxhl.cms.utils.MiitHelper
import com.zxhl.cms.utils.TTAdManagerHolder
import com.zxhl.cms.utils.Utils import com.zxhl.cms.utils.Utils
import java.util.* import java.util.*
...@@ -27,16 +26,11 @@ class Appli : Application() { ...@@ -27,16 +26,11 @@ class Appli : Application() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
AppContext.init(applicationContext) AppContext.init(applicationContext)
UMConfigure.setLogEnabled(false)
UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, "") if (!SettingPreference.getFirstApp()) {
Utils.checkDebugMode(this) initAppConfig()
PlatformConfig.setWeixin(Constant.WX_APPID, Constant.WX_APPKEY) }
PlatformConfig.setWXFileProvider("com.tencent.sample2.fileprovider");
Config.init(this)
//初始化bugly
CrashReport.initCrashReport(applicationContext, "f9fb9a9ef5", false);
getOaid()
initByteDance()
val helper = AppFrontBackHelper() val helper = AppFrontBackHelper()
helper.register(this, object : AppFrontBackHelper.OnAppStatusListener { helper.register(this, object : AppFrontBackHelper.OnAppStatusListener {
override fun onFront() { override fun onFront() {
...@@ -71,10 +65,6 @@ class Appli : Application() { ...@@ -71,10 +65,6 @@ class Appli : Application() {
} }
} }
private fun initByteDance() {
TTAdManagerHolder.init(this)
}
override fun onTrimMemory(level: Int) { override fun onTrimMemory(level: Int) {
super.onTrimMemory(level) super.onTrimMemory(level)
// for (app in mChildApplicationList) { // for (app in mChildApplicationList) {
...@@ -89,4 +79,14 @@ class Appli : Application() { ...@@ -89,4 +79,14 @@ class Appli : Application() {
// } // }
} }
fun initAppConfig(){
UMConfigure.init(AppContext.get(), UMConfigure.DEVICE_TYPE_PHONE, "")
Utils.checkDebugMode(AppContext.get())
PlatformConfig.setWeixin(Constant.WX_APPID, Constant.WX_APPKEY)
PlatformConfig.setWXFileProvider("com.tencent.sample2.fileprovider");
Config.init(AppContext.get())
//初始化bugly
CrashReport.initCrashReport(AppContext.get(), "f9fb9a9ef5", false);
getOaid()
}
} }
\ No newline at end of file
package com.zxhl.shop.activity
import android.content.Intent
import android.text.TextUtils
import android.view.View
import com.zxbw.modulemain.activity.SplashActivity
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.utils.Utils
import com.zxhl.cms.widget.CenterDialog
import com.zxhl.shop.Appli
import com.zxhl.shop.R
/**
* @author (wangXuewei)
* @detail :
*/
class InitActivity :BaseActivity() {
override fun onClick(v: View?) {
}
override fun layoutID(): Int = R.layout.activity_splash
override fun init() {
if (AppContext.get()!=null){
var source = Utils.getChannel(AppContext.get())
if (!TextUtils.isEmpty(source)) {
SettingPreference.setSource(source)
}
}
if (SettingPreference.getFirstApp()) {
CenterDialog.showPrivacyProtocol(this, {
Appli().initAppConfig()
SettingPreference.setFirstApp()
startActivity(Intent(this@InitActivity, SplashActivity::class.java))
finish()
}, {
finish()
})
} else {
startActivity(Intent(this@InitActivity, SplashActivity::class.java))
finish()
}
}
}
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/white</item> <item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/white</item> <item name="colorPrimaryDark">@color/white</item>
<item name="colorAccent">@color/white</item> <item name="colorAccent">@color/color_ffc109</item>
<item name="android:windowBackground">@color/white</item> <item name="android:windowBackground">@color/white</item>
</style> </style>
......
...@@ -140,7 +140,7 @@ public class Constant { ...@@ -140,7 +140,7 @@ public class Constant {
public static class Switch { public static class Switch {
public static boolean isShowUpdateDialoging = false; public static boolean isShowUpdateDialoging = false;
public static boolean isOpenLogin = false; public static boolean isOpenLogin = false;
public static boolean isBindLogin = false; public static boolean isBindLogin = true;
public static boolean isOpenPayTips = true; public static boolean isOpenPayTips = true;
public static boolean isOpenVip = false; public static boolean isOpenVip = false;
} }
......
package com.zxhl.cms.common; package com.zxhl.cms.common;
import static com.zxhl.cms.common.NetConfig.Environment.DEV; import com.zxhl.cms.AppContext;
import com.zxhl.cms.R;
import static com.zxhl.cms.common.NetConfig.Environment.PRODUCT; import static com.zxhl.cms.common.NetConfig.Environment.PRODUCT;
/** /**
...@@ -191,15 +193,15 @@ public class NetConfig { ...@@ -191,15 +193,15 @@ public class NetConfig {
} }
public static class H5 { public static class H5 {
public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xiaoxiangSaveMoney/person_app.html?webName=小象省钱"; public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xiaoxiangSaveMoney/person_app.html?webName="+ AppContext.get().getResources().getString(R.string.app_name);
public static String WEB_URL_PRIVACY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xiaoxiangSaveMoney/privacy_app.html?appName=小象省钱APP&company=北京掌心互联科技有限公司&money=虚拟货币&webName=小象省钱"; public static String WEB_URL_PRIVACY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xiaoxiangSaveMoney/privacy_app.html?appName="+AppContext.get().getResources().getString(R.string.app_name)+"APP&company=北京掌心互联科技有限公司&money=虚拟货币&webName="+AppContext.get().getResources().getString(R.string.app_name);
public static String WEB_URL_ABOUT_US = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/aboutMe.html?version=" + Constant.Param.vn + "&appName=小象省钱&company=北京掌心互联科技有限公司"; public static String WEB_URL_ABOUT_US = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/aboutMe.html?version=" + Constant.Param.vn + "&appName="+AppContext.get().getResources().getString(R.string.app_name)+"&company=北京掌心互联科技有限公司";
public static String WEB_URL_CUSTOMER_SERVICE = "https://1568685.s4.udesk.cn/im_client/?web_plugin_id=35245"; public static String WEB_URL_CUSTOMER_SERVICE = "https://1568685.s4.udesk.cn/im_client/?web_plugin_id=35245";
public static String WEB_URL_ZENGZHI_SERVICE = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/xxsq_zz_server.html"; public static String WEB_URL_ZENGZHI_SERVICE = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/xxsq_zz_server.html";
public static String WEB_URL_BUYER_KNOW = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/buyerKnow.html?version=" + Constant.Param.vn + "&appName=幸运魔盒&company=北京掌心互联科技有限公司"; public static String WEB_URL_BUYER_KNOW = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/buyerKnow.html?version=" + Constant.Param.vn + "&appName="+AppContext.get().getResources().getString(R.string.app_name)+"&company=北京掌心互联科技有限公司";
public static String WEB_URL_WEEK_RULE = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/week_activity_rule.html"; public static String WEB_URL_WEEK_RULE = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/week_activity_rule.html";
public static String WEB_URL_INVITE; public static String WEB_URL_INVITE;
public static String WEB_URL_H5_PAY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/pay_order.html"; public static String WEB_URL_H5_PAY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/pay_order.html";
......
...@@ -295,6 +295,9 @@ interface RounterApi { ...@@ -295,6 +295,9 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://user_question") @RounterUri(Constant.scheme + "://user_question")
fun getIntentUserQuestion(): Intent fun getIntentUserQuestion(): Intent
@RounterUri(Constant.scheme + "://red_envelope")
fun getIntentRedEnvelope(): Intent
@RounterUri(Constant.scheme + "://searchresult") @RounterUri(Constant.scheme + "://searchresult")
fun getIntentSearchReslut( fun getIntentSearchReslut(
@RounterParam("keyword") keyword: String @RounterParam("keyword") keyword: String
......
...@@ -4,6 +4,7 @@ import android.app.Activity ...@@ -4,6 +4,7 @@ import android.app.Activity
import android.content.ClipData import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.content.Intent
import android.os.Handler import android.os.Handler
import android.util.Log import android.util.Log
import com.zx.ad.modulecommon.net.EventApiClient import com.zx.ad.modulecommon.net.EventApiClient
...@@ -49,10 +50,10 @@ object ClipboardManagerUtil { ...@@ -49,10 +50,10 @@ object ClipboardManagerUtil {
var clipData: ClipData? = clipboard.primaryClip var clipData: ClipData? = clipboard.primaryClip
if (clipData != null && clipData.itemCount > 0) { if (clipData != null && clipData.itemCount > 0) {
// 从数据集中获取(粘贴)第一条文本数据 // 从数据集中获取(粘贴)第一条文本数据
var textStr = clipData.getItemAt(0).text.toString() var textStr = clipData.getItemAt(0).coerceToText(context).toString()
Log.d("wxw", "textStr" + textStr) Log.d("wxw", "textStr" + textStr)
if (textStr.length > 10) { if (textStr.length > 10) {
if (textStr != copyLink){ if (textStr != copyLink) {
getGoodsGuideLink(context, textStr) getGoodsGuideLink(context, textStr)
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
clipboard.clearPrimaryClip() clipboard.clearPrimaryClip()
...@@ -86,7 +87,7 @@ object ClipboardManagerUtil { ...@@ -86,7 +87,7 @@ object ClipboardManagerUtil {
.subscribe(object : BaseObserver2<TbGoodsItemEntity>() { .subscribe(object : BaseObserver2<TbGoodsItemEntity>() {
override fun onSuccess(result: TbGoodsItemEntity?) { override fun onSuccess(result: TbGoodsItemEntity?) {
if (result != null) { if (result != null) {
copy(context,result.global_tbk_pwd?:"") copy(context, result.global_tbk_pwd ?: "")
CenterDialog.showTbGoodsDetail( CenterDialog.showTbGoodsDetail(
context, context,
result result
...@@ -95,14 +96,15 @@ object ClipboardManagerUtil { ...@@ -95,14 +96,15 @@ object ClipboardManagerUtil {
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
copy(context, "11111111")
} }
}) })
} }
private var copyLink = "" private var copyLink = ""
fun copy(context: Activity,string: String) { fun copy(context: Activity, string: String) {
if (string.isNullOrEmpty()){ if (string.isNullOrEmpty()) {
return return
} }
copyLink = string copyLink = string
...@@ -111,7 +113,8 @@ object ClipboardManagerUtil { ...@@ -111,7 +113,8 @@ object ClipboardManagerUtil {
val cm: ClipboardManager = val cm: ClipboardManager =
context?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager context?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val mClipData: ClipData = val mClipData: ClipData =
ClipData.newPlainText("Label", string) // ClipData.newPlainText("Label", string)
ClipData.newIntent("Label", Intent())
cm.setPrimaryClip(mClipData) cm.setPrimaryClip(mClipData)
} }
......
...@@ -393,6 +393,7 @@ public class JumpUtils { ...@@ -393,6 +393,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!"); Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
} }
} }
public static void CardVoucherJump(String brand) { public static void CardVoucherJump(String brand) {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentCardVoucher(brand); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentCardVoucher(brand);
...@@ -513,7 +514,7 @@ public class JumpUtils { ...@@ -513,7 +514,7 @@ public class JumpUtils {
} }
} }
public static void UserQuestion() { public static void UserQuestion() {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentUserQuestion(); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentUserQuestion();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
...@@ -523,6 +524,16 @@ public class JumpUtils { ...@@ -523,6 +524,16 @@ public class JumpUtils {
} }
} }
public static void GrabRedEnvelope() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentRedEnvelope();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void SearchReslutJumo(String keyword) { public static void SearchReslutJumo(String keyword) {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentSearchReslut(keyword); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentSearchReslut(keyword);
......
package com.zxhl.cms.utils;
import android.content.Context;
import android.util.Log;
import com.bytedance.sdk.openadsdk.TTAdConfig;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdSdk;
/**
* 可以用一个单例来保存TTAdManager实例,在需要初始化sdk的时候调用
*/
public class TTAdManagerHolder {
private static final String TAG = "TTAdManagerHolder";
private static boolean sInit;
public static TTAdManager get() {
return TTAdSdk.getAdManager();
}
public static void init(final Context context) {
doInit(context);
}
//step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
private static void doInit(Context context) {
if (!sInit) {
//TTAdSdk.init(context, buildConfig(context));
TTAdSdk.init(context, buildConfig(context), new TTAdSdk.InitCallback() {
@Override
public void success() {
Log.i(TAG, "success: "+ TTAdSdk.isInitSuccess());
}
@Override
public void fail(int code, String msg) {
Log.i(TAG, "fail: code = " + code + " msg = " + msg);
}
});
sInit = true;
}
}
private static TTAdConfig buildConfig(Context context) {
return new TTAdConfig.Builder()
.appId("5229735")
.useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
.appName("幸运魔盒")
.allowShowNotify(true) //是否允许sdk展示通知栏提示
.debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
.supportMultiProcess(false)//是否支持多进程
.titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)
.needClearTaskReset()
.build();
}
}
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="7dp" />
<gradient
android:endColor="#F5BA63"
android:startColor="#F2A83C" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="7dp" />
<gradient
android:angle="0"
android:endColor="#ffff4e17"
android:startColor="#fff20200" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
...@@ -8,11 +8,6 @@ ...@@ -8,11 +8,6 @@
android:name=".activity.SplashActivity" android:name=".activity.SplashActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Theme"> android:theme="@style/Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
...@@ -387,6 +382,20 @@ ...@@ -387,6 +382,20 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".activity.GrabRedEnvelopeActivity"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="red_envelope"
android:scheme="xxsqshop" />
</intent-filter>
</activity>
</application> </application>
......
package com.zxbw.modulemain.activity
import android.view.View
import com.zxbw.modulemain.R
import com.zxhl.cms.common.base.BaseActivity
/**
* @author (wangXuewei)
* @datetime 2022-06-28 15:01 GMT+8
* @detail :
*/
class GrabRedEnvelopeActivity : BaseActivity() {
override fun layoutID(): Int = R.layout.activity_layout_grab_red_envelope
override fun onClick(v: View?) {
}
override fun init() {
}
}
\ No newline at end of file
package com.zxbw.modulemain.activity package com.zxbw.modulemain.activity
import android.text.Html
import android.view.View import android.view.View
import com.zxbw.modulemain.R import com.zxbw.modulemain.R
import com.zxhl.cms.common.base.BaseActivity import com.zxhl.cms.common.base.BaseActivity
...@@ -32,6 +33,8 @@ class UserQuestionActivity : BaseActivity() { ...@@ -32,6 +33,8 @@ class UserQuestionActivity : BaseActivity() {
id_ll_question_5.setOnClickListener(this) id_ll_question_5.setOnClickListener(this)
id_ll_kefu.setOnClickListener(this) id_ll_kefu.setOnClickListener(this)
id_img_back.setOnClickListener(this) id_img_back.setOnClickListener(this)
id_tv_answer_5.text = Html.fromHtml(resources.getString(R.string.user_answer_5))
id_tv_answer_5.setOnClickListener(this)
} }
...@@ -85,6 +88,9 @@ class UserQuestionActivity : BaseActivity() { ...@@ -85,6 +88,9 @@ class UserQuestionActivity : BaseActivity() {
id_ll_kefu -> { id_ll_kefu -> {
JumpUtils.UDesk() JumpUtils.UDesk()
} }
id_tv_answer_5 -> {
JumpUtils.webJump("申请退款","http://h5.zxhuichuan.com/xiaoxiang_refund")
}
id_img_back -> { id_img_back -> {
finish() finish()
} }
......
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.zxbw.modulemain.R
import com.zxbw.modulemain.uitls.TimeUtils
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.utils.Utils
class CashEnterListAdapter : BaseRecyclerAdapter<Any, CashEnterListAdapter.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<Any>
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<Any>
) : super() {
mContext = content
this.listener = listener
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
if (position < 2) {
holder.id_img_cash_enter?.setImageResource(R.drawable.icon_withdraw_task_yshixiao)
holder.id_tv_data?.text = TimeUtils.getWeekOfDate(TimeUtils.getDate(position - 2))
} else if (position > 2) {
holder.id_img_cash_enter?.setImageResource(R.drawable.icon_withdraw_task_kstx2)
holder.id_tv_data?.text = TimeUtils.getWeekOfDate(TimeUtils.getDate(position - 2))
} else {
holder.id_img_cash_enter?.setImageResource(R.drawable.icon_withdraw_task_kstx)
holder.id_tv_data?.text = TimeUtils.getWeekOfDate(TimeUtils.getDate(0))
}
holder.id_rl_cash_task_view?.setOnClickListener {
listener.onItemClick(it, position, null)
}
}
override fun getItemCount(): Int {
return 5
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_cash_enter_view, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var id_rl_cash_task_view: LinearLayout?
var id_tv_data: TextView?
var id_img_cash_enter: ImageView?
constructor(
itemView: View
) : super(itemView) {
id_rl_cash_task_view = itemView.findViewById<LinearLayout>(R.id.id_ll_cash_enter_view)
id_tv_data = itemView.findViewById<TextView>(R.id.id_tv_data)
id_img_cash_enter = itemView.findViewById<ImageView>(R.id.id_img_cash_enter)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.widget.RecycleImageView
class CashTaskListAdapter : BaseRecyclerAdapter<Any, CashTaskListAdapter.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<Any>
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<Any>
) : super() {
mContext = content
this.listener = listener
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
if (position == 0) {
holder.id_tv_task_title?.text = "看视频"
holder.id_img_task_icon?.setImageResource(R.drawable.icon_task_kanshipin)
holder.id_tv_task_desc?.text = "每日看视频领取大量幸运币"
holder.id_img_task_btn_icon?.visibility = View.VISIBLE
holder.id_tv_task_btn_desc?.text = "+100/次"
holder.id_ll_progress_view?.visibility = View.VISIBLE
} else {
holder.id_tv_task_title?.text = "整点抢红包"
holder.id_img_task_icon?.setImageResource(R.drawable.icon_task_zhengdianqianghongbao)
holder.id_tv_task_desc?.text = "整点开枪 抢完即止 幸运可拿888元"
holder.id_img_task_btn_icon?.visibility = View.GONE
holder.id_tv_task_btn_desc?.text = "点我抢"
holder.id_ll_progress_view?.visibility = View.GONE
}
holder.id_ll_task_btn?.setOnClickListener {
listener.onItemClick(it, position, null)
}
}
override fun getItemCount(): Int {
return 2
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_cash_task_view, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var id_ll_cash_task_view: LinearLayout?
var id_img_task_icon: ImageView?
var id_tv_task_title: TextView?
var id_tv_task_desc: TextView?
var id_ll_progress_view: LinearLayout?
var id_task_progress_view: ProgressBar?
var id_tv_task_progress_desc: TextView?
var id_tv_task_progress_rate: TextView?
var id_ll_task_btn: LinearLayout?
var id_img_task_btn_icon: ImageView?
var id_tv_task_btn_desc: TextView?
constructor(
itemView: View
) : super(itemView) {
id_ll_cash_task_view = itemView.findViewById<LinearLayout>(R.id.id_ll_cash_task_view)
id_img_task_icon = itemView.findViewById<ImageView>(R.id.id_img_task_icon)
id_tv_task_title = itemView.findViewById<TextView>(R.id.id_tv_task_title)
id_tv_task_desc = itemView.findViewById<TextView>(R.id.id_tv_task_desc)
id_ll_progress_view = itemView.findViewById<LinearLayout>(R.id.id_ll_progress_view)
id_task_progress_view = itemView.findViewById<ProgressBar>(R.id.id_task_progress_view)
id_tv_task_progress_desc =
itemView.findViewById<TextView>(R.id.id_tv_task_progress_desc)
id_tv_task_progress_rate =
itemView.findViewById<TextView>(R.id.id_tv_task_progress_rate)
id_ll_task_btn = itemView.findViewById<LinearLayout>(R.id.id_ll_task_btn)
id_img_task_btn_icon = itemView.findViewById<ImageView>(R.id.id_img_task_btn_icon)
id_tv_task_btn_desc = itemView.findViewById<TextView>(R.id.id_tv_task_btn_desc)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.fragment package com.zxbw.modulemain.fragment
import android.view.View import android.view.View
import android.widget.Adapter
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.zx.ad.AdManager
import com.zx.ad.callback.RewardVideoAdListener
import com.zxbw.modulemain.R import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.CashEnterListAdapter
import com.zxbw.modulemain.adapter.CashTaskListAdapter
import com.zxbw.modulemain.uitls.TimeUtils
import com.zxhl.cms.common.base.BaseFragment import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.OnRecycleItemClickListener
import kotlinx.android.synthetic.main.fragment_layout_cash_check.* import kotlinx.android.synthetic.main.fragment_layout_cash_check.*
import me.jessyan.autosize.utils.ScreenUtils import me.jessyan.autosize.utils.ScreenUtils
...@@ -11,7 +21,11 @@ import me.jessyan.autosize.utils.ScreenUtils ...@@ -11,7 +21,11 @@ import me.jessyan.autosize.utils.ScreenUtils
* @datetime 2022-06-22 14:00 GMT+8 * @datetime 2022-06-22 14:00 GMT+8
* @detail :现金签到 * @detail :现金签到
*/ */
class CashCheckFragment : BaseFragment() { class CashCheckFragment : BaseFragment(), OnRecycleItemClickListener<Any> {
private var mCashTaskAdapter: CashTaskListAdapter? = null
private var mCashEnterAdapter: CashEnterListAdapter? = null
override fun layoutID(): Int = R.layout.fragment_layout_cash_check override fun layoutID(): Int = R.layout.fragment_layout_cash_check
override fun init(view: View?) { override fun init(view: View?) {
...@@ -20,6 +34,57 @@ class CashCheckFragment : BaseFragment() { ...@@ -20,6 +34,57 @@ class CashCheckFragment : BaseFragment() {
statusBarHeight = 40 statusBarHeight = 40
} }
id_sys_bar_view.layoutParams.height = statusBarHeight id_sys_bar_view.layoutParams.height = statusBarHeight
mCashTaskAdapter = CashTaskListAdapter(activity, this)
mCashEnterAdapter = CashEnterListAdapter(
activity
) { view, position, data ->
if (position < 2) {
showToast("本次机会已失效")
} else if (position > 2) {
showToast("本轮尚未开始")
} else {
showToast("今天抽取机会已用完,明天继续获取")
}
}
id_rcl_cash_enter_list.layoutManager = GridLayoutManager(activity, 5)
id_rcl_cash_enter_list.adapter = mCashEnterAdapter
id_rcl_cash_task_list.layoutManager = LinearLayoutManager(activity)
id_rcl_cash_task_list.adapter = mCashTaskAdapter
id_img_open_red_envelope.setOnClickListener {
JumpUtils.GrabRedEnvelope()
}
}
override fun onItemClick(view: View?, position: Int, data: Any?) {
if (position == 0) {
playRewardVideo()
} else {
JumpUtils.GrabRedEnvelope()
}
}
private fun playRewardVideo() {
AdManager.loadRewardAd(activity!!, object : RewardVideoAdListener {
override fun onRewardVideoAdClose() {
}
override fun onRewardVideoAdReward() {
}
override fun onRewardVideoAdShow() {
}
override fun onRewardVideoAdError(errorMsg: String?) {
}
})
} }
} }
\ No newline at end of file
...@@ -92,7 +92,7 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -92,7 +92,7 @@ class SplashPresenter : SplashContract.Presenter {
// } // }
// } // }
// }) // })
checkLoginIsBind() // checkLoginIsBind()
} }
override fun checkLogin() { override fun checkLogin() {
......
package com.zxbw.modulemain.uitls;
import com.umeng.commonsdk.debug.D;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* @author (wangXuewei)
* @datetime 2022-06-27 15:43 GMT+8
* @detail :
*/
public class TimeUtils {
/**
* 获取当前日期是星期几
* @param date
* @return
*/
public static String getWeekOfDate(Date date) {
String[] weekDays = { "日", "一", "二", "三", "四", "五", "六" };
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0)
w = 0;
return "周"+weekDays[w];
}
public static Date getDate(int day){
if(day==0){
return new Date();
}else{
Date d = new Date();
long myTime = (d.getTime() / 1000) + day * 24 * 60 * 60;
d.setTime(myTime * 1000);
return d;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DE4B44"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:id="@+id/id_sys_bar_view"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/white" />
<ImageView
android:id="@+id/id_img_top_bg_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/image_qhb_bg" />
<ImageView
android:id="@+id/id_img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/id_sys_bar_view"
android:layout_marginStart="6dp"
android:padding="10dp"
android:src="@drawable/icon_fanhui" />
<LinearLayout
android:id="@+id/id_ll_money_pool_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/id_img_top_bg_view"
android:layout_marginStart="12dp"
android:layout_marginTop="-30dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_white_r10"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="9dp"
android:paddingBottom="7dp">
<TextView
android:id="@+id/id_next_money_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="10000"
android:textColor="@color/color_333333"
android:textSize="32sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:includeFontPadding="false"
android:text="下场即将发放(元)"
android:textColor="@color/color_999999"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:background="#DEDEDE" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="9dp"
android:paddingBottom="7dp">
<TextView
android:id="@+id/id_today_money_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="230100"
android:textColor="@color/color_333333"
android:textSize="32sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:includeFontPadding="false"
android:text="今日红包总量(元)"
android:textColor="@color/color_999999"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_red_envelope_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/id_ll_money_pool_view"
android:layout_marginStart="12dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_white_r10" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="212dp"
android:layout_below="@+id/id_rcl_red_envelope_list"
android:layout_marginStart="12dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="38dp"
android:background="@drawable/shape_white_r10"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="12dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="锦鲤红包·今日排行榜"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_today_top_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
...@@ -279,13 +279,14 @@ ...@@ -279,13 +279,14 @@
<TextView <TextView
android:id="@+id/id_tv_answer_5" android:id="@+id/id_tv_answer_5"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginTop="14dp" android:layout_marginTop="14dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:background="@drawable/shape_f7f8fb_r10" android:background="@drawable/shape_f7f8fb_r10"
android:padding="10dp" android:padding="10dp"
android:textIsSelectable="true"
android:text="@string/user_answer_5" android:text="@string/user_answer_5"
android:textColor="@color/color_666666" android:textColor="@color/color_666666"
android:textSize="14sp" android:textSize="14sp"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal"
android:background="@color/white" android:background="@color/white"
android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<View <View
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="#F5F5F5">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -36,14 +37,94 @@ ...@@ -36,14 +37,94 @@
android:id="@+id/id_img_anim_bg" android:id="@+id/id_img_anim_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:src="@drawable/image_xiaoxiangbi_anim" /> android:src="@drawable/image_xiaoxiangbi_anim" />
<ImageView <ImageView
android:id="@+id/id_img_open_red_envelope"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="27dp"
android:src="@drawable/icon_daicaihongbao" /> android:src="@drawable/icon_daicaihongbao" />
<LinearLayout
android:id="@+id/id_ll_withdraw_enter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/id_img_anim_bg"
android:layout_marginTop="9dp"
android:layout_marginBottom="8dp"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="13dp"
android:background="@drawable/image_withdraw_list_bg"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="13dp"
android:text="提现不用等 每天抢提现机会"
android:textColor="#353636"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="10dp"
android:text="支付宝快速提现,一分钟到账"
android:textColor="#DE701F"
android:textSize="12sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_cash_enter_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginBottom="18dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginBottom="19dp"
android:text="每天有4次抽取机会哦,记得每天都来抢"
android:textColor="#DE701F"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="玩赚小象币"
android:textColor="#353636"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_cash_task_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/id_ll_withdraw_enter" />
</RelativeLayout> </RelativeLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_cash_enter_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="11dp"
android:layout_marginRight="11dp"
android:background="@drawable/shape_ffffff_r5"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/id_tv_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="周日"
android:textColor="@color/color_999999"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/id_img_cash_enter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="@drawable/icon_withdraw_task_kstx2" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_cash_task_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/shape_ffffff_r5"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingTop="15dp"
android:paddingEnd="12dp"
android:paddingBottom="12dp">
<ImageView
android:id="@+id/id_img_task_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/icon_task_kanshipin" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="39dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/id_tv_task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="看视频"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_task_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="每日看视频领取大量幸运币"
android:textColor="@color/color_999999"
android:textSize="10sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/id_ll_progress_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:gravity="center_vertical">
<RelativeLayout
android:layout_width="100dp"
android:layout_height="15dp">
<ProgressBar
android:id="@+id/id_task_progress_view"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:max="100"
android:progressDrawable="@drawable/task_progress_bg" />
<TextView
android:id="@+id/id_tv_task_progress_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="已赚0"
android:textColor="@color/white"
android:textSize="10sp" />
</RelativeLayout>
<TextView
android:id="@+id/id_tv_task_progress_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(0/2)"
android:textColor="#E37D20"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/id_ll_task_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon_btn_task_bg"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/id_img_task_btn_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:src="@drawable/icon_jinbi_task" />
<TextView
android:id="@+id/id_tv_task_btn_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+100/次"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:visibility="gone"
android:drawableTop="@drawable/icon_bottom_cash_default" android:drawableTop="@drawable/icon_bottom_cash_default"
android:drawablePadding="2dp" android:drawablePadding="2dp"
android:textStyle="bold" android:textStyle="bold"
......
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
<string name="user_answer_2">查看:{我的}-{话费券}中查看即可\n使用:{会员权益}-{话费充值}选择充值100/200 优惠券会自动抵扣</string> <string name="user_answer_2">查看:{我的}-{话费券}中查看即可\n使用:{会员权益}-{话费充值}选择充值100/200 优惠券会自动抵扣</string>
<string name="user_answer_3">充值后会在72小时内到账,如未到账可在线咨询客服处理。</string> <string name="user_answer_3">充值后会在72小时内到账,如未到账可在线咨询客服处理。</string>
<string name="user_answer_4">各大影视平台会员折扣权益,每日秒杀权益,淘宝、外卖优惠券权益</string> <string name="user_answer_4">各大影视平台会员折扣权益,每日秒杀权益,淘宝、外卖优惠券权益</string>
<string name="user_answer_5">如权益未到账 可退款,填写自助退款链接后,会在72小时内操作到账(工作日),如已产生用户id 权益已到账,不支持退款。</string> <string name="user_answer_5"><Data><![CDATA[如需退款,可直接点击链接进行自助退款,退款链接:<font color="#03A9F4">http://h5.zxhuichuan.com/xiaoxiang_refund</font>(最快10分钟-72小时)]]></Data></string>
</resources> </resources>
...@@ -62,7 +62,7 @@ object AdManager { ...@@ -62,7 +62,7 @@ object AdManager {
} }
fun init(application: Context, appLs: String) { fun init(application: Context, appLs: String) {
LogUtils.isShowLog(false) LogUtils.isShowLog(true)
AdNetConfig.setBase_Url(AdNetConfig.Environment.PRODUCT) AdNetConfig.setBase_Url(AdNetConfig.Environment.PRODUCT)
AdConstant.param.mPacketName = application.packageName AdConstant.param.mPacketName = application.packageName
AdConstant.param.appLs = appLs AdConstant.param.appLs = appLs
...@@ -103,6 +103,9 @@ object AdManager { ...@@ -103,6 +103,9 @@ object AdManager {
fun loadSplashAd(context: Activity, mSplashContainer: FrameLayout, listener: SplashAdListener) { fun loadSplashAd(context: Activity, mSplashContainer: FrameLayout, listener: SplashAdListener) {
if (context.isFinishing){
return
}
ZXADClient.adApi.getAds(ADType.AD_SPLASH) ZXADClient.adApi.getAds(ADType.AD_SPLASH)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<NewsEntity>?>() { .subscribe(object : BaseObserver<List<NewsEntity>?>() {
...@@ -177,6 +180,9 @@ object AdManager { ...@@ -177,6 +180,9 @@ object AdManager {
} }
fun loadRewardAd(context: Activity, listener: RewardVideoAdListener) { fun loadRewardAd(context: Activity, listener: RewardVideoAdListener) {
if (context.isFinishing){
return
}
if (isLoadReward) { if (isLoadReward) {
Log.d("AdManager", "正在加载..") Log.d("AdManager", "正在加载..")
return return
......
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