我的tab UI修改
This commit is contained in:
85
app/src/main/java/com/yizhuan/erban/home/MeViewModel.kt
Normal file
85
app/src/main/java/com/yizhuan/erban/home/MeViewModel.kt
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
package com.yizhuan.erban.home
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.yizhuan.erban.base.BaseViewModel
|
||||||
|
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||||
|
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
||||||
|
import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo
|
||||||
|
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||||
|
|
||||||
|
class MeViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
private val _bannerLiveData = MutableLiveData<List<BannerInfo>>()
|
||||||
|
val bannerLiveData: LiveData<List<BannerInfo>> = _bannerLiveData
|
||||||
|
|
||||||
|
private val _meCenterInfoLiveData = MutableLiveData<List<List<MeCenterInfo>>>()
|
||||||
|
val meCenterInfoLiveData: LiveData<List<List<MeCenterInfo>>> = _meCenterInfoLiveData
|
||||||
|
|
||||||
|
private val _gameInfoListLiveData = MutableLiveData<List<List<GameInfo>>>()
|
||||||
|
val gameInfoListLiveData: LiveData<List<List<GameInfo>>> = _gameInfoListLiveData
|
||||||
|
|
||||||
|
init {
|
||||||
|
getBannerInfo()
|
||||||
|
requestMeCenterInfoList()
|
||||||
|
getGameList()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBannerInfo() {
|
||||||
|
safeLaunch(
|
||||||
|
block = {
|
||||||
|
_bannerLiveData.value = HomeModel.getHomeBanner("10")
|
||||||
|
},
|
||||||
|
onError = {
|
||||||
|
_bannerLiveData.value = null
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun requestMeCenterInfoList() {
|
||||||
|
safeLaunch(
|
||||||
|
block = {
|
||||||
|
_meCenterInfoLiveData.value = transformList(HomeModel.requestMeCenterInfoList(), 4)
|
||||||
|
},
|
||||||
|
onError = {
|
||||||
|
_meCenterInfoLiveData.value = null
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getGameList() {
|
||||||
|
safeLaunch(
|
||||||
|
block = {
|
||||||
|
_gameInfoListLiveData.value = transformList(HomeModel.getGameList(), 4)
|
||||||
|
},
|
||||||
|
onError = {
|
||||||
|
_gameInfoListLiveData.value = null
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun <T> transformList(
|
||||||
|
data: List<T>?,
|
||||||
|
pageSize: Int
|
||||||
|
): List<List<T>> {
|
||||||
|
val result: MutableList<MutableList<T>> = ArrayList()
|
||||||
|
if (data.isNullOrEmpty()) {
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
for (i in data.indices) {
|
||||||
|
var page: MutableList<T>? = null
|
||||||
|
if (i % pageSize == 0) {
|
||||||
|
page = ArrayList()
|
||||||
|
result.add(page)
|
||||||
|
} else {
|
||||||
|
if (result.size > 0) {
|
||||||
|
page = result[result.size - 1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
page?.add(data[i])
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
package com.yizhuan.erban.home.adapter
|
||||||
|
|
||||||
|
import android.widget.ImageView
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.ui.utils.load
|
||||||
|
import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo
|
||||||
|
|
||||||
|
|
||||||
|
class MeCenterAdapter :
|
||||||
|
BaseQuickAdapter<MeCenterInfo, BaseViewHolder>(R.layout.item_me_center) {
|
||||||
|
|
||||||
|
override fun convert(helper: BaseViewHolder, item: MeCenterInfo) {
|
||||||
|
|
||||||
|
helper.getView<ImageView>(R.id.iv_pic).load(item.centerPic)
|
||||||
|
helper.setText(R.id.tv_name, item.centerName)
|
||||||
|
helper.itemView.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,19 @@
|
|||||||
|
package com.yizhuan.erban.home.adapter
|
||||||
|
|
||||||
|
import android.widget.ImageView
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.ui.utils.load
|
||||||
|
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||||
|
|
||||||
|
|
||||||
|
class MeGameAdapter :
|
||||||
|
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_me_game) {
|
||||||
|
|
||||||
|
override fun convert(helper: BaseViewHolder, item: GameInfo) {
|
||||||
|
helper.getView<ImageView>(R.id.iv_pic).load(item.pic)
|
||||||
|
helper.setText(R.id.tv_name, item.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1,376 +1,374 @@
|
|||||||
package com.yizhuan.erban.home.fragment;
|
package com.yizhuan.erban.home.fragment
|
||||||
|
|
||||||
import static com.yizhuan.erban.skill.activity.SkillHomeActivity.PAGE_TYPE_SELF;
|
import android.annotation.SuppressLint
|
||||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_HADEXPIRE;
|
import android.content.Intent
|
||||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE;
|
import android.text.TextUtils
|
||||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
import android.util.SparseArray
|
||||||
|
import android.view.View
|
||||||
import android.annotation.SuppressLint;
|
import android.view.ViewGroup
|
||||||
import android.content.Intent;
|
import androidx.databinding.DataBindingUtil
|
||||||
import android.os.Bundle;
|
import androidx.fragment.app.viewModels
|
||||||
import android.text.TextUtils;
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import android.view.View;
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import androidx.viewpager.widget.PagerAdapter
|
||||||
import androidx.annotation.Nullable;
|
import com.yizhuan.erban.R
|
||||||
import androidx.databinding.DataBindingUtil;
|
import com.yizhuan.erban.UIHelper
|
||||||
|
import com.yizhuan.erban.base.BaseFragment
|
||||||
import com.yizhuan.erban.MainActivity;
|
import com.yizhuan.erban.databinding.FragmentMeBinding
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.home.MeViewModel
|
||||||
import com.yizhuan.erban.UIHelper;
|
import com.yizhuan.erban.home.adapter.MeCenterAdapter
|
||||||
import com.yizhuan.erban.base.BaseFragment;
|
import com.yizhuan.erban.home.adapter.MeGameAdapter
|
||||||
import com.yizhuan.erban.databinding.FragmentMeBinding;
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
import com.yizhuan.erban.decoration.view.MyDecorationActivity;
|
import com.yizhuan.erban.skill.activity.SkillHomeActivity
|
||||||
import com.yizhuan.erban.fansteam.FansTeamListActivity;
|
import com.yizhuan.erban.skill.activity.SkillHomeActivity.Companion.start
|
||||||
import com.yizhuan.erban.home.activity.CollectionRoomActivity;
|
import com.yizhuan.erban.ui.relation.AttentionListActivity
|
||||||
import com.yizhuan.erban.home.activity.VisitorListActivity;
|
import com.yizhuan.erban.ui.relation.FansListActivity
|
||||||
import com.yizhuan.erban.home.helper.OpenRoomHelper;
|
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||||
import com.yizhuan.erban.module_hall.HallDataManager;
|
import com.yizhuan.erban.ui.widget.OnPageSelectedListener
|
||||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity;
|
import com.yizhuan.erban.vip.VipHelper
|
||||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity;
|
import com.yizhuan.erban.vip.VipMainActivity.Companion.start
|
||||||
import com.yizhuan.erban.relation.cp.activity.CpHomeActivity;
|
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||||
import com.yizhuan.erban.skill.activity.SkillHomeActivity;
|
import com.yizhuan.xchat_android_core.home.event.VisitorUnreadCountEvent
|
||||||
import com.yizhuan.erban.ui.patriarch.PatriarchModeActivity;
|
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment
|
||||||
import com.yizhuan.erban.ui.pay.ChargeActivity;
|
import com.yizhuan.xchat_android_core.level.UserLevelVo
|
||||||
import com.yizhuan.erban.ui.relation.AttentionListActivity;
|
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager
|
||||||
import com.yizhuan.erban.ui.relation.FansListActivity;
|
import com.yizhuan.xchat_android_core.manager.RelationShipEvent
|
||||||
import com.yizhuan.erban.ui.setting.ScheduleManageActivity;
|
import com.yizhuan.xchat_android_core.noble.NobleProtocol
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
import com.yizhuan.xchat_android_core.noble.NobleUtil
|
||||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo
|
||||||
import com.yizhuan.erban.ui.widget.higuide.TuTuGuideHelper;
|
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||||
import com.yizhuan.erban.vip.VipHelper;
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
||||||
import com.yizhuan.erban.vip.VipMainActivity;
|
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
||||||
import com.yizhuan.xchat_android_core.DemoCache;
|
import com.yizhuan.xchat_android_core.user.UserModel
|
||||||
import com.yizhuan.xchat_android_core.UriProvider;
|
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent
|
||||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
import com.yizhuan.xchat_android_core.utils.StarUtils
|
||||||
import com.yizhuan.xchat_android_core.home.event.VisitorUnreadCountEvent;
|
import com.yizhuan.xchat_android_library.rxbus.RxBusHelper
|
||||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
import org.greenrobot.eventbus.EventBus
|
||||||
import com.yizhuan.xchat_android_core.manager.RelationShipEvent;
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleProtocol;
|
import java.util.*
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
|
||||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
|
||||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
|
||||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
|
||||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
|
||||||
import com.yizhuan.xchat_android_core.utils.StarUtils;
|
|
||||||
import com.yizhuan.xchat_android_library.rxbus.RxBusHelper;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 我的 界面
|
* @description: 我的 界面
|
||||||
* @author: hewenhao
|
* @author: hewenhao
|
||||||
* @date: 2018/9/4 16:53
|
* @date: 2018/9/4 16:53
|
||||||
*/
|
*/
|
||||||
public class MeFragment extends BaseFragment implements View.OnClickListener {
|
class MeFragment : BaseFragment(), View.OnClickListener {
|
||||||
|
|
||||||
public static final String TAG = "MeFragment";
|
companion object {
|
||||||
private static final String HAS_SHOW_GUIDE = "has_show_guide";
|
const val TAG = "MeFragment"
|
||||||
|
|
||||||
private UserInfo mUserInfo;
|
|
||||||
private FragmentMeBinding mBinding;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRootLayoutId() {
|
|
||||||
return R.layout.fragment_me;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private var mUserInfo: UserInfo? = null
|
||||||
public void onSetListener() {
|
private lateinit var mBinding: FragmentMeBinding
|
||||||
mBinding = DataBindingUtil.bind(mView);
|
private val meViewModel: MeViewModel by viewModels()
|
||||||
if (mBinding != null) {
|
override fun getRootLayoutId(): Int {
|
||||||
mBinding.setClick(this);
|
return R.layout.fragment_me
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
override fun onSetListener() {
|
||||||
public void onDestroy() {
|
mBinding = DataBindingUtil.bind(mView)!!
|
||||||
super.onDestroy();
|
mBinding.click = this
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
override fun onDestroy() {
|
||||||
public void initiate() {
|
super.onDestroy()
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().unregister(this)
|
||||||
RxBusHelper.doOnMainThread(NobleProtocol.class, mCompositeDisposable, nobleProtocol -> {
|
}
|
||||||
int second = nobleProtocol.getSecond();
|
|
||||||
if (second == CUSTOM_MESS_SUB_OPENNOBLE || second == CUSTOM_MESS_SUB_RENEWNOBLE) {
|
@SuppressLint("CheckResult")
|
||||||
requestUpdateUserInfo();
|
override fun initiate() {
|
||||||
} else if (second == CUSTOM_MESS_SUB_HADEXPIRE) {
|
EventBus.getDefault().register(this)
|
||||||
mBinding.ivUserNobleLevel.setVisibility(View.GONE);
|
RxBusHelper.doOnMainThread(
|
||||||
mBinding.ivAvatarHeadWear.setVisibility(View.GONE);
|
NobleProtocol::class.java,
|
||||||
|
mCompositeDisposable
|
||||||
|
) { nobleProtocol: NobleProtocol ->
|
||||||
|
val second = nobleProtocol.second
|
||||||
|
if (second == CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE || second == CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE) {
|
||||||
|
requestUpdateUserInfo()
|
||||||
|
} else if (second == CustomAttachment.CUSTOM_MESS_SUB_HADEXPIRE) {
|
||||||
|
mBinding.ivUserNobleLevel.visibility = View.GONE
|
||||||
|
mBinding.ivAvatarHeadWear.visibility = View.GONE
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
mCompositeDisposable.add(
|
mCompositeDisposable.add(
|
||||||
IMNetEaseManager.get().getRelationShipEventObservable().subscribe(e -> onGetRelationShipEvent(e))
|
IMNetEaseManager.get()
|
||||||
);
|
.relationShipEventObservable
|
||||||
|
.subscribe { e: RelationShipEvent ->
|
||||||
//模厅
|
onGetRelationShipEvent(e)
|
||||||
HallDataManager.get().registerHallExist(this, hallExist -> {
|
|
||||||
if (HallDataManager.get().isClanElder()) {
|
|
||||||
mBinding.meItemLinkRoom.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
mBinding.meItemLinkRoom.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if ((hallExist != null && hallExist) || HallDataManager.get().isHasClan()) {
|
|
||||||
mBinding.meItemUnion.setText("我的公会");
|
|
||||||
mBinding.meItemUnion.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
mBinding.meItemUnion.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (TuTuGuideHelper.isNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_ME_TAB)) {
|
|
||||||
mBinding.meItemRadish.post(() -> {
|
|
||||||
if (getActivity() != null && getActivity() instanceof MainActivity) {
|
|
||||||
if (!((MainActivity) getActivity()).isShowMeTab()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
TuTuGuideHelper helper = new TuTuGuideHelper(mContext);
|
|
||||||
helper.createHiGuide(() -> helper.createMeTabOverLayer(mBinding.meItemRadish));
|
|
||||||
TuTuGuideHelper.setNoNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_ME_TAB);
|
|
||||||
}
|
}
|
||||||
});
|
)
|
||||||
|
|
||||||
|
meViewModel.bannerLiveData.observe(viewLifecycleOwner) {
|
||||||
|
BannerHelper.setBanner(mBinding.rollView, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
showGuideView();
|
meViewModel.gameInfoListLiveData.observe(viewLifecycleOwner) {
|
||||||
|
setGameInfoData(it)
|
||||||
if (DemoCache.readBoolean(DemoCache.KEY_VIP_RED_POINT, true)) {
|
|
||||||
mBinding.viewVipRedPoint.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meViewModel.meCenterInfoLiveData.observe(viewLifecycleOwner) {
|
||||||
|
setCenterInfoData(it)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showGuideView() {
|
private fun setCenterInfoData(pagerList: List<List<MeCenterInfo>?>) {
|
||||||
final boolean hasShowGuid = (boolean) SharedPreferenceUtils.get(HAS_SHOW_GUIDE, false);
|
if (ListUtils.isListEmpty(pagerList)) {
|
||||||
if (!hasShowGuid) {
|
return
|
||||||
SharedPreferenceUtils.put(HAS_SHOW_GUIDE, true);
|
|
||||||
mBinding.groupGuide.setVisibility(View.VISIBLE);
|
|
||||||
mBinding.ivOverlayGuide.setOnClickListener(v -> {
|
|
||||||
mBinding.groupGuide.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
mBinding.magicIndicatorEntrance.initIndicator(pagerList.size)
|
||||||
|
mBinding.magicIndicatorEntrance.setSelectedPage(0)
|
||||||
|
mBinding.magicIndicatorEntrance.visibility =
|
||||||
|
if (pagerList.size > 1) View.VISIBLE else View.INVISIBLE
|
||||||
|
val cacheItemView = SparseArray<RecyclerView>()
|
||||||
|
mBinding.viewPagerEntrance.adapter = object : PagerAdapter() {
|
||||||
|
override fun getCount(): Int {
|
||||||
|
return pagerList.size
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun isViewFromObject(view: View, any: Any): Boolean {
|
||||||
|
return view === any
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun instantiateItem(container: ViewGroup, pagePos: Int): Any {
|
||||||
|
val recyclerView: RecyclerView
|
||||||
|
val giftAdapter: MeCenterAdapter?
|
||||||
|
if (cacheItemView[pagePos] == null) {
|
||||||
|
recyclerView = RecyclerView(requireContext())
|
||||||
|
recyclerView.layoutParams = ViewGroup.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
recyclerView.layoutManager = GridLayoutManager(context, 4)
|
||||||
|
giftAdapter = MeCenterAdapter()
|
||||||
|
recyclerView.adapter = giftAdapter
|
||||||
|
cacheItemView.put(pagePos, recyclerView)
|
||||||
|
} else {
|
||||||
|
recyclerView = cacheItemView[pagePos]
|
||||||
|
giftAdapter = recyclerView.adapter as MeCenterAdapter
|
||||||
|
}
|
||||||
|
giftAdapter.setNewData(pagerList[pagePos])
|
||||||
|
container.addView(recyclerView)
|
||||||
|
return recyclerView
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun destroyItem(container: ViewGroup, position: Int, any: Any) {
|
||||||
|
val recyclerView = cacheItemView[position]
|
||||||
|
container.removeView(recyclerView)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mBinding.viewPagerEntrance.addOnPageChangeListener(object : OnPageSelectedListener() {
|
||||||
|
override fun onPageSelected(position: Int) {
|
||||||
|
if (pagerList.size > 1) {
|
||||||
|
mBinding.magicIndicatorEntrance.setSelectedPage(position)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onGetRelationShipEvent(RelationShipEvent event) {
|
private fun setGameInfoData(pagerList: List<List<GameInfo>?>) {
|
||||||
|
if (ListUtils.isListEmpty(pagerList)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mBinding.magicIndicatorGame.initIndicator(pagerList.size)
|
||||||
|
mBinding.magicIndicatorGame.setSelectedPage(0)
|
||||||
|
mBinding.magicIndicatorGame.visibility =
|
||||||
|
if (pagerList.size > 1) View.VISIBLE else View.INVISIBLE
|
||||||
|
val cacheItemView = SparseArray<RecyclerView>()
|
||||||
|
mBinding.viewPagerGame.adapter = object : PagerAdapter() {
|
||||||
|
override fun getCount(): Int {
|
||||||
|
return pagerList.size
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun isViewFromObject(view: View, any: Any): Boolean {
|
||||||
|
return view === any
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun instantiateItem(container: ViewGroup, pagePos: Int): Any {
|
||||||
|
val recyclerView: RecyclerView
|
||||||
|
val giftAdapter: MeGameAdapter?
|
||||||
|
if (cacheItemView[pagePos] == null) {
|
||||||
|
recyclerView = RecyclerView(requireContext())
|
||||||
|
recyclerView.layoutParams = ViewGroup.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
recyclerView.layoutManager = GridLayoutManager(context, 4)
|
||||||
|
giftAdapter = MeGameAdapter()
|
||||||
|
recyclerView.adapter = giftAdapter
|
||||||
|
cacheItemView.put(pagePos, recyclerView)
|
||||||
|
} else {
|
||||||
|
recyclerView = cacheItemView[pagePos]
|
||||||
|
giftAdapter = recyclerView.adapter as MeGameAdapter
|
||||||
|
}
|
||||||
|
giftAdapter.setNewData(pagerList[pagePos])
|
||||||
|
container.addView(recyclerView)
|
||||||
|
return recyclerView
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun destroyItem(container: ViewGroup, position: Int, any: Any) {
|
||||||
|
val recyclerView = cacheItemView[position]
|
||||||
|
container.removeView(recyclerView)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mBinding.viewPagerGame.addOnPageChangeListener(object : OnPageSelectedListener() {
|
||||||
|
override fun onPageSelected(position: Int) {
|
||||||
|
if (pagerList.size > 1) {
|
||||||
|
mBinding.magicIndicatorGame.setSelectedPage(position)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun onGetRelationShipEvent(event: RelationShipEvent) {
|
||||||
if (event.event == RelationShipEvent.EVENT_FRIEND_UPDATE) {
|
if (event.event == RelationShipEvent.EVENT_FRIEND_UPDATE) {
|
||||||
requestUpdateUserInfo();
|
requestUpdateUserInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
override fun onResume() {
|
||||||
public void onResume() {
|
super.onResume()
|
||||||
super.onResume();
|
initUserDate()
|
||||||
initUserDate();
|
|
||||||
// 每次页面重新可见的时候,如果处于审核状态,都尝试刷新拿取最新信息
|
// 每次页面重新可见的时候,如果处于审核状态,都尝试刷新拿取最新信息
|
||||||
// 不算是一个多好的做法,但是 it works
|
// 不算是一个多好的做法,但是 it works
|
||||||
// 不算频繁,可以接受
|
// 不算频繁,可以接受
|
||||||
if (mUserInfo != null && mUserInfo.isReview()) {
|
if (mUserInfo?.isReview == true) {
|
||||||
requestUpdateUserInfo();
|
requestUpdateUserInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initUserDate() {
|
private fun initUserDate() {
|
||||||
mUserInfo = UserModel.get().getCacheLoginUserInfo();
|
mUserInfo = UserModel.get().cacheLoginUserInfo
|
||||||
setUserData();
|
setUserData()
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUserData() {
|
private fun setUserData() {
|
||||||
if (mUserInfo != null) {
|
mUserInfo?.let {
|
||||||
mBinding.setUserInfo(mUserInfo);
|
mBinding.userInfo = mUserInfo
|
||||||
|
mBinding.tvUserId.text = String.format(
|
||||||
mBinding.tvUserId.setText(String.format(Locale.getDefault(),
|
Locale.getDefault(),
|
||||||
getString(R.string.text_user_id), String.valueOf(mUserInfo.getErbanNo())));
|
getString(R.string.text_user_id), it.erbanNo.toString()
|
||||||
|
)
|
||||||
NobleInfo nobleInfo = mUserInfo.getNobleInfo();
|
val nobleInfo = it.nobleInfo
|
||||||
HeadWearInfo headWearInfo = mUserInfo.getUserHeadwear();
|
val headWearInfo = it.userHeadwear
|
||||||
if (headWearInfo != null) {
|
if (headWearInfo != null) {
|
||||||
mBinding.ivAvatarHeadWear.setImageDrawable(null);
|
mBinding.ivAvatarHeadWear.setImageDrawable(null)
|
||||||
if (nobleInfo != null) {
|
if (nobleInfo != null) {
|
||||||
mBinding.ivUserNobleLevel.setVisibility(View.VISIBLE);
|
mBinding.ivUserNobleLevel.visibility = View.VISIBLE
|
||||||
NobleUtil.loadResource(NobleUtil.getBadgeByLevel(nobleInfo.getLevel()), mBinding.ivUserNobleLevel);
|
NobleUtil.loadResource(
|
||||||
|
NobleUtil.getBadgeByLevel(nobleInfo.level),
|
||||||
|
mBinding.ivUserNobleLevel
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
mBinding.ivUserNobleLevel.setVisibility(View.GONE);
|
mBinding.ivUserNobleLevel.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
NobleUtil.loadHeadWear(
|
||||||
NobleUtil.loadHeadWear(headWearInfo.getEffect() != null ? headWearInfo.getEffect() : headWearInfo.getPic(), mBinding.ivAvatarHeadWear);
|
if (headWearInfo.effect != null) headWearInfo.effect else headWearInfo.pic,
|
||||||
|
mBinding.ivAvatarHeadWear
|
||||||
|
)
|
||||||
} else if (nobleInfo != null) {
|
} else if (nobleInfo != null) {
|
||||||
mBinding.ivUserNobleLevel.setVisibility(View.VISIBLE);
|
mBinding.ivUserNobleLevel.visibility = View.VISIBLE
|
||||||
NobleUtil.loadResource(NobleUtil.getBadgeByLevel(nobleInfo.getLevel()), mBinding.ivUserNobleLevel);
|
NobleUtil.loadResource(
|
||||||
mBinding.ivAvatarHeadWear.setImageDrawable(null);
|
NobleUtil.getBadgeByLevel(nobleInfo.level),
|
||||||
NobleUtil.loadResource(nobleInfo.getHeadWear(), mBinding.ivAvatarHeadWear);
|
mBinding.ivUserNobleLevel
|
||||||
|
)
|
||||||
|
mBinding.ivAvatarHeadWear.setImageDrawable(null)
|
||||||
|
NobleUtil.loadResource(nobleInfo.headWear, mBinding.ivAvatarHeadWear)
|
||||||
} else {
|
} else {
|
||||||
mBinding.ivAvatarHeadWear.setImageDrawable(null);
|
mBinding.ivAvatarHeadWear.setImageDrawable(null)
|
||||||
mBinding.ivUserNobleLevel.setVisibility(View.GONE);
|
mBinding.ivUserNobleLevel.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
val star = StarUtils.getConstellation(Date(it.birth))
|
||||||
String star = StarUtils.getConstellation(new Date(mUserInfo.getBirth()));
|
mBinding.tvConstellation.text = star
|
||||||
mBinding.tvConstellation.setText(star);
|
setUserLevel(it.userLevelVo)
|
||||||
setUserLevel(mUserInfo.getUserLevelVo());
|
VipHelper.loadVipIcon(mBinding.ivVipIcon, it.userVipInfoVO)
|
||||||
|
if (it.userVipInfoVO == null || it.userVipInfoVO.vipLevel == 0) {
|
||||||
VipHelper.loadVipIcon(mBinding.ivVipIcon, mUserInfo.getUserVipInfoVO());
|
mBinding.tvVipDesc.text = "开通贵族立享各项特权>>"
|
||||||
if (mUserInfo.getUserVipInfoVO() == null || mUserInfo.getUserVipInfoVO().getVipLevel() == 0) {
|
|
||||||
mBinding.meItemVip.setText("开通贵族立享各项特权>>");
|
|
||||||
} else {
|
} else {
|
||||||
mBinding.meItemVip.setText("查看我的特权>>");
|
mBinding.tvVipDesc.text = "查看我的特权>>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUserLevel(UserLevelVo userLevelVo) {
|
private fun setUserLevel(userLevelVo: UserLevelVo?) {
|
||||||
mBinding.ivUserCharm.setVisibility(View.GONE);
|
mBinding.ivUserCharm.visibility = View.GONE
|
||||||
mBinding.ivUserLevel.setVisibility(View.GONE);
|
mBinding.ivUserLevel.visibility = View.GONE
|
||||||
if (userLevelVo != null) {
|
if (userLevelVo != null) {
|
||||||
String userLevelUrl = userLevelVo.getExperUrl();
|
val userLevelUrl = userLevelVo.getExperUrl()
|
||||||
String userCharmUrl = userLevelVo.getCharmUrl();
|
val userCharmUrl = userLevelVo.getCharmUrl()
|
||||||
if (!TextUtils.isEmpty(userLevelUrl)) {
|
if (!TextUtils.isEmpty(userLevelUrl)) {
|
||||||
mBinding.ivUserLevel.setVisibility(View.VISIBLE);
|
mBinding.ivUserLevel.visibility = View.VISIBLE
|
||||||
ImageLoadUtils.loadImage(mContext, userLevelUrl, mBinding.ivUserLevel);
|
ImageLoadUtils.loadImage(mContext, userLevelUrl, mBinding.ivUserLevel)
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(userCharmUrl)) {
|
if (!TextUtils.isEmpty(userCharmUrl)) {
|
||||||
mBinding.ivUserCharm.setVisibility(View.VISIBLE);
|
mBinding.ivUserCharm.visibility = View.VISIBLE
|
||||||
ImageLoadUtils.loadImage(mContext, userCharmUrl, mBinding.ivUserCharm);
|
ImageLoadUtils.loadImage(mContext, userCharmUrl, mBinding.ivUserCharm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onLoginUserInfoUpdateEvent(LoginUserInfoUpdateEvent event) {
|
fun onLoginUserInfoUpdateEvent(event: LoginUserInfoUpdateEvent?) {
|
||||||
mUserInfo = UserModel.get().getCacheLoginUserInfo();
|
mUserInfo = UserModel.get().cacheLoginUserInfo
|
||||||
setUserData();
|
setUserData()
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||||
public void onVisitorUnreadCountEvent(VisitorUnreadCountEvent event) {
|
fun onVisitorUnreadCountEvent(event: VisitorUnreadCountEvent?) {
|
||||||
if (mBinding == null) return;
|
/* if (mBinding == null) return;
|
||||||
if (event.getVisitNum() == 0) {
|
if (event.getVisitNum() == 0) {
|
||||||
mBinding.tvRedDot.setVisibility(View.GONE);
|
mBinding.tvRedDot.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
mBinding.tvRedDot.setVisibility(View.VISIBLE);
|
mBinding.tvRedDot.setVisibility(View.VISIBLE);
|
||||||
mBinding.tvRedDot.setText(event.getVisitNum() > 99 ? "99+" : String.valueOf(event.getVisitNum()));
|
mBinding.tvRedDot.setText(event.getVisitNum() > 99 ? "99+" : String.valueOf(event.getVisitNum()));
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void requestUpdateUserInfo() {
|
private fun requestUpdateUserInfo() {
|
||||||
if (mUserInfo != null) {
|
if (mUserInfo != null) {
|
||||||
UserModel.get().updateCurrentUserInfo().subscribe();
|
UserModel.get().updateCurrentUserInfo().subscribe()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
override fun onClick(v: View) {
|
||||||
public void onClick(View v) {
|
val id = v.id
|
||||||
int id = v.getId();
|
when (id) {
|
||||||
switch (id) {
|
R.id.iv_user_head, R.id.rl_user_info ->
|
||||||
case R.id.iv_user_head:
|
mUserInfo?.let { UIHelper.showUserInfoAct(mContext, it.uid) }
|
||||||
case R.id.rl_user_info:
|
R.id.iv_edit ->
|
||||||
if (mUserInfo != null) {
|
mUserInfo?.let { UIHelper.showUserInfoModifyAct(mContext, it.uid) }
|
||||||
UIHelper.showUserInfoAct(mContext, mUserInfo.getUid());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.iv_edit:
|
R.id.tv_user_attentions, R.id.tv_user_attention_text -> startActivity(
|
||||||
if (mUserInfo != null) {
|
Intent(
|
||||||
UIHelper.showUserInfoModifyAct(mContext, mUserInfo.getUid());
|
mContext,
|
||||||
}
|
AttentionListActivity::class.java
|
||||||
break;
|
)
|
||||||
|
)
|
||||||
case R.id.tv_user_attentions:
|
R.id.tv_user_fans, R.id.tv_user_fan_text -> startActivity(
|
||||||
case R.id.tv_user_attention_text:
|
Intent(
|
||||||
startActivity(new Intent(mContext, AttentionListActivity.class));
|
mContext,
|
||||||
break;
|
FansListActivity::class.java
|
||||||
|
)
|
||||||
case R.id.tv_user_fans:
|
)
|
||||||
case R.id.tv_user_fan_text:
|
R.id.me_item_setting -> UIHelper.showSettingAct(mContext)
|
||||||
startActivity(new Intent(mContext, FansListActivity.class));
|
R.id.me_item_vip -> {
|
||||||
break;
|
start(mContext)
|
||||||
|
|
||||||
case R.id.ll_my_room:
|
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ME_INTO_MY_ROOM_CLICK, "我页_进入我的房间");
|
|
||||||
OpenRoomHelper.openRoom(getBaseActivity());
|
|
||||||
break;
|
|
||||||
case R.id.ll_collect_room:
|
|
||||||
CollectionRoomActivity.start(mContext);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_radish:
|
|
||||||
startActivity(new Intent(mContext, ChargeActivity.class));
|
|
||||||
break;
|
|
||||||
case R.id.me_item_level:
|
|
||||||
CommonWebViewActivity.start(mContext, UriProvider.getUserLevelUrl());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_decoration_store:
|
|
||||||
startActivity(new Intent(mContext, MyDecorationActivity.class));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_union:
|
|
||||||
if (HallDataManager.get().isHasClan()) {
|
|
||||||
ModuleClanActivity.start(mContext);
|
|
||||||
} else {
|
|
||||||
ModuleHallActivity.start(mContext);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_patriarch:
|
|
||||||
startActivity(new Intent(getActivity(), PatriarchModeActivity.class));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_certification:
|
|
||||||
// 跳去实名认证页面
|
|
||||||
CommonWebViewActivity.start(mContext,
|
|
||||||
UriProvider.getTutuRealNamePage());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_setting:
|
|
||||||
UIHelper.showSettingAct(mContext);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.me_item_invite:
|
|
||||||
CommonWebViewActivity.start(mContext, UriProvider.getGameShareUrl());
|
|
||||||
break;
|
|
||||||
case R.id.me_item_link_room:
|
|
||||||
CommonWebViewActivity.start(mContext, UriProvider.getLinkRoomUrl());
|
|
||||||
break;
|
|
||||||
case R.id.me_item_vip:
|
|
||||||
VipMainActivity.start(mContext);
|
|
||||||
StatisticManager.Instance()
|
StatisticManager.Instance()
|
||||||
.onEvent(StatisticsProtocol.EVENT_VIP_ENTRANCE_ME_CLICK, "贵族我的入口点击事件");
|
.onEvent(StatisticsProtocol.EVENT_VIP_ENTRANCE_ME_CLICK, "贵族我的入口点击事件")
|
||||||
if (mBinding.viewVipRedPoint.getVisibility() == View.VISIBLE) {
|
}
|
||||||
DemoCache.saveBoolean(DemoCache.KEY_VIP_RED_POINT, false);
|
R.id.me_item_skill -> start(
|
||||||
mBinding.viewVipRedPoint.setVisibility(View.GONE);
|
mContext,
|
||||||
}
|
SkillHomeActivity.PAGE_TYPE_SELF,
|
||||||
break;
|
AuthModel.get().currentUid
|
||||||
case R.id.me_item_schedule:
|
)
|
||||||
ScheduleManageActivity.Companion.start(mContext);
|
else -> {}
|
||||||
break;
|
|
||||||
case R.id.me_item_skill:
|
|
||||||
SkillHomeActivity.Companion.start(mContext, PAGE_TYPE_SELF, AuthModel.get().getCurrentUid());
|
|
||||||
break;
|
|
||||||
case R.id.me_item_visitor:
|
|
||||||
EventBus.getDefault().postSticky(new VisitorUnreadCountEvent(0));
|
|
||||||
VisitorListActivity.start(mContext);
|
|
||||||
break;
|
|
||||||
case R.id.me_item_relation:
|
|
||||||
CpHomeActivity.Companion.start(mContext);
|
|
||||||
break;
|
|
||||||
case R.id.me_item_fans_team:
|
|
||||||
FansTeamListActivity.start(mContext);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -0,0 +1,133 @@
|
|||||||
|
package com.yizhuan.erban.home.widget;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import com.yizhuan.erban.R;
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by shichaohui on 2015/7/10 0010.
|
||||||
|
* <p/>
|
||||||
|
* 页码指示器类,获得此类实例后,可通过{@link MePageIndicatorView#initIndicator(int)}方法初始化指示器
|
||||||
|
* </P>
|
||||||
|
*/
|
||||||
|
public class MePageIndicatorView extends LinearLayout {
|
||||||
|
|
||||||
|
private Context mContext = null;
|
||||||
|
private int dotSize = 12; // 指示器的大小(dp)
|
||||||
|
private int height = 4; // 指示器的大小(dp)
|
||||||
|
private double margins = 0; // 指示器间距(dp)
|
||||||
|
private List<View> indicatorViews = null; // 存放指示器
|
||||||
|
private int selectRes = R.drawable.shape_me_indicator_visible;
|
||||||
|
private int noSelectRes = R.drawable.shape_me_indicator_invisible;
|
||||||
|
|
||||||
|
public void setSelectRes(int selectRes) {
|
||||||
|
this.selectRes = selectRes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoSelectRes(int noSelectRes) {
|
||||||
|
this.noSelectRes = noSelectRes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MePageIndicatorView(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MePageIndicatorView(Context context, AttributeSet attrs) {
|
||||||
|
this(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MePageIndicatorView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
init(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
|
||||||
|
setGravity(Gravity.CENTER);
|
||||||
|
setOrientation(HORIZONTAL);
|
||||||
|
|
||||||
|
dotSize = UIUtil.dip2px(context, dotSize);
|
||||||
|
height = UIUtil.dip2px(context, height);
|
||||||
|
margins = UIUtil.dip2px(context, (float) margins);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDotSize(int dotSize) {
|
||||||
|
this.dotSize = dotSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeight(int height) {
|
||||||
|
this.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化指示器,默认选中第一页
|
||||||
|
*
|
||||||
|
* @param count 指示器数量,即页数
|
||||||
|
*/
|
||||||
|
public void initIndicator(int count) {
|
||||||
|
if (indicatorViews == null) {
|
||||||
|
indicatorViews = new ArrayList<>();
|
||||||
|
}
|
||||||
|
indicatorViews.clear();
|
||||||
|
removeAllViews();
|
||||||
|
View view;
|
||||||
|
LayoutParams params = new LayoutParams(dotSize, height);
|
||||||
|
int margins = (int) this.margins;
|
||||||
|
params.setMargins(margins, margins, margins, margins);
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
view = new View(mContext);
|
||||||
|
view.setBackgroundResource(noSelectRes);
|
||||||
|
addView(view, params);
|
||||||
|
indicatorViews.add(view);
|
||||||
|
}
|
||||||
|
if (indicatorViews.size() > 0) {
|
||||||
|
indicatorViews.get(0).setBackgroundResource(selectRes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置选中页
|
||||||
|
*
|
||||||
|
* @param selected 页下标,从0开始
|
||||||
|
*/
|
||||||
|
public void setSelectedPage(int selected) {
|
||||||
|
for (int i = 0; i < indicatorViews.size(); i++) {
|
||||||
|
if (i == selected) {
|
||||||
|
indicatorViews.get(i).setBackgroundResource(selectRes);
|
||||||
|
} else {
|
||||||
|
indicatorViews.get(i).setBackgroundResource(noSelectRes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置选中页
|
||||||
|
*
|
||||||
|
* @param selected 页下标,从0开始
|
||||||
|
*/
|
||||||
|
public void setDifSelectedPage(int selected) {
|
||||||
|
for (int i = 0; i < indicatorViews.size(); i++) {
|
||||||
|
if (i == selected) {
|
||||||
|
LayoutParams params = new LayoutParams(dotSize, height);
|
||||||
|
int margins = (int) this.margins;
|
||||||
|
params.setMargins(margins, margins, margins, margins);
|
||||||
|
indicatorViews.get(i).setLayoutParams(params);
|
||||||
|
indicatorViews.get(i).setBackgroundResource(selectRes);
|
||||||
|
} else {
|
||||||
|
LayoutParams params = new LayoutParams(height, height);
|
||||||
|
indicatorViews.get(i).setLayoutParams(params);
|
||||||
|
indicatorViews.get(i).setBackgroundResource(noSelectRes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
app/src/main/res/drawable-xhdpi/bg_me_wallet_entrance.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_me_wallet_entrance.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 19 KiB |
10
app/src/main/res/drawable/shape_1a000_left_100dp.xml
Normal file
10
app/src/main/res/drawable/shape_1a000_left_100dp.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="#1a000000" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="100dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="100dp"
|
||||||
|
android:topRightRadius="0dp" />
|
||||||
|
</shape>
|
7
app/src/main/res/drawable/shape_me_indicator_bg.xml
Normal file
7
app/src/main/res/drawable/shape_me_indicator_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"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#1a000000" />
|
||||||
|
<corners android:radius="@dimen/dp_100" />
|
||||||
|
</shape>
|
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@color/transparent" />
|
||||||
|
</shape>
|
10
app/src/main/res/drawable/shape_me_indicator_visible.xml
Normal file
10
app/src/main/res/drawable/shape_me_indicator_visible.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#FFBC51" />
|
||||||
|
<size
|
||||||
|
android:width="@dimen/dp_12"
|
||||||
|
android:height="@dimen/dp_4" />
|
||||||
|
<corners android:radius="@dimen/dp_3" />
|
||||||
|
</shape>
|
@@ -18,7 +18,7 @@
|
|||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.ObservableScrollView
|
<ScrollView
|
||||||
android:id="@+id/scroll_view"
|
android:id="@+id/scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -27,40 +27,48 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:background="@drawable/bg_me_page">
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@drawable/bg_me_page"
|
||||||
|
app:layout_constraintDimensionRatio="750:672"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/me_item_setting"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@mipmap/icon_setting" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<!--个人信息-->
|
<!--个人信息-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/rl_user_info"
|
android:id="@+id/rl_user_info"
|
||||||
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_40"
|
|
||||||
android:onClick="@{click}"
|
android:onClick="@{click}"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toBottomOf="@id/me_item_setting">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/me_item_setting"
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:ignore="UseCompoundDrawables">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@mipmap/icon_setting"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<com.yizhuan.erban.common.widget.CircleImageView
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
android:id="@+id/iv_user_head"
|
android:id="@+id/iv_user_head"
|
||||||
@@ -68,7 +76,7 @@
|
|||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="@dimen/dp_20"
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
android:onClick="@{click}"
|
android:onClick="@{click}"
|
||||||
android:src="@drawable/default_avatar"
|
android:src="@drawable/default_avatar"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -238,486 +246,337 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginEnd="25dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/iv_avatar_head_wear"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/tv_user_attentions"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@{String.valueOf(userInfo.followNum)}"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="@dimen/sp_18"
|
|
||||||
tools:text="99999" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_user_attention_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/attention"
|
|
||||||
android:textColor="#4f516a"
|
|
||||||
android:textSize="@dimen/sp_11" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/tv_user_fans"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="30dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@{String.valueOf(userInfo.fansNum)}"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="@dimen/sp_18"
|
|
||||||
tools:text="99999" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_user_fan_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/fan"
|
|
||||||
android:textColor="#4f516a"
|
|
||||||
android:textSize="@dimen/sp_11" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_vip"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="13dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:background="@drawable/bg_vip_me_entrance"
|
|
||||||
android:gravity="center_vertical|end"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14sp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/rl_user_info"
|
|
||||||
tools:text="开通贵族立享各项特权>>" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/view_vip_red_point"
|
|
||||||
android:layout_width="8dp"
|
|
||||||
android:layout_height="8dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:background="@drawable/shap_red_point"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/me_item_vip"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/me_item_vip" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_option"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="15dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:background="@drawable/shape_add_friends_2a2a39"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/me_item_vip">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_radish"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
|
||||||
android:drawableTop="@mipmap/icon_mine_account"
|
|
||||||
android:drawablePadding="@dimen/dp_8"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="我的账户"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_schedule"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/dp_38"
|
|
||||||
android:drawableTop="@mipmap/icon_schedule_manage"
|
|
||||||
android:drawablePadding="@dimen/dp_8"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="赛程管理"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/me_item_skill"
|
android:id="@+id/me_item_skill"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="28dp"
|
||||||
android:layout_marginLeft="@dimen/dp_38"
|
android:background="@drawable/shape_1a000_left_100dp"
|
||||||
android:layout_marginRight="@dimen/dp_30"
|
android:drawableStart="@mipmap/icon_skill_card"
|
||||||
android:drawableTop="@mipmap/icon_skill_card"
|
android:drawablePadding="5dp"
|
||||||
android:drawablePadding="@dimen/dp_8"
|
android:gravity="center"
|
||||||
android:gravity="center_horizontal"
|
android:includeFontPadding="false"
|
||||||
android:onClick="@{click}"
|
android:onClick="@{click}"
|
||||||
android:paddingTop="15dp"
|
android:paddingStart="9dp"
|
||||||
android:paddingBottom="@dimen/dp_15"
|
android:paddingEnd="5dp"
|
||||||
android:text="技能卡"
|
android:text="技能卡"
|
||||||
android:textColor="@color/color_333333"
|
android:textColor="@color/color_333333"
|
||||||
android:textSize="14sp" />
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
</LinearLayout>
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_user_relation"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:layout_marginStart="10dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/ll_option">
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="4"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/rl_user_info">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/tv_user_attentions"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/dp_15"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/shape_add_friends_2a2a39"
|
android:gravity="center"
|
||||||
|
android:onClick="@{click}"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ll_my_room"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
android:maxLines="1"
|
||||||
android:drawableStart="@mipmap/ic_me_my_room"
|
android:text="@{String.valueOf(userInfo.followNum)}"
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="我的房间"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
android:textSize="14sp" />
|
android:textSize="@dimen/sp_20"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="999" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ll_collect_room"
|
android:id="@+id/tv_user_attention_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
android:text="@string/attention"
|
||||||
android:drawableStart="@mipmap/ic_me_collection"
|
android:textColor="@color/color_999999"
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
android:textSize="@dimen/sp_12" />
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="我的收藏"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_decoration_store"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_decoration"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_my_decoration"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_level"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_level"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_my_level"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_fans_team"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_fans_team"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="粉丝团"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_relation"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_relation"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_my_relation"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_wallet"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_wallet"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_my_income"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_union"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_union"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_my_union"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/me_item_visitor"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
tools:ignore="UseCompoundDrawables">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_visitor"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="访客记录"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_red_dot"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:layout_marginStart="115dp"
|
|
||||||
android:background="@drawable/shap_red_point"
|
|
||||||
android:gravity="center"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:minWidth="15dp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="11dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="9"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_invite"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_me_invite"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="推荐给好友"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_patriarch"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_patriarch"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/patriarch_mode"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_certification"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_certification"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_certification"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/me_item_link_room"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
|
||||||
android:drawableStart="@mipmap/icon_me_link_room"
|
|
||||||
android:drawableEnd="@drawable/arrow_right"
|
|
||||||
android:drawablePadding="13dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:paddingTop="@dimen/dp_15"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="@dimen/dp_15"
|
|
||||||
android:text="@string/menu_link_room"
|
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/tv_user_fans"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{String.valueOf(userInfo.fansNum)}"
|
||||||
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
|
android:textSize="@dimen/sp_20"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="999" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_user_fan_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/fan"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/tv_user_visitor"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{String.valueOf(userInfo.fansNum)}"
|
||||||
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
|
android:textSize="@dimen/sp_20"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="999" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_user_visitor_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="访客"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/tv_user_history"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@{String.valueOf(userInfo.fansNum)}"
|
||||||
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
|
android:textSize="@dimen/sp_20"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="999" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_user_history_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="足迹"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
<View
|
android:id="@+id/me_item_wallet"
|
||||||
android:id="@+id/view_guide_center_back"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="405dp"
|
|
||||||
android:background="@color/black_transparent_30"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/view_guide_bottom"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/ll_option" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_overlay_guide"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@drawable/bg_skill_guide"
|
|
||||||
app:layout_constraintRight_toRightOf="@id/ll_option"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/view_guide_center_back" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/view_guide_top"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:background="@color/black_transparent_30"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/view_guide_center_back"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/view_guide_bottom"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:background="@color/black_transparent_30"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/view_guide_center_back" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Group
|
|
||||||
android:id="@+id/group_guide"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:visibility="gone"
|
android:layout_marginStart="15dp"
|
||||||
app:constraint_referenced_ids="view_guide_top,view_guide_center_back,view_guide_bottom,iv_overlay_guide" />
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/bg_me_wallet_entrance"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintDimensionRatio="328:128"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/me_item_vip"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/ll_user_relation">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="0"
|
||||||
|
android:textColor="#FFE398"
|
||||||
|
android:textSize="@dimen/sp_18"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="999" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="钻石充值"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/me_item_vip"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:background="@drawable/bg_vip_me_entrance"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintDimensionRatio="328:128"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/me_item_wallet"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/me_item_wallet">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="贵族中心"
|
||||||
|
android:textColor="#FFE595"
|
||||||
|
android:textSize="@dimen/sp_18" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_vip_desc"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="开通贵族立享各项特权"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/sp_10" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_setting_entrance"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
|
android:background="@drawable/shape_white_8dp_round"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/me_item_wallet">
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/view_pager_entrance"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="130dp" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.home.widget.MePageIndicatorView
|
||||||
|
android:id="@+id/magic_indicator_entrance"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@drawable/shape_me_indicator_bg" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_game"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
|
android:background="@drawable/shape_white_8dp_round"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/ll_setting_entrance"
|
||||||
|
app:layout_constraintVertical_bias="0">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="快捷进房"
|
||||||
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/view_pager_game"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginTop="12dp" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.home.widget.MePageIndicatorView
|
||||||
|
android:id="@+id/magic_indicator_game"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@drawable/shape_me_indicator_bg" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||||
|
android:id="@+id/roll_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="345:80"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/ll_game"
|
||||||
|
app:rollviewpager_hint_gravity="left"
|
||||||
|
app:rollviewpager_hint_paddingBottom="8dp" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</com.yizhuan.erban.ui.widget.ObservableScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
|
35
app/src/main/res/layout/item_me_center.xml
Normal file
35
app/src/main/res/layout/item_me_center.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<LinearLayout 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="wrap_content"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/iv_pic"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/default_cover"
|
||||||
|
app:riv_corner_radius="8dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="10dp"
|
||||||
|
tools:text="余生点余生点" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
35
app/src/main/res/layout/item_me_game.xml
Normal file
35
app/src/main/res/layout/item_me_game.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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="wrap_content"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/iv_pic"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_cover"
|
||||||
|
app:riv_corner_radius="8dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="10dp"
|
||||||
|
tools:text="余生点余生点" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -7,7 +7,9 @@ import com.yizhuan.xchat_android_core.community.CommunityConstant
|
|||||||
import com.yizhuan.xchat_android_core.community.bean.UnReadCountInfo
|
import com.yizhuan.xchat_android_core.community.bean.UnReadCountInfo
|
||||||
import com.yizhuan.xchat_android_core.home.bean.*
|
import com.yizhuan.xchat_android_core.home.bean.*
|
||||||
import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo
|
import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo
|
||||||
|
import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo
|
||||||
import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo
|
import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo
|
||||||
|
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||||
import com.yizhuan.xchat_android_core.utils.net.launchRequest
|
import com.yizhuan.xchat_android_core.utils.net.launchRequest
|
||||||
@@ -162,6 +164,16 @@ object HomeModel : BaseModel() {
|
|||||||
api.requestHomeLiveTopInfo()
|
api.requestHomeLiveTopInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun requestMeCenterInfoList(): List<MeCenterInfo>? =
|
||||||
|
launchRequest {
|
||||||
|
api.requestMeCenterInfoList()
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun getGameList(): List<GameInfo>? =
|
||||||
|
launchRequest {
|
||||||
|
api.getGameList()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private interface Api {
|
private interface Api {
|
||||||
/**
|
/**
|
||||||
@@ -339,6 +351,22 @@ object HomeModel : BaseModel() {
|
|||||||
@GET("single/broadcast/onceLook")
|
@GET("single/broadcast/onceLook")
|
||||||
suspend fun requestHomeLiveTopInfo(): ServiceResult<HomeLiveTopInfo>
|
suspend fun requestHomeLiveTopInfo(): ServiceResult<HomeLiveTopInfo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("personal/center/list")
|
||||||
|
suspend fun requestMeCenterInfoList(): ServiceResult<List<MeCenterInfo>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST("/miniGame/record/miniGameList")
|
||||||
|
suspend fun getGameList(
|
||||||
|
): ServiceResult<List<GameInfo>>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -0,0 +1,12 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.room.bean
|
||||||
|
|
||||||
|
data class MeCenterInfo(
|
||||||
|
val centerBadge: String = "",
|
||||||
|
val centerId: Int = 0,
|
||||||
|
val centerName: String = "",
|
||||||
|
val centerPic: String = "",
|
||||||
|
val centerSeq: Int = 0,
|
||||||
|
val centerStatus: Int = 0,
|
||||||
|
val centerUrl: String = "",
|
||||||
|
val skipType: Int = 0,
|
||||||
|
)
|
@@ -28,17 +28,6 @@ object GameModel : BaseModel() {
|
|||||||
.compose(RxHelper.handleSchAndExce())
|
.compose(RxHelper.handleSchAndExce())
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getHomeBanner(type: String): List<BannerInfo>? =
|
|
||||||
launchRequest {
|
|
||||||
api.apiHomeBanner(
|
|
||||||
type, AuthModel.get().currentUid.toString(),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().ticket
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private interface Api {
|
private interface Api {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,24 +52,6 @@ object GameModel : BaseModel() {
|
|||||||
@Field("uid") uid: Long
|
@Field("uid") uid: Long
|
||||||
): Single<ServiceResult<GameCodeInfo>>
|
): Single<ServiceResult<GameCodeInfo>>
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页Banner
|
|
||||||
*
|
|
||||||
* @param type
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/banner")
|
|
||||||
suspend fun apiHomeBanner(
|
|
||||||
@Query("type") type: String,
|
|
||||||
@Query("uid") uid: String,
|
|
||||||
@Query("types") types: String,
|
|
||||||
@Query("ticket") ticket: String
|
|
||||||
): ServiceResult<List<BannerInfo>>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user