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
b55b8350
Commit
b55b8350
authored
Jul 30, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
eea467fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+9
-13
No files found.
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
b55b8350
...
...
@@ -35,6 +35,7 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override
fun
getStatusBarHeightView
():
View
?
{
return
null
}
override
fun
initData
()
{
super
.
initData
()
OaidManager
.
init
()
...
...
@@ -46,10 +47,10 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
when
(
it
)
{
R
.
id
.
menu_home
->
{
// if(){
binding
.
mainViewpager
.
setCurrentItem
(
0
,
false
)
binding
.
mainViewpager
.
setCurrentItem
(
0
,
false
)
// }else{
binding
.
mainViewpager
.
setCurrentItem
(
3
,
false
)
// }
binding
.
mainViewpager
.
setCurrentItem
(
3
,
false
)
// }
}
R
.
id
.
menu_square
->
binding
.
mainViewpager
.
setCurrentItem
(
1
,
false
)
R
.
id
.
menu_my
->
{
...
...
@@ -70,18 +71,12 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
)
RxPermissions
(
this
).
request
(
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
else
""
,
Manifest
.
permission
.
ACCESS_FINE_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
READ_PHONE_STATE
)
.
subscribe
{
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
else
""
,
Manifest
.
permission
.
ACCESS_FINE_LOCATION
).
subscribe
{
}
}
var
oldTime
:
Long
=
0
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
when
(
keyCode
)
{
...
...
@@ -135,7 +130,8 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
2
->
{
//个人中心
MyFragment
()
}
3
->
{
}
3
->
{
GoogleMapFragment
()
}
...
...
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