Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_freeworld
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_freeworld
Commits
c4ab24f7
Commit
c4ab24f7
authored
Aug 05, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改支付之后切换页面问题已解决
parent
24affd8c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
+17
-15
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+13
-10
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+1
-2
HomeViewModel.kt
...src/main/java/com/mints/street/main/home/HomeViewModel.kt
+1
-1
SearchAfterItem.kt
...c/main/java/com/mints/street/main/home/SearchAfterItem.kt
+2
-2
No files found.
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
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
...
@@ -37,14 +38,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...
@@ -37,14 +38,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override
fun
getStatusBarHeightView
():
View
?
{
override
fun
getStatusBarHeightView
():
View
?
{
return
null
return
null
}
}
public
fun
verifyMember
(){
if
(
UserManager
.
INSTANCE
.
userIsLogin
()
&&
UserManager
.
INSTANCE
.
getVipFlag
())
{
binding
.
mainViewpager
.
setCurrentItem
(
3
,
false
)
}
else
{
binding
.
mainViewpager
.
setCurrentItem
(
0
,
false
)
}
}
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
...
@@ -88,6 +81,16 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...
@@ -88,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
)
{
...
@@ -132,7 +135,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
...
@@ -132,7 +135,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
return
when
(
position
)
{
return
when
(
position
)
{
0
->
{
0
->
{
//首页
//首页
HomeFragment
(
activity
)
HomeFragment
()
}
}
1
->
{
1
->
{
//广场
//广场
...
@@ -148,7 +151,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
...
@@ -148,7 +151,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
else
->
{
else
->
{
//首页
//首页
HomeFragment
(
activity
)
HomeFragment
()
}
}
}
}
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
c4ab24f7
...
@@ -40,7 +40,7 @@ import me.goldze.mvvmhabit.utils.ToastUtils
...
@@ -40,7 +40,7 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* Created by 冯瑞雨 on 2021/7/2.
* Created by 冯瑞雨 on 2021/7/2.
* 首页页面
* 首页页面
*/
*/
class
HomeFragment
(
val
mainActivity
:
MainActivity
)
:
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"
}
}
...
@@ -303,7 +303,6 @@ class HomeFragment(val mainActivity: MainActivity) : BaseFragment<FragmentHomeBi
...
@@ -303,7 +303,6 @@ class HomeFragment(val mainActivity: MainActivity) : BaseFragment<FragmentHomeBi
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
binding
.
bmapView
.
onResume
()
binding
.
bmapView
.
onResume
()
mainActivity
.
verifyMember
()
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
c4ab24f7
...
@@ -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
}
}
...
...
app/src/main/java/com/mints/street/main/home/SearchAfterItem.kt
View file @
c4ab24f7
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment