Commit 49584319 authored by 张释方's avatar 张释方

优化热门景点弹窗

parent 71ab39c9
...@@ -10,7 +10,6 @@ import com.mints.street.R ...@@ -10,7 +10,6 @@ import com.mints.street.R
import com.mints.street.bean.VreperienceBean import com.mints.street.bean.VreperienceBean
import com.mints.street.databinding.ItemEnterDestinationAdapterBinding import com.mints.street.databinding.ItemEnterDestinationAdapterBinding
import com.mints.street.main.vr.DetailedActivity import com.mints.street.main.vr.DetailedActivity
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
......
...@@ -2,6 +2,8 @@ package com.mints.street.adapter ...@@ -2,6 +2,8 @@ package com.mints.street.adapter
import android.content.Context import android.content.Context
import com.alibaba.android.vlayout.layout.LinearLayoutHelper import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.baidu.mapapi.model.LatLng
import com.baidu.mapapi.utils.DistanceUtil.getDistance
import com.blankj.utilcode.util.ActivityUtils.startActivity import com.blankj.utilcode.util.ActivityUtils.startActivity
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.fry.base.adapter.AbstractVLayoutBaseAdapter import com.fry.base.adapter.AbstractVLayoutBaseAdapter
...@@ -9,14 +11,15 @@ import com.fry.base.adapter.BindingViewHolder ...@@ -9,14 +11,15 @@ import com.fry.base.adapter.BindingViewHolder
import com.mints.street.R import com.mints.street.R
import com.mints.street.bean.HotViewBean import com.mints.street.bean.HotViewBean
import com.mints.street.databinding.ItemHotViewAdapterBinding import com.mints.street.databinding.ItemHotViewAdapterBinding
import com.mints.street.main.home.HomeViewModel
import com.mints.street.main.my.OpenvipActivity import com.mints.street.main.my.OpenvipActivity
import com.mints.street.manager.UserManager import com.mints.street.manager.UserManager
import com.mints.street.webview.MintsWebViewActivity
import me.goldze.mvvmhabit.utils.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
import java.text.DecimalFormat
class ItemHotViewAdapter(val context: Context, var list: List<HotViewBean.dataslist>?) : class ItemHotViewAdapter(val context: Context, var list: List<HotViewBean.dataslist>?, val viewModel: HomeViewModel, val mCurrentLat: Double, val mCurrentLon: Double) :
AbstractVLayoutBaseAdapter<ItemHotViewAdapterBinding, List<HotViewBean.dataslist>?>( AbstractVLayoutBaseAdapter<ItemHotViewAdapterBinding, List<HotViewBean.dataslist>?>(
context,list,1 context, list, 1
) { ) {
override fun onBindViewHolder(holder: BindingViewHolder<ItemHotViewAdapterBinding>, position: Int) { override fun onBindViewHolder(holder: BindingViewHolder<ItemHotViewAdapterBinding>, position: Int) {
...@@ -27,26 +30,28 @@ class ItemHotViewAdapter(val context: Context, var list: List<HotViewBean.datasl ...@@ -27,26 +30,28 @@ class ItemHotViewAdapter(val context: Context, var list: List<HotViewBean.datasl
//设置图片 //设置图片
Glide.with(mContext).load(img).into(holder.binding.image1) Glide.with(mContext).load(img).into(holder.binding.image1)
//设置名称 //设置名称
holder.binding.viewname.text=name holder.binding.viewname.text = name
//设置距离 //设置距离
// holder.binding.tvDistance.text= distance.toString() var distance:Double=getDistance(LatLng(lat!!.toDouble(), lng!!.toDouble()),LatLng(mCurrentLat, mCurrentLon))
holder.binding.tvDistance.text = "距离${DecimalFormat("0.00").format(distance/1000).toString()}km"
//设置景点简介 //设置景点简介
holder.binding.tvDescribe.text=desc holder.binding.tvDescribe.text = desc
//设置点击事件 //设置点击事件
RxUtils.onMultiClick(holder.itemView){ RxUtils.onMultiClick(holder.itemView) {
//判断是否当前是否是会员, //判断是否当前是否是会员,
if (!UserManager.INSTANCE.userIsLogin()){ if (!UserManager.INSTANCE.userIsLogin()) {
//否-跳转到开通vip界面 //否-跳转到开通vip界面
startActivity(OpenvipActivity::class.java) startActivity(OpenvipActivity::class.java)
}else{ } else {
//是-继续浏览, viewModel.authorized(list?.get(position)?.name, list?.get(position)?.lat?.toDouble(), list?.get(position)?.lng?.toDouble())
} }
} }
} }
} }
override fun getItemCount() = list?.size?: 0
override fun getItemCount() = list?.size ?: 0
override fun onCreateLayoutHelper() = LinearLayoutHelper() override fun onCreateLayoutHelper() = LinearLayoutHelper()
override fun getLayoutId(viewType: Int) = R.layout.item_hot_view_adapter override fun getLayoutId(viewType: Int) = R.layout.item_hot_view_adapter
......
...@@ -11,5 +11,6 @@ class HotViewBean : Serializable { ...@@ -11,5 +11,6 @@ class HotViewBean : Serializable {
val lat: String? = null val lat: String? = null
val lng: String? = null val lng: String? = null
val name: String? = null val name: String? = null
val distance: Double? = null
} }
} }
...@@ -51,7 +51,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -51,7 +51,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
R.id.menu_home -> { R.id.menu_home -> {
if (UserManager.INSTANCE.userIsLogin() && UserManager.INSTANCE.getVipFlag()) { if (UserManager.INSTANCE.userIsLogin() && UserManager.INSTANCE.getVipFlag()) {
binding.mainViewpager.setCurrentItem(3, false) binding.mainViewpager.setCurrentItem(3, false)
} else { } else {
binding.mainViewpager.setCurrentItem(0, false) binding.mainViewpager.setCurrentItem(0, false)
} }
......
...@@ -42,8 +42,9 @@ import me.goldze.mvvmhabit.utils.SPUtils ...@@ -42,8 +42,9 @@ import me.goldze.mvvmhabit.utils.SPUtils
* 首页页面 * 首页页面
*/ */
class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener { class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener {
private val hotViewDialog by lazy { HotViewDialog(requireActivity(),viewModel,this).init() }
private val viewrecommedDialog by lazy { ViewRecommedDialog(requireActivity(),viewModel,this).init() } 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"
} }
...@@ -94,9 +95,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -94,9 +95,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
override fun initContentView( override fun initContentView(
inflater: LayoutInflater?, inflater: LayoutInflater?,
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
) = R.layout.fragment_home ) = R.layout.fragment_home
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
...@@ -116,6 +117,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -116,6 +117,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
override fun initData() { override fun initData() {
super.initData() super.initData()
geoCoder() geoCoder()
Handler().postDelayed({ isScrollLayoutClose = true }, 2000) Handler().postDelayed({ isScrollLayoutClose = true }, 2000)
RxUtils.onMultiClick(binding.stbBgSearch) { RxUtils.onMultiClick(binding.stbBgSearch) {
...@@ -123,9 +126,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -123,9 +126,9 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
} }
RxUtils.onMultiClick(binding.ivClick) { RxUtils.onMultiClick(binding.ivClick) {
viewModel.authorized( viewModel.authorized(
"", "",
currentLat.toString(), currentLon.toString(), currentLat.toString(), currentLon.toString(),
false false
) )
} }
RxUtils.onMultiClick(binding.imageMapChangeIcon) { RxUtils.onMultiClick(binding.imageMapChangeIcon) {
...@@ -140,9 +143,10 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -140,9 +143,10 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
} }
//点击热门景点 //点击热门景点
RxUtils.onMultiClick(binding.lyHotview) { RxUtils.onMultiClick(binding.lyHotview, {
hotViewDialog.show() val hotViewDialog:HotViewDialog?=HotViewDialog(requireActivity(), viewModel, currentLat,currentLon,this)
} hotViewDialog?.init()?.show()
})
viewModel.getMapBean() viewModel.getMapBean()
} }
...@@ -205,6 +209,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -205,6 +209,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
KLog.a("百度map", "移动结束") KLog.a("百度map", "移动结束")
currentLat = status?.target?.latitude ?: 0.0 currentLat = status?.target?.latitude ?: 0.0
currentLon = status?.target?.longitude ?: 0.0 currentLon = status?.target?.longitude ?: 0.0
KLog.e("zsf__", "=======移动结束=======${currentLat}================${currentLon}====================")
currentMapZoom = status?.zoom ?: 0f currentMapZoom = status?.zoom ?: 0f
// 发起反地理编码请求 // 发起反地理编码请求
mSearch.reverseGeoCode(ReverseGeoCodeOption().location(status?.target)) mSearch.reverseGeoCode(ReverseGeoCodeOption().location(status?.target))
...@@ -245,13 +251,13 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -245,13 +251,13 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
private fun initLocation() { private fun initLocation() {
// 获取传感器管理服务 // 获取传感器管理服务
mSensorManager = AppManager.getAppManager().currentActivity mSensorManager = AppManager.getAppManager().currentActivity
.getSystemService(SENSOR_SERVICE) as SensorManager .getSystemService(SENSOR_SERVICE) as SensorManager
mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL
// 为系统的方向传感器注册监听器 // 为系统的方向传感器注册监听器
mSensorManager?.registerListener( mSensorManager?.registerListener(
this, this,
mSensorManager?.getDefaultSensor(Sensor.TYPE_ORIENTATION), mSensorManager?.getDefaultSensor(Sensor.TYPE_ORIENTATION),
SensorManager.SENSOR_DELAY_UI SensorManager.SENSOR_DELAY_UI
) )
// 开启定位图层 // 开启定位图层
...@@ -298,7 +304,7 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -298,7 +304,7 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
val builder = MapStatus.Builder() val builder = MapStatus.Builder()
builder.target(center).zoom(zoom) builder.target(center).zoom(zoom)
val mapStatusUpdate = val mapStatusUpdate =
MapStatusUpdateFactory.newMapStatus(builder.build()) MapStatusUpdateFactory.newMapStatus(builder.build())
showupgradevipDialog(requireContext()) showupgradevipDialog(requireContext())
// 设置地图状态 // 设置地图状态
mBaiduMap?.animateMapStatus(mapStatusUpdate, 200) mBaiduMap?.animateMapStatus(mapStatusUpdate, 200)
...@@ -352,9 +358,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -352,9 +358,8 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
/** /**
* 更新手势状态 * 更新手势状态
*/ */
fun updateGesture(isMove: Boolean) { fun updateGesture(isMove: Boolean) {
if (isMove) { if (isMove) {
mUiSettings?.isZoomGesturesEnabled = false mUiSettings?.isZoomGesturesEnabled = false
} else { } else {
...@@ -401,11 +406,11 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -401,11 +406,11 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
mCurrentLon = location?.longitude ?: 0.0 mCurrentLon = location?.longitude ?: 0.0
mCurrentAccracy = location?.radius ?: 0f mCurrentAccracy = location?.radius ?: 0f
myLocationData = MyLocationData.Builder() myLocationData = MyLocationData.Builder()
.accuracy(location?.radius ?: 0f) // 设置定位数据的精度信息,单位:米 .accuracy(location?.radius ?: 0f) // 设置定位数据的精度信息,单位:米
.direction(mCurrentDirection.toFloat()) // 此处设置开发者获取到的方向信息,顺时针0-360 .direction(mCurrentDirection.toFloat()) // 此处设置开发者获取到的方向信息,顺时针0-360
.latitude(location?.latitude ?: 0.0) .latitude(location?.latitude ?: 0.0)
.longitude(location?.longitude ?: 0.0) .longitude(location?.longitude ?: 0.0)
.build() .build()
this.setMyLocationData(myLocationData) this.setMyLocationData(myLocationData)
if (isFirstLoc) { if (isFirstLoc) {
isFirstLoc = false isFirstLoc = false
...@@ -421,15 +426,15 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso ...@@ -421,15 +426,15 @@ class HomeFragment() : BaseFragment<FragmentHomeBinding, HomeViewModel>(), Senso
override fun onSensorChanged(sensorEvent: SensorEvent?) { override fun onSensorChanged(sensorEvent: SensorEvent?) {
val x: Double = 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) { if (kotlin.math.abs(x - lastX) > 1.0) {
mCurrentDirection = x.toInt() mCurrentDirection = x.toInt()
myLocationData = MyLocationData.Builder() myLocationData = MyLocationData.Builder()
.accuracy(mCurrentAccracy) // 设置定位数据的精度信息,单位:米 .accuracy(mCurrentAccracy) // 设置定位数据的精度信息,单位:米
.direction(mCurrentDirection.toFloat()) // 此处设置开发者获取到的方向信息,顺时针0-360 .direction(mCurrentDirection.toFloat()) // 此处设置开发者获取到的方向信息,顺时针0-360
.latitude(mCurrentLat) .latitude(mCurrentLat)
.longitude(mCurrentLon) .longitude(mCurrentLon)
.build() .build()
mBaiduMap?.setMyLocationData(myLocationData) mBaiduMap?.setMyLocationData(myLocationData)
} }
lastX = x lastX = x
......
...@@ -234,4 +234,26 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -234,4 +234,26 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
} }
) )
} }
fun authorized(name:String?,lat:Double?=0.0 ,lng:Double?=0.0) {
ApiModel.authorized().safeSubscribe(object
: HttpSubscribeImpl<BaseResponse<AuthorizedBean>>(
this@HomeViewModel,false
) {
override fun onBusinessSuccess(response: BaseResponse<AuthorizedBean>) {
MintsWebViewActivity.startWebView(
name,
MintsWebViewActivity.toGoogleVR(
response.result.u,
response.result.gk,
response.result.base,
lat.toString(),
lng.toString(),
response.result.ut
)
)
}
})
}
} }
\ No newline at end of file
package com.mints.street.utils;
public class GetJuLiUtils {
private static final double EARTH_RADIUS = 6378137.0;
public static double getDistance(double longitude,double latitue,double longitude2,double latitue2){
double lat1 = rad(latitue);
double lat2 = rad(latitue2);
double a = lat1 - lat2;
double b = rad(longitude)-rad(longitude2);
double s = 2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(lat1)*Math.cos(lat2)*Math.pow(Math.sin(b/2),2)));
s=s*EARTH_RADIUS;
s=Math.round(s*10000)/10000;
return s;
}
private static double rad(double d){
return d*Math.PI/180.0;
}
}
...@@ -16,58 +16,60 @@ import com.mints.street.main.home.HomeFragment ...@@ -16,58 +16,60 @@ 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.widget.GridItemDecoration import com.mints.street.widget.GridItemDecoration
class HotViewDialog(context: FragmentActivity, viewModel: HomeViewModel, homeFragment: HomeFragment) { class HotViewDialog(context: FragmentActivity, viewModel: HomeViewModel, mCurrentLat:Double, mCurrentLon:Double,homeFragment: HomeFragment) {
private var mBottomSheetDialog:BottomSheetDialog?=null private var mBottomSheetDialog: BottomSheetDialog? = null
private var context:FragmentActivity private var context: FragmentActivity
private var viewModel:HomeViewModel?=null private var viewModel: HomeViewModel? = null
private var homeFragment:HomeFragment?=null private var homeFragment: HomeFragment? = null
private var mCurrentLat: Double? = null
private var mCurrentLon: Double? = null
private var vLayout: VirtualLayoutManager? = null private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null private var mAdapter: DelegateAdapter? = null
private var itemHotViewAdapter: ItemHotViewAdapter?=null private var itemHotViewAdapter: ItemHotViewAdapter? = null
// private var itemHotViewAdapter: ItemEnterDestinationAdapter?=null
// private var itemHotViewAdapter: ItemEnterDestinationAdapter?=null
init { init {
this.context=context this.context = context
this.viewModel=viewModel this.viewModel = viewModel
this.homeFragment=homeFragment this.homeFragment = homeFragment
this.mCurrentLat=mCurrentLat
this.mCurrentLon=mCurrentLon
} }
// //
fun init():HotViewDialog{ fun init(): HotViewDialog {
//创建弹窗 //创建弹窗
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_hotview,null) val view1: View = LayoutInflater.from(context).inflate(R.layout.layout_hotview, 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 iv_close: ImageView = view1.findViewById(R.id.iv_close)
val recycler_view:RecyclerView=view1.findViewById(R.id.recycler_view) val recycler_view: RecyclerView = view1.findViewById(R.id.recycler_view)
//添加下划线 //添加下划线
view1.findViewById<RecyclerView>(R.id.recycler_view) view1.findViewById<RecyclerView>(R.id.recycler_view)
.addItemDecoration(GridItemDecoration(context, DividerItemDecoration.VERTICAL)) .addItemDecoration(GridItemDecoration(context, DividerItemDecoration.VERTICAL))
vLayout = VirtualLayoutManager(context!!); vLayout = VirtualLayoutManager(context!!);
mAdapter = DelegateAdapter(vLayout,false) mAdapter = DelegateAdapter(vLayout, false)
recycler_view.layoutManager = vLayout recycler_view.layoutManager = vLayout
recycler_view.adapter = mAdapter recycler_view.adapter = mAdapter
// if (itemHotViewAdapter == null){
// itemHotViewAdapter = ItemHotViewAdapter(context!!, listOf("1","3","1","3","1","3","1","3"))
// mAdapter?.addAdapter(itemHotViewAdapter)
// }
// itemHotViewAdapter!!.list=listOf("1","3","1","3","1","3","1","3")
viewModel?.getHotView() viewModel?.getHotView()
viewModel?.hotviewData?.observe(homeFragment!!, androidx.lifecycle.Observer { viewModel?.hotviewData?.observe(homeFragment!!, androidx.lifecycle.Observer {
if (itemHotViewAdapter == null){ if (itemHotViewAdapter == null) {
itemHotViewAdapter = ItemHotViewAdapter(context!!, it.list) itemHotViewAdapter = ItemHotViewAdapter(context!!, it.list, viewModel!!,mCurrentLat!!,mCurrentLon!!)
mAdapter?.addAdapter(itemHotViewAdapter) mAdapter?.addAdapter(itemHotViewAdapter)
} }
mAdapter?.notifyDataSetChanged() mAdapter?.notifyDataSetChanged()
}) })
iv_close.setOnClickListener{ iv_close.setOnClickListener {
mBottomSheetDialog!!.dismiss() mBottomSheetDialog!!.dismiss()
} }
return this return this
} }
......
...@@ -53,10 +53,11 @@ ...@@ -53,10 +53,11 @@
android:id="@+id/ly_hotview" android:id="@+id/ly_hotview"
android:layout_width="35dp" android:layout_width="35dp"
android:layout_height="35dp" android:layout_height="35dp"
android:padding="3dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:src="@mipmap/icon_hotview" android:src="@mipmap/icon_hotview"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_map_history" /> app:layout_constraintTop_toBottomOf="@id/image_map_change_icon" />
<ImageView <ImageView
android:id="@+id/image_location_icon" android:id="@+id/image_location_icon"
......
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:ellipsize="end"
android:maxEms="5"
android:maxLines="1"
android:text="景点名称" android:text="景点名称"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="18dp" android:textSize="18dp"
...@@ -54,10 +57,9 @@ ...@@ -54,10 +57,9 @@
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="14dp" android:layout_height="14dp"
android:background="@color/black" android:background="@color/black"
app:layout_constraintBottom_toBottomOf="@+id/tv_distance" app:layout_constraintBottom_toBottomOf="@+id/viewname"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/viewname" app:layout_constraintStart_toEndOf="@+id/viewname"
app:layout_constraintTop_toTopOf="@+id/tv_distance" app:layout_constraintTop_toTopOf="@+id/viewname"
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<TextView <TextView
...@@ -65,37 +67,46 @@ ...@@ -65,37 +67,46 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="2dp" android:layout_marginLeft="2dp"
android:text="距离" android:text="距离1897.8km"
android:textColor="#99000000" android:textColor="#99000000"
android:textSize="14dp" android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="@+id/viewname"
app:layout_constraintStart_toEndOf="@+id/view" app:layout_constraintStart_toEndOf="@+id/view"
app:layout_constraintTop_toTopOf="@+id/viewname" app:layout_constraintTop_toTopOf="@+id/viewname"
tools:text="距离" /> tools:text="距离" />
<TextView <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/tv_describe"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginTop="5dp"
android:text="景点介绍。。。" android:orientation="vertical"
android:textColor="#99000000" app:layout_constraintBottom_toBottomOf="@+id/image1"
app:layout_constraintStart_toEndOf="@+id/image1" app:layout_constraintStart_toStartOf="@+id/viewname"
app:layout_constraintTop_toBottomOf="@+id/viewname" app:layout_constraintTop_toBottomOf="@+id/viewname"
tools:text="景点介绍。。。" /> tools:ignore="MissingConstraints">
<TextView <TextView
android:id="@+id/textView5" android:id="@+id/tv_describe"
android:layout_width="70dp" android:layout_width="200dp"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/shape_btn_friends_unenabled" android:layout_marginBottom="5dp"
android:gravity="center" android:text="景点介绍。。。"
android:text="看街景" android:textColor="#99000000"
android:textColor="@color/black" android:textSize="12sp" />
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/image1" <TextView
app:layout_constraintStart_toEndOf="@+id/image1" android:id="@+id/textView5"
tools:text="看街景" /> android:layout_width="100dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:background="@drawable/shape_btn_friends_unenabled"
android:gravity="center"
android:text="看街景"
android:textColor="@color/black"
android:textSize="12sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
android:id="@+id/iv_close" android:id="@+id/iv_close"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginTop="8dp" android:layout_marginTop="10dp"
android:layout_marginRight="8dp" android:layout_marginRight="10dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:src="@mipmap/icon_hot_view_close" android:src="@mipmap/icon_hot_view_close"
android:layout_gravity="end"/> android:layout_gravity="end"/>
......
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