Commit 3b33c748 authored by jyx's avatar jyx

代码优化

parent 13befde2
...@@ -209,7 +209,7 @@ class VipPresenter : BasePresenter<VipView>() { ...@@ -209,7 +209,7 @@ class VipPresenter : BasePresenter<VipView>() {
val code: Int = baseResponse.getStatus() val code: Int = baseResponse.getStatus()
when (code) { when (code) {
200 -> { 200 -> {
view.getVipPayParamsSuc("ALIPAY", baseResponse.data, enter) view.getVipPayParamsSuc(payChannel, baseResponse.data, enter)
} }
else -> { else -> {
......
...@@ -70,7 +70,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -70,7 +70,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
const val IS_MAIN = "IS_MAIN"//是否从首页进入 const val IS_MAIN = "IS_MAIN"//是否从首页进入
const val IS_RECOMMEND = "IS_RECOMMEND"//是否从推荐页进入 const val IS_RECOMMEND = "IS_RECOMMEND"//是否从推荐页进入
const val wxAppId = BuildConfig.WEIXIN_APP_PAY_ID const val wxAppId = BuildConfig.WEIXIN_APP_PAY_ID
const val WEIXIN_PAY = "WEIXIN_PAY" const val WEIXIN_PAY = "WEIXIN"
const val ALIPAY = "ALIPAY" const val ALIPAY = "ALIPAY"
const val THIRD_ID = "THIRD_ID" const val THIRD_ID = "THIRD_ID"
const val VEDIO_ID = "VEDIO_ID" const val VEDIO_ID = "VEDIO_ID"
...@@ -310,6 +310,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -310,6 +310,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
if (!TextUtils.isEmpty(bean.remarks)) { if (!TextUtils.isEmpty(bean.remarks)) {
tv_vip_hint.text = bean.remarks tv_vip_hint.text = bean.remarks
tv_vip_hint.visibility = View.VISIBLE tv_vip_hint.visibility = View.VISIBLE
ll_vip_wx.visibility = View.GONE
if (bean.isShowCycTips) { if (bean.isShowCycTips) {
tv_vip_hint.setTextColor(Color.parseColor("#FFAC5E")) tv_vip_hint.setTextColor(Color.parseColor("#FFAC5E"))
tv_vip_hint.textSize = 12f tv_vip_hint.textSize = 12f
...@@ -318,6 +319,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -318,6 +319,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
tv_vip_hint.textSize = 10f tv_vip_hint.textSize = 10f
} }
} else { } else {
ll_vip_wx.visibility = View.VISIBLE
tv_vip_hint.visibility = View.GONE tv_vip_hint.visibility = View.GONE
} }
if (bean.isShowCycTips) { if (bean.isShowCycTips) {
...@@ -554,6 +556,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On ...@@ -554,6 +556,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
val linearLayoutManager = LinearLayoutManager(this) val linearLayoutManager = LinearLayoutManager(this)
linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
rvVip.layoutManager = linearLayoutManager rvVip.layoutManager = linearLayoutManager
rvVip.setItemViewCacheSize(0)
rvVip.isDrawingCacheEnabled = false
vipAdapter = VipAdapter(vipList) vipAdapter = VipAdapter(vipList)
rvVip.adapter = vipAdapter rvVip.adapter = vipAdapter
vipAdapter.setOnItemClickListener(this) vipAdapter.setOnItemClickListener(this)
......
...@@ -24,9 +24,10 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -24,9 +24,10 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
override fun convert(holder: BaseViewHolder, item: HallList.ListDTO) { override fun convert(holder: BaseViewHolder, item: HallList.ListDTO) {
if (!item.distance.isNullOrEmpty()) { if (!item.distance.isNullOrEmpty()) {
if(item.distance.contains("·")){ if (item.distance.contains("·")) {
holder.getView<TextView>(R.id.tv_recommend_location).text = "" + item.distance + "KM" holder.getView<TextView>(R.id.tv_recommend_location).text =
}else{ "" + item.distance + "KM"
} else {
holder.getView<TextView>(R.id.tv_recommend_location).text = "" + item.distance holder.getView<TextView>(R.id.tv_recommend_location).text = "" + item.distance
} }
} else { } else {
...@@ -98,16 +99,13 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -98,16 +99,13 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
holder.getView<LinearLayout>(R.id.ll_recommend_root) holder.getView<LinearLayout>(R.id.ll_recommend_root)
.setBackgroundResource(R.drawable.shape_bg_black) .setBackgroundResource(R.drawable.shape_bg_black)
if(item.headerUrl!=null&&!TextUtils.isEmpty(item.headerUrl)){ loadSquareImageView(
loadSquareImageView( context,
context, item.headerUrl,
item.headerUrl, holder.getView(R.id.iv_recommend_header),
holder.getView(R.id.iv_recommend_header), isBlur,
isBlur, R.mipmap.ic_default_avatar_female
R.mipmap.ic_default_avatar_female )
)
}
holder.getView<RelativeLayout>(R.id.rl_album).visibility = View.VISIBLE holder.getView<RelativeLayout>(R.id.rl_album).visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_status).visibility = View.VISIBLE holder.getView<TextView>(R.id.tv_status).visibility = View.VISIBLE
...@@ -223,7 +221,7 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -223,7 +221,7 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
fun loadSquareImageView( fun loadSquareImageView(
ctx: Context, ctx: Context,
path: String, path: String?,
iv: ImageView, iv: ImageView,
isBlur: Boolean, isBlur: Boolean,
defaultImage: Int = R.mipmap.ic_default_avatar_male defaultImage: Int = R.mipmap.ic_default_avatar_male
...@@ -234,8 +232,13 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -234,8 +232,13 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
if (UserManager.getInstance().userSex != 1) { if (UserManager.getInstance().userSex != 1) {
// 用户是女的,看的只有男的 // 用户是女的,看的只有男的
GlideUtils.loadThumbRound2ImageView(ctx, path, iv, defaultImage) GlideUtils.loadThumbRound2ImageView(ctx, path, iv, defaultImage)
}else{ } else {
GlideUtils.loadThumbRound2ImageView(ctx, path, iv, R.mipmap.ic_default_avatar_female) GlideUtils.loadThumbRound2ImageView(
ctx,
path,
iv,
R.mipmap.ic_default_avatar_female
)
} }
} }
......
...@@ -66,9 +66,9 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene ...@@ -66,9 +66,9 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
override fun onFragmentResume() { override fun onFragmentResume() {
super.onFragmentResume() super.onFragmentResume()
if (::squareAdapter.isInitialized && !squareAdapter.isBlur() && UserManager.getInstance().vipFlag) { // if (::squareAdapter.isInitialized && !squareAdapter.isBlur() && UserManager.getInstance().vipFlag) {
squareAdapter.setIsBlur(true) // squareAdapter.setIsBlur(true)
} // }
} }
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
app:layout_behavior=".ui.widgets.AppBarLayoutBehavior">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -93,25 +92,25 @@ ...@@ -93,25 +92,25 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#90000000" android:background="#90000000"
android:visibility="gone" android:orientation="vertical"
android:orientation="vertical"> android:visibility="gone">
<ImageView <ImageView
android:id="@+id/iv_user_next" android:id="@+id/iv_user_next"
android:layout_width="330dp" android:layout_width="330dp"
android:layout_centerInParent="true"
android:layout_height="315dp" android:layout_height="315dp"
android:layout_centerInParent="true"
android:src="@mipmap/bg_new_girl" /> android:src="@mipmap/bg_new_girl" />
<ImageView <ImageView
android:visibility="gone"
android:id="@+id/iv_user_quit" android:id="@+id/iv_user_quit"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:padding="10dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:src="@mipmap/bg_pay_calcel" /> android:padding="10dp"
android:src="@mipmap/bg_pay_calcel"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
......
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