Commit c520d1f0 authored by fengruiyu's avatar fengruiyu

Merge branch 'dev_1.0.0' of http://39.97.65.143:81/android/android_street into fry_dev

parents 13c048f7 8480e59e
package com.mints.street.adapter
import android.content.Context
import android.content.Intent
import android.content.pm.ActivityInfo
import android.os.UserManager
import android.view.Window
import android.view.WindowManager
import androidx.recyclerview.widget.RecyclerView
......@@ -14,13 +16,17 @@ import com.fry.base.binding.setMargin
import com.fry.base.utils.ImageLoader
import com.mints.street.R
import com.mints.street.bean.DetailedBean
import com.mints.street.bean.UserBean
import com.mints.street.databinding.ItemGridVrmapAdapterBinding
import com.mints.street.main.my.OpenvipActivity
import com.mints.street.main.vr.DetailedActivity
import com.mints.street.main.vr.DetailedViewModel
import me.goldze.mvvmhabit.utils.AppUtils
import me.goldze.mvvmhabit.utils.RxUtils
class GridVrMapAdapter(val context: Context, var list: List<DetailedBean.DetailedItemBean>?,val viewModel: DetailedViewModel) :
class GridVrMapAdapter(val context: Context, var list: List<DetailedBean.DetailedItemBean>?, val viewModel: DetailedViewModel) :
AbstractVLayoutBaseAdapter<ItemGridVrmapAdapterBinding, List<DetailedBean.DetailedItemBean>>(context, list, 2) {
private val userManager by lazy { com.mints.street.manager.UserManager.INSTANCE }
override fun onBindViewHolder(
holder: BindingViewHolder<ItemGridVrmapAdapterBinding>,
position: Int
......@@ -41,13 +47,16 @@ class GridVrMapAdapter(val context: Context, var list: List<DetailedBean.Detaile
ImageLoader.ImageBuilder.with(context)
.setUrl(it[position].img).setTargetView(holder.binding.image).start()
}
RxUtils.onMultiClick(holder.binding.bg){
viewModel.authorized(list?.get(position)?.name,list?.get(position)?.lat,list?.get(position)?.lng)
RxUtils.onMultiClick(holder.binding.bg) {
if (userManager.getVipFlag()) {//是会员
viewModel.authorized(list?.get(position)?.name, list?.get(position)?.lat, list?.get(position)?.lng)
}else{
context.startActivity(Intent(context, OpenvipActivity::class.java))
}
}
}
override fun getItemCount() = list?.size?:0
override fun getItemCount() = list?.size ?: 0
override fun onCreateLayoutHelper(): LayoutHelper {
val hp: GridLayoutHelper = GridLayoutHelper(2)
......
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