Commit 185da2bb authored by jyx's avatar jyx

代码优化

parent e5e5fa0d
...@@ -34,7 +34,7 @@ class CoinRecordActivity : BaseActivity(), CoinRecordView, OnRefreshListener, On ...@@ -34,7 +34,7 @@ class CoinRecordActivity : BaseActivity(), CoinRecordView, OnRefreshListener, On
iv_left_icon.setOnClickListener { finish() } iv_left_icon.setOnClickListener { finish() }
coinRecordAdapter = CoinRecordAdapter() coinRecordAdapter = CoinRecordAdapter()
val emptyView = LayoutInflater.from(this).inflate(R.layout.item_empty_history, null) val emptyView = LayoutInflater.from(this).inflate(R.layout.item_empty_data, null)
coinRecordAdapter.setEmptyView(emptyView) coinRecordAdapter.setEmptyView(emptyView)
rv_coin_record.layoutManager = LinearLayoutManager(this) rv_coin_record.layoutManager = LinearLayoutManager(this)
rv_coin_record.adapter = coinRecordAdapter rv_coin_record.adapter = coinRecordAdapter
......
...@@ -149,6 +149,12 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView { ...@@ -149,6 +149,12 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
val emptyView2 = LayoutInflater.from(this).inflate(R.layout.item_empty_data, null) val emptyView2 = LayoutInflater.from(this).inflate(R.layout.item_empty_data, null)
mShareInviteAdapter.setEmptyView(emptyView2) mShareInviteAdapter.setEmptyView(emptyView2)
rcy_my_invite.adapter = mShareInviteAdapter rcy_my_invite.adapter = mShareInviteAdapter
if (UserManager.getInstance().userSex == 1) {
tv_tips.visibility = View.GONE
tv_tip2.visibility = View.GONE
}
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
......
...@@ -4,6 +4,7 @@ import android.graphics.Color ...@@ -4,6 +4,7 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewOutlineProvider
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
...@@ -56,6 +57,7 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -56,6 +57,7 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
blurViewHead.setupWith(holder.itemView as ViewGroup) blurViewHead.setupWith(holder.itemView as ViewGroup)
.setFrameClearDrawable(holder.itemView.background) .setFrameClearDrawable(holder.itemView.background)
.setBlurRadius(10f) .setBlurRadius(10f)
blurViewHead.clipToOutline = true
} else { } else {
holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName
blurViewHead.visibility = View.GONE blurViewHead.visibility = View.GONE
...@@ -116,11 +118,15 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou ...@@ -116,11 +118,15 @@ class SquareAdapter : BaseQuickAdapter<HallList.ListDTO, BaseViewHolder>(R.layou
blurViewHead.visibility = View.VISIBLE blurViewHead.visibility = View.VISIBLE
blurViewHead.setupWith(holder.itemView as ViewGroup) blurViewHead.setupWith(holder.itemView as ViewGroup)
.setFrameClearDrawable(ColorDrawable(Color.RED)) .setFrameClearDrawable(ColorDrawable(Color.RED))
.setBlurRadius(30f) .setBlurRadius(10f)
blurViewImages.visibility = View.VISIBLE blurViewImages.visibility = View.VISIBLE
blurViewImages.setupWith(holder.itemView as ViewGroup) blurViewImages.setupWith(holder.itemView as ViewGroup)
.setFrameClearDrawable(ColorDrawable(Color.RED)) .setFrameClearDrawable(ColorDrawable(Color.RED))
.setBlurRadius(30f) .setBlurRadius(10f)
blurViewHead.outlineProvider = ViewOutlineProvider.BACKGROUND
blurViewHead.clipToOutline = true
blurViewImages.outlineProvider = ViewOutlineProvider.BACKGROUND
blurViewImages.clipToOutline = true
} else { } else {
holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName holder.getView<TextView>(R.id.tv_recommend_name).text = item.nickName
blurViewHead.visibility = View.GONE blurViewHead.visibility = View.GONE
......
...@@ -89,8 +89,8 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene ...@@ -89,8 +89,8 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
LayoutInflater.from(requireContext()).inflate(R.layout.item_empty_data, null) LayoutInflater.from(requireContext()).inflate(R.layout.item_empty_data, null)
squareAdapter.setEmptyView(emptyView) squareAdapter.setEmptyView(emptyView)
squareAdapter.setOnItemClickListener { adapter, view, position -> squareAdapter.setOnItemClickListener { adapter, view, position ->
if (mType == 2 && !UserManager.getInstance().vipFlag) { if (mType == 3 && !UserManager.getInstance().vipFlag) {
showUnlockWechatDialog(squareAdapter.data[position].headerUrl) showSquareNewDialog(squareAdapter.data[position].headerUrl)
return@setOnItemClickListener return@setOnItemClickListener
} }
val bundle = Bundle() val bundle = Bundle()
...@@ -100,7 +100,7 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene ...@@ -100,7 +100,7 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
squareAdapter.setOnClickLikeListener(object : SquareAdapter.OnClickLikeListener { squareAdapter.setOnClickLikeListener(object : SquareAdapter.OnClickLikeListener {
override fun onClickLike(position: Int) { override fun onClickLike(position: Int) {
if (mType == 2 && !UserManager.getInstance().vipFlag) { if (mType == 2 && !UserManager.getInstance().vipFlag) {
showUnlockWechatDialog(squareAdapter.data[position].headerUrl) showSquareNewDialog(squareAdapter.data[position].headerUrl)
return return
} }
val likeStatus = if (squareAdapter.data[position].likeStatus == 0) { val likeStatus = if (squareAdapter.data[position].likeStatus == 0) {
...@@ -117,7 +117,7 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene ...@@ -117,7 +117,7 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
}) })
} }
private fun showUnlockWechatDialog(headUrl: String) { private fun showSquareNewDialog(headUrl: String) {
SquareNewDialog( SquareNewDialog(
requireContext(), requireContext(),
headUrl, headUrl,
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<corners android:radius="10dip" />
</shape>
\ No newline at end of file
...@@ -289,6 +289,7 @@ ...@@ -289,6 +289,7 @@
android:textColor="@color/color_F1D6BA" /> android:textColor="@color/color_F1D6BA" />
<TextView <TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
...@@ -296,6 +297,7 @@ ...@@ -296,6 +297,7 @@
android:textColor="@color/color_F1D6BA" /> android:textColor="@color/color_F1D6BA" />
<TextView <TextView
android:id="@+id/tv_tip2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
android:id="@+id/tv_unlock" android:id="@+id/tv_unlock"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="80dp" android:layout_marginTop="50dp"
android:layout_marginBottom="20dp"
android:textColor="@color/color_FCE8BA" android:textColor="@color/color_FCE8BA"
android:textSize="16sp" /> android:textSize="16sp" />
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
android:id="@+id/tv_vip_btn" android:id="@+id/tv_vip_btn"
android:layout_width="260dp" android:layout_width="260dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginTop="40dp" android:layout_marginTop="10dp"
android:background="@drawable/shape_bg_hall_btn2" android:background="@drawable/shape_bg_hall_btn2"
android:gravity="center" android:gravity="center"
android:text="分享得会员" android:text="分享得会员"
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
android:id="@+id/item_blurview_head" android:id="@+id/item_blurview_head"
android:layout_width="110dp" android:layout_width="110dp"
android:layout_height="110dp" android:layout_height="110dp"
android:background="@drawable/shape_blur_round"
android:visibility="gone" /> android:visibility="gone" />
</FrameLayout> </FrameLayout>
......
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