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
314872e0
Commit
314872e0
authored
Aug 06, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_1.0.0' of
http://39.97.65.143:81/android/android_street
into dev_1.0.0
parents
2ce9774c
c4ab24f7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+12
-1
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+5
-1
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 @
314872e0
...
...
@@ -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
:
Fragment
Activity
):
ViewPager2
{
private
fun
ViewPager2
.
initMain
(
activity
:
Main
Activity
):
ViewPager2
{
//是否可滑动
this
.
isUserInputEnabled
=
false
//预加载
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
314872e0
...
...
@@ -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
()
...
...
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
314872e0
...
...
@@ -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
}
...
...
app/src/main/java/com/mints/street/main/home/SearchAfterItem.kt
View file @
314872e0
...
...
@@ -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
...
...
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