feat:初步完成首页改版UI部分(首页-推荐、首页-我的)
This commit is contained in:
@@ -0,0 +1,103 @@
|
|||||||
|
package com.chwl.app.home.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.chwl.app.R;
|
||||||
|
import com.chwl.app.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class HomeIndicatorAdapter extends CommonNavigatorAdapter {
|
||||||
|
private final Context mContext;
|
||||||
|
private final List<? extends CharSequence> mTitleList;
|
||||||
|
|
||||||
|
private int textSize = 21;
|
||||||
|
private float minScale = 0.857f;
|
||||||
|
private boolean showIndicator = true;
|
||||||
|
private OnItemSelectListener mOnItemSelectListener;
|
||||||
|
|
||||||
|
public HomeIndicatorAdapter(Context context, List<? extends CharSequence> charSequences) {
|
||||||
|
this.mContext = context;
|
||||||
|
this.mTitleList = charSequences;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return mTitleList == null ? 0 : mTitleList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||||
|
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
|
||||||
|
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.white_transparent_60));
|
||||||
|
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_FFFFFF));
|
||||||
|
scaleTransitionPagerTitleView.setMinScale(minScale);
|
||||||
|
scaleTransitionPagerTitleView.setTextSize(textSize);
|
||||||
|
int padding = UIUtil.dip2px(context, 13);
|
||||||
|
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
|
||||||
|
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
|
||||||
|
scaleTransitionPagerTitleView.setOnClickListener(view -> {
|
||||||
|
if (mOnItemSelectListener != null) {
|
||||||
|
mOnItemSelectListener.onItemSelect(i, scaleTransitionPagerTitleView);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
return scaleTransitionPagerTitleView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPagerIndicator getIndicator(Context context) {
|
||||||
|
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||||
|
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||||
|
indicator.setLineHeight(UIUtil.dip2px(mContext, 1.5));
|
||||||
|
indicator.setRoundRadius(UIUtil.dip2px(mContext, 1));
|
||||||
|
indicator.setLineWidth(UIUtil.dip2px(mContext, 8));
|
||||||
|
indicator.setColors(context.getResources().getColor(R.color.color_10ECD6));
|
||||||
|
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
|
// lp.bottomMargin = mBottomMargin;
|
||||||
|
indicator.setLayoutParams(lp);
|
||||||
|
return indicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTextSize() {
|
||||||
|
return textSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextSize(int textSize) {
|
||||||
|
this.textSize = textSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMinScale() {
|
||||||
|
return minScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinScale(float minScale) {
|
||||||
|
this.minScale = minScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowIndicator() {
|
||||||
|
return showIndicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowIndicator(boolean showIndicator) {
|
||||||
|
this.showIndicator = showIndicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {
|
||||||
|
mOnItemSelectListener = onItemSelectListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemSelectListener {
|
||||||
|
void onItemSelect(int position, TextView view);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,148 +1,37 @@
|
|||||||
package com.chwl.app.home.fragment
|
package com.chwl.app.home.fragment
|
||||||
|
|
||||||
import android.view.Gravity
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
|
||||||
import com.chwl.app.R
|
import com.chwl.app.R
|
||||||
import com.chwl.app.application.IReportConstants
|
import com.chwl.app.application.IReportConstants
|
||||||
import com.chwl.app.application.ReportManager
|
import com.chwl.app.application.ReportManager
|
||||||
import com.chwl.app.avroom.activity.AVRoomActivity
|
import com.chwl.app.avroom.adapter.CommonVPAdapter
|
||||||
|
import com.chwl.app.avroom.adapter.RoomMessageIndicatorAdapter
|
||||||
import com.chwl.app.base.BaseViewBindingFragment
|
import com.chwl.app.base.BaseViewBindingFragment
|
||||||
import com.chwl.app.databinding.FragmentHomeBinding
|
import com.chwl.app.databinding.FragmentHomeBinding
|
||||||
import com.chwl.app.home.HomeViewModel
|
import com.chwl.app.home.HomeViewModel
|
||||||
import com.chwl.app.home.adapter.HomeBannerAdapter
|
import com.chwl.app.home.adapter.HomeIndicatorAdapter
|
||||||
import com.chwl.app.home.dialog.RecommendRoomDialog
|
|
||||||
import com.chwl.app.home.helper.OpenRoomHelper
|
|
||||||
import com.chwl.app.ui.search.SearchActivity
|
import com.chwl.app.ui.search.SearchActivity
|
||||||
import com.chwl.app.ui.utils.load
|
|
||||||
import com.chwl.app.ui.user.adapter.MainIndicatorAdapter
|
|
||||||
import com.chwl.app.ui.webview.CommonWebViewActivity
|
|
||||||
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
|
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil
|
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
import com.chwl.app.utils.CommonJumpHelper
|
|
||||||
import com.chwl.core.DemoCache
|
import com.chwl.core.DemoCache
|
||||||
import com.chwl.core.UriProvider
|
|
||||||
import com.chwl.core.home.bean.BannerInfo
|
|
||||||
import com.chwl.core.home.bean.HomeTagInfo
|
|
||||||
import com.chwl.core.home.event.RefreshHomeDataEvent
|
|
||||||
import com.chwl.library.utils.ListUtils
|
|
||||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
|
||||||
import com.zhpan.bannerview.BannerViewPager
|
|
||||||
import org.greenrobot.eventbus.EventBus
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
首页
|
首页
|
||||||
*/
|
*/
|
||||||
class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClickListener,
|
class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClickListener {
|
||||||
MainIndicatorAdapter.OnItemSelectListener {
|
|
||||||
|
|
||||||
private val TAB_ID_RECOMMEND = Int.MAX_VALUE - 1
|
|
||||||
|
|
||||||
private val TAB_ID_ACCOMPANY = Int.MAX_VALUE - 2
|
|
||||||
|
|
||||||
private val tabList = mutableListOf<HomeTagInfo>()
|
|
||||||
private val tabTitleList = mutableListOf<String>()
|
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
initListener()
|
initListener()
|
||||||
initTab()
|
initTab()
|
||||||
initBanner()
|
|
||||||
initResource()
|
|
||||||
homeViewModel.homeTagLiveData.observe(this) {
|
|
||||||
loadTabList(transformTabList(it))
|
|
||||||
}
|
|
||||||
homeViewModel.getHomeTagInfo()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initListener() {
|
private fun initListener() {
|
||||||
binding.tvSearch.setOnClickListener(this)
|
binding.tvSearch.setOnClickListener(this)
|
||||||
binding.ivRanking.setOnClickListener(this)
|
|
||||||
binding.ivMyRoom.setOnClickListener(this)
|
|
||||||
binding.refreshLayout.setOnRefreshListener {
|
|
||||||
it.finishRefresh()
|
|
||||||
EventBus.getDefault().post(RefreshHomeDataEvent())
|
|
||||||
homeViewModel.getBannerInfo()
|
|
||||||
if (binding.viewPager.adapter?.itemCount == 0) {
|
|
||||||
homeViewModel.getHomeTagInfo()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.refreshLayout.isEnableLoadmore = false
|
|
||||||
binding.refreshLayout.isEnableOverScrollBounce = false
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initResource(){
|
|
||||||
homeViewModel.currentResourceLiveData.observe(this) {
|
|
||||||
it?.let {
|
|
||||||
val resourceViews = arrayOf(
|
|
||||||
binding.ivResource0,
|
|
||||||
binding.ivResource1
|
|
||||||
)
|
|
||||||
if (it.size != 2) {
|
|
||||||
resourceViews.forEach {
|
|
||||||
it.isVisible = false
|
|
||||||
}
|
|
||||||
return@observe
|
|
||||||
}
|
|
||||||
resourceViews.forEach {
|
|
||||||
it.isVisible = true
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
dialogManager.showProgressDialog(mContext)
|
|
||||||
homeViewModel.getResourceJumpInfo(it[i].id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
homeViewModel.resourceJumpLiveData.observe(this) {
|
|
||||||
dialogManager.dismissDialog()
|
|
||||||
it?.let {
|
|
||||||
if (it.isPick) {
|
|
||||||
AVRoomActivity.start(context, it.uid)
|
|
||||||
} else {
|
|
||||||
RecommendRoomDialog.newInstance(it).show(context)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
homeViewModel.getCurrentResourceInfo()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initBanner() {
|
|
||||||
val bannerView: BannerViewPager<BannerInfo?> =
|
|
||||||
binding.bannerView as BannerViewPager<BannerInfo?>
|
|
||||||
homeViewModel.bannerLiveData.observe(this) {
|
|
||||||
it?.let {
|
|
||||||
if (ListUtils.isListEmpty(it)) {
|
|
||||||
bannerView.visibility = View.GONE
|
|
||||||
return@let
|
|
||||||
}
|
|
||||||
bannerView.visibility = View.VISIBLE
|
|
||||||
bannerView.adapter = HomeBannerAdapter()
|
|
||||||
bannerView.post {
|
|
||||||
binding.bannerView.setPageMargin(UIUtil.dip2px(mContext, 8.0))
|
|
||||||
.setScrollDuration(800)
|
|
||||||
.setOnPageClickListener { _: View?, position: Int ->
|
|
||||||
CommonJumpHelper.bannerJump(context, it[position])
|
|
||||||
}
|
|
||||||
.create(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
homeViewModel.getBannerInfo()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(v: View) {
|
override fun onClick(v: View) {
|
||||||
@@ -161,107 +50,35 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
|||||||
DemoCache.saveAnchorCardView(1)
|
DemoCache.saveAnchorCardView(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.iv_ranking -> {
|
|
||||||
//首页_排行榜
|
|
||||||
CommonWebViewActivity.start(mContext, UriProvider.getRanking())
|
|
||||||
}
|
|
||||||
|
|
||||||
R.id.iv_my_room -> {
|
|
||||||
OpenRoomHelper.openRoom(baseActivity)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initTab() {
|
private fun initTab() {
|
||||||
|
val fragmentList = ArrayList<Fragment>()
|
||||||
|
fragmentList.add(HomeRecommendFragment())
|
||||||
|
fragmentList.add(HomeWithMeFragment())
|
||||||
|
val titleList = ArrayList<String>()
|
||||||
|
titleList.add(getString(R.string.main_tab_recommend))
|
||||||
|
titleList.add(getString(R.string.main_me))
|
||||||
val commonNavigator = CommonNavigator(context)
|
val commonNavigator = CommonNavigator(context)
|
||||||
commonNavigator.setTitleWrapContent(false)
|
commonNavigator.setTitleWrapContent(false)
|
||||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0F)
|
val magicIndicatorAdapter = HomeIndicatorAdapter(context, titleList)
|
||||||
commonNavigator.setTitleGravity(Gravity.CENTER_VERTICAL)
|
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
|
||||||
val magicIndicatorAdapter = MainIndicatorAdapter(context, tabTitleList)
|
binding.viewPager.currentItem = position
|
||||||
magicIndicatorAdapter.setOnItemSelectListener(this)
|
}
|
||||||
commonNavigator.adapter = magicIndicatorAdapter
|
commonNavigator.adapter = magicIndicatorAdapter
|
||||||
binding.magicIndicator.navigator = commonNavigator
|
binding.magicIndicator.navigator = commonNavigator
|
||||||
binding.viewPager.adapter =
|
binding.viewPager.offscreenPageLimit = 2
|
||||||
object : FragmentStateAdapter(childFragmentManager, lifecycle) {
|
binding.viewPager.adapter = CommonVPAdapter(
|
||||||
override fun getItemId(position: Int): Long {
|
childFragmentManager,
|
||||||
return tabList[position].id.toLong()
|
lifecycle,
|
||||||
}
|
fragmentList
|
||||||
|
)
|
||||||
override fun containsItem(itemId: Long): Boolean {
|
|
||||||
return tabList.firstOrNull { it.id.toLong() == itemId } != null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun createFragment(position: Int): Fragment {
|
|
||||||
val itemId = getItemId(position)
|
|
||||||
return when (itemId) {
|
|
||||||
TAB_ID_RECOMMEND.toLong() -> {
|
|
||||||
RecommendFragment()
|
|
||||||
}
|
|
||||||
|
|
||||||
TAB_ID_ACCOMPANY.toLong() -> {
|
|
||||||
AccompanyFragment()
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> {
|
|
||||||
return HomeTabFragment.newInstance(itemId.toInt())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getItemCount(): Int {
|
|
||||||
return tabList.size
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||||
loadTabList(transformTabList(emptyList()))
|
binding.viewPager.isUserInputEnabled = false
|
||||||
}
|
|
||||||
|
|
||||||
private fun transformTabList(list: List<HomeTagInfo>): List<HomeTagInfo> {
|
|
||||||
// val finalList = ArrayList<HomeTagInfo>()
|
|
||||||
// finalList.add(
|
|
||||||
// HomeTagInfo(
|
|
||||||
// TAB_ID_RECOMMEND,
|
|
||||||
// ResUtil.getString(R.string.home_fragment_homefragment_04),
|
|
||||||
// 0
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// finalList.addAll(list)
|
|
||||||
// finalList.add(
|
|
||||||
// HomeTagInfo(
|
|
||||||
// TAB_ID_ACCOMPANY,
|
|
||||||
// ResUtil.getString(R.string.home_fragment_homefragment_07),
|
|
||||||
// 0
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
return list
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun loadTabList(list: List<HomeTagInfo>) {
|
|
||||||
// 预防脏数据导致fragment复用问题
|
|
||||||
val newList = list.distinctBy {
|
|
||||||
it.id
|
|
||||||
}
|
|
||||||
val currentListId = tabList.joinToString { it.id.toString() }
|
|
||||||
val newListId = newList.joinToString { it.id.toString() }
|
|
||||||
if (currentListId == newListId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
tabList.clear()
|
|
||||||
tabList.addAll(newList)
|
|
||||||
tabTitleList.clear()
|
|
||||||
tabTitleList.addAll(tabList.map { it.name })
|
|
||||||
binding.magicIndicator.navigator.notifyDataSetChanged()
|
|
||||||
binding.viewPager.adapter?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
tabList.clear()
|
|
||||||
tabTitleList.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onItemSelect(position: Int, view: TextView?) {
|
|
||||||
binding.viewPager.currentItem = position
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -0,0 +1,258 @@
|
|||||||
|
package com.chwl.app.home.fragment
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||||
|
import com.chwl.app.R
|
||||||
|
import com.chwl.app.application.IReportConstants
|
||||||
|
import com.chwl.app.application.ReportManager
|
||||||
|
import com.chwl.app.avroom.activity.AVRoomActivity
|
||||||
|
import com.chwl.app.base.BaseViewBindingFragment
|
||||||
|
import com.chwl.app.databinding.FragmentHomeRecommendBinding
|
||||||
|
import com.chwl.app.home.HomeViewModel
|
||||||
|
import com.chwl.app.home.adapter.HomeBannerAdapter
|
||||||
|
import com.chwl.app.home.dialog.RecommendRoomDialog
|
||||||
|
import com.chwl.app.ui.search.SearchActivity
|
||||||
|
import com.chwl.app.ui.user.adapter.HomeRecommendIndicatorAdapter
|
||||||
|
import com.chwl.app.ui.utils.load
|
||||||
|
import com.chwl.app.ui.webview.CommonWebViewActivity
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
|
import com.chwl.app.utils.CommonJumpHelper
|
||||||
|
import com.chwl.core.DemoCache
|
||||||
|
import com.chwl.core.home.bean.BannerInfo
|
||||||
|
import com.chwl.core.home.bean.HomeTagInfo
|
||||||
|
import com.chwl.core.home.event.RefreshHomeDataEvent
|
||||||
|
import com.chwl.library.utils.ListUtils
|
||||||
|
import com.example.lib_utils.ktx.getDrawableById
|
||||||
|
import com.zhpan.bannerview.BannerViewPager
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
|
||||||
|
/**
|
||||||
|
首页
|
||||||
|
*/
|
||||||
|
class HomeRecommendFragment : BaseViewBindingFragment<FragmentHomeRecommendBinding>(),
|
||||||
|
View.OnClickListener,
|
||||||
|
HomeRecommendIndicatorAdapter.OnItemSelectListener {
|
||||||
|
|
||||||
|
private val TAB_ID_RECOMMEND = Int.MAX_VALUE - 1
|
||||||
|
|
||||||
|
private val TAB_ID_ACCOMPANY = Int.MAX_VALUE - 2
|
||||||
|
|
||||||
|
private val tabList = mutableListOf<HomeTagInfo>()
|
||||||
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
initListener()
|
||||||
|
initTab()
|
||||||
|
initBanner()
|
||||||
|
initResource()
|
||||||
|
homeViewModel.homeTagLiveData.observe(this) {
|
||||||
|
loadTabList(transformTabList(it))
|
||||||
|
}
|
||||||
|
homeViewModel.getHomeTagInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initListener() {
|
||||||
|
// binding.tvSearch.setOnClickListener(this)
|
||||||
|
// binding.ivRanking.setOnClickListener(this)
|
||||||
|
// binding.ivMyRoom.setOnClickListener(this)
|
||||||
|
binding.refreshLayout.setOnRefreshListener {
|
||||||
|
it.finishRefresh()
|
||||||
|
EventBus.getDefault().post(RefreshHomeDataEvent())
|
||||||
|
homeViewModel.getBannerInfo()
|
||||||
|
if (binding.viewPager.adapter?.itemCount == 0) {
|
||||||
|
homeViewModel.getHomeTagInfo()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.refreshLayout.isEnableLoadmore = false
|
||||||
|
binding.refreshLayout.isEnableOverScrollBounce = false
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initResource() {
|
||||||
|
homeViewModel.currentResourceLiveData.observe(this) {
|
||||||
|
it?.let {
|
||||||
|
val resourceViews = arrayOf(
|
||||||
|
binding.ivResource0,
|
||||||
|
binding.ivResource1
|
||||||
|
)
|
||||||
|
if (it.size != 2) {
|
||||||
|
resourceViews.forEach {
|
||||||
|
it.isVisible = false
|
||||||
|
}
|
||||||
|
return@observe
|
||||||
|
}
|
||||||
|
resourceViews.forEach {
|
||||||
|
it.isVisible = true
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
dialogManager.showProgressDialog(mContext)
|
||||||
|
homeViewModel.getResourceJumpInfo(it[i].id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
homeViewModel.resourceJumpLiveData.observe(this) {
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
it?.let {
|
||||||
|
if (it.isPick) {
|
||||||
|
AVRoomActivity.start(context, it.uid)
|
||||||
|
} else {
|
||||||
|
RecommendRoomDialog.newInstance(it).show(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
homeViewModel.getCurrentResourceInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initBanner() {
|
||||||
|
val bannerView: BannerViewPager<BannerInfo?> =
|
||||||
|
binding.bannerView as BannerViewPager<BannerInfo?>
|
||||||
|
homeViewModel.bannerLiveData.observe(this) {
|
||||||
|
it?.let {
|
||||||
|
if (ListUtils.isListEmpty(it)) {
|
||||||
|
bannerView.visibility = View.GONE
|
||||||
|
return@let
|
||||||
|
}
|
||||||
|
bannerView.visibility = View.VISIBLE
|
||||||
|
bannerView.adapter = HomeBannerAdapter()
|
||||||
|
bannerView.post {
|
||||||
|
binding.bannerView.setPageMargin(UIUtil.dip2px(mContext, 8.0))
|
||||||
|
.setScrollDuration(800)
|
||||||
|
.setOnPageClickListener { _: View?, position: Int ->
|
||||||
|
CommonJumpHelper.bannerJump(context, it[position])
|
||||||
|
}
|
||||||
|
.create(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
homeViewModel.getBannerInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClick(v: View) {
|
||||||
|
when (v.id) {
|
||||||
|
R.id.tv_search -> {
|
||||||
|
//首页_搜索
|
||||||
|
ReportManager.get().reportEvent(
|
||||||
|
IReportConstants.MODULE_HOMEPAGE_CLICK, mapOf(
|
||||||
|
Pair(IReportConstants.HOMEPAGE_TYPE, IReportConstants.ONE),
|
||||||
|
Pair(IReportConstants.MODULE, IReportConstants.MOLISTAR_HOMEPAGE)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
SearchActivity.start(activity)
|
||||||
|
//为啥触发条件这么恶心
|
||||||
|
if (DemoCache.readAnchorCardView() == 0) {
|
||||||
|
DemoCache.saveAnchorCardView(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// R.id.iv_ranking -> {
|
||||||
|
// //首页_排行榜
|
||||||
|
// CommonWebViewActivity.start(mContext, UriProvider.getRanking())
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// R.id.iv_my_room -> {
|
||||||
|
// OpenRoomHelper.openRoom(baseActivity)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initTab() {
|
||||||
|
binding.viewPager.adapter =
|
||||||
|
object : FragmentStateAdapter(childFragmentManager, lifecycle) {
|
||||||
|
override fun getItemId(position: Int): Long {
|
||||||
|
return tabList[position].id.toLong()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun containsItem(itemId: Long): Boolean {
|
||||||
|
return tabList.firstOrNull { it.id.toLong() == itemId } != null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createFragment(position: Int): Fragment {
|
||||||
|
val itemId = getItemId(position)
|
||||||
|
return when (itemId) {
|
||||||
|
TAB_ID_RECOMMEND.toLong() -> {
|
||||||
|
RecommendFragment()
|
||||||
|
}
|
||||||
|
|
||||||
|
TAB_ID_ACCOMPANY.toLong() -> {
|
||||||
|
AccompanyFragment()
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
return HomeTabFragment.newInstance(itemId.toInt())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return tabList.size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun resetTabIndicator(list: List<String>) {
|
||||||
|
val commonNavigator = CommonNavigator(context)
|
||||||
|
if (list.size <= 4) {
|
||||||
|
commonNavigator.isAdjustMode = true
|
||||||
|
}
|
||||||
|
val magicIndicatorAdapter = HomeRecommendIndicatorAdapter(
|
||||||
|
context,
|
||||||
|
list
|
||||||
|
)
|
||||||
|
magicIndicatorAdapter.setOnItemSelectListener { position, _ ->
|
||||||
|
binding.viewPager.currentItem = position
|
||||||
|
}
|
||||||
|
commonNavigator.adapter = magicIndicatorAdapter
|
||||||
|
binding.magicIndicator.navigator = commonNavigator
|
||||||
|
val titleContainer: LinearLayout = commonNavigator.titleContainer // must after setNavigator
|
||||||
|
titleContainer.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||||
|
titleContainer.dividerPadding = resources.getDimensionPixelOffset(R.dimen.dp_15)
|
||||||
|
titleContainer.dividerDrawable = getDrawableById(R.drawable.home_recommend_tab_splitter)
|
||||||
|
binding.magicIndicator.onPageSelected(binding.viewPager.currentItem)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun transformTabList(list: List<HomeTagInfo>): List<HomeTagInfo> {
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun loadTabList(list: List<HomeTagInfo>) {
|
||||||
|
// 预防脏数据导致fragment复用问题
|
||||||
|
val newList = list.distinctBy {
|
||||||
|
it.id
|
||||||
|
}
|
||||||
|
val currentListId = tabList.joinToString { it.id.toString() }
|
||||||
|
val newListId = newList.joinToString { it.id.toString() }
|
||||||
|
if (currentListId == newListId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tabList.clear()
|
||||||
|
tabList.addAll(newList)
|
||||||
|
binding.viewPager.adapter?.notifyDataSetChanged()
|
||||||
|
resetTabIndicator(tabList.map { it.name })
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
tabList.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onItemSelect(position: Int, view: TextView?) {
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,143 @@
|
|||||||
|
package com.chwl.app.home.fragment
|
||||||
|
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||||
|
import com.chwl.app.R
|
||||||
|
import com.chwl.app.base.BaseViewBindingFragment
|
||||||
|
import com.chwl.app.databinding.HomeMeFragmentBinding
|
||||||
|
import com.chwl.app.home.HomeViewModel
|
||||||
|
import com.chwl.app.home.helper.OpenRoomHelper
|
||||||
|
import com.chwl.app.ui.user.adapter.HomeRecommendIndicatorAdapter
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
|
||||||
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
|
import com.chwl.core.home.bean.HomeTagInfo
|
||||||
|
import com.chwl.core.home.event.RefreshHomeDataEvent
|
||||||
|
import com.example.lib_utils.ktx.getDrawableById
|
||||||
|
import com.example.lib_utils.ktx.singleClick
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
|
||||||
|
/**
|
||||||
|
首页
|
||||||
|
*/
|
||||||
|
class HomeWithMeFragment : BaseViewBindingFragment<HomeMeFragmentBinding>(),
|
||||||
|
HomeRecommendIndicatorAdapter.OnItemSelectListener {
|
||||||
|
|
||||||
|
private val TAB_ID_RECOMMEND = Int.MAX_VALUE - 1
|
||||||
|
|
||||||
|
private val TAB_ID_ACCOMPANY = Int.MAX_VALUE - 2
|
||||||
|
|
||||||
|
private val tabList = mutableListOf<HomeTagInfo>()
|
||||||
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
initListener()
|
||||||
|
initTab()
|
||||||
|
homeViewModel.homeTagLiveData.observe(this) {
|
||||||
|
loadTabList(transformTabList(it))
|
||||||
|
}
|
||||||
|
homeViewModel.getHomeTagInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initListener() {
|
||||||
|
binding.refreshLayout.setOnRefreshListener {
|
||||||
|
it.finishRefresh()
|
||||||
|
EventBus.getDefault().post(RefreshHomeDataEvent())
|
||||||
|
homeViewModel.getBannerInfo()
|
||||||
|
if (binding.viewPager.adapter?.itemCount == 0) {
|
||||||
|
homeViewModel.getHomeTagInfo()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.refreshLayout.isEnableLoadmore = false
|
||||||
|
binding.refreshLayout.isEnableOverScrollBounce = false
|
||||||
|
binding.layoutRoomCard.singleClick {
|
||||||
|
OpenRoomHelper.openRoom(baseActivity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initTab() {
|
||||||
|
binding.viewPager.adapter =
|
||||||
|
object : FragmentStateAdapter(childFragmentManager, lifecycle) {
|
||||||
|
override fun getItemId(position: Int): Long {
|
||||||
|
return tabList[position].id.toLong()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun containsItem(itemId: Long): Boolean {
|
||||||
|
return tabList.firstOrNull { it.id.toLong() == itemId } != null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createFragment(position: Int): Fragment {
|
||||||
|
val itemId = getItemId(position)
|
||||||
|
return when (itemId) {
|
||||||
|
TAB_ID_RECOMMEND.toLong() -> {
|
||||||
|
RecommendFragment()
|
||||||
|
}
|
||||||
|
|
||||||
|
TAB_ID_ACCOMPANY.toLong() -> {
|
||||||
|
AccompanyFragment()
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
return HomeTabFragment.newInstance(itemId.toInt())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return tabList.size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun resetTabIndicator(list: List<String>) {
|
||||||
|
val commonNavigator = CommonNavigator(context)
|
||||||
|
if (list.size <= 4) {
|
||||||
|
commonNavigator.isAdjustMode = true
|
||||||
|
}
|
||||||
|
val magicIndicatorAdapter = HomeRecommendIndicatorAdapter(
|
||||||
|
context,
|
||||||
|
list
|
||||||
|
)
|
||||||
|
magicIndicatorAdapter.setOnItemSelectListener { position, _ ->
|
||||||
|
binding.viewPager.currentItem = position
|
||||||
|
}
|
||||||
|
commonNavigator.adapter = magicIndicatorAdapter
|
||||||
|
binding.magicIndicator.navigator = commonNavigator
|
||||||
|
val titleContainer: LinearLayout = commonNavigator.titleContainer // must after setNavigator
|
||||||
|
titleContainer.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||||
|
titleContainer.dividerPadding = resources.getDimensionPixelOffset(R.dimen.dp_15)
|
||||||
|
titleContainer.dividerDrawable = getDrawableById(R.drawable.home_recommend_tab_splitter)
|
||||||
|
binding.magicIndicator.onPageSelected(binding.viewPager.currentItem)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun transformTabList(list: List<HomeTagInfo>): List<HomeTagInfo> {
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun loadTabList(list: List<HomeTagInfo>) {
|
||||||
|
// 预防脏数据导致fragment复用问题
|
||||||
|
val newList = list.distinctBy {
|
||||||
|
it.id
|
||||||
|
}
|
||||||
|
val currentListId = tabList.joinToString { it.id.toString() }
|
||||||
|
val newListId = newList.joinToString { it.id.toString() }
|
||||||
|
if (currentListId == newListId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tabList.clear()
|
||||||
|
tabList.addAll(newList)
|
||||||
|
binding.viewPager.adapter?.notifyDataSetChanged()
|
||||||
|
resetTabIndicator(tabList.map { it.name })
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
tabList.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onItemSelect(position: Int, view: TextView?) {
|
||||||
|
}
|
||||||
|
}
|
@@ -1,8 +1,7 @@
|
|||||||
package com.chwl.app.ui.user.adapter;
|
package com.chwl.app.ui.user.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Color;
|
||||||
import android.graphics.LinearGradient;
|
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -13,26 +12,24 @@ import androidx.core.content.ContextCompat;
|
|||||||
|
|
||||||
import com.chwl.app.R;
|
import com.chwl.app.R;
|
||||||
import com.chwl.app.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
|
import com.chwl.app.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
|
||||||
import com.chwl.app.ui.widget.magicindicator.FragmentContainerHelper;
|
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.GradientLinePagerIndicator;
|
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.model.PositionData;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MainIndicatorAdapter extends CommonNavigatorAdapter {
|
public class HomeRecommendIndicatorAdapter extends CommonNavigatorAdapter {
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final List<? extends CharSequence> mTitleList;
|
private final List<? extends CharSequence> mTitleList;
|
||||||
|
|
||||||
private int textSize = 16;
|
private int textSize = 14;
|
||||||
private float minScale = 1f;
|
private float minScale = 1f;
|
||||||
private boolean showIndicator = true;
|
private boolean showIndicator = true;
|
||||||
private OnItemSelectListener mOnItemSelectListener;
|
private OnItemSelectListener mOnItemSelectListener;
|
||||||
|
|
||||||
public MainIndicatorAdapter(Context context, List<? extends CharSequence> charSequences) {
|
public HomeRecommendIndicatorAdapter(Context context, List<? extends CharSequence> charSequences) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mTitleList = charSequences;
|
this.mTitleList = charSequences;
|
||||||
}
|
}
|
@@ -3,6 +3,7 @@ package com.chwl.app.vip.dialog
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import com.chwl.app.R
|
||||||
import com.opensource.svgaplayer.SVGADrawable
|
import com.opensource.svgaplayer.SVGADrawable
|
||||||
import com.opensource.svgaplayer.SVGAParser
|
import com.opensource.svgaplayer.SVGAParser
|
||||||
import com.opensource.svgaplayer.SVGAVideoEntity
|
import com.opensource.svgaplayer.SVGAVideoEntity
|
||||||
@@ -69,6 +70,6 @@ class VipUpgradeDialog : BaseDialog<DialogVipUpgradeBinding>() {
|
|||||||
} catch (e: MalformedURLException) {
|
} catch (e: MalformedURLException) {
|
||||||
|
|
||||||
}
|
}
|
||||||
binding?.tvLevelDesc?.text = "恭喜你成為「${vipInfo.vipName}」!當前已自動佩戴該等級裝扮,是否保留原有裝扮?"
|
binding?.tvLevelDesc?.text = getString(R.string.level_up_wear_dress_tips_format).format(vipInfo.vipName)
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
app/src/main/res/drawable-xxhdpi/home_ic_search.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/home_ic_search.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="16dp"
|
|
||||||
android:height="16dp"
|
|
||||||
android:viewportWidth="16"
|
|
||||||
android:viewportHeight="16">
|
|
||||||
<path
|
|
||||||
android:pathData="M12.687,11.944C13.705,10.751 14.283,9.237 14.283,7.642C14.283,3.973 11.31,1 7.642,1C3.974,1 1,3.974 1,7.642C1,11.31 3.974,14.284 7.642,14.284C8.299,14.284 8.953,14.187 9.581,13.996C9.857,13.91 10.012,13.617 9.927,13.341C9.843,13.065 9.552,12.909 9.275,12.991C8.746,13.152 8.195,13.234 7.642,13.233C4.554,13.233 2.05,10.73 2.05,7.642C2.05,4.554 4.554,2.05 7.642,2.05C10.73,2.05 13.233,4.554 13.233,7.642C13.233,9.107 12.653,10.492 11.639,11.536C11.408,11.774 11.411,12.154 11.646,12.388L14.107,14.849C14.312,15.051 14.642,15.05 14.846,14.846C15.05,14.642 15.051,14.312 14.849,14.107L12.687,11.944Z"
|
|
||||||
android:strokeWidth="0.2"
|
|
||||||
android:fillColor="#B8B7C7"
|
|
||||||
android:fillType="nonZero"
|
|
||||||
android:strokeColor="#B8B7C7"/>
|
|
||||||
</vector>
|
|
7
app/src/main/res/drawable/home_me_room_card_bg.xml
Normal file
7
app/src/main/res/drawable/home_me_room_card_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:endColor="#FFE993"
|
||||||
|
android:startColor="#FDC36F" />
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
</shape>
|
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<size android:width="@dimen/dp_1_5" />
|
||||||
|
<solid android:color="#331E1E1F" />
|
||||||
|
<corners android:radius="@dimen/dp_0_5" />
|
||||||
|
</shape>
|
@@ -13,163 +13,38 @@
|
|||||||
android:src="@drawable/bg_theme_top_home"
|
android:src="@drawable/bg_theme_top_home"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
android:id="@+id/layout_title_bar"
|
android:id="@+id/layout_title_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_44"
|
android:layout_marginTop="@dimen/dp_44"
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
<com.chwl.app.ui.widget.magicindicator.MagicIndicator
|
||||||
|
android:id="@+id/magic_indicator"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/dp_35"
|
||||||
|
android:layout_gravity="start|center_vertical" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
android:id="@+id/tv_search"
|
android:id="@+id/tv_search"
|
||||||
android:layout_width="0dp"
|
android:layout_width="@dimen/dp_25"
|
||||||
android:layout_height="@dimen/dp_32"
|
android:layout_height="@dimen/dp_25"
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
android:layout_gravity="end|center_vertical"
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/shape_fafbfc_16dp"
|
|
||||||
android:drawableStart="@drawable/home_ic_search"
|
|
||||||
android:drawablePadding="@dimen/dp_7"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:paddingStart="@dimen/dp_5"
|
||||||
android:paddingStart="@dimen/dp_15"
|
|
||||||
android:paddingEnd="@dimen/dp_5"
|
android:paddingEnd="@dimen/dp_5"
|
||||||
android:text="@string/search_id_room"
|
android:scaleType="fitCenter"
|
||||||
android:textColor="#B8B7C7"
|
android:src="@drawable/home_ic_search" />
|
||||||
android:textSize="@dimen/dp_12"
|
|
||||||
app:autoSizeMaxTextSize="@dimen/dp_12"
|
|
||||||
app:autoSizeMinTextSize="@dimen/dp_8"
|
|
||||||
app:autoSizeStepGranularity="1px"
|
|
||||||
app:autoSizeTextType="uniform" />
|
|
||||||
|
|
||||||
<ImageView
|
</FrameLayout>
|
||||||
android:id="@+id/iv_ranking"
|
|
||||||
android:layout_width="@dimen/dp_32"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:src="@drawable/home_ic_rank" />
|
|
||||||
|
|
||||||
<ImageView
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
android:id="@+id/iv_my_room"
|
android:id="@+id/view_pager"
|
||||||
android:layout_width="@dimen/dp_32"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:src="@drawable/home_ic_my_room" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
|
||||||
android:id="@+id/refresh_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginBottom="@dimen/main_bottom_bar_top_margin"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/layout_title_bar">
|
app:layout_constraintTop_toBottomOf="@id/layout_title_bar" />
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
||||||
android:id="@+id/coordinator_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/transparent"
|
|
||||||
app:elevation="0dp"
|
|
||||||
app:layout_behavior="com.chwl.app.ui.widget.AppBarLayoutBehavior">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:contentScrim="@color/transparent"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/iv_resource0"
|
|
||||||
android:layout_width="@dimen/dp_0"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="@dimen/dp_14"
|
|
||||||
android:layout_marginTop="@dimen/dp_16"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:visibility="gone"
|
|
||||||
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"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<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_7"
|
|
||||||
android:layout_marginEnd="@dimen/dp_14"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:visibility="gone"
|
|
||||||
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="@id/iv_resource0"
|
|
||||||
app:riv_corner_radius="@dimen/dp_4"
|
|
||||||
tools:src="@drawable/default_banner"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.zhpan.bannerview.BannerViewPager
|
|
||||||
android:id="@+id/banner_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginHorizontal="@dimen/dp_14"
|
|
||||||
android:layout_marginTop="@dimen/dp_9"
|
|
||||||
android:background="@drawable/base_shape_negative_5dp"
|
|
||||||
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="351:80"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_resource0"
|
|
||||||
app:layout_goneMarginTop="@dimen/dp_16"
|
|
||||||
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.chwl.app.ui.widget.magicindicator.MagicIndicator
|
|
||||||
android:id="@+id/magic_indicator"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_40"
|
|
||||||
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>
|
|
||||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
117
app/src/main/res/layout/fragment_home_recommend.xml
Normal file
117
app/src/main/res/layout/fragment_home_recommend.xml
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/refresh_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/coordinator_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
app:elevation="0dp"
|
||||||
|
app:layout_behavior="com.chwl.app.ui.widget.AppBarLayoutBehavior">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:contentScrim="@color/transparent"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/iv_resource0"
|
||||||
|
android:layout_width="@dimen/dp_0"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="@dimen/dp_14"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone"
|
||||||
|
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"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<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_7"
|
||||||
|
android:layout_marginEnd="@dimen/dp_14"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone"
|
||||||
|
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="@id/iv_resource0"
|
||||||
|
app:riv_corner_radius="@dimen/dp_4"
|
||||||
|
tools:src="@drawable/default_banner"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<com.zhpan.bannerview.BannerViewPager
|
||||||
|
android:id="@+id/banner_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_9"
|
||||||
|
android:background="@drawable/base_shape_negative_5dp"
|
||||||
|
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="351:80"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_resource0"
|
||||||
|
app:layout_goneMarginTop="@dimen/dp_16"
|
||||||
|
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.chwl.app.ui.widget.magicindicator.MagicIndicator
|
||||||
|
android:id="@+id/magic_indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_40"
|
||||||
|
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>
|
||||||
|
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
205
app/src/main/res/layout/home_me_fragment.xml
Normal file
205
app/src/main/res/layout/home_me_fragment.xml
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/refresh_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/coordinator_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
app:elevation="0dp"
|
||||||
|
app:layout_behavior="com.chwl.app.ui.widget.AppBarLayoutBehavior">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:contentScrim="@color/transparent"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/layout_room_card"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_93"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:background="@drawable/home_me_room_card_bg">
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/iv_room_cover"
|
||||||
|
android:layout_width="@dimen/dp_73"
|
||||||
|
android:layout_height="@dimen/dp_73"
|
||||||
|
android:layout_marginStart="@dimen/dp_9"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_cover"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:shapeAppearance="@style/shape_corner_6dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_room_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_6"
|
||||||
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:hint="@string/my_room"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#18181A"
|
||||||
|
android:textColorHint="#18181A"
|
||||||
|
android:textSize="@dimen/dp_15"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_room_topic"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_room_cover"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_room_topic"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:hint="@string/home_room_card_topic_empty_def"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#18181A"
|
||||||
|
android:textColorHint="#18181A"
|
||||||
|
android:textSize="@dimen/dp_13"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/layout_room_user_list"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/tv_room_name"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/tv_room_name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_room_name" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_room_user_list"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/tv_room_name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_room_topic">
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/iv_room_user_0"
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:padding="@dimen/dp_0_5"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:shapeAppearance="@style/shape_circle"
|
||||||
|
app:strokeColor="@color/white"
|
||||||
|
app:strokeWidth="@dimen/dp_1" />
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/iv_room_user_1"
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginStart="-5dp"
|
||||||
|
android:padding="@dimen/dp_0_5"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:shapeAppearance="@style/shape_circle"
|
||||||
|
app:strokeColor="@color/white"
|
||||||
|
app:strokeWidth="@dimen/dp_1" />
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/iv_room_user_2"
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginStart="-5dp"
|
||||||
|
android:padding="@dimen/dp_0_5"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:shapeAppearance="@style/shape_circle"
|
||||||
|
app:strokeColor="@color/white"
|
||||||
|
app:strokeWidth="@dimen/dp_1" />
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/iv_room_user_3"
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginStart="-5dp"
|
||||||
|
android:padding="@dimen/dp_0_5"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:shapeAppearance="@style/shape_circle"
|
||||||
|
app:strokeColor="@color/white"
|
||||||
|
app:strokeWidth="@dimen/dp_1" />
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/iv_room_user_4"
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginStart="-5dp"
|
||||||
|
android:padding="@dimen/dp_0_5"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:shapeAppearance="@style/shape_circle"
|
||||||
|
app:strokeColor="@color/white"
|
||||||
|
app:strokeWidth="@dimen/dp_1" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<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_9"
|
||||||
|
android:layout_marginBottom="@dimen/dp_14"
|
||||||
|
android:drawableStart="@drawable/home_ic_hot"
|
||||||
|
android:drawablePadding="@dimen/dp_3"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="0"
|
||||||
|
android:textColor="#797B80"
|
||||||
|
android:textSize="@dimen/dp_13"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
tools:text="266" />
|
||||||
|
|
||||||
|
</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.chwl.app.ui.widget.magicindicator.MagicIndicator
|
||||||
|
android:id="@+id/magic_indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_40"
|
||||||
|
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>
|
||||||
|
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -5298,4 +5298,6 @@
|
|||||||
<string name="start_pk">ابدأ PK</string>
|
<string name="start_pk">ابدأ PK</string>
|
||||||
<string name="send_gift_to_self_tips">حاول تقديم الهدايا للآخرين~</string>
|
<string name="send_gift_to_self_tips">حاول تقديم الهدايا للآخرين~</string>
|
||||||
<string name="send_gift_tab_title">الهدايا</string>
|
<string name="send_gift_tab_title">الهدايا</string>
|
||||||
|
<string name="level_up_wear_dress_tips_format">恭喜你成為「%s」!當前已自動佩戴該等級裝扮,是否保留原有裝扮?</string>
|
||||||
|
<string name="home_room_card_topic_empty_def">歡迎來到我的房間</string>
|
||||||
</resources>
|
</resources>
|
@@ -3198,7 +3198,7 @@
|
|||||||
<string name="layout_dialog_patriarch_mode_01">青少年保護</string>
|
<string name="layout_dialog_patriarch_mode_01">青少年保護</string>
|
||||||
<string name="layout_dialog_pk_result_01">拉拉</string>
|
<string name="layout_dialog_pk_result_01">拉拉</string>
|
||||||
<string name="layout_dialog_pk_result_02">· 紅隊勝利 ·</string>
|
<string name="layout_dialog_pk_result_02">· 紅隊勝利 ·</string>
|
||||||
<string name="layout_dialog_pk_result_03">查看藍隊戰績</string>
|
<string name="layout_dialog_pk_result_03">查看藍隊戰績></string>
|
||||||
<string name="layout_dialog_privacy_agreement_01">同意</string>
|
<string name="layout_dialog_privacy_agreement_01">同意</string>
|
||||||
<string name="layout_dialog_privacy_agreement_02">不同意並退出</string>
|
<string name="layout_dialog_privacy_agreement_02">不同意並退出</string>
|
||||||
<string name="layout_dialog_protocol_update_01">用戶協議</string>
|
<string name="layout_dialog_protocol_update_01">用戶協議</string>
|
||||||
@@ -5240,4 +5240,7 @@
|
|||||||
<string name="start_pk">開始PK</string>
|
<string name="start_pk">開始PK</string>
|
||||||
<string name="send_gift_to_self_tips">试试给其他人送出您的心意吧~</string>
|
<string name="send_gift_to_self_tips">试试给其他人送出您的心意吧~</string>
|
||||||
<string name="send_gift_tab_title">送禮</string>
|
<string name="send_gift_tab_title">送禮</string>
|
||||||
|
<string name="level_up_wear_dress_tips_format">恭喜你成為「%s」!當前已自動佩戴該等級裝扮,是否保留原有裝扮?</string>
|
||||||
|
<string name="home_room_card_topic_empty_def">歡迎來到我的房間</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@@ -5279,6 +5279,8 @@ You cannot join again within 24 hours after leaving</string>
|
|||||||
<string name="start_pk">Start PK</string>
|
<string name="start_pk">Start PK</string>
|
||||||
<string name="send_gift_to_self_tips">Try giving gifts to other people~</string>
|
<string name="send_gift_to_self_tips">Try giving gifts to other people~</string>
|
||||||
<string name="send_gift_tab_title">Gift</string>
|
<string name="send_gift_tab_title">Gift</string>
|
||||||
|
<string name="level_up_wear_dress_tips_format">恭喜你成為「%s」!當前已自動佩戴該等級裝扮,是否保留原有裝扮?</string>
|
||||||
|
<string name="home_room_card_topic_empty_def">歡迎來到我的房間</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user