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