Commit 314872e0 authored by mengcuiguang2's avatar mengcuiguang2

Merge branch 'dev_1.0.0' of http://39.97.65.143:81/android/android_street into dev_1.0.0

parents 2ce9774c c4ab24f7
...@@ -19,6 +19,7 @@ import com.mints.street.databinding.ActivityMainBinding ...@@ -19,6 +19,7 @@ import com.mints.street.databinding.ActivityMainBinding
import com.mints.street.main.googlemap.GoogleMapFragment import com.mints.street.main.googlemap.GoogleMapFragment
import com.mints.street.main.home.HomeFragment import com.mints.street.main.home.HomeFragment
import com.mints.street.main.my.MyFragment import com.mints.street.main.my.MyFragment
import com.mints.street.main.my.OpenvipActivity
import com.mints.street.main.vr.VRFragment import com.mints.street.main.vr.VRFragment
import com.mints.street.manager.UserManager import com.mints.street.manager.UserManager
import com.mints.street.manager.oaid.OaidManager import com.mints.street.manager.oaid.OaidManager
...@@ -80,6 +81,16 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -80,6 +81,16 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
}) })
viewModel.checkUpgrade() viewModel.checkUpgrade()
} }
override fun onResume() {
super.onResume()
if (binding.mainViewpager.currentItem == 0){
if (UserManager.INSTANCE.userIsLogin() && UserManager.INSTANCE.getVipFlag()) {
binding.mainViewpager.setCurrentItem(3, false)
}
}
}
var oldTime: Long = 0 var oldTime: Long = 0
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
when (keyCode) { when (keyCode) {
...@@ -112,7 +123,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U ...@@ -112,7 +123,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
return this return this
} }
private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 { private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
//是否可滑动 //是否可滑动
this.isUserInputEnabled = false this.isUserInputEnabled = false
//预加载 //预加载
......
...@@ -25,6 +25,7 @@ import com.mints.street.R ...@@ -25,6 +25,7 @@ import com.mints.street.R
import com.mints.street.bean.MapBean import com.mints.street.bean.MapBean
import com.mints.street.bean.PositioningBean import com.mints.street.bean.PositioningBean
import com.mints.street.databinding.FragmentHomeBinding import com.mints.street.databinding.FragmentHomeBinding
import com.mints.street.main.MainActivity
import com.mints.street.manager.UmengManager import com.mints.street.manager.UmengManager
import com.mints.street.widget.ScrollLayout import com.mints.street.widget.ScrollLayout
import com.mints.street.widget.dialog.DialogUtils import com.mints.street.widget.dialog.DialogUtils
...@@ -39,7 +40,7 @@ import me.goldze.mvvmhabit.utils.ToastUtils ...@@ -39,7 +40,7 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* Created by 冯瑞雨 on 2021/7/2. * Created by 冯瑞雨 on 2021/7/2.
* 首页页面 * 首页页面
*/ */
class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener { class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener {
companion object { companion object {
val IS_FIRST_OPEN: String = "isFirstOpen" val IS_FIRST_OPEN: String = "isFirstOpen"
} }
...@@ -99,6 +100,9 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -99,6 +100,9 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
uploadDeviceInfo() uploadDeviceInfo()
} }
private fun uploadDeviceInfo() { private fun uploadDeviceInfo() {
UmengManager.initUm() UmengManager.initUm()
......
...@@ -69,7 +69,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -69,7 +69,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
}) })
} else { } else {
if ((!UserManager.INSTANCE.userIsLogin() && !UserManager.INSTANCE.getVipFlag())) { if ((!UserManager.INSTANCE.userIsLogin() || !UserManager.INSTANCE.getVipFlag())) {
startActivity(OpenvipActivity::class.java) startActivity(OpenvipActivity::class.java)
return return
} }
......
...@@ -23,8 +23,8 @@ class SearchAfterItem(viewModel: SearchMapViewModel,val name:String? ...@@ -23,8 +23,8 @@ class SearchAfterItem(viewModel: SearchMapViewModel,val name:String?
* 点击名称回调回调 * 点击名称回调回调
*/ */
val onClick = BindingCommand<Any>(BindingAction { val onClick = BindingCommand<Any>(BindingAction {
if(viewModel.index.value==1&& if(viewModel.index.value==1||
!UserManager.INSTANCE.userIsLogin() && !UserManager.INSTANCE.userIsLogin() ||
!UserManager.INSTANCE.getVipFlag()){ !UserManager.INSTANCE.getVipFlag()){
viewModel.startActivity(OpenvipActivity::class.java) viewModel.startActivity(OpenvipActivity::class.java)
return@BindingAction return@BindingAction
......
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