feat:完成首页替换
@@ -1,17 +1,11 @@
|
||||
package com.pikolive.app.home.adapter
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.core.view.isGone
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.opensource.svgaplayer.SVGAImageView
|
||||
import com.pikolive.app.R
|
||||
import com.pikolive.app.ui.utils.ImageLoadUtilsV2
|
||||
import com.pikolive.app.ui.utils.load
|
||||
import com.pikolive.app.ui.utils.loadFromAssets
|
||||
import com.pikolive.core.utils.TextUtils
|
||||
import com.pikolive.core2.home.bean.HomeRoomInfo
|
||||
|
||||
/**
|
||||
@@ -26,19 +20,6 @@ class HomeHotAdapter :
|
||||
setText(R.id.tv_online_number, "${item.onlineNum}")
|
||||
setText(R.id.tv_room_title, item.title)
|
||||
}
|
||||
helper.setGone(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
|
||||
|
||||
val icTopList = helper.getView<AppCompatImageView>(R.id.iv_top_list)
|
||||
if(item.isHourTop1 == 1){
|
||||
icTopList.visibility = View.VISIBLE
|
||||
icTopList.setImageResource(R.drawable.bg_recommend_hour_list)
|
||||
} else if(item.isWeekTop1 == 1){
|
||||
icTopList.visibility = View.VISIBLE
|
||||
icTopList.setImageResource(R.drawable.bg_recommend_weekly_list)
|
||||
} else {
|
||||
icTopList.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
val avatars: Array<ImageView> = arrayOf(
|
||||
helper.getView(R.id.iv_avatar_0),
|
||||
@@ -52,23 +33,5 @@ class HomeHotAdapter :
|
||||
avatars[i].isGone = avatarUrl.isNullOrBlank()
|
||||
avatars[i].load(avatarUrl)
|
||||
}
|
||||
|
||||
val svgaPk = helper.getView<SVGAImageView>(R.id.svga_pk)
|
||||
if (item.isCrossPking) {
|
||||
svgaPk.visibility = View.VISIBLE
|
||||
svgaPk.loadFromAssets("svga/svga_home_pk.svga")
|
||||
} else {
|
||||
svgaPk.visibility = View.GONE
|
||||
}
|
||||
|
||||
val svgaLiving = helper.getView<SVGAImageView>(R.id.svga_living)
|
||||
svgaLiving.loadFromAssets("svga/home_white_living.svga")
|
||||
}
|
||||
|
||||
override fun onViewAttachedToWindow(holder: BaseViewHolder) {
|
||||
super.onViewAttachedToWindow(holder)
|
||||
val svgaLiving = holder.getView<SVGAImageView>(R.id.svga_living)
|
||||
svgaLiving?.loadFromAssets("svga/home_white_living.svga")
|
||||
}
|
||||
|
||||
}
|
@@ -1,36 +1,27 @@
|
||||
package com.pikolive.app.home.fragment
|
||||
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.pikolive.app.R
|
||||
import com.pikolive.app.application.IReportConstants
|
||||
import com.pikolive.app.application.ReportManager
|
||||
import com.pikolive.app.base.BaseViewBindingFragment
|
||||
import com.pikolive.app.home.HomeViewModel
|
||||
import com.pikolive.app.databinding.FragmentHomeBinding
|
||||
import com.pikolive.app.home.HomeViewModel
|
||||
import com.pikolive.app.home.adapter.HomeBannerAdapter
|
||||
import com.pikolive.app.home.dialog.RecommendRoomDialog
|
||||
import com.pikolive.app.home.helper.OpenRoomHelper
|
||||
import com.pikolive.app.ui.im.avtivity.NimP2PMessageActivity
|
||||
import com.pikolive.app.ui.search.SearchActivity
|
||||
import com.pikolive.app.ui.user.adapter.MainIndicatorAdapter
|
||||
import com.pikolive.app.ui.utils.load
|
||||
import com.pikolive.app.ui.webview.CommonWebViewActivity
|
||||
import com.pikolive.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
import com.pikolive.app.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.pikolive.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.pikolive.app.utils.CommonJumpHelper
|
||||
import com.pikolive.core.DemoCache
|
||||
import com.pikolive.core2.UriProvider
|
||||
import com.pikolive.core2.home.bean.BannerInfo
|
||||
import com.pikolive.core2.home.bean.HomeTagInfo
|
||||
import com.pikolive.library.utils.ListUtils
|
||||
import com.pikolive.library.utils.ResUtil
|
||||
import com.zhpan.bannerview.BannerViewPager
|
||||
|
||||
/**
|
||||
@@ -39,16 +30,10 @@ import com.zhpan.bannerview.BannerViewPager
|
||||
class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClickListener,
|
||||
MainIndicatorAdapter.OnItemSelectListener {
|
||||
|
||||
private val mFragments = mutableListOf<Class<out Fragment>>()
|
||||
private val mTabInfoList = mutableListOf<HomeTagInfo>()
|
||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||
|
||||
private var mBanner: BannerViewPager<BannerInfo>? = null
|
||||
|
||||
companion object {
|
||||
private const val TAG = "HomeFragment"
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
mBanner = view?.findViewById(R.id.banner)
|
||||
initTitleTab()
|
||||
@@ -70,7 +55,10 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
ReportManager.get().reportEvent(
|
||||
IReportConstants.MODULE_HOMEPAGE_CLICK, mapOf(
|
||||
Pair(IReportConstants.HOMEPAGE_TYPE, IReportConstants.SIX),
|
||||
Pair(IReportConstants.MODULE, IReportConstants.PEKO_HOMEPAGE)
|
||||
Pair(
|
||||
IReportConstants.MODULE,
|
||||
IReportConstants.PEKO_HOMEPAGE
|
||||
)
|
||||
)
|
||||
)
|
||||
CommonJumpHelper.bannerJump(context, it[position])
|
||||
@@ -80,37 +68,6 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
}
|
||||
}
|
||||
}
|
||||
homeViewModel.currentResourceLiveData.observe(this) {
|
||||
it?.let {
|
||||
if(it.size != 2){
|
||||
binding.csResource.visibility = View.GONE
|
||||
return@observe
|
||||
}
|
||||
binding.csResource.visibility = View.VISIBLE
|
||||
val resourceViews = arrayOf(
|
||||
binding.ivResource0,
|
||||
binding.ivResource1
|
||||
)
|
||||
for (i in resourceViews.indices) {
|
||||
resourceViews[i].load(it[i].icon)
|
||||
resourceViews[i].setOnClickListener { _ ->
|
||||
when {
|
||||
it[i].resourceType == 5 -> {
|
||||
CommonWebViewActivity.start(context, it[i].resourceContent)
|
||||
}
|
||||
i == 3 -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getHomeChatPick()
|
||||
}
|
||||
else -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getResourceJumpInfo(it[i].id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
homeViewModel.resourceJumpLiveData.observe(this) {
|
||||
dialogManager.dismissDialog()
|
||||
it?.let {
|
||||
@@ -156,6 +113,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
DemoCache.saveAnchorCardView(1)
|
||||
}
|
||||
}
|
||||
|
||||
R.id.iv_ranking -> {
|
||||
//首页_排行榜
|
||||
ReportManager.get().reportEvent(
|
||||
@@ -166,6 +124,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
)
|
||||
CommonWebViewActivity.start(mContext, UriProvider.getRanking())
|
||||
}
|
||||
|
||||
R.id.iv_my_room -> {
|
||||
//首页_创建房间
|
||||
ReportManager.get().reportEvent(
|
||||
@@ -183,66 +142,11 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
* 初始化推荐
|
||||
*/
|
||||
private fun initTitleTab() {
|
||||
mTabInfoList.add(
|
||||
HomeTagInfo(
|
||||
6,
|
||||
ResUtil.getString(R.string.home_fragment_homefragment_04),
|
||||
0
|
||||
)
|
||||
)
|
||||
mTabInfoList.add(
|
||||
HomeTagInfo(
|
||||
7,
|
||||
ResUtil.getString(R.string.home_fragment_homefragment_07),
|
||||
0
|
||||
)
|
||||
)
|
||||
mFragments.add(RecommendFragment::class.java)
|
||||
mFragments.add(AccompanyFragment::class.java)
|
||||
|
||||
val commonNavigator =
|
||||
CommonNavigator(
|
||||
context
|
||||
)
|
||||
commonNavigator.setTitleWrapContent(false)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0F)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER_VERTICAL)
|
||||
val magicIndicatorAdapter =
|
||||
MainIndicatorAdapter(
|
||||
context,
|
||||
mTabInfoList.map { it.name })
|
||||
magicIndicatorAdapter.setOnItemSelectListener(this)
|
||||
commonNavigator.adapter = magicIndicatorAdapter
|
||||
binding.magicIndicator.navigator = commonNavigator
|
||||
binding.viewPager.adapter =
|
||||
object : FragmentStateAdapter(childFragmentManager, lifecycle) {
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return mFragments[position].newInstance()
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return mFragments.size
|
||||
}
|
||||
|
||||
}
|
||||
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||
binding.viewPager.offscreenPageLimit = 1
|
||||
val fragment = RecommendFragment()
|
||||
childFragmentManager.beginTransaction()
|
||||
.add(R.id.frameLayout, fragment).commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
override fun onItemSelect(position: Int, view: TextView?) {
|
||||
binding.viewPager.currentItem = position
|
||||
//点击顶部tab上报
|
||||
val map = HashMap<String, Any>(3)
|
||||
map[IReportConstants.HOMEPAGE_TAB] = mTabInfoList[position].id
|
||||
map[IReportConstants.MODULE] = IReportConstants.PEKO_HOMEPAGE
|
||||
ReportManager.get().reportEvent(
|
||||
IReportConstants.TAB_HOMEPAGE_CLICK, map)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
mTabInfoList.clear()
|
||||
mFragments.clear()
|
||||
}
|
||||
|
||||
}
|
@@ -3,7 +3,8 @@ package com.pikolive.app.home.fragment
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.pikolive.app.application.IReportConstants
|
||||
import com.pikolive.app.application.ReportManager
|
||||
@@ -61,14 +62,17 @@ class RecommendFragment : BaseViewBindingFragment<FragmentRecommendBinding>() {
|
||||
Pair(IReportConstants.MODULE, IReportConstants.PEKO_HOMEPAGE)
|
||||
)
|
||||
)
|
||||
com.pikolive.app.avroom.activity.AVRoomActivity.start(mContext, homePlayInfo.uid)
|
||||
com.pikolive.app.avroom.activity.AVRoomActivity.start(
|
||||
mContext,
|
||||
homePlayInfo.uid
|
||||
)
|
||||
}
|
||||
}
|
||||
rvDelegate = RVDelegate.Builder<HomeRoomInfo>()
|
||||
.setAdapter(roomHotAdapter)
|
||||
.setRecyclerView(binding.mRecyclerRoom)
|
||||
.setEmptyView(EmptyViewHelper.createEmptyTextViewHeight(context, "暂无熱門推薦"))
|
||||
.setLayoutManager(GridLayoutManager(mContext, 2))
|
||||
.setLayoutManager(LinearLayoutManager(mContext, RecyclerView.VERTICAL, false))
|
||||
.build()
|
||||
homeViewModel.homeHotRoomLiveData.observe(this) {
|
||||
rvDelegate.loadData(it)
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 876 B |
BIN
app/src/main/res/drawable-xxhdpi/home_bg.webp
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
app/src/main/res/drawable-xxhdpi/home_ic_hot.webp
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/home_ic_rank.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable-xxhdpi/home_ic_room.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xxhdpi/home_ic_room_tag.webp
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/home_ic_search.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
6
app/src/main/res/drawable/shape_4c000000_10dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="#4c000000"/>
|
||||
</shape>
|
6
app/src/main/res/drawable/shape_ff84c0_5dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="5dp"/>
|
||||
<solid android:color="@color/color_FF84C0"/>
|
||||
</shape>
|
@@ -3,13 +3,13 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_normal_1c1b22">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<View
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:background="@drawable/bg_home_top"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_bg"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -17,7 +17,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -25,141 +24,87 @@
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/iv_search"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableStart="@drawable/ic_home_search"
|
||||
android:drawablePadding="@dimen/dp_6"
|
||||
android:drawableStart="@drawable/home_ic_search"
|
||||
android:drawablePadding="7dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="@dimen/dp_13"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/search_id_room"
|
||||
android:textColor="@color/color_B8B7C7"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:corner="@dimen/dp_16"
|
||||
app:solid="@color/color_FAFBFC" />
|
||||
android:textSize="12dp"
|
||||
app:corner="16dp"
|
||||
app:solid="#FCFAFA" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ranking"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_home_rank" />
|
||||
android:src="@drawable/home_ic_rank" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_my_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_home_my_room" />
|
||||
android:src="@drawable/home_ic_room" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/coordinator_layout"
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:visibility="gone"
|
||||
app:bvp_auto_play="true"
|
||||
app:bvp_can_loop="true"
|
||||
app:bvp_indicator_checked_color="@color/color_9168FA"
|
||||
app:bvp_indicator_normal_color="@color/color_B3B3C3"
|
||||
app:bvp_indicator_radius="@dimen/dp_4"
|
||||
app:bvp_indicator_visibility="visible"
|
||||
app:bvp_page_style="multi_page_scale"
|
||||
app:layout_constraintDimensionRatio="345:80"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/shape_ff84c0_5dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_title"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="11dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:text="熱門推薦"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frameLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar">
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
app:elevation="0dp"
|
||||
app:layout_behavior="com.pikolive.app.ui.widget.AppBarLayoutBehavior">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cs_resource"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:paddingStart="@dimen/dp_14"
|
||||
android:paddingEnd="@dimen/dp_14">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_resource0"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintDimensionRatio="170:82"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_resource1"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_4"
|
||||
tools:src="@drawable/default_banner" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_resource1"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintDimensionRatio="170:82"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_resource0"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_4"
|
||||
tools:src="@drawable/default_banner" />
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:bvp_auto_play="true"
|
||||
app:bvp_can_loop="true"
|
||||
app:bvp_indicator_checked_color="@color/color_9168FA"
|
||||
app:bvp_indicator_normal_color="@color/color_B3B3C3"
|
||||
app:bvp_indicator_radius="@dimen/dp_4"
|
||||
app:bvp_indicator_visibility="visible"
|
||||
app:bvp_page_style="multi_page_scale"
|
||||
app:layout_constraintDimensionRatio="345:80"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_resource0"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<com.pikolive.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_12" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_8" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -15,18 +15,17 @@
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="12dp">
|
||||
|
||||
<com.pikolive.library.common.widget.VpRecyclerView
|
||||
android:id="@+id/mRecyclerRoom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none"
|
||||
app:spanCount="2"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" />
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
@@ -4,43 +4,40 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_6"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
android:paddingVertical="6dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/v_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="84dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:background="@drawable/shape_white_8dp_round"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.pikolive.app.common.widget.RectRoundImageView
|
||||
android:id="@+id/iv_room_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_1"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="88dp"
|
||||
android:src="@drawable/default_cover"
|
||||
app:borderRadius="@dimen/dp_16"
|
||||
app:layout_constraintDimensionRatio="170:174"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_top_list"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_top_list"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_top_list"
|
||||
app:borderRadius="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/v_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:type="round" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
android:layout_margin="@dimen/dp_1"
|
||||
android:background="@drawable/bg_mask_home_item"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_top_list"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:src="@drawable/bg_recommend_weekly_list"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintDimensionRatio="174:178"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
<TextView
|
||||
android:id="@+id/tv_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:background="@drawable/home_ic_room_tag"
|
||||
android:gravity="center"
|
||||
android:text="热门"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11dp"
|
||||
app:layout_constraintEnd_toEndOf="@id/v_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/v_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_tag"
|
||||
@@ -52,13 +49,33 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_room_image"
|
||||
tools:src="@drawable/tag_101" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_room_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/fl_avatar"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_tag"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_room_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="@string/layout_item_room_common_02" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_room_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_room_image">
|
||||
android:layout_marginStart="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_room_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_room_title">
|
||||
|
||||
<com.pikolive.app.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_0"
|
||||
@@ -72,7 +89,7 @@
|
||||
android:id="@+id/iv_avatar_1"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
@@ -81,7 +98,7 @@
|
||||
android:id="@+id/iv_avatar_2"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginStart="28dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
@@ -90,7 +107,7 @@
|
||||
android:id="@+id/iv_avatar_3"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="54dp"
|
||||
android:layout_marginStart="42dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
@@ -99,58 +116,30 @@
|
||||
android:id="@+id/iv_avatar_4"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginStart="56dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_room_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_room_image"
|
||||
app:layout_constraintEnd_toStartOf="@+id/svga_living"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_room_image"
|
||||
tools:text="@string/layout_item_room_common_02" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/svga_living"
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_online_number"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_online_number"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_online_number" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/svga_pk"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/fl_avatar"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_online_number"
|
||||
app:layout_constraintTop_toTopOf="@+id/fl_avatar" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_online_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:background="@drawable/shape_4c000000_10dp"
|
||||
android:drawableStart="@drawable/home_ic_hot"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_room_title"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_room_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_room_title"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/v_bg"
|
||||
tools:text="266" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -711,5 +711,5 @@
|
||||
<color name="color_FFF87A">#FFFFF87A</color>
|
||||
<color name="color_ffffff_30">#4CFFFFFF</color>
|
||||
<color name="color_FFE468">#FFFFE468</color>
|
||||
|
||||
<color name="color_FF84C0">#FFFF84C0</color>
|
||||
</resources>
|
||||
|