Commit 3b33c748 authored by jyx's avatar jyx

代码优化

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