Commit c29a8e87 authored by fengruiyu's avatar fengruiyu

修改JS(z3map)

地图样式
parent 4d37bd73
...@@ -114,6 +114,16 @@ function needPay() { ...@@ -114,6 +114,16 @@ function needPay() {
} }
} }
function needPayPopup() {
try {
doAppFun("needPayPopup");
} catch (e) {
// console.log("tips", msg)
//alert("app未弹框==>" + msg + e)
}
}
function tips(msg) { function tips(msg) {
try { try {
doAppFun("tips", msg); doAppFun("tips", msg);
......
...@@ -52,7 +52,7 @@ var vm = new Vue({ ...@@ -52,7 +52,7 @@ var vm = new Vue({
vrs: function () { vrs: function () {
var th = this; var th = this;
if(this.isVip==false){ if(this.isVip==false){
this.needPay(); this.needPay('p');
return; return;
} }
if (th.canclick) { if (th.canclick) {
...@@ -129,7 +129,7 @@ var vm = new Vue({ ...@@ -129,7 +129,7 @@ var vm = new Vue({
}) })
marker.addListener("click", (ss) => { marker.addListener("click", (ss) => {
if(this.isVip==false){ if(this.isVip==false){
this.needPay(); this.needPay('p');
return; return;
} }
params = vm.getSeLabel(marker.getTitle()); params = vm.getSeLabel(marker.getTitle());
...@@ -163,7 +163,7 @@ var vm = new Vue({ ...@@ -163,7 +163,7 @@ var vm = new Vue({
inMsg.lat = 39.90960456049752; inMsg.lat = 39.90960456049752;
inMsg.lng = 116.3972282409668; inMsg.lng = 116.3972282409668;
} }
th.isVip = inMsg.vip == 1; th.isVip = inMsg.vip == 1;
var point = { var point = {
lat: parseFloat(inMsg.lat), lat: parseFloat(inMsg.lat),
lng: parseFloat(inMsg.lng) lng: parseFloat(inMsg.lng)
...@@ -232,9 +232,14 @@ var vm = new Vue({ ...@@ -232,9 +232,14 @@ var vm = new Vue({
return; return;
} }
}, },
needPay:function(){ needPay:function(d){
console.log("<<请开启会员") console.log("<<请开启会员")
needPay(); if(d!=undefined&&d!=null&&d=='p'){
needPay();
return;
}
needPayPopup();
}, },
G_initMap: function (point, zoomLevel) { G_initMap: function (point, zoomLevel) {
if (zoomLevel == undefined || zoomLevel == null) if (zoomLevel == undefined || zoomLevel == null)
...@@ -284,24 +289,14 @@ var vm = new Vue({ ...@@ -284,24 +289,14 @@ var vm = new Vue({
}); });
G_MAP.addListener("dragend", () => { // G_MAP.addListener("dragend", () => {
centerChanged(); // centerChanged();
}); // });
document.addEventListener("touchstart", function (e) {
centerChanged();
// document.addEventListener("touchstart", function (e) { }, false);
// console.log(e.touches);
// if (e.touches.length > 1) {
// vm.gdcenter =
// {
// lat: G_MAP.getCenter().lat(),
// lng: G_MAP.getCenter().lng()
// };
// console.log("两指")
// } else {
// vm.gdcenter = null;
// console.log("一指")
// }
// }, false);
} }
...@@ -317,7 +312,7 @@ var vm = new Vue({ ...@@ -317,7 +312,7 @@ var vm = new Vue({
window.onload = function () { window.onload = function () {
allIsOk(); allIsOk();
// init(); //init();
} }
function init() { function init() {
......
package com.mints.street.adapter package com.mints.street.adapter
import android.content.Context import android.content.Context
import android.content.Intent
import android.view.View import android.view.View
import com.alibaba.android.vlayout.LayoutHelper import com.alibaba.android.vlayout.LayoutHelper
import com.alibaba.android.vlayout.layout.GridLayoutHelper import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder import com.fry.base.adapter.BindingViewHolder
import com.fry.base.utils.ImageLoader
import com.mints.street.R import com.mints.street.R
import com.mints.street.bean.MapStyleList import com.mints.street.bean.MapStyleList
import com.mints.street.databinding.DialogMapContentItemBinding import com.mints.street.databinding.DialogMapContentItemBinding
import com.mints.street.databinding.DialogMapContentItemBindingImpl import com.mints.street.main.my.OpenvipActivity
import com.mints.street.databinding.ItemGridMapAdapterBinding import com.mints.street.manager.UserManager
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
/** /**
* Created by 冯瑞雨 on 2021/8/9. * Created by 冯瑞雨 on 2021/8/9.
*/ */
class DialogMapContentAdapter(val context: Context, var list: List<MapStyleList>?, class DialogMapContentAdapter(
val onItemMapStyleChange:OnItemMapStyleChange?=null) : val context: Context, var list: List<MapStyleList>?,
private val onItemMapStyleChange: OnItemMapStyleChange? = null
) :
AbstractVLayoutBaseAdapter<DialogMapContentItemBinding, List<MapStyleList>>(context, list, 2) { AbstractVLayoutBaseAdapter<DialogMapContentItemBinding, List<MapStyleList>>(context, list, 2) {
override fun onBindViewHolder( override fun onBindViewHolder(
holder: BindingViewHolder<DialogMapContentItemBinding>, holder: BindingViewHolder<DialogMapContentItemBinding>,
position: Int) { position: Int
when(list?.get(position)?.img?:0){ ) {
1->holder.binding.image.setImageResource(R.mipmap.img_mapstyle_1) ImageLoader.ImageBuilder.with(context)
2->holder.binding.image.setImageResource(R.mipmap.img_mapstyle_2) .setTargetView(holder.binding.image)
3->holder.binding.image.setImageResource(R.mipmap.img_mapstyle_3) .setUrl(list?.get(position)?.img).start()
4->holder.binding.image.setImageResource(R.mipmap.img_mapstyle_4) holder.binding.tvName.text = list?.get(position)?.name
} if (list?.get(position)?.isSelected == true) {
if(list?.get(position)?.isSelected == true){
holder.binding.ivSelected.visibility = View.VISIBLE holder.binding.ivSelected.visibility = View.VISIBLE
}else{ } else {
holder.binding.ivSelected.visibility = View.GONE holder.binding.ivSelected.visibility = View.GONE
} }
RxUtils.onMultiClick(holder.binding.image){ RxUtils.onMultiClick(holder.binding.image) {
if(list?.get(position)?.isSelected==true)return@onMultiClick if (list?.get(position)?.isSelected == true) return@onMultiClick
if (list?.get(position)?.type == "1" && !UserManager.INSTANCE.getVipFlag()) {
AppManager.getAppManager().currentActivity?.apply {
this.startActivity(
Intent(
this, OpenvipActivity::class.java
)
)
}
return@onMultiClick
}
list?.forEach { list?.forEach {
it.isSelected = false it.isSelected = false
} }
list?.get(position)?.isSelected =true list?.get(position)?.isSelected = true
onItemMapStyleChange?.onItemChange(list?.get(position)?.img?:0) onItemMapStyleChange?.onItemChange(list?.get(position)?.key ?: "hybrid")
notifyDataSetChanged() notifyDataSetChanged()
} }
} }
override fun getItemCount() = list?.size?:0 override fun getItemCount() = list?.size ?: 0
override fun onCreateLayoutHelper(): LayoutHelper { override fun onCreateLayoutHelper(): LayoutHelper {
val helper = GridLayoutHelper(2) val helper = GridLayoutHelper(2)
...@@ -57,7 +70,7 @@ class DialogMapContentAdapter(val context: Context, var list: List<MapStyleList> ...@@ -57,7 +70,7 @@ 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(type:Int) fun onItemChange(type: String)
} }
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.mints.street.netwrok.common.HttpManager ...@@ -5,6 +5,7 @@ import com.mints.street.netwrok.common.HttpManager
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.Response import retrofit2.Response
import retrofit2.http.Body import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST import retrofit2.http.POST
/** /**
...@@ -145,4 +146,9 @@ interface MainApi { ...@@ -145,4 +146,9 @@ 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/getMapChargeConfig")
fun getMapChargeConfig():Observable<Response<BaseResponse<MapStyleSort>>>
} }
\ No newline at end of file
package com.mints.street.bean
/**
* Created by 冯瑞雨 on 2021/8/16.
*/
class InitMapBean {
var lat: Double = 0.0
var lng: Double = 0.0
var vip: Int? = 0//0 非vip 1 vip
var inner: Int? = 0// 0国内 ,1国外
}
\ No newline at end of file
...@@ -10,11 +10,12 @@ class MapStyleSortBean { ...@@ -10,11 +10,12 @@ class MapStyleSortBean {
} }
class MapStyleSort{ class MapStyleSort{
var name:String?=null var name:String?=null
var mapStyleList:List<MapStyleList>?=null var list:List<MapStyleList>?=null
} }
class MapStyleList{ class MapStyleList{
var name:String?=null var name:String?=null
var img:Int=0 var key:String?=null
var type:String?=null//是否收费
var img:String?=null
var isSelected:Boolean?=false var isSelected:Boolean?=false
}
}
\ No newline at end of file
...@@ -4,7 +4,6 @@ import android.Manifest ...@@ -4,7 +4,6 @@ import android.Manifest
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.KeyEvent import android.view.KeyEvent
import android.view.MotionEvent
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
...@@ -17,7 +16,6 @@ import com.mints.street.BR ...@@ -17,7 +16,6 @@ import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.databinding.ActivityMainBinding import com.mints.street.databinding.ActivityMainBinding
import com.mints.street.main.googlemap.GoogleMapFragment 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.MyFragment
import com.mints.street.main.vr.VRFragment import com.mints.street.main.vr.VRFragment
import com.mints.street.manager.UserManager import com.mints.street.manager.UserManager
...@@ -25,6 +23,7 @@ import com.mints.street.manager.oaid.OaidManager ...@@ -25,6 +23,7 @@ import com.mints.street.manager.oaid.OaidManager
import com.permissionx.guolindev.PermissionX import com.permissionx.guolindev.PermissionX
import com.permissionx.guolindev.callback.RequestCallback import com.permissionx.guolindev.callback.RequestCallback
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
...@@ -37,29 +36,20 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -37,29 +36,20 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override fun getStatusBarHeightView(): View? { override fun getStatusBarHeightView(): View? {
return null return null
} }
private val homeFragment = HomeFragment()
override fun initData() { override fun initData() {
super.initData() super.initData()
OaidManager.init() OaidManager.init()
//初始化viewpager2 //初始化viewpager2
binding.mainViewpager.initMain(this,homeFragment) binding.mainViewpager.initMain(this)
//初始化 bottomBarF //初始化 bottomBarF
binding.mainBottom.init { binding.mainBottom.init {
when (it) { when (it) {
R.id.menu_home -> { R.id.menu_home -> binding.mainViewpager.setCurrentItem(0, false)
if (UserManager.INSTANCE.userIsLogin() && UserManager.INSTANCE.getVipFlag()) {
binding.mainViewpager.setCurrentItem(3, false)
} else {
binding.mainViewpager.setCurrentItem(0, false)
}
}
R.id.menu_square -> binding.mainViewpager.setCurrentItem(1, false) R.id.menu_square -> binding.mainViewpager.setCurrentItem(1, false)
R.id.menu_my -> { R.id.menu_my -> { binding.mainViewpager.setCurrentItem(2, false) }
binding.mainViewpager.setCurrentItem(2, false)
// stopAnim()
}
} }
} }
//加载本地GIF动图 //加载本地GIF动图
...@@ -81,15 +71,7 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -81,15 +71,7 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
viewModel.checkUpgrade() 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 var oldTime: Long = 0
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
when (keyCode) { when (keyCode) {
...@@ -108,19 +90,18 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -108,19 +90,18 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
} }
// override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
override fun dispatchTouchEvent(ev: MotionEvent): Boolean { // if (ev.action == MotionEvent.ACTION_MOVE) {
if (ev.action == MotionEvent.ACTION_MOVE){ // //触点的个数,就是有几个手指同时接触屏幕
//触点的个数,就是有几个手指同时接触屏幕 // if (ev.pointerCount == 1) {
if (ev.pointerCount==1){ // homeFragment.updateGesture(true)
homeFragment.updateGesture(true) // } else {
}else{ // homeFragment.updateGesture(false)
homeFragment.updateGesture(false) // }
} // }
} //
// return super.dispatchTouchEvent(ev)
return super.dispatchTouchEvent(ev) // }
}
} }
...@@ -137,11 +118,11 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U ...@@ -137,11 +118,11 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
return this return this
} }
private fun ViewPager2.initMain(activity: MainActivity,homeFragment:HomeFragment): ViewPager2 { private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
//是否可滑动 //是否可滑动
this.isUserInputEnabled = false this.isUserInputEnabled = false
//预加载 //预加载
this.offscreenPageLimit = 4 // this.offscreenPageLimit = 2
//设置适配器 //设置适配器
adapter = object : FragmentStateAdapter(activity) { adapter = object : FragmentStateAdapter(activity) {
...@@ -149,7 +130,7 @@ private fun ViewPager2.initMain(activity: MainActivity,homeFragment:HomeFragment ...@@ -149,7 +130,7 @@ private fun ViewPager2.initMain(activity: MainActivity,homeFragment:HomeFragment
return when (position) { return when (position) {
0 -> { 0 -> {
//首页 //首页
homeFragment GoogleMapFragment()
} }
1 -> { 1 -> {
//广场 //广场
...@@ -159,16 +140,13 @@ private fun ViewPager2.initMain(activity: MainActivity,homeFragment:HomeFragment ...@@ -159,16 +140,13 @@ private fun ViewPager2.initMain(activity: MainActivity,homeFragment:HomeFragment
//个人中心 //个人中心
MyFragment() MyFragment()
} }
3 -> {
GoogleMapFragment()
}
else -> { else -> {
//首页 //首页
HomeFragment() GoogleMapFragment()
} }
} }
} }
override fun getItemCount() = 4 override fun getItemCount() = 4
......
...@@ -130,7 +130,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -130,7 +130,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
} }
//地图样式 //地图样式
RxUtils.onMultiClick(binding.imageMapChangeIcon) { RxUtils.onMultiClick(binding.imageMapChangeIcon) {
if (!com.mints.street.manager.UserManager.INSTANCE.userIsLogin()&&!com.mints.street.manager.UserManager.INSTANCE.getVipFlag()){ if (!com.mints.street.manager.UserManager.
INSTANCE.userIsLogin()&&!com.mints.street.
manager.UserManager.INSTANCE.getVipFlag()){
startActivity(OpenvipActivity::class.java) startActivity(OpenvipActivity::class.java)
} }
......
...@@ -16,11 +16,13 @@ import com.mints.street.model.ApiModel ...@@ -16,11 +16,13 @@ import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl import com.mints.street.netwrok.base.HttpSubscribeImpl
import com.mints.street.utils.DeviceUuidFactory import com.mints.street.utils.DeviceUuidFactory
import com.mints.street.webview.MintsWebViewActivity import com.mints.street.webview.MintsWebViewActivity
import io.reactivex.Observable
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.SPUtils import me.goldze.mvvmhabit.utils.SPUtils
import me.tatarka.bindingcollectionadapter2.ItemBinding import me.tatarka.bindingcollectionadapter2.ItemBinding
import retrofit2.Response
import java.io.BufferedReader import java.io.BufferedReader
import java.io.InputStreamReader import java.io.InputStreamReader
...@@ -33,14 +35,22 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -33,14 +35,22 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
var addressList = ObservableArrayList<HomeButtonItemVM?>() var addressList = ObservableArrayList<HomeButtonItemVM?>()
var addressItemBinding = var addressItemBinding =
ItemBinding.of<HomeButtonItemVM>(BR.viewModel, R.layout.item_home_button) ItemBinding.of<HomeButtonItemVM>(BR.viewModel, R.layout.item_home_button)
var isLoginAndVipEqualTrue:Boolean?=null
//搜索页面回调 谷歌GPS //搜索页面回调 谷歌GPS
var pt = MutableLiveData<GPS>() var pt = MutableLiveData<GPS>()
val authorizedBean = MutableLiveData<AuthorizedBean>() val authorizedBean = MutableLiveData<AuthorizedBean>()
fun authorized() { fun authorized() {
ApiModel.authorized().safeSubscribe(object var authorized : Observable< Response<BaseResponse<AuthorizedBean>>>?=null
if (isLoginAndVipEqualTrue == true){
//vip
authorized = ApiModel.authorized()
}else{
//非vip
authorized = ApiModel.authorizedA()
}
authorized.safeSubscribe(object
: HttpSubscribeImpl<BaseResponse<AuthorizedBean>>( : HttpSubscribeImpl<BaseResponse<AuthorizedBean>>(
null, false null, false
) { ) {
...@@ -50,7 +60,6 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -50,7 +60,6 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
} }
authorizedBean.value = response.result authorizedBean.value = response.result
} }
}) })
} }
...@@ -241,26 +250,21 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -241,26 +250,21 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
/** /**
* 获取地图展示样式 * 获取地图展示样式
*/ */
val mapStyleSortBean = MutableLiveData<MapStyleSortBean>(getMapStyle()) val mapStyleSortBean = MutableLiveData<MapStyleSortBean>()
fun getMapStyle():MapStyleSortBean?{ fun getMapStyle(){
val assets = AppManager.getAppManager().currentActivity.assets ApiModel.getMapChargeConfig(lifecycleProvider).safeSubscribe(object
val stringBuilder = StringBuilder() :HttpSubscribeImpl<BaseResponse<MapStyleSort>>(this@HomeViewModel){
var mapBean: MapStyleSortBean? = null override fun onBusinessSuccess(response: BaseResponse<MapStyleSort>) {
try { response.result.name = "常用"
//通过管理器打开文件并读取 val bean = MapStyleSortBean()
val bf = BufferedReader( bean.isStreetViewMap = true
InputStreamReader( bean.isRecommendedPlaces = false
assets.open("mapStyle.json") if (response.result.list!=null && response.result.list?.size?:0>0){
) response.result.list?.get(0)?.isSelected = true
) }
var line: String? bean.mapStyleSort = listOf(response.result)
while (bf.readLine().also { line = it } != null) { mapStyleSortBean.value = bean
stringBuilder.append(line)
} }
mapBean = Gson().fromJson(stringBuilder.toString(), MapStyleSortBean::class.java) })
} catch (e: Exception) {
KLog.e("读取assets文件下的json出问题")
}
return mapBean
} }
} }
\ No newline at end of file
...@@ -149,8 +149,18 @@ object ApiModel { ...@@ -149,8 +149,18 @@ object ApiModel {
/** /**
* 请求热门景点数据 * 请求热门景点数据
*/ */
fun getHotView(lifecycleProvider: LifecycleProvider<Any>?, map: HashMap<String, Any>):Observable<Response<BaseResponse<HotViewBean>>>{ fun getHotView(lifecycleProvider: LifecycleProvider<Any>?,
return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getHotView(map)) map: HashMap<String, Any>):Observable<Response<BaseResponse<HotViewBean>>>{
return HttpManager.getInstance().execute(lifecycleProvider,
MainApi.newInstance().getHotView(map))
}
/**
* 地图是否收费
*/
fun getMapChargeConfig(lifecycleProvider: LifecycleProvider<Any>?)
:Observable<Response<BaseResponse<MapStyleSort>>>{
return HttpManager.getInstance().execute(lifecycleProvider,
MainApi.newInstance().getMapChargeConfig())
} }
} }
\ No newline at end of file
package com.mints.street.widget.dialog
import androidx.fragment.app.FragmentActivity
import com.mints.street.login.OnLoginListener
class BenfitDialog(context: FragmentActivity){
}
\ No newline at end of file
...@@ -66,9 +66,9 @@ class DialogMapStyle( ...@@ -66,9 +66,9 @@ class DialogMapStyle(
mapStyleBean?.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.list,
object : DialogMapContentAdapter.OnItemMapStyleChange { object : DialogMapContentAdapter.OnItemMapStyleChange {
override fun onItemChange(type: Int) { override fun onItemChange(type: String) {
onMapStyleDataChange?.onMapStyleItemChange(type) onMapStyleDataChange?.onMapStyleItemChange(type)
} }
}) })
...@@ -92,7 +92,7 @@ class DialogMapStyle( ...@@ -92,7 +92,7 @@ class DialogMapStyle(
) )
} }
interface OnMapStyleDataChange{ interface OnMapStyleDataChange{
fun onMapStyleItemChange(type:Int) fun onMapStyleItemChange(type:String)
fun onRecommendedPlacesChange(isSelected: Boolean) fun onRecommendedPlacesChange(isSelected: Boolean)
fun onStreetViewMapChange(isSelected: Boolean) fun onStreetViewMapChange(isSelected: Boolean)
} }
......
...@@ -22,7 +22,7 @@ object DialogUtils { ...@@ -22,7 +22,7 @@ object DialogUtils {
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
fun showupgradevipDialog(ctx: Context){ fun showupgradevipDialog(ctx: Context?){
val weakReference = WeakReference<Context>(ctx) val weakReference = WeakReference<Context>(ctx)
val bonusDialog = UpgradeVipDialog(weakReference.get()!!) val bonusDialog = UpgradeVipDialog(weakReference.get()!!)
bonusDialog.show() bonusDialog.show()
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
android:src="@mipmap/map_select_icon" android:src="@mipmap/map_select_icon"
/> />
<TextView <TextView
android:id="@+id/tv_name"
android:paddingTop="10dp" android:paddingTop="10dp"
app:layout_constraintTop_toBottomOf="@+id/image" app:layout_constraintTop_toBottomOf="@+id/image"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
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