Commit 98e429ed authored by 张释方's avatar 张释方

Merge branch 'master' of http://gitlab.mints-id.com/android/android_street into branche_zsf

parents ae3ed87f 60d5b81b
...@@ -167,9 +167,9 @@ dependencies { ...@@ -167,9 +167,9 @@ dependencies {
// 应用管理中心分包 // 应用管理中心分包
implementation(name: 'humesdk-1.0.0', ext: 'aar') implementation(name: 'humesdk-1.0.0', ext: 'aar')
// umeng // umeng
implementation 'com.umeng.umsdk:common:9.4.0'// 必选 implementation 'com.umeng.umsdk:common:9.3.8'// 必选
implementation 'com.umeng.umsdk:asms:1.2.3'// 必选 implementation 'com.umeng.umsdk:asms:1.2.3'// 必选
implementation 'com.umeng.umsdk:apm:1.4.0' implementation 'com.umeng.umsdk:apm:1.3.1'
// 穿山甲 GroMore // 穿山甲 GroMore
// mediation_ad_sdk // mediation_ad_sdk
implementation(name: 'mediation_ad_sdk_2.8.1.0', ext: 'aar') implementation(name: 'mediation_ad_sdk_2.8.1.0', ext: 'aar')
......
package com.mints.street.adapter
import android.content.Context
import android.text.TextUtils
import androidx.databinding.ViewDataBinding
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder
import com.fry.base.recycler_view.VHMAdapter
import com.fry.base.recycler_view.VHModel
import com.google.gson.Gson
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.ItemHistoryRecordAdapterBinding
import com.mints.street.main.home.SearchMapActivity
import me.goldze.mvvmhabit.utils.SPUtils
/**
* Created by 冯瑞雨 on 2021/7/14.
* 历史记录的adapter
*/
class HistoryRecordAdapter(val context: Context, var name: String? = null) :
AbstractVLayoutBaseAdapter<ItemHistoryRecordAdapterBinding, String>(context, name, 1) {
var listName: List<String>? = getHistoryData()
override fun onBindViewHolder(
holder: BindingViewHolder<ItemHistoryRecordAdapterBinding>,
position: Int
) {
val adapter = VHMAdapter<HistoryRecordItemVHM>()
listName?.apply {
for (items in this) {
adapter.add(HistoryRecordItemVHM(items))
}
}
holder.binding.listView.adapter = adapter
}
private fun getHistoryData(): List<String>? {
val instance = SPUtils.getInstance(SearchMapActivity.HISTORY_NAME)
val string = instance.decodeString("name")
if (TextUtils.isEmpty(string)){
return null
}
return Gson().fromJson<List<String>>(string, List::class.java)
}
fun addHistoryData(list:List<String> ) {
val instance = SPUtils.getInstance(SearchMapActivity.HISTORY_NAME)
instance.encode("name", Gson().toJson(list).toString())
}
override fun getItemCount() = 1
override fun onCreateLayoutHelper() = LinearLayoutHelper()
override fun getLayoutId(viewType: Int) = R.layout.item_history_record_adapter
}
class HistoryRecordItemVHM(
var name: String
) : VHModel() {
override fun getLayoutId() = R.layout.item_history_record_name
override fun getVariableId() = BR.vhm
override fun onBind(binding: ViewDataBinding) {
super.onBind(binding)
}
}
\ No newline at end of file
package com.mints.street.adapter
import android.content.Context
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter
import com.fry.base.adapter.BindingViewHolder
import com.mints.street.R
import com.mints.street.databinding.ItemPopularSceneAdapterBinding
import me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/14.
* 热门景区的adapter
*/
class PopularSceneAdapter(val context: Context, var list: List<String>) :
AbstractVLayoutBaseAdapter<ItemPopularSceneAdapterBinding, List<String>>(context, list, 2) {
override fun onBindViewHolder(
holder: BindingViewHolder<ItemPopularSceneAdapterBinding>,
position: Int
) {
KLog.e("PopularSceneAdapter",list.size)
}
override fun getItemCount() = list.size
override fun onCreateLayoutHelper() = LinearLayoutHelper()
override fun getLayoutId(viewType: Int) = R.layout.item_popular_scene_adapter
}
package com.mints.street.bean
/**
* Created by 冯瑞雨 on 2021/7/15.
*/
class PositioningBean {
//纬度
var latitude:Double?=0.0
//经度
var longitude:Double?=0.0
// 国家码
var countryCode:String?=null
//国家名称
var country:String?=null
//获取省份
var province:String?=null
//获取城市
var city :String?=null
//获取区
var district :String?=null
//获取镇信息
var town :String?=null
//获取街道信息
var street :String?=null
// 地址信息
var addrStr :String?=null
}
\ No newline at end of file
package com.mints.street.main.home package com.mints.street.main.home
import me.goldze.mvvmhabit.base.ItemViewModel import me.goldze.mvvmhabit.base.ItemViewModel
import me.goldze.mvvmhabit.binding.command.BindingAction
import me.goldze.mvvmhabit.binding.command.BindingCommand
/** /**
* Created by 冯瑞雨 on 2021/7/9. * Created by 冯瑞雨 on 2021/7/9.
*/ */
class HomeButtonItemVM (viewModel: HomeViewModel): ItemViewModel<HomeViewModel?>(viewModel) { class HomeButtonItemVM(viewModel: HomeViewModel) : ItemViewModel<HomeViewModel?>(viewModel) {
val onItemClick = BindingCommand<Any?>(BindingAction {
SearchMapActivity.startSearchMapActivity()
})
} }
\ No newline at end of file
...@@ -20,12 +20,15 @@ import com.baidu.mapapi.search.core.RecommendStopInfo ...@@ -20,12 +20,15 @@ import com.baidu.mapapi.search.core.RecommendStopInfo
import com.baidu.mapapi.search.recommendstop.RecommendStopSearch import com.baidu.mapapi.search.recommendstop.RecommendStopSearch
import com.baidu.mapapi.search.recommendstop.RecommendStopSearchOption import com.baidu.mapapi.search.recommendstop.RecommendStopSearchOption
import com.fry.base.base.BaseFragment import com.fry.base.base.BaseFragment
import com.google.gson.Gson
import com.mints.street.BR import com.mints.street.BR
import com.mints.street.R import com.mints.street.R
import com.mints.street.bean.PositioningBean
import com.mints.street.databinding.FragmentHomeBinding import com.mints.street.databinding.FragmentHomeBinding
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
import me.goldze.mvvmhabit.utils.SPUtils
/** /**
* Created by 冯瑞雨 on 2021/7/2. * Created by 冯瑞雨 on 2021/7/2.
...@@ -100,21 +103,21 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -100,21 +103,21 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
mBaiduMap?.setMapStatus(mapStatusUpdate) mBaiduMap?.setMapStatus(mapStatusUpdate)
mBaiduMap?.setOnMapStatusChangeListener(object : BaiduMap.OnMapStatusChangeListener { mBaiduMap?.setOnMapStatusChangeListener(object : BaiduMap.OnMapStatusChangeListener {
override fun onMapStatusChangeStart(status: MapStatus?) { override fun onMapStatusChangeStart(status: MapStatus?) {
KLog.a("百度map", "移动开始") //KLog.a("百度map", "移动开始")
} }
override fun onMapStatusChangeStart(status: MapStatus?, reason: Int) { override fun onMapStatusChangeStart(status: MapStatus?, reason: Int) {
KLog.a("百度map", "移动开始,两个参数") // KLog.a("百度map", "移动开始,两个参数")
} }
override fun onMapStatusChange(status: MapStatus?) { override fun onMapStatusChange(status: MapStatus?) {
KLog.a("百度map", "移动改变") //KLog.a("百度map", "移动改变")
} }
override fun onMapStatusChangeFinish(status: MapStatus?) { override fun onMapStatusChangeFinish(status: MapStatus?) {
KLog.a("百度map", "移动结束") // KLog.a("百度map", "移动结束")
mRecommendStopSearch?.requestRecommendStop( mRecommendStopSearch?.requestRecommendStop(
RecommendStopSearchOption().location( RecommendStopSearchOption().location(
center center
...@@ -185,7 +188,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -185,7 +188,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
option.isOpenGps = true option.isOpenGps = true
// 设置坐标类型 // 设置坐标类型
option.setCoorType("bd09ll") option.setCoorType("bd09ll")
option.setScanSpan(1000) //可选,默认0,即仅定位一次,设置发起连续定位请求的间隔需要大于等于1000ms才是有效的
option.setScanSpan(100000)//十秒一次
option.setIsNeedAddress(true) // 可选,设置是否需要地址信息,默认不需要
option.setIsNeedLocationDescribe(true) // 可选,设置是否需要地址描述
mLocClient?.locOption = option mLocClient?.locOption = option
mLocClient?.start() mLocClient?.start()
} }
...@@ -244,8 +251,28 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -244,8 +251,28 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
/** /**
* 定位SDK监听函数 * 定位SDK监听函数
*/ */
var sp:SPUtils?=null
var positioningBean:PositioningBean?=null
inner class MyLocationListener : BDLocationListener { inner class MyLocationListener : BDLocationListener {
override fun onReceiveLocation(location: BDLocation) { override fun onReceiveLocation(location: BDLocation) {
if (sp==null){
sp = SPUtils.getInstance(SPUtils.POSITIONING_MAP)
}
if (positioningBean == null){
positioningBean = PositioningBean()
}
positioningBean?.latitude = location.latitude
positioningBean?.longitude = location.longitude
positioningBean?.countryCode = location.countryCode
positioningBean?.country = location.country
positioningBean?.province = location.province
positioningBean?.city = location.city
positioningBean?.district = location.district
positioningBean?.town = location.town
positioningBean?.street = location.street
positioningBean?.addrStr = location.addrStr
sp?.encode(SPUtils.POSITIONING_MAP,Gson().toJson(positioningBean).toString())
// MapView 销毁后不在处理新接收的位置 // MapView 销毁后不在处理新接收的位置
mBaiduMap?.apply { mBaiduMap?.apply {
mCurrentLat = location.latitude mCurrentLat = location.latitude
......
package com.mints.street.main.home
import me.goldze.mvvmhabit.base.ItemViewModel
/**
* Created by 冯瑞雨 on 2021/7/15.
*/
class SearchAfterItem(viewModel: SearchMapViewModel,val name:String?, val address:String?) :
ItemViewModel<SearchMapViewModel>(viewModel) {
}
\ No newline at end of file
package com.mints.street.main.home
import android.content.Intent
import android.os.Bundle
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.baidu.mapapi.search.sug.OnGetSuggestionResultListener
import com.baidu.mapapi.search.sug.SuggestionResult
import com.baidu.mapapi.search.sug.SuggestionSearch
import com.baidu.mapapi.search.sug.SuggestionSearchOption
import com.fry.base.base.BaseActivity
import com.fry.base.utils.ResourceUtils
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.adapter.HistoryRecordAdapter
import com.mints.street.adapter.PopularSceneAdapter
import com.mints.street.databinding.ActivitySearchMapBinding
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/13.
*/
class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewModel>(),
OnGetSuggestionResultListener {
companion object {
const val HISTORY_NAME = "history_name"
fun startSearchMapActivity() {
AppManager.getAppManager().currentActivity?.apply {
this.startActivity(Intent(this, SearchMapActivity::class.java))
}
}
}
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
private var index = 0;//0=境内 1=境外
private var historyRecordAdapter: HistoryRecordAdapter? = null
private var popularSceneAdapter: PopularSceneAdapter? = null
//检索模块
private var mSuggestionSearch: SuggestionSearch? = null
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_search_map
override fun initVariableId() = BR.viewModel
override fun initData() {
super.initData()
//初始化布局管理器
vLayout = VirtualLayoutManager(this)
mAdapter = DelegateAdapter(vLayout, false)
binding.recyList.layoutManager = vLayout
binding.recyList.adapter = mAdapter
// 初始化建议搜索模块,注册建议搜索事件监听
mSuggestionSearch = SuggestionSearch.newInstance()
mSuggestionSearch?.setOnGetSuggestionResultListener(this)
binding.et.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
override fun afterTextChanged(s: Editable?) {
if (TextUtils.isEmpty(s)) {
viewModel.searchAfterOneItems.clear()
return
}
// 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新
mSuggestionSearch?.requestSuggestion(
SuggestionSearchOption()
.keyword(s.toString()) // 关键字
.city(viewModel.positioningBean?.city ?: "北京")
) // 城市
}
})
historyRecordAdapter = HistoryRecordAdapter(this)
popularSceneAdapter = PopularSceneAdapter(this, listOf("1", "12"))
mAdapter?.addAdapter(historyRecordAdapter)
mAdapter?.addAdapter(popularSceneAdapter)
//境内
binding.territory.setOnClickListener {
territory()
}
//境外
binding.abroad.setOnClickListener {
abroad()
}
}
private fun update() {
mAdapter?.clear()
if (index == 0) {
historyRecordAdapter?.apply {
mAdapter?.addAdapter(historyRecordAdapter)
}
} else {
mAdapter?.removeAdapter(historyRecordAdapter)
}
popularSceneAdapter?.apply {
this.list = listOf("1", "12", "dfdsfsd")
mAdapter?.addAdapter(popularSceneAdapter)
}
mAdapter?.notifyDataSetChanged()
}
private fun territory() {
if (index == 0) return
index = 0
binding.territory.setTextColor(ResourceUtils.getColor(R.color.blue))
binding.abroad.setTextColor(ResourceUtils.getColor(R.color.white))
binding.territory.solid = ResourceUtils.getColor(R.color.white)
binding.abroad.solid = ResourceUtils.getColor(R.color.blue)
update()
}
private fun abroad() {
if (index == 1) return
index = 1
binding.territory.setTextColor(ResourceUtils.getColor(R.color.white))
binding.abroad.setTextColor(ResourceUtils.getColor(R.color.blue))
binding.territory.solid = ResourceUtils.getColor(R.color.blue)
binding.abroad.solid = ResourceUtils.getColor(R.color.white)
update()
}
/**
* 获取在线建议搜索结果,得到requestSuggestion返回的搜索结果
*
* @param suggestionResult Sug检索结果
*/
override fun onGetSuggestionResult(suggestionResult: SuggestionResult?) {
if (suggestionResult == null || suggestionResult.allSuggestions == null) {
return
}
viewModel.searchAfterOneItems.clear()
if(TextUtils.isEmpty(binding.et.text)){
return
}
for (info in suggestionResult.allSuggestions) {
viewModel.searchAfterOneItems.add(SearchAfterItem(viewModel
,info.key,info.address))
}
}
}
\ No newline at end of file
package com.mints.street.main.home
import android.app.Application
import android.text.TextUtils
import android.view.View
import androidx.databinding.ObservableArrayList
import com.google.gson.Gson
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.bean.PositioningBean
import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.SPUtils
import me.tatarka.bindingcollectionadapter2.ItemBinding
/**
* Created by 冯瑞雨 on 2021/7/13.
*/
class SearchMapViewModel(application: Application) : BaseViewModel(application) {
val searchAfterItemBinding = ItemBinding.of<SearchAfterItem>(BR.viewModel, R.layout.item_search_after)
val searchAfterOneItems = ObservableArrayList<SearchAfterItem>()
//定位位置
val positioningBean: PositioningBean? =getpositioningMap()
private fun getpositioningMap():PositioningBean?{
SPUtils.getInstance(SPUtils.POSITIONING_MAP)
.decodeString(SPUtils.POSITIONING_MAP)?.apply {
if (!TextUtils.isEmpty(this)){
return Gson().fromJson(this,PositioningBean::class.java)
}
}
return null
}
}
\ No newline at end of file
...@@ -74,7 +74,7 @@ class PanoramicActivity : BaseActivity<ActivityPanoramicBinding, PanoramicViewMo ...@@ -74,7 +74,7 @@ class PanoramicActivity : BaseActivity<ActivityPanoramicBinding, PanoramicViewMo
"请在AndoridManifest.xml中输入正确的授权Key,并检查您的网络连接是否正常!error: $iError" "请在AndoridManifest.xml中输入正确的授权Key,并检查您的网络连接是否正常!error: $iError"
) )
} else { } else {
KLog.a("BMapManager", "key认证成功") KLog.i("BMapManager", "key认证成功")
} }
} }
} }
...@@ -148,6 +148,8 @@ class PanoramicActivity : BaseActivity<ActivityPanoramicBinding, PanoramicViewMo ...@@ -148,6 +148,8 @@ class PanoramicActivity : BaseActivity<ActivityPanoramicBinding, PanoramicViewMo
} }
override fun onLoadPanoramaError(p0: String?) { override fun onLoadPanoramaError(p0: String?) {
KLog.i("PanoramicActivity", "onLoadPanoramaError...$p0")
} }
override fun onMessage(p0: String?, p1: Int) { override fun onMessage(p0: String?, p1: Int) {
...@@ -200,9 +202,9 @@ class PanoramicActivity : BaseActivity<ActivityPanoramicBinding, PanoramicViewMo ...@@ -200,9 +202,9 @@ class PanoramicActivity : BaseActivity<ActivityPanoramicBinding, PanoramicViewMo
return return
} }
binding.panorama.setPanoramaImageLevel( binding.panorama.setPanoramaImageLevel(
PanoramaView.ImageDefinition.ImageDefinitionMiddle PanoramaView.ImageDefinition.ImageDefinitionLow
) )
binding.panorama.setPanorama(lon, lat, PanoramaView.COORDTYPE_BD09LL) binding.panorama.setPanorama(lon, lat)
} }
//通过百度墨卡托坐标(BD09MC)获取全景 //通过百度墨卡托坐标(BD09MC)获取全景
MERCATOR -> { MERCATOR -> {
......
package com.mints.street.webview
import android.os.Bundle
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.databinding.ActivityMintsWebViewBinding
/**
* Created by 冯瑞雨 on 2021/7/15.
*/
class MintsWebViewActivity:BaseActivity<ActivityMintsWebViewBinding,MintsWebViewModel>() {
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_mints_web_view
override fun initVariableId() = BR.viewModel
}
\ No newline at end of file
package com.mints.street.webview
import android.app.Application
import me.goldze.mvvmhabit.base.BaseViewModel
/**
* Created by 冯瑞雨 on 2021/7/15.
*/
class MintsWebViewModel(application: Application):BaseViewModel(application) {
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 边框的颜色和粗细 -->
<solid android:color="#ffffffff" />
<corners android:radius="81dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#00bb9c"/>
<size android:width="1dp"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_gold_card" android:state_checked="true"/>
<item android:drawable="@drawable/shape_gold" android:state_checked="false"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@color/blue" />
<item android:state_checked="true" android:drawable="@color/black" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="com.mints.street.webview.MintsWebViewModel" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<com.fry.base.ui.widget.CommonTitleBar
android:id="@+id/ctb_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ctb_theme="dark"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/view_bg"
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@color/color_8F6D21"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_title_bg"
android:layout_width="120dp"
android:layout_height="30dp"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="@id/ctb_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/ctb_title">
<com.coorchice.library.SuperTextView
android:id="@+id/territory"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="境内"
android:textColor="@color/blue"
android:textSize="14sp"
app:stv_corner="5dp"
app:stv_left_bottom_corner="true"
app:stv_left_top_corner="true"
app:stv_solid="@color/white"
app:stv_stroke_color="@color/white"
app:stv_stroke_width="1dp" />
<com.coorchice.library.SuperTextView
android:id="@+id/abroad"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="境外"
android:textColor="@color/white"
android:textSize="14sp"
app:stv_corner="5dp"
app:stv_right_bottom_corner="true"
app:stv_right_top_corner="true"
app:stv_solid="@color/blue"
app:stv_stroke_color="@color/white"
app:stv_stroke_width="1dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:paddingTop="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_bg" />
<EditText
android:id="@+id/et"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:layout_marginStart="20dp"
android:background="@drawable/cursor_bg_shape"
android:gravity="center_vertical"
android:hint="请输入地址"
android:textColor="@color/color_8F6D21"
android:textCursorDrawable="@drawable/cursor_color"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@id/view_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_bg" />
<com.fry.base.ui.widget.CommonTitleBar
android:id="@+id/ctb_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ctb_theme="dark"
app:layout_constraintTop_toTopOf="parent" />
<com.fry.base.ui.widget.CustomRecycleView
android:background="@color/white"
android:id="@+id/recy_after_search"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/et"
app:itemBinding="@{viewModel.searchAfterItemBinding}"
app:items="@{viewModel.searchAfterOneItems}"
android:visibility="@{viewModel.searchAfterOneItems.size() == 0 ? view.GONE:view.VISIBLE}"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<data>
<variable
name="viewModel"
type="com.mints.street.main.home.SearchMapViewModel" />
<variable
name="view"
type="android.view.View" />
</data>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="adpter"
type="com.mints.street.adapter.HistoryRecordAdapter" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<ImageView
android:padding="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_search_history"
/>
<TextView
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="历史记录"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="14sp"
/>
<TextView
android:padding="10dp"
android:drawableStart="@mipmap/icon_search_history"
android:drawablePadding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="清空"
android:textColor="@color/color_555"
android:textSize="12sp"
/>
</LinearLayout>
<com.fry.base.ui.widget.CustomRecycleView
android:id="@+id/list_view"
app:dividerColor="#00000000"
app:dividerHeight="10dp"
app:dividerMarginEnd="10dp"
app:layoutManagerType="flow"
app:useDivider="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="vhm"
type="com.mints.street.adapter.HistoryRecordItemVHM" />
</data>
<com.coorchice.library.SuperTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:textSize="14sp"
android:gravity="center"
android:text="@{vhm.name}"
android:textColor="@color/color_555"
app:stv_stroke_color="@color/color_555"
app:stv_stroke_width="1dp"
app:stv_corner="10dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
/>
</layout>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:layout_height="120dp" android:layout_height="120dp"
android:background="@mipmap/abc_popup_background_mtrl_mult" android:background="@mipmap/abc_popup_background_mtrl_mult"
android:padding="15dp" android:padding="15dp"
app:onClickCommand="@{viewModel.onItemClick}"
> >
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="140dp"
android:background="@mipmap/vip_google_bg"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:padding="10dp"
>
<TextView
android:id="@+id/tv_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="测试"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold"
/>
<ImageView
android:id="@+id/image1"
android:layout_width="0dp"
android:layout_height="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/image2"
android:src="@mipmap/bg_fl"
/>
<ImageView
android:layout_marginStart="10dp"
android:id="@+id/image2"
android:layout_width="0dp"
android:layout_height="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image1"
app:layout_constraintEnd_toStartOf="@id/image3"
android:src="@mipmap/bg_fl"
/>
<ImageView
android:layout_marginStart="10dp"
android:id="@+id/image3"
android:layout_width="0dp"
android:layout_height="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/image2"
app:layout_constraintEnd_toEndOf="parent"
android:src="@mipmap/bg_fl"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="10dp">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@mipmap/map_history_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@{viewModel.name}"
android:textColor="@color/color_555"
android:textSize="14sp"
android:maxLines="1"
android:singleLine="true"
app:layout_constraintBottom_toTopOf="@id/tv_address"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_address"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.address}"
android:textColor="@color/color_555"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image"
app:layout_constraintTop_toBottomOf="@id/tv_name" />
<View
android:layout_width="0dp"
android:layout_height="0.5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image"
android:background="@color/color_555"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<data>
<variable
name="viewModel"
type="com.mints.street.main.home.SearchAfterItem" />
</data>
</layout>
\ No newline at end of file
...@@ -21,6 +21,7 @@ public final class SPUtils { ...@@ -21,6 +21,7 @@ public final class SPUtils {
private static Map<String, SPUtils> sSPMap = new HashMap<>(); private static Map<String, SPUtils> sSPMap = new HashMap<>();
private static final String DEFAULT_KEY = "spUtils"; private static final String DEFAULT_KEY = "spUtils";
public static final String POSITIONING_MAP = "positioningMap";
private MMKV mv; private MMKV mv;
public static void init(Application application){ public static void init(Application application){
......
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