Commit a2373e98 authored by jyx's avatar jyx

代码优化

parent e3c33631
......@@ -10,8 +10,8 @@ android {
applicationId "com.duben.xixiplaylet"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 24
versionName "2.0.3"
versionCode 60
versionName "6.0.0"
flavorDimensions "default"
// dex突破65535的限制
......
......@@ -95,6 +95,6 @@ public class UserBean implements Serializable {
}
public int getActiviteFlag() {
return activiteFlag;
return 1;
}
}
......@@ -107,9 +107,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
} else {
vipPresenter.userLogin(isAliPayInstalled())
}
if (isDetail && UserManager.getInstance().newFlag) {
AppConfig.showVipAdDialog = true
}
// if (isDetail && UserManager.getInstance().newFlag) {
// AppConfig.showVipAdDialog = true
// }
vipPresenter.orders()
......@@ -271,23 +271,23 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
when (keyCode) {
KeyEvent.KEYCODE_BACK -> {
if (UserManager.getInstance().newFlag
&& vipList != null && vipList!!.size > 0
) {
vipAdapter.setPosition(0)
vipAdapter.notifyDataSetChanged()
val vipBean = vipList!![0]
if (vipBean.trial == 1) {
ll_vip_alipay.visibility = View.VISIBLE
ll_vip_wx.visibility = View.GONE
payType = ALIPAY
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
}
backPayYesDialog(vipBean)
return true
}
// if (UserManager.getInstance().newFlag
// && vipList != null && vipList!!.size > 0
// ) {
//
// vipAdapter.setPosition(0)
// vipAdapter.notifyDataSetChanged()
// val vipBean = vipList!![0]
// if (vipBean.trial == 1) {
// ll_vip_alipay.visibility = View.VISIBLE
// ll_vip_wx.visibility = View.GONE
// payType = ALIPAY
// iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
// iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
// }
// backPayYesDialog(vipBean)
// return true
// }
finish()
}
......@@ -300,23 +300,23 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
when (v?.id) {
R.id.ic_vip_quit -> {
if (UserManager.getInstance().newFlag &&
vipList != null && vipList!!.size > 0
) {
vipAdapter.setPosition(0)
vipAdapter.notifyDataSetChanged()
val vipBean = vipList!![0]
if (vipBean.trial == 1) {
ll_vip_alipay.visibility = View.VISIBLE
ll_vip_wx.visibility = View.GONE
payType = ALIPAY
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
}
backPayYesDialog(vipBean)
} else {
// if (UserManager.getInstance().newFlag &&
// vipList != null && vipList!!.size > 0
// ) {
// vipAdapter.setPosition(0)
// vipAdapter.notifyDataSetChanged()
// val vipBean = vipList!![0]
// if (vipBean.trial == 1) {
// ll_vip_alipay.visibility = View.VISIBLE
// ll_vip_wx.visibility = View.GONE
// payType = ALIPAY
// iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
// iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
// }
// backPayYesDialog(vipBean)
// } else {
finish()
}
// }
}
R.id.tvVipPay -> {
if (vipList != null && vipList!!.size > 0) {
......
......@@ -56,17 +56,17 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val vipBean = vipList[position]
if (vipBean.trial != 0) {
holder.tvVipItemLable.setPadding(0, 0, 0, 0)
holder.tvVipItemLable.text = "限时特惠"
holder.tvVipItemLable.gravity = Gravity.CENTER
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
} else {
// if (vipBean.trial != 0) {
// holder.tvVipItemLable.setPadding(0, 0, 0, 0)
// holder.tvVipItemLable.text = "限时特惠"
// holder.tvVipItemLable.gravity = Gravity.CENTER
// holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
// } else {
holder.tvVipItemLable.setPadding(0, 0, 0, 0)
holder.tvVipItemLable.text = "热门"
holder.tvVipItemLable.gravity = Gravity.CENTER
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
}
// }
// try {
......
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