feat:UI 調整
This commit is contained in:
@@ -1496,8 +1496,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
private fun playMemberInAnim(text: String, svgaVideoEntity: SVGAVideoEntity) {
|
||||
binding.roomMenberInSvga.visibility = VISIBLE
|
||||
binding.roomMenberInSvga.loops = 10000
|
||||
// binding.roomMenberInSvga.clearsAfterStop = true
|
||||
binding.roomMenberInSvga.loops = 1
|
||||
binding.roomMenberInSvga.clearsAfterStop = true
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字體顏色
|
||||
|
@@ -79,9 +79,9 @@ public abstract class RecentViewHolder extends RecyclerViewHolder<BaseQuickAdapt
|
||||
|
||||
protected void updateBackground(NIMBaseViewHolder holder, RecentContact recent, int position) {
|
||||
if ((recent.getTag() & RecentContactsFragment.RECENT_TAG_STICKY) == 0) {
|
||||
holder.getConvertView().setBackgroundResource(R.color.transparent);
|
||||
holder.getConvertView().setBackgroundResource(R.drawable.shape_white_corner_8dp);
|
||||
} else {
|
||||
holder.getConvertView().setBackgroundResource(R.color.transparent);
|
||||
holder.getConvertView().setBackgroundResource(R.drawable.shape_white_corner_8dp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -50,6 +50,8 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import com.youth.banner.listener.OnPageChangeListener
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
||||
import java.text.SimpleDateFormat
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
@@ -132,6 +134,7 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
// 页面被选中,position 已更新
|
||||
currentIndex = position
|
||||
vipViewModel.onItemSelect(position)
|
||||
refreshBottomArea()
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
@@ -180,6 +183,7 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
binding.recyclerViewBottom.isNestedScrollingEnabled = false
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun handleViewModel() {
|
||||
vipViewModel.getVipPageInfo()
|
||||
|
||||
@@ -219,21 +223,20 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
vipViewModel.vipInfosLiveData.observe(this) {
|
||||
it?.let { // ArrayList[VipInfo] 每个等级的 VIP 内容
|
||||
// TODO 初始化轮播组件
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
vipViewModel.myVipInfoLiveData.observe(this) {
|
||||
it?.let {
|
||||
|
||||
val adapter = vipViewModel.vipInfosLiveData.value?.let { it1 ->
|
||||
VipCenterBannerAdapter(this,
|
||||
it1, it)
|
||||
}
|
||||
banner.setAdapter(adapter, false)
|
||||
banner.setCurrentItem(it.currLevel - 1)
|
||||
//TODO 处理有 VIP 的情况,banner 要跳转到对应 index
|
||||
// bannerView.visibility = View.VISIBLE
|
||||
lifecycleScope.launch {
|
||||
delay(500)
|
||||
banner.setCurrentItem(it.vipLevel-1)
|
||||
}
|
||||
// bannerView.post {
|
||||
// binding.bannerView.setPageMargin(UIUtil.dip2px(mContext, 8.0))
|
||||
// .setScrollDuration(800)
|
||||
@@ -256,7 +259,6 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
binding.slAuth.isVisible = false
|
||||
binding.bannerView.isVisible = false
|
||||
binding.layoutBottomPanel.isVisible = false
|
||||
// loadSVGA(binding.ivNotOpenIcon, it.vipLogo)
|
||||
} else {
|
||||
val myVipInfo = vipViewModel.myVipInfoLiveData.value
|
||||
// TODO 根据当前显示的 VIP 信息更新 UI
|
||||
@@ -264,7 +266,7 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
authAdapter.notifyDataSetChanged()
|
||||
handleIdentificationAreaContent(it)
|
||||
vipIdentificationsAdapter.setVipInfo(it)
|
||||
refreshOpenVipState()
|
||||
refreshBottomArea()
|
||||
}
|
||||
|
||||
} ?: run {
|
||||
@@ -317,12 +319,12 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
|
||||
private fun loadChargeList(list: List<ChargeBean>) {
|
||||
this.chargeList = list
|
||||
refreshOpenVipState()
|
||||
refreshBottomArea()
|
||||
}
|
||||
|
||||
private fun checkBuyVip(block: () -> Unit) {
|
||||
val myVipInfo = vipViewModel.myVipInfoLiveData.value
|
||||
val currentVipInfo = vipViewModel.currVipInfoLiveData.value
|
||||
val currentVipInfo = vipViewModel.vipInfosLiveData.value?.get(currentIndex)
|
||||
if (currentVipInfo != null && myVipInfo != null && currentVipInfo.vipLevel > myVipInfo.vipLevel) {
|
||||
val message = context.getString(R.string.vip_buy_tips).format(
|
||||
myVipInfo.vipName,currentVipInfo.vipName
|
||||
@@ -399,6 +401,42 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshBottomArea() {
|
||||
val currentPageVipInfo = vipViewModel.vipInfosLiveData.value?.get(currentIndex)
|
||||
currentPageVipInfo?.let {
|
||||
if (it.buyAmount == 0) {
|
||||
binding.tvNoticeText.visibility = View.VISIBLE
|
||||
binding.tvAdditionalText.visibility = View.GONE
|
||||
binding.tvOpenVip.visibility = View.GONE
|
||||
binding.layoutOpenVip.visibility = View.GONE
|
||||
binding.tvIcon.visibility = View.GONE
|
||||
|
||||
getString(R.string.vip_center_9).format(
|
||||
currentPageVipInfo.vipLevel
|
||||
).also { binding.tvNoticeText.text = it }
|
||||
} else {
|
||||
binding.tvNoticeText.visibility = View.GONE
|
||||
binding.tvAdditionalText.visibility = View.VISIBLE
|
||||
binding.tvOpenVip.visibility = View.VISIBLE
|
||||
binding.layoutOpenVip.visibility = View.VISIBLE
|
||||
binding.tvIcon.visibility = View.VISIBLE
|
||||
"${it.buyAmount} ${
|
||||
getString(R.string.vip_center_5).format(
|
||||
" / 30"
|
||||
)
|
||||
}".also { binding.tvOpenVip.text = it }
|
||||
|
||||
val calendar = Calendar.getInstance()
|
||||
calendar.add(Calendar.DAY_OF_YEAR, 30)
|
||||
val dateFormat = SimpleDateFormat("yyyy/MM/dd 00:00", Locale.getDefault())
|
||||
val formattedDate = dateFormat.format(calendar.time)
|
||||
val result = "$formattedDate ${getString(R.string.vip_center_6)}"
|
||||
binding.tvAdditionalText.text = result
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshOpenVipState() {
|
||||
val currentVipInfo = vipViewModel.currVipInfoLiveData.value
|
||||
val myVipInfo = vipViewModel.myVipInfoLiveData.value
|
||||
@@ -419,7 +457,7 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
calendar.add(Calendar.DAY_OF_YEAR, 30)
|
||||
val dateFormat = SimpleDateFormat("yyyy/MM/dd 00:00", Locale.getDefault())
|
||||
val formattedDate = dateFormat.format(calendar.time)
|
||||
val result = "$formattedDate Expires"
|
||||
val result = "$formattedDate ${getString(R.string.vip_center_6)}"
|
||||
binding.tvAdditionalText.text = result
|
||||
|
||||
} else {
|
||||
|
@@ -98,7 +98,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Identification"
|
||||
android:text="@string/vip_center_3"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/color_FFE3AF"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
@@ -157,7 +157,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Exclusive Privileges"
|
||||
android:text="@string/vip_center_4"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColor="@color/color_FFE3AF"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
@@ -261,8 +261,22 @@
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:text="@string/vip_center_7"
|
||||
tools:text="Renew" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_notice_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start|center_vertical"
|
||||
android:textColor="@color/color_FFE3AF"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_bottom_panel"
|
||||
app:layout_constraintEnd_toEndOf="@id/layout_bottom_panel"
|
||||
app:layout_constraintStart_toStartOf="@id/layout_bottom_panel"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_bottom_panel"
|
||||
android:textSize="@dimen/sp_11"
|
||||
tools:text="Only through activity"
|
||||
android:text="@string/vip_center_9"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -50,7 +50,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/vip_center_2"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="18dp"
|
||||
|
@@ -13,57 +13,6 @@
|
||||
android:src="@drawable/bg_theme_top_home"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/layout_public_chat"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_44"-->
|
||||
<!-- android:background="@drawable/public_chat_bg_lane"-->
|
||||
<!-- app:layout_constraintDimensionRatio="375:112"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.Guideline-->
|
||||
<!-- android:id="@+id/line_public_chat_title_top"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintGuide_percent="0.22" />-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.Guideline-->
|
||||
<!-- android:id="@+id/line_public_chat_list_top"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintGuide_percent="0.46" />-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.Guideline-->
|
||||
<!-- android:id="@+id/line_public_chat_list_bottom"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintGuide_percent="0.94" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_public_chat_title"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="@string/public_chat_room"-->
|
||||
<!-- android:textColor="#FFDDA2"-->
|
||||
<!-- android:textSize="@dimen/dp_17"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@id/line_public_chat_title_top" />-->
|
||||
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- tools:visibility="visible"-->
|
||||
<!-- android:id="@+id/recycler_view_public_chat"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@id/line_public_chat_list_bottom"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@id/line_public_chat_list_top" />-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_title"
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -15,8 +15,8 @@
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_tab_icon"
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
<TextView
|
||||
|
@@ -6,7 +6,6 @@
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/color_white"
|
||||
android:gravity="start|center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
Reference in New Issue
Block a user