| | |
| | | import com.sinata.xqmuse.network.entity.CommonItemBean |
| | | import com.sinata.xqmuse.network.entity.HomeListBean |
| | | import com.sinata.xqmuse.network.entity.Menu |
| | | import com.sinata.xqmuse.ui.home.TypeVoiceActivity |
| | | import com.youth.banner.Banner |
| | | import org.jetbrains.anko.startActivity |
| | | import java.util.ArrayList |
| | | |
| | | class HomeAdapter(list: ArrayList<HomeListBean>) :HFRecyclerAdapter<HomeListBean>(list, R.layout.item_home_list){ |
| | |
| | | } |
| | | iv_3.setOnClickListener { |
| | | context.myToast("点击菜单3") |
| | | |
| | | } |
| | | }else{ |
| | | cl_menu.gone() |
| | | cl_banner.visible() |
| | | holder.setText(R.id.tv_title,data.clientMeditationCategoryVO.categoryName) |
| | | holder.setText(R.id.tv_subtitle,data.clientMeditationCategoryVO.description) |
| | | |
| | | val banner_landscape = holder.bind<View>(R.id.banner_landscape) |
| | | val banner_card = holder.bind<View>(R.id.banner_card) |
| | | |
| | | holder.bind<View>(R.id.iv_more).setOnClickListener { |
| | | context.startActivity<TypeVoiceActivity>("title" to data.clientMeditationCategoryVO.categoryName,"id" to data.clientMeditationCategoryVO.id) |
| | | } |
| | | val banner_landscape = holder.bind<Banner<CommonItemBean,LandscapeBannerAdapter>>(R.id.banner_landscape) |
| | | val banner_card = holder.bind<Banner<CommonItemBean,CardBannerAdapter>>(R.id.banner_card) |
| | | if (data.clientMeditationCategoryVO.showType == 1){ //横版 |
| | | banner_landscape.visible() |
| | | banner_card.gone() |
| | | val landscapeBannerAdapter = LandscapeBannerAdapter(data.clientMeditationVOList,context) |
| | | banner_landscape.adapter = landscapeBannerAdapter |
| | | }else{ //竖版布局 |
| | | banner_landscape.gone() |
| | | banner_card.visible() |
| | | val cardBannerAdapter = CardBannerAdapter(data.clientMeditationVOList,context) |
| | | banner_card.adapter = cardBannerAdapter |
| | | banner_card.setBannerGalleryEffect(100,20,0.9f) |
| | | } |
| | | } |
| | | } |