Commit 474f8297 authored by fengruiyu's avatar fengruiyu

地图样式的功能已完成

景点推荐的功能已完成
街景地图的功能已完成
js->android 的.弹出景点弹框已完成(展示页面已完成)
地图的小icon布局修改
parent f9dcd277
...@@ -26,6 +26,6 @@ ...@@ -26,6 +26,6 @@
"name": "常用" "name": "常用"
} }
], ],
"isRecommendedPlaces": true, "isRecommendedPlaces": false,
"isStreetViewMap": false "isStreetViewMap": true
} }
...@@ -204,6 +204,7 @@ connectWebViewJavascriptBridge(function (bridge) { ...@@ -204,6 +204,7 @@ connectWebViewJavascriptBridge(function (bridge) {
}); });
bridge.registerHandler("showScenics", function (data, responseCallback) { bridge.registerHandler("showScenics", function (data, responseCallback) {
data = JSON.parse(data) data = JSON.parse(data)
console.log('ksssssssssssssssssss',data)
vm.doShowScenics(data.list); vm.doShowScenics(data.list);
responseCallback(getVmMsg("suc:showScenics")); responseCallback(getVmMsg("suc:showScenics"));
}); });
......
...@@ -41,7 +41,7 @@ class DialogMapContentAdapter(val context: Context, var list: List<MapStyleList> ...@@ -41,7 +41,7 @@ class DialogMapContentAdapter(val context: Context, var list: List<MapStyleList>
it.isSelected = false it.isSelected = false
} }
list?.get(position)?.isSelected =true list?.get(position)?.isSelected =true
onItemMapStyleChange?.onItemChange() onItemMapStyleChange?.onItemChange(list?.get(position)?.img?:0)
notifyDataSetChanged() notifyDataSetChanged()
} }
...@@ -58,6 +58,6 @@ class DialogMapContentAdapter(val context: Context, var list: List<MapStyleList> ...@@ -58,6 +58,6 @@ class DialogMapContentAdapter(val context: Context, var list: List<MapStyleList>
override fun getLayoutId(viewType: Int) = R.layout.dialog_map_content_item override fun getLayoutId(viewType: Int) = R.layout.dialog_map_content_item
interface OnItemMapStyleChange{ interface OnItemMapStyleChange{
fun onItemChange() fun onItemChange(type:Int)
} }
} }
\ No newline at end of file
...@@ -29,13 +29,13 @@ class DialogMapTailAdapter(val context: Context, private var mapStyleBean: MapS ...@@ -29,13 +29,13 @@ class DialogMapTailAdapter(val context: Context, private var mapStyleBean: MapS
override fun toggleToOn(view: SwitchView) { override fun toggleToOn(view: SwitchView) {
mapStyleBean?.isRecommendedPlaces = !view.isOpened mapStyleBean?.isRecommendedPlaces = !view.isOpened
view.isOpened = !view.isOpened view.isOpened = !view.isOpened
onDataChange?.onDataChange() onDataChange?.onRecommendedPlacesChange(view.isOpened)
} }
override fun toggleToOff(view: SwitchView) { override fun toggleToOff(view: SwitchView) {
mapStyleBean?.isRecommendedPlaces = !view.isOpened mapStyleBean?.isRecommendedPlaces = !view.isOpened
view.isOpened = !view.isOpened view.isOpened = !view.isOpened
onDataChange?.onDataChange() onDataChange?.onRecommendedPlacesChange(view.isOpened)
} }
}) })
holder.binding.svStreetView.setOnStateChangedListener(object : holder.binding.svStreetView.setOnStateChangedListener(object :
...@@ -43,13 +43,13 @@ class DialogMapTailAdapter(val context: Context, private var mapStyleBean: MapS ...@@ -43,13 +43,13 @@ class DialogMapTailAdapter(val context: Context, private var mapStyleBean: MapS
override fun toggleToOn(view: SwitchView) { override fun toggleToOn(view: SwitchView) {
mapStyleBean?.isStreetViewMap = !view.isOpened mapStyleBean?.isStreetViewMap = !view.isOpened
view.isOpened = !view.isOpened view.isOpened = !view.isOpened
onDataChange?.onDataChange() onDataChange?.onStreetViewMapChange( view.isOpened)
} }
override fun toggleToOff(view: SwitchView) { override fun toggleToOff(view: SwitchView) {
mapStyleBean?.isStreetViewMap = !view.isOpened mapStyleBean?.isStreetViewMap = !view.isOpened
view.isOpened = !view.isOpened view.isOpened = !view.isOpened
onDataChange?.onDataChange() onDataChange?.onStreetViewMapChange( view.isOpened)
} }
...@@ -64,6 +64,7 @@ class DialogMapTailAdapter(val context: Context, private var mapStyleBean: MapS ...@@ -64,6 +64,7 @@ class DialogMapTailAdapter(val context: Context, private var mapStyleBean: MapS
override fun getLayoutId(viewType: Int) = R.layout.dialog_map_tail_item override fun getLayoutId(viewType: Int) = R.layout.dialog_map_tail_item
interface OnDataChange{ interface OnDataChange{
fun onDataChange() fun onRecommendedPlacesChange(isSelected:Boolean)
fun onStreetViewMapChange(isSelected:Boolean)
} }
} }
\ No newline at end of file
...@@ -145,9 +145,4 @@ interface MainApi { ...@@ -145,9 +145,4 @@ interface MainApi {
@POST("na/getAttractionsList") @POST("na/getAttractionsList")
fun getHotView(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<HotViewBean>>> fun getHotView(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<HotViewBean>>>
/**
* 景点推荐
*/
@POST("na/getAttractionsList")
fun getViewRecommed(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<ViewRecommed>>>
} }
\ No newline at end of file
...@@ -9,4 +9,6 @@ class MutualBean { ...@@ -9,4 +9,6 @@ class MutualBean {
var lat:String?=null var lat:String?=null
var lng:String?=null var lng:String?=null
var inner:Int=0 var inner:Int=0
var show:Int=0//展示地图的选择地址按钮
var type:String?=null//切换图层 hybrid=卫星路网混合 'roadmap'=路网图 'satellite’=卫星图 'terrain'=地形图
} }
\ No newline at end of file
package com.mints.street.bean
import java.io.Serializable
class ViewRecommed : Serializable {
val list: List<dataslist>? = null
inner class dataslist : Serializable {
val desc: String? = null
val img: String? = null
val lat: String? = null
val lng: String? = null
val name: String? = null
}
}
package com.mints.street.bean
/**
* Created by 冯瑞雨 on 2021/8/13.
*/
class ViewRecommedBean {
val desc: String? = null
val img: String? = null
val lat: String? = null
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
}
\ No newline at end of file
...@@ -20,6 +20,7 @@ import com.mints.street.R ...@@ -20,6 +20,7 @@ import com.mints.street.R
import com.mints.street.bean.GPS import com.mints.street.bean.GPS
import com.mints.street.bean.HotViewBean import com.mints.street.bean.HotViewBean
import com.mints.street.bean.MutualBean import com.mints.street.bean.MutualBean
import com.mints.street.bean.ViewRecommedBean
import com.mints.street.databinding.ActivityGoogleMapBinding import com.mints.street.databinding.ActivityGoogleMapBinding
import com.mints.street.main.home.HomeViewModel import com.mints.street.main.home.HomeViewModel
import com.mints.street.main.home.SearchMapActivity import com.mints.street.main.home.SearchMapActivity
...@@ -27,6 +28,7 @@ import com.mints.street.webview.MintsWebViewActivity ...@@ -27,6 +28,7 @@ import com.mints.street.webview.MintsWebViewActivity
import com.mints.street.widget.ScrollLayout import com.mints.street.widget.ScrollLayout
import com.mints.street.widget.dialog.DialogMapStyle import com.mints.street.widget.dialog.DialogMapStyle
import com.mints.street.widget.dialog.HotViewDialog import com.mints.street.widget.dialog.HotViewDialog
import com.mints.street.widget.dialog.ViewRecommedDialog
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.CommonDialogUtils import me.goldze.mvvmhabit.utils.CommonDialogUtils
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
...@@ -144,6 +146,16 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -144,6 +146,16 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
binding.webview.registerHandler("allIsOk") { _, _ -> binding.webview.registerHandler("allIsOk") { _, _ ->
initZsMap() initZsMap()
} }
//android->js 景点推荐 弹出景点弹框
binding.webview.registerHandler("openScenicsFrame") { data, _ ->
var bean: ViewRecommedBean? = null
try {
bean = Gson().fromJson(data, ViewRecommedBean::class.java)
} catch (e: Exception) {
KLog.e("实体类转换错误")
}
ViewRecommedDialog(context,bean,gps,viewModel).init().show()
}
viewModel.getMapBean() viewModel.getMapBean()
//定位 //定位
...@@ -172,7 +184,28 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -172,7 +184,28 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
RxUtils.onMultiClick(binding.imageMapChangeIcon) { RxUtils.onMultiClick(binding.imageMapChangeIcon) {
context?.apply { context?.apply {
if (dialogMapStyle == null) { if (dialogMapStyle == null) {
dialogMapStyle = DialogMapStyle(this,viewModel.mapStyleSortBean) dialogMapStyle = DialogMapStyle(this,viewModel.mapStyleSortBean.value,
object :DialogMapStyle.OnMapStyleDataChange{
override fun onMapStyleItemChange(type: Int) {
changeMapType(type)
}
override fun onRecommendedPlacesChange(isSelected: Boolean) {
if (isSelected){
if(viewModel.viewRecommed.value==null){
viewModel.getviewrecommend()
}else{
openScenics(viewModel.viewRecommed.value)
}
}else{
closeScenics()
}
}
override fun onStreetViewMapChange(isSelected: Boolean) {
changeVrButton(isSelected)
}
})
} }
if (this@GoogleMapFragment.fragmentManager != null) { if (this@GoogleMapFragment.fragmentManager != null) {
dialogMapStyle?.show(this@GoogleMapFragment.fragmentManager!!, "dialogMapStyle") dialogMapStyle?.show(this@GoogleMapFragment.fragmentManager!!, "dialogMapStyle")
...@@ -211,9 +244,11 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -211,9 +244,11 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
/** /**
* 开关街景按钮 * 开关街景按钮
*/ */
private fun changeVrButton(){ private fun changeVrButton(isShow:Boolean){
var mutualBean=MutualBean()
mutualBean.show= if (isShow)1 else 0
binding.webview.callHandler("changeVrButton" binding.webview.callHandler("changeVrButton"
,Gson().toJson(gps) ) { ,Gson().toJson(mutualBean) ) {
} }
} }
...@@ -221,9 +256,9 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -221,9 +256,9 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
* 调用JS方法 * 调用JS方法
* 开启景点 * 开启景点
*/ */
private fun openScenics(){ private fun openScenics(bean :HotViewBean?){
binding.webview.callHandler("openScenics" binding.webview.callHandler("showScenics"
,Gson().toJson(gps) ) { ,Gson().toJson(bean) ) {
} }
} }
/** /**
...@@ -235,6 +270,22 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -235,6 +270,22 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
,null ) { ,null ) {
} }
} }
/**
* 调用JS方法
* 切换图层
*/
private fun changeMapType(type:Int=0){
var mutualBean=MutualBean()
when(type){
1->mutualBean.type="hybrid"
2->mutualBean.type="roadmap"
3->mutualBean.type="satellite"
4->mutualBean.type="terrain"
}
binding.webview.callHandler("changeMapType"
,Gson().toJson(mutualBean) ) {
}
}
private fun initPosition() { private fun initPosition() {
//定位 //定位
...@@ -303,11 +354,16 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -303,11 +354,16 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
viewModel.mapStyleSortBean.observe(this, Observer { viewModel.mapStyleSortBean.observe(this, Observer {
it?.apply { it?.apply {
dialogMapStyle?.apply { dialogMapStyle?.apply {
this.mapStyleBean = viewModel.mapStyleSortBean this.mapStyleBean = it
} }
} }
}) })
viewModel.viewRecommed.observe(this, Observer {
it?.apply {
openScenics(this)
}
})
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
......
...@@ -32,7 +32,6 @@ import com.mints.street.widget.dialog.DialogMapStyle ...@@ -32,7 +32,6 @@ import com.mints.street.widget.dialog.DialogMapStyle
import com.mints.street.widget.dialog.DialogUtils import com.mints.street.widget.dialog.DialogUtils
import com.mints.street.widget.dialog.DialogUtils.showupgradevipDialog import com.mints.street.widget.dialog.DialogUtils.showupgradevipDialog
import com.mints.street.widget.dialog.HotViewDialog import com.mints.street.widget.dialog.HotViewDialog
import com.mints.street.widget.dialog.ViewRecommedDialog
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
...@@ -44,14 +43,6 @@ import me.goldze.mvvmhabit.utils.SPUtils ...@@ -44,14 +43,6 @@ import me.goldze.mvvmhabit.utils.SPUtils
*/ */
class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener { class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener {
private val viewrecommedDialog by lazy {
ViewRecommedDialog(
requireActivity(),
viewModel,
this
).init()
}
companion object { companion object {
val IS_FIRST_OPEN: String = "isFirstOpen" val IS_FIRST_OPEN: String = "isFirstOpen"
} }
......
...@@ -198,11 +198,6 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -198,11 +198,6 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
override fun onBusinessSuccess(response: BaseResponse<HotViewBean>) { override fun onBusinessSuccess(response: BaseResponse<HotViewBean>) {
hotviewData.value = response.result hotviewData.value = response.result
} }
override fun onError(e: Throwable) {
super.onError(e)
}
} }
) )
} }
...@@ -210,25 +205,18 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -210,25 +205,18 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
/** /**
* 获取景点推荐数据 * 获取景点推荐数据
*/ */
var viewRecommed=MutableLiveData<ViewRecommed>() var viewRecommed=MutableLiveData<HotViewBean?>()
fun getviewrecommend(){ fun getviewrecommend(){
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
//2-景点推荐 3-热门景点 //2-景点推荐 3-热门景点
vo["type"] = 2 vo["type"] = 2
ApiModel.getViewRecommed(lifecycleProvider,vo).safeSubscribe( ApiModel.getHotView(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<ViewRecommed>>( object : HttpSubscribeImpl<BaseResponse<HotViewBean>>(
this@HomeViewModel, true) { this@HomeViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<ViewRecommed>) { override fun onBusinessSuccess(response: BaseResponse<HotViewBean>) {
viewRecommed.value = response.result viewRecommed.value = response.result
KLog.e("getmyInfo", response.result.toString())
} }
override fun onError(e: Throwable) {
super.onError(e)
KLog.e("getmyInfo", "用户登录信息请求失败")
}
} }
) )
} }
......
...@@ -153,10 +153,4 @@ object ApiModel { ...@@ -153,10 +153,4 @@ object ApiModel {
return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getHotView(map)) return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getHotView(map))
} }
/**
* 请求景点推荐数据
*/
fun getViewRecommed(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Any>):Observable<Response<BaseResponse<ViewRecommed>>>{
return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getViewRecommed(map))
}
} }
\ No newline at end of file
...@@ -24,7 +24,7 @@ import com.mints.street.bean.MapStyleSortBean ...@@ -24,7 +24,7 @@ import com.mints.street.bean.MapStyleSortBean
*/ */
class DialogMapStyle( class DialogMapStyle(
var mContext: Context, var mContext: Context,
var mapStyleBean: MutableLiveData<MapStyleSortBean>? var mapStyleBean: MapStyleSortBean?,val onMapStyleDataChange :OnMapStyleDataChange?=null
) : BaseDialogFragment() { ) : BaseDialogFragment() {
private var recycler: RecyclerView? = null private var recycler: RecyclerView? = null
private var vLayout: VirtualLayoutManager? = null private var vLayout: VirtualLayoutManager? = null
...@@ -63,13 +63,13 @@ class DialogMapStyle( ...@@ -63,13 +63,13 @@ class DialogMapStyle(
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
mapStyleBean?.value?.mapStyleSort?.forEach { mapStyleBean?.mapStyleSort?.forEach {
mAdapter?.addAdapter(DialogMapHeadAdapter(mContext, it.name)) mAdapter?.addAdapter(DialogMapHeadAdapter(mContext, it.name))
mAdapter?.addAdapter( mAdapter?.addAdapter(
DialogMapContentAdapter(mContext, it.mapStyleList, DialogMapContentAdapter(mContext, it.mapStyleList,
object : DialogMapContentAdapter.OnItemMapStyleChange { object : DialogMapContentAdapter.OnItemMapStyleChange {
override fun onItemChange() { override fun onItemChange(type: Int) {
mapStyleBean?.value = mapStyleBean?.value onMapStyleDataChange?.onMapStyleItemChange(type)
} }
}) })
) )
...@@ -77,15 +77,23 @@ class DialogMapStyle( ...@@ -77,15 +77,23 @@ class DialogMapStyle(
mAdapter?.addAdapter(DialogMapHeadAdapter(mContext, "地图设置")) mAdapter?.addAdapter(DialogMapHeadAdapter(mContext, "地图设置"))
mAdapter?.addAdapter( mAdapter?.addAdapter(
DialogMapTailAdapter(mContext, mapStyleBean?.value, DialogMapTailAdapter(mContext, mapStyleBean,
object : DialogMapTailAdapter.OnDataChange { object : DialogMapTailAdapter.OnDataChange {
override fun onDataChange() { override fun onRecommendedPlacesChange(isSelected: Boolean) {
mapStyleBean?.value = mapStyleBean?.value onMapStyleDataChange?.onRecommendedPlacesChange(isSelected)
}
override fun onStreetViewMapChange(isSelected: Boolean) {
onMapStyleDataChange?.onStreetViewMapChange(isSelected)
} }
}) })
) )
} }
interface OnMapStyleDataChange{
fun onMapStyleItemChange(type:Int)
fun onRecommendedPlacesChange(isSelected: Boolean)
fun onStreetViewMapChange(isSelected: Boolean)
}
} }
package com.mints.street.widget.dialog package com.mints.street.widget.dialog
import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.vlayout.DelegateAdapter import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager import com.alibaba.android.vlayout.VirtualLayoutManager
import com.baidu.mapapi.model.LatLng
import com.baidu.mapapi.utils.DistanceUtil
import com.fry.base.utils.ImageLoader
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.mints.street.R import com.mints.street.R
import com.mints.street.adapter.ItemHotViewAdapter import com.mints.street.adapter.ItemHotViewAdapter
import com.mints.street.bean.GPS
import com.mints.street.bean.ViewRecommedBean
import com.mints.street.main.home.HomeFragment import com.mints.street.main.home.HomeFragment
import com.mints.street.main.home.HomeViewModel import com.mints.street.main.home.HomeViewModel
import com.mints.street.webview.MintsWebViewActivity
import com.mints.street.widget.GridItemDecoration import com.mints.street.widget.GridItemDecoration
import com.mints.street.widget.XCRoundRectImageView
import me.goldze.mvvmhabit.utils.RxUtils
import java.text.DecimalFormat
class ViewRecommedDialog (context: FragmentActivity, viewModel: HomeViewModel, homeFragment: HomeFragment) { class ViewRecommedDialog (context: Context?, bean: ViewRecommedBean?,gps:GPS?,homeViewModel: HomeViewModel) {
private var mBottomSheetDialog: BottomSheetDialog?=null private var mBottomSheetDialog: BottomSheetDialog?=null
private var context: FragmentActivity private var context: Context?=null
private var viewModel: HomeViewModel?=null private var bean: ViewRecommedBean?=null
private var homeFragment: HomeFragment?=null private var homeViewModel: HomeViewModel?=null
private var gps: GPS?=null
init { init {
this.context=context this.context=context
this.viewModel=viewModel this.bean=bean
this.homeFragment=homeFragment this.gps=gps
this.homeViewModel=homeViewModel
} }
// //
fun init(): ViewRecommedDialog { fun init(): ViewRecommedDialog {
//创建弹窗 //创建弹窗
if (mBottomSheetDialog!=null) return this if (mBottomSheetDialog!=null) return this
mBottomSheetDialog= BottomSheetDialog(context) mBottomSheetDialog= BottomSheetDialog(context!!)
val view1: View = LayoutInflater.from(context).inflate(R.layout.layout_viewrecommed,null) val view1: View = LayoutInflater.from(context).inflate(R.layout.layout_viewrecommed,null)
mBottomSheetDialog!!.setContentView(view1) mBottomSheetDialog!!.setContentView(view1)
mBottomSheetDialog!!.window!!.findViewById<View>(R.id.design_bottom_sheet).setBackgroundColor(Color.TRANSPARENT) mBottomSheetDialog!!.window!!.findViewById<View>(R.id.design_bottom_sheet).setBackgroundColor(Color.TRANSPARENT)
val iv_close: ImageView =view1.findViewById(R.id.iv_close) val viewname: TextView =view1.findViewById(R.id.viewname)
val recycler_view: RecyclerView =view1.findViewById(R.id.recycler_view) val tvDistance: TextView =view1.findViewById(R.id.tv_distance)
val image1: XCRoundRectImageView =view1.findViewById(R.id.image1)
val tvDescribe: TextView =view1.findViewById(R.id.tv_describe)
val textView5: TextView =view1.findViewById(R.id.textView5)
viewModel?.getHotView() viewname.text = bean?.name
viewModel?.hotviewData?.observe(homeFragment!!, androidx.lifecycle.Observer { val a = DistanceUtil.getDistance(LatLng(bean?.blat?.toDouble()?:0.0,
bean?.blng?.toDouble()?:0.0) ,LatLng(
gps?.lat?:0.0,gps?.lng?:0.0))
tvDistance.text = "距离${DecimalFormat("0.00").format(a/1000).toString()}km"
ImageLoader.ImageBuilder.with(context)
.setUrl(bean?.img).setTargetView(image1).start()
tvDescribe.text = bean?.desc
RxUtils.onMultiClick(textView5){
homeViewModel?.authorized( bean?.bvid,bean?.name)
})
iv_close.setOnClickListener{
mBottomSheetDialog!!.dismiss()
} }
return this return this
} }
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<ImageView <ImageView
android:visibility="gone" android:visibility="gone"
android:id="@+id/image_map_history" android:id="@+id/image_map_history"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:src="@mipmap/map_history_icon" android:src="@mipmap/map_history_icon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
<ImageView <ImageView
android:id="@+id/image_location_icon" android:id="@+id/image_location_icon"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:layout_marginBottom="220dp" android:layout_marginBottom="220dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:src="@mipmap/location_icon" android:src="@mipmap/location_icon"
...@@ -44,18 +44,18 @@ ...@@ -44,18 +44,18 @@
<ImageView <ImageView
android:id="@+id/image_map_change_icon" android:id="@+id/image_map_change_icon"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:layout_marginBottom="220dp" android:layout_marginBottom="220dp"
android:layout_marginTop="35dp" android:layout_marginTop="40dp"
android:src="@mipmap/map_change_icon" android:src="@mipmap/map_change_icon"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
/> />
<ImageView <ImageView
android:id="@+id/ly_hotview" android:id="@+id/ly_hotview"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:padding="3dp" android:padding="3dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:src="@mipmap/icon_hotview" android:src="@mipmap/icon_hotview"
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
<LinearLayout <LinearLayout
android:id="@+id/map_a_d" android:id="@+id/map_a_d"
android:layout_width="31dp" android:layout_width="36dp"
android:layout_height="63dp" android:layout_height="73dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_marginEnd="2dp" android:layout_marginEnd="2dp"
android:background="@drawable/shape_gold_card" android:background="@drawable/shape_gold_card"
...@@ -77,24 +77,26 @@ ...@@ -77,24 +77,26 @@
<ImageView <ImageView
android:id="@+id/image_in" android:id="@+id/image_in"
android:layout_width="31dp" android:layout_width="36dp"
android:layout_height="31dp" android:layout_height="36dp"
android:padding="10dp" android:padding="10dp"
android:src="@mipmap/scale_add_icon" /> android:src="@mipmap/scale_add_icon" />
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:background="@color/color_333" />
<ImageView <ImageView
android:id="@+id/image_out" android:id="@+id/image_out"
android:layout_width="31dp" android:layout_width="36dp"
android:layout_height="31dp" android:layout_height="36dp"
android:padding="10dp" android:padding="10dp"
android:src="@mipmap/scale_shrink_icon" /> android:src="@mipmap/scale_shrink_icon" />
<View
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:background="@color/color_333" />
</LinearLayout> </LinearLayout>
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
<ImageView <ImageView
android:id="@+id/image_map_history" android:id="@+id/image_map_history"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:src="@mipmap/map_history_icon" android:src="@mipmap/map_history_icon"
android:visibility="gone" android:visibility="gone"
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
<ImageView <ImageView
android:id="@+id/ly_hotview" android:id="@+id/ly_hotview"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:padding="3dp" android:padding="3dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:src="@mipmap/icon_hotview" android:src="@mipmap/icon_hotview"
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
<ImageView <ImageView
android:id="@+id/image_location_icon" android:id="@+id/image_location_icon"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginBottom="220dp" android:layout_marginBottom="220dp"
android:src="@mipmap/location_icon" android:src="@mipmap/location_icon"
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
<ImageView <ImageView
android:id="@+id/image_map_change_icon" android:id="@+id/image_map_change_icon"
android:layout_width="35dp" android:layout_width="40dp"
android:layout_height="35dp" android:layout_height="40dp"
android:layout_marginBottom="220dp" android:layout_marginBottom="220dp"
android:layout_marginTop="35dp" android:layout_marginTop="35dp"
android:src="@mipmap/map_change_icon" android:src="@mipmap/map_change_icon"
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
<LinearLayout <LinearLayout
android:id="@+id/map_a_d" android:id="@+id/map_a_d"
android:layout_width="31dp" android:layout_width="36dp"
android:layout_height="63dp" android:layout_height="73dp"
android:layout_marginEnd="2dp" android:layout_marginEnd="2dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card" android:background="@drawable/shape_gold_card"
...@@ -82,24 +82,25 @@ ...@@ -82,24 +82,25 @@
<ImageView <ImageView
android:id="@+id/image_in" android:id="@+id/image_in"
android:layout_width="31dp" android:layout_width="36dp"
android:layout_height="31dp" android:layout_height="36dp"
android:padding="10dp" android:padding="10dp"
android:src="@mipmap/scale_add_icon" /> android:src="@mipmap/scale_add_icon" />
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="@color/color_333" />
<ImageView <ImageView
android:id="@+id/image_out" android:id="@+id/image_out"
android:layout_width="31dp" android:layout_width="36dp"
android:layout_height="31dp" android:layout_height="36dp"
android:padding="10dp" android:padding="10dp"
android:src="@mipmap/scale_shrink_icon" /> android:src="@mipmap/scale_shrink_icon" />
<View
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="@color/color_333" />
</LinearLayout> </LinearLayout>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="景点名称" tools:text="景点名称"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="18dp" android:textSize="18dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
android:id="@+id/tv_distance" android:id="@+id/tv_distance"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="距离"
android:textColor="#99000000" android:textColor="#99000000"
android:textSize="14dp" android:textSize="14dp"
app:layout_constraintBottom_toBottomOf="@+id/viewname" app:layout_constraintBottom_toBottomOf="@+id/viewname"
...@@ -61,7 +60,6 @@ ...@@ -61,7 +60,6 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="120dp" android:layout_height="120dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:src="@mipmap/icon_card6"
app:layout_constraintEnd_toEndOf="@+id/textView5" app:layout_constraintEnd_toEndOf="@+id/textView5"
app:layout_constraintStart_toStartOf="@+id/viewname" app:layout_constraintStart_toStartOf="@+id/viewname"
app:layout_constraintTop_toBottomOf="@+id/viewname" app:layout_constraintTop_toBottomOf="@+id/viewname"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment