一些细节问题处理
This commit is contained in:
@@ -7,10 +7,13 @@ import androidx.core.view.isVisible
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity
|
||||
import com.nnbc123.app.ui.utils.loadAvatar
|
||||
import com.nnbc123.app.ui.utils.loadFromAssets
|
||||
import com.nnbc123.app.vip.VipHelper
|
||||
import com.nnbc123.core.user.bean.UserInfo
|
||||
import com.nnbc123.core.utils.CurrentTimeUtils
|
||||
import com.nnbc123.core.utils.ifNullOrEmpty
|
||||
import com.opensource.svgaplayer.SVGAImageView
|
||||
|
||||
|
||||
@@ -20,22 +23,38 @@ class RoomNewFriendsAdapter :
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: UserInfo) {
|
||||
helper.getView<ImageView>(R.id.iv_avatar).loadAvatar(item.avatar)
|
||||
helper.setText(R.id.tv_desc, item.userDesc)
|
||||
helper.setText(R.id.tv_desc, item.userDesc.ifNullOrEmpty { "我是个默认签名" })
|
||||
.setText(
|
||||
R.id.tv_age,
|
||||
((CurrentTimeUtils.getCurrentTime() - item.birth) / 1000 / 60 / 60 / 24 / 365).toString()
|
||||
)
|
||||
|
||||
helper.setBackgroundRes(
|
||||
R.id.ll_gender_age,
|
||||
if (item.gender == 1) R.drawable.shape_ff9cce_corner else R.drawable.shape_65d3f7_corner
|
||||
)
|
||||
helper.setBackgroundRes(
|
||||
R.id.iv_gender,
|
||||
if (item.gender == 1) R.drawable.ic_home_woman else R.drawable.ic_home_man
|
||||
)
|
||||
val tvOnlineText = helper.getView<TextView>(R.id.tv_online_text)
|
||||
val svgaLiving = helper.getView<SVGAImageView>(R.id.svga_living)
|
||||
val llOnline = helper.getView<View>(R.id.ll_online)
|
||||
val viewOnline = helper.getView<View>(R.id.view_online)
|
||||
|
||||
if (item.isBanAccount) {
|
||||
if (item.inRoomUid != 0L) {
|
||||
viewOnline.isVisible = true
|
||||
svgaLiving.isVisible = true
|
||||
tvOnlineText.isVisible = true
|
||||
tvOnlineText.text = "直播中"
|
||||
svgaLiving.loadFromAssets("svag/home_living.svga")
|
||||
svgaLiving.loadFromAssets("svga/home_living.svga")
|
||||
llOnline.setOnClickListener {
|
||||
|
||||
AVRoomActivity.start(mContext, item.inRoomUid)
|
||||
}
|
||||
} else {
|
||||
viewOnline.isVisible = false
|
||||
svgaLiving.isVisible = false
|
||||
tvOnlineText.isVisible = false
|
||||
svgaLiving.setImageResource(R.drawable.ic_new_friends_msg)
|
||||
tvOnlineText.text = "和TA聊"
|
||||
llOnline.setOnClickListener {
|
||||
|
@@ -6,6 +6,7 @@ import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
@@ -89,6 +90,11 @@ class RecommendFragment : BaseFragment(),
|
||||
initTitleTab()
|
||||
//initSingleAnchor()
|
||||
giftServiceAdapter = GiftServiceAdapter()
|
||||
giftServiceAdapter.setOnItemClickListener { _, _, position ->
|
||||
giftServiceAdapter.getItem(position)?.let {
|
||||
AVRoomActivity.start(mContext, it.roomUid)
|
||||
}
|
||||
}
|
||||
rvDelegate = RVDelegate.Builder<GiftServiceMsgVo>()
|
||||
.setAdapter(giftServiceAdapter)
|
||||
.setRecyclerView(mBinding.rvGiftService)
|
||||
@@ -177,6 +183,9 @@ class RecommendFragment : BaseFragment(),
|
||||
mBinding.rvGiftService.smoothScrollToPosition(index)
|
||||
}
|
||||
}
|
||||
mBinding.tvNewRefresh.setOnClickListener {
|
||||
homeViewModel.getNewFriendList()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initRefreshView() {
|
||||
@@ -237,6 +246,8 @@ class RecommendFragment : BaseFragment(),
|
||||
if (mFragmentsBottom.isEmpty()) {
|
||||
return
|
||||
}
|
||||
mBinding.tvNewRefresh.isVisible = position == 0
|
||||
mBinding.tvNewFilter.isVisible = position == 0
|
||||
mBinding.viewPager.currentItem = position
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_TJ_TABEXCHANGE, "用户切换tab次数,热门房间or组队开黑")
|
||||
|
@@ -585,8 +585,8 @@ public class ChargeActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void setWxPayFirst(int defaultType) {
|
||||
iv_type_first.setImageDrawable(getResources().getDrawable(R.drawable.dialog_charge_ic_alipay));
|
||||
iv_type_second.setImageDrawable(getResources().getDrawable(R.drawable.dialog_charge_ic_wechat));
|
||||
iv_type_first.setImageDrawable(getResources().getDrawable(R.drawable.dialog_charge_ic_wechat));
|
||||
iv_type_second.setImageDrawable(getResources().getDrawable(R.drawable.dialog_charge_ic_alipay));
|
||||
tv_type_first.setText("微信");
|
||||
tv_type_second.setText("支付宝");
|
||||
ll_type_first.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_WX, defaultType));
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/ic_home_arrow_new.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_home_arrow_new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 303 B |
BIN
app/src/main/res/drawable-xhdpi/ic_home_refresh_new.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_home_refresh_new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 584 B |
@@ -266,11 +266,39 @@
|
||||
android:paddingLeft="13dp"
|
||||
android:paddingRight="10dp" />
|
||||
|
||||
<com.nnbc123.library.widget.DrawableCenterTextView
|
||||
android:id="@+id/tv_new_refresh"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/shape_white_round_23dp"
|
||||
android:drawableEnd="@drawable/ic_home_refresh_new"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="换一换"
|
||||
android:textColor="#ff878b9c"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<com.nnbc123.library.widget.DrawableCenterTextView
|
||||
android:id="@+id/tv_new_filter"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/shape_white_round_23dp"
|
||||
android:drawableEnd="@drawable/ic_home_arrow_new"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="所有"
|
||||
android:textColor="#ff878b9c"
|
||||
android:textSize="11sp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -89,8 +89,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_room_tag"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_room_tag">
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_room_tag"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_room_title">
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_0"
|
||||
|
@@ -138,7 +138,8 @@
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/svga_living"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp" />
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_online_text"
|
||||
|
@@ -208,6 +208,8 @@ public class UserInfo implements Serializable {
|
||||
private long limitChargeEndTime;
|
||||
private boolean banAccount;
|
||||
|
||||
private long inRoomUid;
|
||||
|
||||
public UserInfo() {
|
||||
}
|
||||
|
||||
@@ -518,6 +520,14 @@ public class UserInfo implements Serializable {
|
||||
this.userHeadwear = userHeadwear;
|
||||
}
|
||||
|
||||
public long getInRoomUid() {
|
||||
return inRoomUid;
|
||||
}
|
||||
|
||||
public void setInRoomUid(long inRoomUid) {
|
||||
this.inRoomUid = inRoomUid;
|
||||
}
|
||||
|
||||
public Map<String, Object> toMap(@Nullable Map<String, Object> map, UserInfo userInfo) {
|
||||
if (map == null) {
|
||||
map = new HashMap<>();
|
||||
|
Reference in New Issue
Block a user