优化了事件面板展示
启动页面展示,但是还是会出现加载进入后的图标下挫问题,待修复
This commit is contained in:
@@ -4,7 +4,9 @@ import android.content.res.ColorStateList
|
||||
import android.graphics.Typeface
|
||||
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
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
@@ -34,11 +36,11 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
|
||||
private val activeColor: Int = android.graphics.Color.parseColor("#ff678f")
|
||||
private val normalColor: Int = android.graphics.Color.parseColor("#EE00FF")
|
||||
private val activeColor: Int = android.graphics.Color.parseColor("#FFFFFF")
|
||||
private val normalColor: Int = android.graphics.Color.parseColor("#65FFFFFF")
|
||||
|
||||
private val activeSize = 35
|
||||
private val normalSize = 30
|
||||
private val activeSize = 20
|
||||
private val normalSize = 20
|
||||
|
||||
private var selectPosition = 0
|
||||
|
||||
@@ -66,6 +68,12 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
//viewPager 页面切换监听
|
||||
vpEventPanel.registerOnPageChangeCallback(changeCallback)
|
||||
|
||||
/*TabLayout中间分界线*/
|
||||
val linearLayout: LinearLayout = tabLayout.getChildAt(0) as LinearLayout
|
||||
linearLayout.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||
linearLayout.dividerDrawable = activity?.let { ContextCompat.getDrawable(it, R.drawable.bg_v2x_event_live_show) }
|
||||
linearLayout.dividerPadding = 30
|
||||
|
||||
//这里可以自定义TabView
|
||||
mediator = TabLayoutMediator(tabLayout, vpEventPanel, TabConfigurationStrategy { tab, position ->
|
||||
val tabView = TextView(context)
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cardview_dark_background"
|
||||
android:background="#10121E"
|
||||
android:visibility="gone"
|
||||
app:roundLayoutRadius="@dimen/dp_40"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
@@ -21,12 +22,11 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="#ff678f"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabIndicatorHeight="2dp"
|
||||
app:tabMode="fixed"
|
||||
app:tabSelectedTextColor="#ff678f"
|
||||
app:tabTextColor="#EE00FF"
|
||||
app:tabMode="scrollable"
|
||||
app:tabSelectedTextColor="#FFFFFF"
|
||||
app:tabTextColor="#65FFFFFF"
|
||||
app:tabUnboundedRipple="true" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
@@ -38,7 +38,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabLayout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnShowOrHidePanels"
|
||||
|
||||
Reference in New Issue
Block a user