Commit 171f2da8 authored by 张释方's avatar 张释方

消除水波纹效果

parent 21cd4fac
...@@ -23,6 +23,7 @@ import com.mints.street.manager.oaid.OaidManager ...@@ -23,6 +23,7 @@ import com.mints.street.manager.oaid.OaidManager
import com.permissionx.guolindev.PermissionX import com.permissionx.guolindev.PermissionX
import com.permissionx.guolindev.callback.RequestCallback import com.permissionx.guolindev.callback.RequestCallback
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
...@@ -89,26 +90,13 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -89,26 +90,13 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
} }
// override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
// if (ev.action == MotionEvent.ACTION_MOVE) {
// //触点的个数,就是有几个手指同时接触屏幕
// if (ev.pointerCount == 1) {
// homeFragment.updateGesture(true)
// } else {
// homeFragment.updateGesture(false)
// }
// }
//
// return super.dispatchTouchEvent(ev)
// }
} }
private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> Unit): BottomNavigationViewEx { private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> Unit): BottomNavigationViewEx {
enableAnimation(true) enableAnimation(false)
enableShiftingMode(false) enableShiftingMode(false)
enableItemShiftingMode(true) enableItemShiftingMode(false)
setTextSize(12F) setTextSize(12F)
setOnNavigationItemSelectedListener { setOnNavigationItemSelectedListener {
navigationItemSelectedAction.invoke(it.itemId) navigationItemSelectedAction.invoke(it.itemId)
...@@ -121,11 +109,11 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 { ...@@ -121,11 +109,11 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
//是否可滑动 //是否可滑动
this.isUserInputEnabled = false this.isUserInputEnabled = false
//预加载 //预加载
// this.offscreenPageLimit = 2 this.offscreenPageLimit = 2
//设置适配器 //设置适配器
adapter = object : FragmentStateAdapter(activity) { adapter = object : FragmentStateAdapter(activity) {
override fun createFragment(position: Int): Fragment { override fun createFragment(position: Int): Fragment {
KLog.e("sdfsdfsa",position)
return when (position) { return when (position) {
0 -> { 0 -> {
//首页 //首页
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_F9F9F9" android:background="@color/color_F9F9F9"
app:itemIconSize="20dp" app:itemIconSize="20dp"
app:itemBackground="@null"
app:itemTextColor="@color/bottom_selector" app:itemTextColor="@color/bottom_selector"
app:menu="@menu/menu_navigation" /> app:menu="@menu/menu_navigation" />
</FrameLayout> </FrameLayout>
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<item <item
android:id="@+id/menu_home" android:id="@+id/menu_home"
android:checked="true"
android:icon="@drawable/menu_main" android:icon="@drawable/menu_main"
android:title="@string/bottom_name_home" /> android:title="@string/bottom_name_home" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment