Commit f0cc5af9 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 179518ae
...@@ -14,7 +14,7 @@ object Constant { ...@@ -14,7 +14,7 @@ object Constant {
const val LOAN_PERMISSION_FLAG = "loan_permission_flag" const val LOAN_PERMISSION_FLAG = "loan_permission_flag"
const val FIRST_SPLASH = "first_splash" const val FIRST_SPLASH = "first_splash"
const val IS_FIRST_AGREE_BTN = "is_first_agree_btn" const val IS_FIRST_AGREE_BTN = "is_first_agree_btn"
const val IS_FIRST_VIP_NUM = "is_first_agree_num" const val IS_FIRST_VIP_BTN = "is_first_agree_btn"
const val TAG_NAME = "SUN" const val TAG_NAME = "SUN"
const val MINTS_APP_NAME = "河狸短视频" const val MINTS_APP_NAME = "河狸短视频"
const val MINTS_PKG_NAME = "com.mints.wisdomclean" const val MINTS_PKG_NAME = "com.mints.wisdomclean"
......
...@@ -142,12 +142,10 @@ class SplashActivity : BaseActivity() { ...@@ -142,12 +142,10 @@ class SplashActivity : BaseActivity() {
* 跳转到主页面 * 跳转到主页面
*/ */
private fun goToMainActivity() { private fun goToMainActivity() {
// if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) { // val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
// if ((UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) || !vipEnter) {
var vipEnterNum = AppPreferencesManager.get().getInt(Constant.IS_FIRST_VIP_NUM, 1) if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
if (!UserManager.getInstance().vipFlag && vipEnterNum <= 1) { // AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_NUM, vipEnterNum++)
// 匹配用户 且 不是vip // 匹配用户 且 不是vip
val bundle = Bundle() val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true) bundle.putBoolean(VipActivity.IS_GUIDE, true)
......
...@@ -95,11 +95,10 @@ class SplashAdActivity : BaseActivity() { ...@@ -95,11 +95,10 @@ class SplashAdActivity : BaseActivity() {
* 跳转到主页面 * 跳转到主页面
*/ */
private fun goToMainActivity() { private fun goToMainActivity() {
// if (UserManager.getInstance().newFlag&&!UserManager.getInstance().vipFlag) { // val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
var vipEnterNum = AppPreferencesManager.get().getInt(Constant.IS_FIRST_VIP_NUM, 1) // if ((UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) || !vipEnter) {
if (!UserManager.getInstance().vipFlag && vipEnterNum <= 1) { if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_NUM, vipEnterNum++) // AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip // 匹配用户 且 不是vip
val bundle = Bundle() val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true) bundle.putBoolean(VipActivity.IS_GUIDE, true)
......
...@@ -130,7 +130,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -130,7 +130,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
ll_vip_alipay.visibility = View.GONE ll_vip_alipay.visibility = View.GONE
ll_vip_wx.visibility = View.VISIBLE ll_vip_wx.visibility = View.VISIBLE
payType = WEIXIN_PAY payType = WEIXIN_PAY
iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable) iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none) iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none)
} }
...@@ -189,7 +189,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -189,7 +189,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
when (keyCode) { when (keyCode) {
KeyEvent.KEYCODE_BACK -> { KeyEvent.KEYCODE_BACK -> {
if (!UserManager.getInstance().vipFlag && vipList != null && vipList!!.size > 0) { if (!UserManager.getInstance().vipFlag && UserManager.getInstance().newFlag
&& vipList != null && vipList!!.size > 0
) {
vipAdapter.setPosition(0) vipAdapter.setPosition(0)
vipAdapter.notifyDataSetChanged() vipAdapter.notifyDataSetChanged()
...@@ -220,7 +222,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -220,7 +222,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
when (v?.id) { when (v?.id) {
R.id.ic_vip_quit -> { R.id.ic_vip_quit -> {
if (!UserManager.getInstance().vipFlag && vipList != null && vipList!!.size > 0) { if (!UserManager.getInstance().vipFlag && UserManager.getInstance().newFlag &&
vipList != null && vipList!!.size > 0
) {
vipAdapter.setPosition(0) vipAdapter.setPosition(0)
vipAdapter.notifyDataSetChanged() vipAdapter.notifyDataSetChanged()
val vipBean = vipList!![0] val vipBean = vipList!![0]
......
...@@ -39,7 +39,7 @@ class TopAdapter(val topList: MutableList<VedioBean>?) : ...@@ -39,7 +39,7 @@ class TopAdapter(val topList: MutableList<VedioBean>?) :
val topBean = topList?.get(position) val topBean = topList?.get(position)
if (topBean != null) { if (topBean != null) {
holder.tvTopItemLable.text = "${position + 1}" holder.tvTopItemLable.text = "${position + 1}"
holder.tvTopItemCount.text = topBean.hot holder.tvTopItemCount.text = topBean.showNum
holder.tvTopItemTitle.text = "${topBean.title}" holder.tvTopItemTitle.text = "${topBean.title}"
if (topBean.orderTags != null && topBean.orderTags.size > 0) { if (topBean.orderTags != null && topBean.orderTags.size > 0) {
val sb = StringBuilder() val sb = StringBuilder()
......
...@@ -177,6 +177,7 @@ ...@@ -177,6 +177,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="我去平行时空" android:text="我去平行时空"
android:singleLine="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" /> android:textSize="14sp" />
...@@ -186,6 +187,8 @@ ...@@ -186,6 +187,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="重生 虐恋" android:text="重生 虐恋"
android:singleLine="true"
android:layout_marginBottom="2dp"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="10sp" /> android:textSize="10sp" />
...@@ -194,6 +197,7 @@ ...@@ -194,6 +197,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="重生 虐恋" android:text="重生 虐恋"
android:singleLine="true"
android:textColor="@color/graya" android:textColor="@color/graya"
android:textSize="10sp" /> android:textSize="10sp" />
</LinearLayout> </LinearLayout>
...@@ -213,7 +217,7 @@ ...@@ -213,7 +217,7 @@
<TextView <TextView
android:id="@+id/tv_main_watching_goto" android:id="@+id/tv_main_watching_goto"
android:layout_width="wrap_content" android:layout_width="120dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
......
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