[BugFix]修复标签页面ui问题
This commit is contained in:
@@ -3,8 +3,8 @@ package com.yizhuan.erban.ui.user.activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
@@ -14,7 +14,6 @@ import com.google.android.flexbox.FlexWrap
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.base.TitleBar
|
||||
@@ -149,7 +148,7 @@ class EditUserLabelActivity : BaseViewBindingActivity<ActivityEditUserLabelBindi
|
||||
mMyLabelAdapter.setOnItemChildClickListener { _, _, position ->
|
||||
EventBus.getDefault().post(LabelEvent(mMyLabelAdapter.data[position]))
|
||||
mMyLabelAdapter.remove(position)
|
||||
if(mMyLabelAdapter.data.size == 0){
|
||||
if (mMyLabelAdapter.data.size == 0) {
|
||||
binding.group.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@@ -178,14 +177,13 @@ class EditUserLabelActivity : BaseViewBindingActivity<ActivityEditUserLabelBindi
|
||||
private fun initViewPager() {
|
||||
if (mTitles.size == 0) return
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(false)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0F)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER_VERTICAL)
|
||||
commonNavigator.setTitleWrapContent(true)
|
||||
val magicIndicatorAdapter = CommonWrapIndicatorAdapter(this, mTitles.map { it.title })
|
||||
magicIndicatorAdapter.textSize = 14
|
||||
magicIndicatorAdapter.textSize = 15
|
||||
magicIndicatorAdapter.setOnItemSelectListener(this)
|
||||
commonNavigator.adapter = magicIndicatorAdapter
|
||||
binding.magicIndicator.navigator = commonNavigator
|
||||
commonNavigator.titleContainer.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||
binding.mViewPager.adapter =
|
||||
object : FragmentStateAdapter(supportFragmentManager, lifecycle) {
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
|
@@ -63,12 +63,14 @@
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view_bg"/>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/mViewPager"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintTop_toBottomOf="@+id/magic_indicator"
|
||||
|
@@ -15,7 +15,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_2"
|
||||
android:paddingEnd="@dimen/dp_0"
|
||||
android:paddingBottom="@dimen/dp_8"
|
||||
android:textColor="@color/color_1F1A4E"
|
||||
android:textSize="@dimen/sp_13"
|
||||
@@ -23,9 +23,10 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/dp_2"
|
||||
android:paddingEnd="@dimen/dp_12"
|
||||
android:src="@drawable/ic_tag_close_my" />
|
||||
|
||||
</LinearLayout>
|
Reference in New Issue
Block a user