Commit 8480e59e authored by 张释方's avatar 张释方

添加精选体验跳转开通vip页

parent f488b893
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