Commit d809c8ce authored by jyx's avatar jyx

代码优化

parent e9c5156c
...@@ -4,4 +4,7 @@ seeds.txt ...@@ -4,4 +4,7 @@ seeds.txt
unused.txt unused.txt
priguardMapping.txt priguardMapping.txt
/facai /facai
/smartclean /huawei
\ No newline at end of file /oppo
/xiaomi
/vivo
\ No newline at end of file
...@@ -9,15 +9,17 @@ import android.os.Bundle ...@@ -9,15 +9,17 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.text.TextUtils import android.text.TextUtils
import android.util.Log
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.widget.CompoundButton import android.widget.CompoundButton
import androidx.recyclerview.widget.GridLayoutManager import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alipay.sdk.app.OpenAuthTask import com.alipay.sdk.app.OpenAuthTask
import com.daimajia.androidanimations.library.Techniques import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.duben.library.utils.GlideUtils
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.loveplayletu.BuildConfig import com.duben.loveplayletu.BuildConfig
import com.duben.loveplayletu.R import com.duben.loveplayletu.R
import com.duben.loveplayletu.common.AppConfig import com.duben.loveplayletu.common.AppConfig
...@@ -33,8 +35,6 @@ import com.duben.loveplayletu.ui.adapter.VipBannerAdapter ...@@ -33,8 +35,6 @@ import com.duben.loveplayletu.ui.adapter.VipBannerAdapter
import com.duben.loveplayletu.ui.widgets.* import com.duben.loveplayletu.ui.widgets.*
import com.duben.loveplayletu.ui.widgets.countdowntimer.CountDownTimerSupport import com.duben.loveplayletu.ui.widgets.countdowntimer.CountDownTimerSupport
import com.duben.loveplayletu.ui.widgets.countdowntimer.OnCountDownTimerListener import com.duben.loveplayletu.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.duben.library.utils.GlideUtils
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.loveplayletu.utils.SpanUtils import com.duben.loveplayletu.utils.SpanUtils
import com.jobo.alipay.AliPay import com.jobo.alipay.AliPay
import com.jobo.alipay.AlipayInfoImpl import com.jobo.alipay.AlipayInfoImpl
...@@ -47,7 +47,7 @@ import com.tencent.mm.opensdk.openapi.IWXAPI ...@@ -47,7 +47,7 @@ import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.WXAPIFactory import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.youth.banner.listener.OnPageChangeListener import com.youth.banner.listener.OnPageChangeListener
import kotlinx.android.synthetic.main.activity_new_vip.* import kotlinx.android.synthetic.main.activity_new_vip.*
import java.net.URLDecoder import kotlinx.android.synthetic.main.header_layout.*
import java.net.URLEncoder import java.net.URLEncoder
...@@ -421,8 +421,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -421,8 +421,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private fun initRvView() { private fun initRvView() {
if (vipList != null && vipList!!.size > 0) { if (vipList != null && vipList!!.size > 0) {
val gridLayoutManager = LinearLayoutManager(this) val linearLayoutManager = LinearLayoutManager(this)
rvVip.layoutManager = gridLayoutManager linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
rvVip.layoutManager = linearLayoutManager
vipAdapter = VipAdapter(vipList!!) vipAdapter = VipAdapter(vipList!!)
rvVip.adapter = vipAdapter rvVip.adapter = vipAdapter
vipAdapter.setOnItemClickListener(this) vipAdapter.setOnItemClickListener(this)
......
...@@ -13,7 +13,7 @@ import com.duben.loveplayletu.mvp.model.VipBean ...@@ -13,7 +13,7 @@ import com.duben.loveplayletu.mvp.model.VipBean
import com.duben.loveplayletu.utils.BubbleUtils import com.duben.loveplayletu.utils.BubbleUtils
import com.duben.loveplayletu.utils.SpanUtils import com.duben.loveplayletu.utils.SpanUtils
class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : class VipAdapter(private val vipList: MutableList<VipBean.ListBean>) :
RecyclerView.Adapter<VipAdapter.ViewHolder>() { RecyclerView.Adapter<VipAdapter.ViewHolder>() {
var myPos: Int = 0 var myPos: Int = 0
...@@ -22,8 +22,8 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : ...@@ -22,8 +22,8 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
lateinit var mOnItemClickListener: OnItemClickListener lateinit var mOnItemClickListener: OnItemClickListener
init { init {
if (vipList != null && vipList.size > 0) { if (vipList.size > 0) {
for (i in 0..vipList.size - 1) { for (i in 0 until vipList.size) {
if (vipList[i].activityType == 1) { if (vipList[i].activityType == 1) {
myPos = i myPos = i
break break
...@@ -105,13 +105,13 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : ...@@ -105,13 +105,13 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}" // holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
//// holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}" //// holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
// } // }
if(vipBean.price==0.0){ if (vipBean.price == 0.0) {
holder.tvVipItemCurMoney.text = SpanUtils() holder.tvVipItemCurMoney.text = SpanUtils()
.append("0.01") .append("0.01")
.setFontSize(BubbleUtils.sp2px(34)) .setFontSize(BubbleUtils.sp2px(34))
.append("元") .append("元")
.create() .create()
}else{ } else {
holder.tvVipItemCurMoney.text = SpanUtils() holder.tvVipItemCurMoney.text = SpanUtils()
.append(vipBean.price.toString()) .append(vipBean.price.toString())
.setFontSize(BubbleUtils.sp2px(34)) .setFontSize(BubbleUtils.sp2px(34))
......
...@@ -47,11 +47,10 @@ ...@@ -47,11 +47,10 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvVip" android:id="@+id/rvVip"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="200dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:background="@null" android:background="@color/color_2F155E" />
android:overScrollMode="never" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="200dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
......
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