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

优化vr和推荐套餐显示方式

parent a7165474
......@@ -24,43 +24,47 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
holder: BindingViewHolder<ItemGridMapAdapterBinding>,
position: Int
) {
// var a = holder.binding.bg.layoutParams
// if (position % 2 == 0) {
// holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
// AppUtils.dp2Px(context, 10F), 0, null, null, null)
// } else {
// holder.binding.bg.setMargin(0, AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
// 0, null, null, null)
// }
//
// datalist?.let {
// var databean = it[position]
// //设置图片
// Glide.with(mContext).load(databean.img).into(holder.binding.image)
// //设置标题
// holder.binding.tvName.text = databean.name
//// //设置星星数量
//// var i = 0
//// while (i < 5) {
//// holder.binding.lyStar.addView(View.inflate(context, R.layout.include_start_show, null))
//// i += 1
//// }
// //设置点击跳转
// holder.itemView.setOnClickListener {
// //页面跳转
// MintsWebViewActivity.startWebView(databean.name, url = databean.url)
var a = holder.binding.bg.layoutParams
if (position % 2 == 0) {
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
AppUtils.dp2Px(context, 10F), 0, null, null, null)
} else {
holder.binding.bg.setMargin(0, AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
0, null, null, null)
}
datalist?.let {
var databean = it[position]
//设置图片
Glide.with(mContext).load(databean.img).into(holder.binding.image)
//设置标题
holder.binding.tvName.text = databean.name
// //设置星星数量
// var i = 0
// while (i < 5) {
// holder.binding.lyStar.addView(View.inflate(context, R.layout.include_start_show, null))
// i += 1
// }
//设置点击跳转
holder.itemView.setOnClickListener {
//页面跳转
MintsWebViewActivity.startWebView(databean.name, url = databean.url)
}
}
// RxUtils.onMultiClick(holder.binding.bg) {
// PanoramicActivity.starPanoramicActivity(context, ""
// , PanoramicActivity.WGS84, lat = 39.906283536127169, lon = 116.39129554889048)
// }
//// RxUtils.onMultiClick(holder.binding.bg) {
//// PanoramicActivity.starPanoramicActivity(context, ""
//// , PanoramicActivity.WGS84, lat = 39.906283536127169, lon = 116.39129554889048)
//// }
}
override fun getItemCount() = list!!.size
override fun onCreateLayoutHelper() = GridLayoutHelper(2)
override fun onCreateLayoutHelper(): LayoutHelper {
val hp : GridLayoutHelper= GridLayoutHelper(2)
hp.setAutoExpand(false)
return hp
}
override fun getLayoutId(viewType: Int) = R.layout.item_grid_map_adapter
......
......@@ -2,6 +2,7 @@ package com.mints.street.adapter
import android.content.Context
import android.graphics.Paint
import com.alibaba.android.vlayout.LayoutHelper
import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.fry.base.adapter.AbstractVLayoutBaseAdapter
......@@ -65,11 +66,15 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
}
}
override fun onCreateLayoutHelper() = GridLayoutHelper(3)
override fun getLayoutId(viewType: Int) = R.layout.item_grid_payment_adpater
fun getPosition()=mposition
fun getPosition() = mposition
override fun onCreateLayoutHelper(): LayoutHelper {
val hp : GridLayoutHelper= GridLayoutHelper(3)
hp.setAutoExpand(false)
return hp
}
}
......@@ -13,7 +13,7 @@
<LinearLayout
android:layout_margin="15dp"
android:id="@+id/bg"
android:layout_width="100dp"
android:layout_width="wrap_content"
android:layout_height="230dp"
android:background="@drawable/shape_bg_vrdata"
android:elevation="5dp"
......
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