Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
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_street
Commits
004be3c4
Commit
004be3c4
authored
Aug 05, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付成功之后刷新地图页面问题
parent
2dab4867
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+11
-3
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+6
-1
No files found.
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
004be3c4
...
...
@@ -37,6 +37,14 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override
fun
getStatusBarHeightView
():
View
?
{
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
()
{
super
.
initData
()
...
...
@@ -112,7 +120,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
return
this
}
private
fun
ViewPager2
.
initMain
(
activity
:
Fragment
Activity
):
ViewPager2
{
private
fun
ViewPager2
.
initMain
(
activity
:
Main
Activity
):
ViewPager2
{
//是否可滑动
this
.
isUserInputEnabled
=
false
//预加载
...
...
@@ -124,7 +132,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
return
when
(
position
)
{
0
->
{
//首页
HomeFragment
()
HomeFragment
(
activity
)
}
1
->
{
//广场
...
...
@@ -140,7 +148,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
else
->
{
//首页
HomeFragment
()
HomeFragment
(
activity
)
}
}
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
004be3c4
...
...
@@ -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
(
val
mainActivity
:
MainActivity
)
:
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
()
...
...
@@ -299,6 +303,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
override
fun
onResume
()
{
super
.
onResume
()
binding
.
bmapView
.
onResume
()
mainActivity
.
verifyMember
()
}
override
fun
onDestroy
()
{
...
...
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