Commit a59fc2ca authored by fengruiyu's avatar fengruiyu

百度地图的sdk 地图缩放不移动,移动不缩放功能已完成

parent d1913046
......@@ -12,7 +12,7 @@ import com.mints.street.databinding.ItemGridMapAdapterBinding
* Created by 冯瑞雨 on 2021/8/9.
*/
class DialogMapTailAdapter(val context: Context) :
AbstractVLayoutBaseAdapter<ItemGridMapAdapterBinding, Any>(context, null, 3) {
AbstractVLayoutBaseAdapter<ItemGridMapAdapterBinding, List<String>>(context, null, 3) {
override fun onBindViewHolder(
holder: BindingViewHolder<ItemGridMapAdapterBinding>,
......@@ -21,7 +21,6 @@ class DialogMapTailAdapter(val context: Context) :
}
override fun getItemCount() = 1
override fun onCreateLayoutHelper(): LayoutHelper {
......
package com.mints.street.adapter
import android.app.ActionBar
import android.content.Context
import android.icu.number.IntegerWidth
import android.view.WindowManager
import android.widget.ImageView
import com.alibaba.android.vlayout.LayoutHelper
import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.bumptech.glide.Glide
......@@ -14,10 +10,8 @@ import com.fry.base.binding.setMargin
import com.mints.street.R
import com.mints.street.bean.VrmapBean
import com.mints.street.databinding.ItemGridMapAdapterBinding
import com.mints.street.main.vr.PanoramicActivity
import com.mints.street.webview.MintsWebViewActivity
import me.goldze.mvvmhabit.utils.AppUtils
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.RxUtils
/**
......
......@@ -64,7 +64,7 @@ class HistoryRecordAdapter(val activity: SearchMapActivity,val viewModel: Search
}
private fun getHistoryData(): MutableList<HistoryBean>? {
val instance = SPUtils.getInstance(SearchMapActivity.HISTORY_NAME)
val instance = SPUtils.getInstance( SearchMapActivity.HISTORY_NAME)
val string = instance.decodeString(if (type==0){"Territory"}else{"Abroad"})
if (TextUtils.isEmpty(string)) {
return null
......
......@@ -4,10 +4,10 @@ import android.Manifest
import android.os.Build
import android.os.Bundle
import android.view.KeyEvent
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
import com.fry.base.base.BaseActivity
......@@ -19,7 +19,6 @@ import com.mints.street.databinding.ActivityMainBinding
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.OpenvipActivity
import com.mints.street.main.vr.VRFragment
import com.mints.street.manager.UserManager
import com.mints.street.manager.oaid.OaidManager
......@@ -38,13 +37,14 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override fun getStatusBarHeightView(): View? {
return null
}
private val homeFragment = HomeFragment()
override fun initData() {
super.initData()
OaidManager.init()
//初始化viewpager2
binding.mainViewpager.initMain(this)
binding.mainViewpager.initMain(this,homeFragment)
//初始化 bottomBarF
binding.mainBottom.init {
when (it) {
......@@ -108,6 +108,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
return true
}
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
if (ev.action == MotionEvent.ACTION_MOVE){
//触点的个数,就是有几个手指同时接触屏幕
if (ev.pointerCount==1){
homeFragment.updateGesture(true)
}else{
homeFragment.updateGesture(false)
}
}
return super.dispatchTouchEvent(ev)
}
}
......@@ -123,7 +138,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
return this
}
private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
private fun ViewPager2.initMain(activity: MainActivity,homeFragment:HomeFragment): ViewPager2 {
//是否可滑动
this.isUserInputEnabled = false
//预加载
......@@ -135,7 +150,7 @@ private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
return when (position) {
0 -> {
//首页
HomeFragment()
homeFragment
}
1 -> {
//广场
......
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