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
f9dcd277
Commit
f9dcd277
authored
Aug 13, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_1.0.1' of
http://gitlab.mints-id.com/android/android_street
into fry_dev
parents
ce311601
36c980dd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
56 deletions
+49
-56
ItemHotViewAdapter.kt
.../main/java/com/mints/street/adapter/ItemHotViewAdapter.kt
+1
-0
HotViewBean.kt
app/src/main/java/com/mints/street/bean/HotViewBean.kt
+9
-0
GoogleMapFragment.kt
...java/com/mints/street/main/googlemap/GoogleMapFragment.kt
+3
-16
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+33
-35
HomeViewModel.kt
...src/main/java/com/mints/street/main/home/HomeViewModel.kt
+2
-4
activity_google_map.xml
app/src/main/res/layout/activity_google_map.xml
+1
-0
item_search_after.xml
app/src/main/res/layout/item_search_after.xml
+0
-1
No files found.
app/src/main/java/com/mints/street/adapter/ItemHotViewAdapter.kt
View file @
f9dcd277
...
...
@@ -44,6 +44,7 @@ class ItemHotViewAdapter(val context: Context, val dialog: BottomSheetDialog?, v
RxUtils
.
onMultiClick
(
holder
.
itemView
)
{
//判断是否当前是否是会员,
if
(!
UserManager
.
INSTANCE
.
userIsLogin
())
{
dialog
?.
dismiss
()
//否-跳转到开通vip界面
startActivity
(
OpenvipActivity
::
class
.
java
)
}
else
{
...
...
app/src/main/java/com/mints/street/bean/HotViewBean.kt
View file @
f9dcd277
...
...
@@ -12,5 +12,14 @@ class HotViewBean : Serializable {
val
lng
:
String
?
=
null
val
name
:
String
?
=
null
val
distance
:
Double
?
=
null
// blng:百度经度
val
blng
:
String
?
=
null
// blat:百度纬度
val
blat
:
String
?
=
null
// bvid: 全景id
val
bvid
:
String
?
=
null
}
}
app/src/main/java/com/mints/street/main/googlemap/GoogleMapFragment.kt
View file @
f9dcd277
...
...
@@ -3,7 +3,6 @@ package com.mints.street.main.googlemap
import
android.os.Bundle
import
android.os.Handler
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.webkit.WebChromeClient
import
androidx.lifecycle.Observer
...
...
@@ -11,7 +10,6 @@ import com.baidu.location.BDLocation
import
com.baidu.location.BDLocationListener
import
com.baidu.location.LocationClient
import
com.baidu.location.LocationClientOption
import
com.baidu.mapapi.map.MapStatusUpdateFactory
import
com.fry.base.base.BaseFragment
import
com.github.lzyzsd.jsbridge.CallBackFunction
import
com.github.lzyzsd.jsbridge.DefaultHandler
...
...
@@ -25,10 +23,8 @@ import com.mints.street.bean.MutualBean
import
com.mints.street.databinding.ActivityGoogleMapBinding
import
com.mints.street.main.home.HomeViewModel
import
com.mints.street.main.home.SearchMapActivity
import
com.mints.street.utils.GPSConverterUtils
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.widget.ScrollLayout
import
com.mints.street.widget.ScrollLayout.STATUS_CLOSE
import
com.mints.street.widget.dialog.DialogMapStyle
import
com.mints.street.widget.dialog.HotViewDialog
import
me.goldze.mvvmhabit.base.AppManager
...
...
@@ -186,28 +182,19 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
}
//点击热门景点
RxUtils
.
onMultiClick
(
binding
.
lyHotview
)
{
HotViewDialog
(
requireActivity
(),
viewModel
,
0.0
,
0.0
,
gps
.
lat
,
gps
.
lng
,
this
@GoogleMapFragment
,
object
:
HotViewDialog
.
OnHotItemClick
{
override
fun
onItemClick
(
position
:
Int
,
itemBean
:
HotViewBean
.
Dataslist
?)
{
itemBean
?.
apply
{
//todo 冯瑞雨 修改toDouble
viewModel
.
authorized
(
name
,
lat
,
lng
,
false
)
viewModel
.
authorized
(
bvid
,
name
)
binding
.
webview
.
callHandler
(
"initZsMap"
,
Gson
().
toJson
(
GPS
(
lat
?.
toDouble
()
?:
0.0
,
lng
?.
toDouble
()
?:
0.0
,
0
))
)
{
}
}
}
}).
init
()
.
show
()
}).
init
().
show
()
}
}
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
f9dcd277
...
...
@@ -26,9 +26,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.my.OpenvipActivity
import
com.mints.street.manager.UmengManager
import
com.mints.street.manager.UserManager
import
com.mints.street.widget.ScrollLayout
import
com.mints.street.widget.dialog.DialogMapStyle
import
com.mints.street.widget.dialog.DialogUtils
...
...
@@ -48,9 +46,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
private
val
viewrecommedDialog
by
lazy
{
ViewRecommedDialog
(
requireActivity
(),
viewModel
,
this
requireActivity
(),
viewModel
,
this
).
init
()
}
...
...
@@ -104,9 +102,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
override
fun
initContentView
(
inflater
:
LayoutInflater
?,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
inflater
:
LayoutInflater
?,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
)
=
R
.
layout
.
fragment_home
override
fun
initVariableId
()
=
BR
.
viewModel
...
...
@@ -133,9 +131,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
}
RxUtils
.
onMultiClick
(
binding
.
ivClick
)
{
viewModel
.
authorized
(
""
,
currentLat
.
toString
(),
currentLon
.
toString
(),
false
""
,
currentLat
.
toString
(),
currentLon
.
toString
(),
false
)
}
RxUtils
.
onMultiClick
(
binding
.
imageMapChangeIcon
)
{
...
...
@@ -151,12 +149,12 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
}
//点击热门景点
RxUtils
.
onMultiClick
(
binding
.
lyHotview
)
{
if
((!
UserManager
.
INSTANCE
.
userIsLogin
()
||
!
UserManager
.
INSTANCE
.
getVipFlag
()))
{
startActivity
(
OpenvipActivity
::
class
.
java
)
return
@onMultiClick
}
HotViewDialog
(
requireActivity
(),
viewModel
,
currentLat
,
currentLon
,
this
).
init
().
show
()
//
if ((!UserManager.INSTANCE.userIsLogin() || !UserManager.INSTANCE.getVipFlag())) {
//
startActivity(OpenvipActivity::class.java)
//
return@onMultiClick
//
}
HotViewDialog
(
requireActivity
(),
viewModel
,
currentLat
,
currentLon
,
this
).
init
().
show
()
}
viewModel
.
getMapBean
()
...
...
@@ -223,8 +221,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
currentLon
=
status
?.
target
?.
longitude
?:
0.0
KLog
.
e
(
"zsf__"
,
"=======移动结束=======${currentLat}================${currentLon}===================="
"zsf__"
,
"=======移动结束=======${currentLat}================${currentLon}===================="
)
currentMapZoom
=
status
?.
zoom
?:
0f
// 发起反地理编码请求
...
...
@@ -272,13 +270,13 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
private
fun
initLocation
()
{
// 获取传感器管理服务
mSensorManager
=
AppManager
.
getAppManager
().
currentActivity
.
getSystemService
(
SENSOR_SERVICE
)
as
SensorManager
.
getSystemService
(
SENSOR_SERVICE
)
as
SensorManager
mCurrentMode
=
MyLocationConfiguration
.
LocationMode
.
NORMAL
// 为系统的方向传感器注册监听器
mSensorManager
?.
registerListener
(
this
,
mSensorManager
?.
getDefaultSensor
(
Sensor
.
TYPE_ORIENTATION
),
SensorManager
.
SENSOR_DELAY_UI
this
,
mSensorManager
?.
getDefaultSensor
(
Sensor
.
TYPE_ORIENTATION
),
SensorManager
.
SENSOR_DELAY_UI
)
// 开启定位图层
...
...
@@ -325,7 +323,7 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
val
builder
=
MapStatus
.
Builder
()
builder
.
target
(
center
).
zoom
(
zoom
)
val
mapStatusUpdate
=
MapStatusUpdateFactory
.
newMapStatus
(
builder
.
build
())
MapStatusUpdateFactory
.
newMapStatus
(
builder
.
build
())
showupgradevipDialog
(
requireContext
())
// 设置地图状态
mBaiduMap
?.
animateMapStatus
(
mapStatusUpdate
,
200
)
...
...
@@ -427,11 +425,11 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
mCurrentLon
=
location
?.
longitude
?:
0.0
mCurrentAccracy
=
location
?.
radius
?:
0f
myLocationData
=
MyLocationData
.
Builder
()
.
accuracy
(
location
?.
radius
?:
0f
)
// 设置定位数据的精度信息,单位:米
.
direction
(
mCurrentDirection
.
toFloat
())
// 此处设置开发者获取到的方向信息,顺时针0-360
.
latitude
(
location
?.
latitude
?:
0.0
)
.
longitude
(
location
?.
longitude
?:
0.0
)
.
build
()
.
accuracy
(
location
?.
radius
?:
0f
)
// 设置定位数据的精度信息,单位:米
.
direction
(
mCurrentDirection
.
toFloat
())
// 此处设置开发者获取到的方向信息,顺时针0-360
.
latitude
(
location
?.
latitude
?:
0.0
)
.
longitude
(
location
?.
longitude
?:
0.0
)
.
build
()
this
.
setMyLocationData
(
myLocationData
)
if
(
isFirstLoc
)
{
isFirstLoc
=
false
...
...
@@ -447,15 +445,15 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
override
fun
onSensorChanged
(
sensorEvent
:
SensorEvent
?)
{
val
x
:
Double
=
sensorEvent
?.
values
?.
get
(
SensorManager
.
DATA_X
)
?.
toDouble
()
?:
0.0
sensorEvent
?.
values
?.
get
(
SensorManager
.
DATA_X
)
?.
toDouble
()
?:
0.0
if
(
kotlin
.
math
.
abs
(
x
-
lastX
)
>
1.0
)
{
mCurrentDirection
=
x
.
toInt
()
myLocationData
=
MyLocationData
.
Builder
()
.
accuracy
(
mCurrentAccracy
)
// 设置定位数据的精度信息,单位:米
.
direction
(
mCurrentDirection
.
toFloat
())
// 此处设置开发者获取到的方向信息,顺时针0-360
.
latitude
(
mCurrentLat
)
.
longitude
(
mCurrentLon
)
.
build
()
.
accuracy
(
mCurrentAccracy
)
// 设置定位数据的精度信息,单位:米
.
direction
(
mCurrentDirection
.
toFloat
())
// 此处设置开发者获取到的方向信息,顺时针0-360
.
latitude
(
mCurrentLat
)
.
longitude
(
mCurrentLon
)
.
build
()
mBaiduMap
?.
setMyLocationData
(
myLocationData
)
}
lastX
=
x
...
...
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
f9dcd277
...
...
@@ -197,12 +197,10 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
HotViewBean
>)
{
hotviewData
.
value
=
response
.
result
KLog
.
e
(
"getmyInfo"
,
response
.
result
.
toString
())
}
override
fun
onError
(
e
:
Throwable
)
{
super
.
onError
(
e
)
KLog
.
e
(
"getmyInfo"
,
"用户登录信息请求失败"
)
}
}
...
...
@@ -235,7 +233,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
)
}
fun
authorized
(
name
:
String
?,
lat
:
String
?
,
lng
:
String
?)
{
fun
authorized
(
bvid
:
String
?,
name
:
String
?)
{
ApiModel
.
authorized
().
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AuthorizedBean
>>(
this
@HomeViewModel
,
false
...
...
@@ -243,7 +241,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AuthorizedBean
>)
{
MintsWebViewActivity
.
startWebView
(
name
,
MintsWebViewActivity
.
toBaduVR
(
lat
,
lng
,
response
.
result
?.
bk
)
MintsWebViewActivity
.
toBaduVR
(
bvid
,
response
.
result
?.
bk
)
)
}
...
...
app/src/main/res/layout/activity_google_map.xml
View file @
f9dcd277
...
...
@@ -9,6 +9,7 @@
android:orientation=
"vertical"
>
<com.github.lzyzsd.jsbridge.BridgeWebView
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
...
app/src/main/res/layout/item_search_after.xml
View file @
f9dcd277
...
...
@@ -21,7 +21,6 @@
<TextView
android:layout_marginStart=
"10dp"
android:id=
"@+id/tv_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
...
...
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