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
5cdb56e9
Commit
5cdb56e9
authored
Aug 18, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改第一次景点按钮问题
parent
7b9acf59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
27 deletions
+41
-27
GoogleMapFragment.kt
...java/com/mints/street/main/googlemap/GoogleMapFragment.kt
+41
-27
No files found.
app/src/main/java/com/mints/street/main/googlemap/GoogleMapFragment.kt
View file @
5cdb56e9
...
...
@@ -110,9 +110,9 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
}
//点击地图样式
RxUtils
.
onMultiClick
(
binding
.
imageMapChangeIcon
)
{
if
(
dialogMapStyle
==
null
){
if
(
dialogMapStyle
==
null
)
{
viewModel
.
getMapStyle
()
}
else
{
}
else
{
if
(
this
@GoogleMapFragment
.
fragmentManager
!=
null
)
{
dialogMapStyle
?.
show
(
this
@GoogleMapFragment
.
fragmentManager
!!
,
"dialogMapStyle"
)
}
...
...
@@ -205,13 +205,13 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
}
//android->js调起付费页面
binding
.
webview
.
registerHandler
(
"needPay"
)
{
_
,
_
->
if
(!
UserManager
.
INSTANCE
.
getVipFlag
())
{
if
(!
UserManager
.
INSTANCE
.
getVipFlag
())
{
startActivity
(
OpenvipActivity
::
class
.
java
)
}
}
//android->js调起升级的弹出框
binding
.
webview
.
registerHandler
(
"needPayPopup"
)
{
_
,
_
->
if
(!
UserManager
.
INSTANCE
.
getVipFlag
())
{
if
(!
UserManager
.
INSTANCE
.
getVipFlag
())
{
showUpgradeVipDialog
()
}
}
...
...
@@ -231,9 +231,9 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
}
}
private
var
upgradeVipDialog
:
UpgradeVipDialog
?
=
null
private
fun
showUpgradeVipDialog
(){
if
(
upgradeVipDialog
==
null
)
{
private
var
upgradeVipDialog
:
UpgradeVipDialog
?
=
null
private
fun
showUpgradeVipDialog
()
{
if
(
upgradeVipDialog
==
null
)
{
upgradeVipDialog
=
showupgradevipDialog
(
this
.
context
)
}
upgradeVipDialog
?.
show
()
...
...
@@ -261,13 +261,17 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
)
{
}
}
/**
* 调用JS
* 第一次加载
*/
private
fun
beginInitZsMap
(
lat
:
Double
?
=
null
,
lng
:
Double
?
=
null
,
inner
:
Int
=
0
,
bean
:
HotViewBean
?=
null
,
mapType
:
String
?
,
showVrButton
:
Int
?,
showScenics
:
Int
?)
{
private
fun
beginInitZsMap
(
lat
:
Double
?
=
null
,
lng
:
Double
?
=
null
,
inner
:
Int
=
0
,
bean
:
HotViewBean
?
=
null
)
{
val
initMapBean
=
InitMapBean
()
initMapBean
.
lat
=
lat
?:
gps
.
lat
initMapBean
.
lng
=
lng
?:
gps
.
lng
...
...
@@ -278,10 +282,30 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
//非vip
initMapBean
.
vip
=
0
}
var
mapType
:
String
?
=
null
viewModel
.
mapStyleSortBean
.
value
?.
mapStyleSort
?.
get
(
0
)
?.
list
?.
forEach
outside
@
{
bean
->
if
(
bean
.
isSelected
==
true
)
{
mapType
=
bean
.
key
return
@outside
}
}
initMapBean
.
inner
=
inner
initMapBean
.
mapType
=
mapType
initMapBean
.
showVrButton
=
showVrButton
initMapBean
.
showScenics
=
showScenics
initMapBean
.
mapType
=
mapType
?:
"hybrid"
initMapBean
.
showVrButton
=
if
(
viewModel
.
mapStyleSortBean
.
value
==
null
)
{
1
}
else
if
(
viewModel
.
mapStyleSortBean
.
value
?.
isStreetViewMap
==
true
)
{
1
}
else
{
0
}
initMapBean
.
showScenics
=
if
(
viewModel
.
mapStyleSortBean
.
value
?.
isRecommendedPlaces
==
true
)
{
1
}
else
{
0
}
initMapBean
.
scenics
=
bean
?.
list
binding
.
webview
.
callHandler
(
"beginInitZsMap"
,
Gson
().
toJson
(
initMapBean
)
...
...
@@ -409,7 +433,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
})
//搜索页面回调参数
viewModel
.
pt
.
observe
(
this
,
Observer
{
loadPosition
(
it
.
lat
,
it
.
lng
,
it
.
inner
)
loadPosition
(
it
.
lat
,
it
.
lng
,
it
.
inner
)
binding
.
scrollLayout
.
toggle
(
ScrollLayout
.
STATUS_CLOSE
)
})
//获取地图展示样式
...
...
@@ -445,18 +469,8 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
})
viewModel
.
viewRecommed
.
observe
(
this
,
Observer
{
it
?.
apply
{
var
mapType
:
String
?
=
null
viewModel
.
mapStyleSortBean
.
value
?.
mapStyleSort
?.
get
(
0
)
?.
list
?.
forEach
outside
@
{
bean
->
if
(
bean
.
isSelected
==
true
){
mapType
=
bean
.
key
return
@outside
}
}
beginInitZsMap
(
gps
.
lat
,
gps
.
lng
,
bean
=
this
,
mapType
=
mapType
?:
"hybrid"
,
showVrButton
=
if
(
viewModel
.
mapStyleSortBean
.
value
?.
isStreetViewMap
==
true
){
1
}
else
{
0
}
,
showScenics
=
if
(
viewModel
.
mapStyleSortBean
.
value
?.
isRecommendedPlaces
==
true
){
1
}
else
{
0
})
beginInitZsMap
(
gps
.
lat
,
gps
.
lng
,
bean
=
this
)
}
})
}
...
...
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