history ui调整

This commit is contained in:
renhaoting 2025-11-07 19:24:19 +08:00
parent 1adb1db7a2
commit 47dcc38e46
4 changed files with 10 additions and 7 deletions

View File

@ -59,11 +59,17 @@ class HistoryFragment : BaseBindingFragment<FragmentMainHistoryBinding>() {
) )
orientation = ViewPager2.ORIENTATION_HORIZONTAL orientation = ViewPager2.ORIENTATION_HORIZONTAL
offscreenPageLimit = fragments.size offscreenPageLimit = fragments.size
isUserInputEnabled = false isUserInputEnabled = true
adapter = object : FragmentStateAdapter(this@HistoryFragment) { adapter = object : FragmentStateAdapter(this@HistoryFragment) {
override fun getItemCount() = fragments.size override fun getItemCount() = fragments.size
override fun createFragment(position: Int): Fragment = fragments[position] override fun createFragment(position: Int): Fragment = fragments[position]
} }
registerOnPageChangeCallback(object: ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
binding.tabLayout.setSelectedTab(position, true)
}
})
} }
} }

View File

@ -3,8 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" >
android:background="@mipmap/bg_level_1_page" >
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout <com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -3,8 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" >
android:background="@mipmap/bg_level_1_page" >
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout <com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -3,8 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="@mipmap/bg_level_1_page" >
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout <com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"