Commit b55b8350 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent eea467fc
......@@ -35,6 +35,7 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override fun getStatusBarHeightView(): View? {
return null
}
override fun initData() {
super.initData()
OaidManager.init()
......@@ -46,10 +47,10 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
when (it) {
R.id.menu_home -> {
// if(){
binding.mainViewpager.setCurrentItem(0, false)
binding.mainViewpager.setCurrentItem(0, false)
// }else{
binding.mainViewpager.setCurrentItem(3, false)
// }
binding.mainViewpager.setCurrentItem(3, false)
// }
}
R.id.menu_square -> binding.mainViewpager.setCurrentItem(1, false)
R.id.menu_my -> {
......@@ -70,18 +71,12 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
)
RxPermissions(this).request(
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) Manifest.permission.ACCESS_BACKGROUND_LOCATION else "",
Manifest.permission.ACCESS_FINE_LOCATION ,
Manifest.permission.WRITE_EXTERNAL_STORAGE ,
Manifest.permission.READ_PHONE_STATE
)
.subscribe {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) Manifest.permission.ACCESS_BACKGROUND_LOCATION else "",
Manifest.permission.ACCESS_FINE_LOCATION).subscribe {
}
}
var oldTime: Long = 0
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
when (keyCode) {
......@@ -135,7 +130,8 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
2 -> {
//个人中心
MyFragment()
}3 -> {
}
3 -> {
GoogleMapFragment()
}
......
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