Commit 79df58b6 authored by mengcuiguang's avatar mengcuiguang

提现页面调试

parent b13b8fba
...@@ -2,6 +2,7 @@ package com.duben.dayplaylet.ad ...@@ -2,6 +2,7 @@ package com.duben.dayplaylet.ad
import android.app.Activity import android.app.Activity
import com.duben.dayplaylet.ad.full.FullScreenManager import com.duben.dayplaylet.ad.full.FullScreenManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.ad.video.InMoneyVideo import com.duben.dayplaylet.ad.video.InMoneyVideo
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.utils.HitChanceKeeper import com.duben.dayplaylet.utils.HitChanceKeeper
...@@ -120,6 +121,7 @@ class AdManager { ...@@ -120,6 +121,7 @@ class AdManager {
*/ */
fun splashPreLoadAll(activity: Activity) { fun splashPreLoadAll(activity: Activity) {
this.loadRewardVideo(activity) this.loadRewardVideo(activity)
HalfScreenManager.getInstance().preLoadAd(activity)
// this.loadFullVideo(activity) // this.loadFullVideo(activity)
} }
......
package com.duben.dayplaylet.ad.half;
import android.app.Activity;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd;
import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot;
import com.duben.dayplaylet.BuildConfig;
import com.duben.dayplaylet.ad.AdStatusListener;
import com.duben.dayplaylet.common.Constant;
import com.duben.dayplaylet.manager.TrackManager;
import com.duben.dayplaylet.utils.LogUtil;
import java.lang.ref.WeakReference;
import java.util.HashMap;
/**
* 插全屏广告实时加载-半屏-半屏
*/
public class HalfScreenManagerNoPre {
private static final String TAG = HalfScreenManagerNoPre.class.getSimpleName();
private static HalfScreenManagerNoPre _inst;
public static HalfScreenManagerNoPre getInstance() {
if (_inst == null) {
_inst = new HalfScreenManagerNoPre();
}
return _inst;
}
private HalfScreenManagerNoPre() {
}
private TTFullScreenVideoAd mTtFullScreenVideoAd;
private WeakReference<Activity> weakActivity;
private boolean isPreLoad = false;//是否是预加载调用,需要躲避监听
private AdStatusListener adStatusListener;
public void showAd(Activity _activity, AdStatusListener adStatusListener) {
this.adStatusListener = adStatusListener;
this.weakActivity = new WeakReference(_activity);
TTAdNative adNativeLoader = TTAdSdk.getAdManager().createAdNative(weakActivity.get());
AdSlot adSlot = new AdSlot.Builder()
.setCodeId(BuildConfig.GROMORE_HALF_CODE)
.setOrientation(TTAdConstant.ORIENTATION_VERTICAL)
.setMediationAdSlot(
new MediationAdSlot.Builder()
.setMuted(false)
.setVolume(0.7f)
.setBidNotify(true)
.build()
).build();
adNativeLoader.loadFullScreenVideoAd(adSlot, new TTAdNative.FullScreenVideoAdListener() {
@Override
public void onError(int i, String s) {
if (adStatusListener != null) {
adStatusListener.adFail();
}
}
@Override
public void onFullScreenVideoAdLoad(TTFullScreenVideoAd ttFullScreenVideoAd) {
}
@Override
public void onFullScreenVideoCached() {
}
@Override
public void onFullScreenVideoCached(TTFullScreenVideoAd ttFullScreenVideoAd) {
LogUtil.d(TAG, "gromore预加载 插全屏广告实时加载-半屏--> 4、onRewardVideoCached ");
if (adStatusListener != null) {
adStatusListener.adSuccess();
}
mTtFullScreenVideoAd = ttFullScreenVideoAd;
mTtFullScreenVideoAd.showFullScreenVideoAd(weakActivity.get());
mTtFullScreenVideoAd.setFullScreenVideoAdInteractionListener(mTTFullScreenAdListener);
}
});
}
private final TTFullScreenVideoAd.FullScreenVideoAdInteractionListener mTTFullScreenAdListener = new TTFullScreenVideoAd.FullScreenVideoAdInteractionListener() {
@Override
public void onAdShow() {
if (mTtFullScreenVideoAd != null && mTtFullScreenVideoAd.getMediationManager().getShowEcpm() != null) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mTtFullScreenVideoAd.getMediationManager().getShowEcpm().getSlotId());
vo.put("ecpm", mTtFullScreenVideoAd.getMediationManager().getShowEcpm().getEcpm());
vo.put("adSource", mTtFullScreenVideoAd.getMediationManager().getShowEcpm().getSdkName());
vo.put("adid", BuildConfig.GROMORE_HALF_CODE);
vo.put("adType", Constant.GRO_MORE_ADTYPE3);
TrackManager.getInstance().reporGromeEcpm(vo);
}
LogUtil.d(TAG, "gromore预加载 插全屏广告实时加载-半屏-->onAdShow");
}
@Override
public void onAdVideoBarClick() {
LogUtil.d(TAG, "gromore预加载 插全屏广告实时加载-半屏-->onAdVideoBarClick");
}
@Override
public void onAdClose() {
LogUtil.d(TAG, "gromore预加载 插全屏广告实时加载-半屏-->onAdClose");
//
if (adStatusListener != null) {
adStatusListener.adClose(null);
}
adStatusListener = null;
}
@Override
public void onVideoComplete() {
LogUtil.d(TAG, "gromore预加载 插全屏广告实时加载-半屏-->onVideoComplete");
}
@Override
public void onSkippedVideo() {
}
};
}
...@@ -8,6 +8,7 @@ package com.duben.dayplaylet.common; ...@@ -8,6 +8,7 @@ package com.duben.dayplaylet.common;
public class AppConfig { public class AppConfig {
public static boolean app_updateing = false; public static boolean app_updateing = false;
public static boolean mainShowHalfAd = false;
public static int fragmentClickFlag = 0; public static int fragmentClickFlag = 0;
public static String gromoreId = ""; public static String gromoreId = "";
public static int awardRedpkg = 0; public static int awardRedpkg = 0;
......
...@@ -26,6 +26,9 @@ object Constant { ...@@ -26,6 +26,9 @@ object Constant {
const val CARRIERTYPE_SIGN_DRAW = "FORCASH_SIGN_MORE" //签到第二次提现 const val CARRIERTYPE_SIGN_DRAW = "FORCASH_SIGN_MORE" //签到第二次提现
const val CARRIERTYPE_SIGN_7 = "FORCASH_SIGN_AFTER7" //签到7天后的视频 const val CARRIERTYPE_SIGN_7 = "FORCASH_SIGN_AFTER7" //签到7天后的视频
const val CARRIERTYPE_TASK_YUANBAO = "REWARD_DI" //签到7天后的视频 const val CARRIERTYPE_TASK_YUANBAO = "REWARD_DI" //签到7天后的视频
const val CARRIERTYPE_REWARD_COIN = "REWARD_COIN" //红包提现页
const val CARRIERTYPE_REWARD_DI = "REWARD_DI" //元宝提现页
const val CARRIERTYPE_ONLY_SHOW = "ONLY_SHOW" //白嫖
const val CARRIERTYPE_SONG_CLICK = "REWARD_GUESS_SONG_CLICK" //不看视频点击答题 的入参 const val CARRIERTYPE_SONG_CLICK = "REWARD_GUESS_SONG_CLICK" //不看视频点击答题 的入参
......
...@@ -21,11 +21,13 @@ class DrawProgressActivity : BaseActivity(), View.OnClickListener { ...@@ -21,11 +21,13 @@ class DrawProgressActivity : BaseActivity(), View.OnClickListener {
companion object { companion object {
const val PROGRESS = "PROGRESS" const val PROGRESS = "PROGRESS"
const val MAX = "MAX" const val MAX = "MAX"
const val CARRIERTYPE = "CARRIERTYPE"
} }
private var progress = 0 private var progress = 0
private var max = 0 private var max = 0
private var tempAdProgress = 0 private var tempAdProgress = 0
private var carrierType = ""
override fun getContentViewLayoutID() = R.layout.activity_draw_progress override fun getContentViewLayoutID() = R.layout.activity_draw_progress
...@@ -40,6 +42,7 @@ class DrawProgressActivity : BaseActivity(), View.OnClickListener { ...@@ -40,6 +42,7 @@ class DrawProgressActivity : BaseActivity(), View.OnClickListener {
extras?.let { extras?.let {
progress = it.getInt(PROGRESS, 0) progress = it.getInt(PROGRESS, 0)
max = it.getInt(MAX, 0) max = it.getInt(MAX, 0)
carrierType = it.getString(CARRIERTYPE, "")
} }
} }
...@@ -93,7 +96,7 @@ class DrawProgressActivity : BaseActivity(), View.OnClickListener { ...@@ -93,7 +96,7 @@ class DrawProgressActivity : BaseActivity(), View.OnClickListener {
finish() finish()
} }
R.id.tv_draw_progress_ad -> { R.id.tv_draw_progress_ad -> {
showAd("") showAd(carrierType)
} }
} }
} }
......
...@@ -214,4 +214,8 @@ class MainActivity : BaseActivity(), View.OnClickListener { ...@@ -214,4 +214,8 @@ class MainActivity : BaseActivity(), View.OnClickListener {
} }
currentFragment = fragment currentFragment = fragment
} }
fun dismissDrawDialog(){
( myFragment as MyFragment ).dismissDrawCashDialog()
}
} }
\ No newline at end of file
...@@ -36,7 +36,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -36,7 +36,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
initLayout() initLayout()
} }
@SuppressLint("CutPasteId") @SuppressLint("CutPasteId")
...@@ -65,18 +64,13 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -65,18 +64,13 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
item_invitedCode.findViewById<TextView>(R.id.tv_right).text = item_invitedCode.findViewById<TextView>(R.id.tv_right).text =
userManager.codeId userManager.codeId
// item_phone.findViewById<TextView>(R.id.tv_title).text = "手机号" item_phone.findViewById<TextView>(R.id.tv_title).text = "问题反馈"
// val phone = ContextCompat.getDrawable(this, R.mipmap.icon_settings_tel) val phone = ContextCompat.getDrawable(this, R.mipmap.icon_settings_user)
// phone?.setBounds(0, 0, 56, 56) phone?.setBounds(0, 0, 56, 56)
// item_phone.findViewById<TextView>(R.id.tv_title) item_phone.findViewById<TextView>(R.id.tv_title)
// .setCompoundDrawables(phone, null, null, null) .setCompoundDrawables(phone, null, null, null)
// item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
// item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
// if (!TextUtils.isEmpty(userManager.mobile)) {
// item_phone.findViewById<TextView>(R.id.tv_right).text = userManager.mobile
// } else {
// item_phone.findViewById<TextView>(R.id.tv_right).text = "未绑定"
// }
item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存" item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存"
val cleanCache = ContextCompat.getDrawable(this, R.mipmap.icon_settings_clean) val cleanCache = ContextCompat.getDrawable(this, R.mipmap.icon_settings_clean)
...@@ -130,7 +124,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -130,7 +124,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
...@@ -163,10 +156,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -163,10 +156,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
cancelAccount() cancelAccount()
} }
R.id.item_phone -> { R.id.item_phone -> {
if (TextUtils.isEmpty(userManager.mobile)) { readyGo(FeedbackActivity::class.java)
readyGo(MobileLoginActivity::class.java)
return
}
} }
R.id.item_back -> { R.id.item_back -> {
} }
......
...@@ -5,16 +5,21 @@ import android.os.Handler ...@@ -5,16 +5,21 @@ import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.widget.FrameLayout
import com.duben.dayplaylet.MintsApplication import com.duben.dayplaylet.MintsApplication
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.express.ExpressAdCallback
import com.duben.dayplaylet.ad.express.ExpressManager
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.manager.TrackManager import com.duben.dayplaylet.manager.TrackManager
import com.duben.dayplaylet.ui.activitys.base.BaseActivity import com.duben.dayplaylet.ui.activitys.base.BaseActivity
import com.duben.dayplaylet.utils.ConsumerToastUtil import com.duben.dayplaylet.utils.ConsumerToastUtil
import com.duben.dayplaylet.utils.SpanUtils import com.duben.dayplaylet.utils.SpanUtils
import com.duben.dayplaylet.utils.UIUtils
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_task_award.* import kotlinx.android.synthetic.main.activity_task_award.*
...@@ -66,6 +71,7 @@ class TaskAwardActivity : BaseActivity(), View.OnClickListener { ...@@ -66,6 +71,7 @@ class TaskAwardActivity : BaseActivity(), View.OnClickListener {
} }
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
showAdView()
tv_award_hint.text = SpanUtils() tv_award_hint.text = SpanUtils()
.append("金元宝") .append("金元宝")
.setForegroundColor(context.resources.getColor(R.color.red)) .setForegroundColor(context.resources.getColor(R.color.red))
...@@ -216,4 +222,31 @@ class TaskAwardActivity : BaseActivity(), View.OnClickListener { ...@@ -216,4 +222,31 @@ class TaskAwardActivity : BaseActivity(), View.OnClickListener {
}, 800) }, 800)
} }
} }
private fun showAdView() {
MyExpressManager.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
adView?.let {
UIUtils.removeFromParent(it)
fl_ad.removeAllViews()
fl_ad.addView(it)
}
}
override fun renderSuccess(adView: FrameLayout?): Boolean {
adView?.let {
UIUtils.removeFromParent(it)
fl_ad.removeAllViews()
fl_ad.addView(it)
}
ExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
}
})
}
} }
\ No newline at end of file
...@@ -4,6 +4,8 @@ import android.view.LayoutInflater ...@@ -4,6 +4,8 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.manager.LocalVedioManager import com.duben.dayplaylet.manager.LocalVedioManager
import com.duben.dayplaylet.mvp.model.BannerList import com.duben.dayplaylet.mvp.model.BannerList
import com.duben.dayplaylet.mvp.model.VedioBean import com.duben.dayplaylet.mvp.model.VedioBean
...@@ -33,6 +35,9 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView { ...@@ -33,6 +35,9 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
watchRecordPresenter.attachView(this) watchRecordPresenter.attachView(this)
AppConfig.mainShowHalfAd = true
HalfScreenManager.getInstance().preLoadAd(this)
tv_title.text = "观看记录" tv_title.text = "观看记录"
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
......
...@@ -24,6 +24,7 @@ import com.duben.dayplaylet.ad.AdManager ...@@ -24,6 +24,7 @@ import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.banner.BannerManager import com.duben.dayplaylet.ad.banner.BannerManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.LocalVedioManager import com.duben.dayplaylet.manager.LocalVedioManager
...@@ -119,6 +120,11 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -119,6 +120,11 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
homePresenter.orders() homePresenter.orders()
homePresenter.getMyInfo() homePresenter.getMyInfo()
} }
if (AppConfig.mainShowHalfAd) {
AppConfig.mainShowHalfAd = false
HalfScreenManager.getInstance().showAd(requireActivity(), null)
}
} }
} }
...@@ -307,7 +313,20 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -307,7 +313,20 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
isShowSignFlag = true isShowSignFlag = true
if (!isShowNewuserFlag) { if (!isShowNewuserFlag) {
showSignDialog() HalfScreenManager.getInstance()
.showAd(requireActivity(), object : AdStatusListener {
override fun adSuccess() {
}
override fun adFail() {
showSignDialog()
}
override fun adClose(vo: HashMap<String, Any>?) {
showSignDialog()
}
})
} }
} }
} }
......
...@@ -9,6 +9,7 @@ import com.duben.dayplaylet.R ...@@ -9,6 +9,7 @@ import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManagerNoPre
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.UserManager import com.duben.dayplaylet.manager.UserManager
...@@ -90,6 +91,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -90,6 +91,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible() super.onFragmentFirstVisible()
HalfScreenManagerNoPre.getInstance().showAd(requireActivity(), null)
} }
override fun onDestroy() { override fun onDestroy() {
...@@ -115,7 +117,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -115,7 +117,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
when (v?.id) { when (v?.id) {
R.id.civ_my -> { // 跳转设置页 R.id.ll_my_info -> { // 跳转设置页
readyGo(SettingsActivity::class.java) readyGo(SettingsActivity::class.java)
} }
R.id.btn_my_draw -> { // 提现 R.id.btn_my_draw -> { // 提现
...@@ -161,7 +163,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -161,7 +163,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
btn_my_draw.setOnClickListener(this) btn_my_draw.setOnClickListener(this)
btn_task.setOnClickListener(this) btn_task.setOnClickListener(this)
tv_my_explain.setOnClickListener(this) tv_my_explain.setOnClickListener(this)
civ_my.setOnClickListener(this) ll_my_info.setOnClickListener(this)
rg_my_income.setOnCheckedChangeListener { group, checkedId -> rg_my_income.setOnCheckedChangeListener { group, checkedId ->
if (checkedId == R.id.rb_my_cash) { if (checkedId == R.id.rb_my_cash) {
...@@ -204,6 +206,10 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener { ...@@ -204,6 +206,10 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
} }
} }
fun dismissDrawCashDialog() {
drawCashDialog?.dismiss()
}
private fun showAd(carrierType: String) { private fun showAd(carrierType: String) {
AdManager.instance.showAd(requireActivity(), carrierType, AdManager.instance.showAd(requireActivity(), carrierType,
object : AdStatusListener { object : AdStatusListener {
......
package com.duben.dayplaylet.ui.fragment.draw package com.duben.dayplaylet.ui.fragment.draw
import android.text.TextUtils
import android.view.View import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
import com.duben.dayplaylet.mvp.model.DrawInfoBean
class DrawCashAdapter() : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_draw_cash) { class DrawCashAdapter :
BaseQuickAdapter<DrawInfoBean.DrawInfoItemBean, BaseViewHolder>(R.layout.item_draw_cash) {
private var mSelectIndex = 0 private var mSelectIndex = 0
...@@ -13,13 +16,19 @@ class DrawCashAdapter() : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item ...@@ -13,13 +16,19 @@ class DrawCashAdapter() : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item
mSelectIndex = 0 mSelectIndex = 0
} }
override fun convert(holder: BaseViewHolder, item: String) { override fun convert(holder: BaseViewHolder, item: DrawInfoBean.DrawInfoItemBean) {
holder.getView<View>(R.id.root_view).setOnClickListener { holder.getView<View>(R.id.root_view).setOnClickListener {
mOnClickListener?.onItemClick(holder.adapterPosition)
setPosition(holder.adapterPosition) setPosition(holder.adapterPosition)
notifyDataSetChanged()
} }
holder.setText(R.id.tv_cash, item) holder.setText(R.id.tv_cash, "${item.cash}元")
if (TextUtils.isEmpty(item.unitTag)) {
holder.getView<View>(R.id.tv_label).visibility = View.GONE
} else {
holder.getView<View>(R.id.tv_label).visibility = View.VISIBLE
holder.setText(R.id.tv_label, item.unitTag)
}
if (getPosition() == holder.adapterPosition) { if (getPosition() == holder.adapterPosition) {
//当前选中 //当前选中
...@@ -33,8 +42,19 @@ class DrawCashAdapter() : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item ...@@ -33,8 +42,19 @@ class DrawCashAdapter() : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item
fun getPosition() = mSelectIndex fun getPosition() = mSelectIndex
private fun setPosition(index: Int) { fun setPosition(index: Int) {
this.mSelectIndex = index this.mSelectIndex = index
notifyDataSetChanged()
} }
private var mOnClickListener: OnClickListener? = null
fun setOnClickListener(onClickListener: OnClickListener?) {
mOnClickListener = onClickListener
}
interface OnClickListener {
fun onItemClick(position: Int)
}
} }
\ No newline at end of file
...@@ -73,7 +73,7 @@ class DrawCashDialog(private val index: Int = 0) : BaseBottomSheetDialog() { ...@@ -73,7 +73,7 @@ class DrawCashDialog(private val index: Int = 0) : BaseBottomSheetDialog() {
} }
}) })
updateTab(tabLayout.getTabAt(0), true)
vp2.currentItem = index vp2.currentItem = index
} }
...@@ -107,22 +107,4 @@ class DrawCashDialog(private val index: Int = 0) : BaseBottomSheetDialog() { ...@@ -107,22 +107,4 @@ class DrawCashDialog(private val index: Int = 0) : BaseBottomSheetDialog() {
return view return view
} }
// 提现
private fun drawCash() {
// if (rbWechat.isChecked) wechatDrawCash()
// else alipayDrawCash()
}
// 微信提现
private fun wechatDrawCash() {
}
// 支付宝提现
private fun alipayDrawCash() {
}
} }
\ No newline at end of file
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<include <include
android:id="@+id/item_phone" android:id="@+id/item_phone"
android:visibility="gone"
layout="@layout/item_settings" /> layout="@layout/item_settings" />
<include <include
......
...@@ -168,6 +168,14 @@ ...@@ -168,6 +168,14 @@
android:text="秒后自动领取" android:text="秒后自动领取"
android:textColor="@color/graya" android:textColor="@color/graya"
android:textSize="13sp"></TextView> android:textSize="13sp"></TextView>
<com.duben.dayplaylet.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll"
android:layout_marginTop="2dp"
android:background="@drawable/shape_bg_write" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/selector_withdraw_wx" android:background="@drawable/selector_withdraw_wx"
android:button="@null" android:button="@null"
android:checked="true" /> android:checked="false" />
<RadioButton <RadioButton
android:id="@+id/rb_alipay" android:id="@+id/rb_alipay"
...@@ -83,21 +83,39 @@ ...@@ -83,21 +83,39 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/selector_withdraw_zfb" android:background="@drawable/selector_withdraw_zfb"
android:button="@null" android:button="@null"
android:checked="false" /> android:checked="true" />
</RadioGroup> </RadioGroup>
<Button <RelativeLayout
android:id="@+id/btn_draw" android:id="@+id/btn_draw"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@drawable/shape_withdraw_header" android:background="@drawable/shape_withdraw_header">
android:text="去提现"
android:textColor="@color/white" <ImageView
android:textSize="@dimen/font_size_16" /> android:id="@+id/iv_draw_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toLeftOf="@+id/tv_draw_next"
android:src="@mipmap/ic_ad"
android:visibility="gone" />
<TextView
android:id="@+id/tv_draw_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="10dp"
android:text="去提现"
android:textColor="@color/white"
android:textSize="@dimen/font_size_16" />
</RelativeLayout>
<View <View
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@mipmap/ic_withdraw_label" android:background="@mipmap/ic_withdraw_label"
android:gravity="center" android:gravity="center"
android:visibility="gone"
android:paddingLeft="2dp" android:paddingLeft="2dp"
android:paddingRight="2dp" android:paddingRight="2dp"
android:text="新人福利" android:text="新人福利"
......
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