Merge branch 'dev_rank_test'

This commit is contained in:
zlzw 2022-11-02 16:54:40 +08:00
commit e3f9f21287
21 changed files with 1409 additions and 573 deletions

View File

@ -95,7 +95,7 @@ public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
return position;
}
protected boolean canClick() {
protected static boolean canClick() {
return ClickUtil.canClick();
}

View File

@ -22,9 +22,9 @@ public class ViewClicksAntiShake {
/**
* 防抖
*/
public static void clicksAntiShake(View view, ViewClicksCallBack callBack) {
public static void clicksAntiShake(int duration, View view, ViewClicksCallBack callBack) {
RxView.clicks(view)
.throttleFirst(800, TimeUnit.MILLISECONDS)
.throttleFirst(duration, TimeUnit.MILLISECONDS)
.subscribe(new Observer<Unit>() {
@Override
public void onSubscribe(Disposable d) {
@ -48,4 +48,8 @@ public class ViewClicksAntiShake {
}
});
}
public static void clicksAntiShake(View view, ViewClicksCallBack callBack) {
clicksAntiShake(800, view, callBack);
}
}

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape>
<corners android:radius="10dp"/>
<stroke android:width="1dp" android:color="#b6b6b6"/>
<shape android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:radius="18dp" />
</shape>
</item>
<item android:state_checked="false">

View File

@ -84,4 +84,5 @@ dependencies {
implementation 'com.google.android.gms:play-services-auth:15.0.0'
//
implementation 'com.binioter:guideview:1.0.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
}

View File

@ -7,20 +7,47 @@ import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.viewpager.widget.ViewPager;
import com.alibaba.fastjson.JSON;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.MyRadioButton;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.main.R;
import com.yunbao.main.adapter.MainListAdapter;
import com.yunbao.main.bean.ListBean;
import com.yunbao.main.http.MainHttpUtil;
import com.yunbao.main.views.AbsMainListChildViewHolder;
import com.yunbao.main.views.MainListContributeViewHolder;
import com.yunbao.main.views.MainListProfitViewHolder;
import com.yunbao.main.views.MyClipPagerTitleView;
import net.lucode.hackware.magicindicator.MagicIndicator;
import net.lucode.hackware.magicindicator.ViewPagerHelper;
@ -36,18 +63,33 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MainListActivity extends AbsActivity {
import pl.droidsonroids.gif.GifImageView;
public class MainListActivity extends AbsActivity implements OnItemClickListener<ListBean> {
private static final int PAGE_COUNT = 2;
public static final String DAY = "day";
public static final String WEEK = "week";
public static final String MONTH = "month";
public static final String TOTAL = "total";
protected String mType;
private List<FrameLayout> mViewList;
private AbsMainListChildViewHolder[] mViewHolders;
private MainListProfitViewHolder mProfitViewHolder;//收益榜
private MainListContributeViewHolder mContributeViewHolder;//贡献榜
private MagicIndicator mIndicator;
private ViewPager mViewPager;
private List<String> outRankHide = new ArrayList<>();
public MainListAdapter mAdapter;
private RadioButton mDay, mWeek;
private int position;
private ImageView mBack;
private RadioGroup radioGroup;
public static void forward(Context context, int p) {
context.startActivity(new Intent(context, MainListActivity.class).putExtra("p", p));
@ -57,12 +99,7 @@ public class MainListActivity extends AbsActivity {
@Override
protected void onResume() {
super.onResume();
if (mProfitViewHolder != null && mProfitViewHolder.mAdapter != null) {
mProfitViewHolder.mAdapter.notifyDataSetChanged();
}
if (mContributeViewHolder != null && mContributeViewHolder.mAdapter != null) {
mContributeViewHolder.mAdapter.notifyDataSetChanged();
}
}
@Override
@ -72,6 +109,7 @@ public class MainListActivity extends AbsActivity {
@Override
protected void main() {
mViewList = new ArrayList<>();
for (int i = 0; i < PAGE_COUNT; i++) {
FrameLayout frameLayout = new FrameLayout(mContext);
@ -79,25 +117,7 @@ public class MainListActivity extends AbsActivity {
mViewList.add(frameLayout);
}
mViewHolders = new AbsMainListChildViewHolder[PAGE_COUNT];
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mViewPager.setOffscreenPageLimit(PAGE_COUNT - 1);
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
loadPageData(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
final String[] titles = new String[]{
(WordUtil.getString(R.string.glamour_list)),
@ -114,13 +134,14 @@ public class MainListActivity extends AbsActivity {
@Override
public IPagerTitleView getTitleView(Context context, final int index) {
ClipPagerTitleView clipPagerTitleView = new ClipPagerTitleView(context);
MyClipPagerTitleView clipPagerTitleView = new MyClipPagerTitleView(context);
clipPagerTitleView.setText(titles[index]);
clipPagerTitleView.setTextColor(Color.parseColor("#B6B6B6"));
clipPagerTitleView.setClipColor(Color.parseColor("#F8F8F8"));
clipPagerTitleView.setTextColor(Color.parseColor("#FFFFFF"));
clipPagerTitleView.setClipColor(Color.parseColor("#FFFFFF"));
clipPagerTitleView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mIndicator.onPageSelected(index);
mViewPager.setCurrentItem(index);
}
});
@ -131,22 +152,16 @@ public class MainListActivity extends AbsActivity {
@Override
public IPagerIndicator getIndicator(Context context) {
LinePagerIndicator indicator = new LinePagerIndicator(context);
float navigatorHeight = context.getResources().getDimension(R.dimen.common_navigator_height);
float borderWidth = UIUtil.dip2px(context, 1);
float lineHeight = navigatorHeight - 2 * borderWidth;
indicator.setLineHeight(lineHeight);
indicator.setRoundRadius(lineHeight / 2);
indicator.setYOffset(borderWidth);
//选中的背景颜色
indicator.setColors(Color.parseColor("#FFBE41"));
indicator.setLineWidth(DpUtil.dp2px(14));
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
indicator.setColors(Color.parseColor("#FFFFFF"));
return indicator;
}
});
mIndicator.setNavigator(commonNavigator);
ViewPagerHelper.bind(mIndicator, mViewPager);
//默认选择第几个
mIndicator.onPageSelected(getIntent().getIntExtra("p", 0));
mViewPager.setCurrentItem(getIntent().getIntExtra("p", 0));
//加载数据
loadData();
EventBus.getDefault().register(MainListActivity.this);
@ -156,9 +171,7 @@ public class MainListActivity extends AbsActivity {
@Override
public void onSuccess(NobleRankHideUserListModel data) {
outRankHide = data.getOutRankHide();
if (mContributeViewHolder != null) {
mContributeViewHolder.setHide(outRankHide);
}
}
@Override
@ -166,9 +179,58 @@ public class MainListActivity extends AbsActivity {
Log.e("MainListActivity", error);
}
});
initView();
}
private void loadPageData(int position) {
private void initView() {
mType = DAY;
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mBack = findViewById(R.id.btn_back);
mDay = findViewById(R.id.btn_day);
mWeek = findViewById(R.id.btn_week);
radioGroup = findViewById(R.id.radioGroup);
mViewPager.setOffscreenPageLimit(PAGE_COUNT - 1);
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
MainListActivity.this.position = position;
mDay.setChecked(true);
mDay.setTextColor(Color.parseColor("#FF82C1"));
mWeek.setTextColor(Color.parseColor("#FFFFFF"));
loadPageData(position, DAY);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
mDay.setOnClickListener(v -> {
loadPageData(position, DAY);
mDay.setTextColor(Color.parseColor("#FF82C1"));
mWeek.setTextColor(Color.parseColor("#FFFFFF"));
});
mWeek.setOnClickListener(v -> {
loadPageData(position, WEEK);
mWeek.setTextColor(Color.parseColor("#FF82C1"));
mDay.setTextColor(Color.parseColor("#FFFFFF"));
});
mBack.setOnClickListener(v -> {
finish();
});
ViewPagerHelper.bind(mIndicator, mViewPager);
mViewPager.setCurrentItem(getIntent().getIntExtra("p", 0));
loadPageData(0, DAY);
}
private void loadPageData(int position, String rank) {
if (mViewHolders == null) {
return;
}
@ -180,32 +242,38 @@ public class MainListActivity extends AbsActivity {
return;
}
if (position == 0) {
mProfitViewHolder = new MainListProfitViewHolder(mContext, parent);
vh = mProfitViewHolder;
vh = new MainListProfitViewHolder(mContext, parent);
vh.setAppbarColor(Color.parseColor("#FF73C3"));
} else if (position == 1) {
mContributeViewHolder = new MainListContributeViewHolder(mContext, parent);
MainListContributeViewHolder mContributeViewHolder = new MainListContributeViewHolder(mContext, parent);
mContributeViewHolder.setHide(outRankHide);
vh = mContributeViewHolder;
vh.setAppbarColor(Color.parseColor("#73B2FF"));
}
if (vh == null) {
return;
}
vh.setAppbarListener(isShow -> {
if (isShow) {
radioGroup.setVisibility(View.VISIBLE);
} else {
radioGroup.setVisibility(View.INVISIBLE);
}
});
mViewHolders[position] = vh;
vh.addToParent();
vh.subscribeActivityLifeCycle();
}
}
if (vh != null) {
vh.loadData();
vh.setType(position, rank);
}
}
// @Override
public void loadData() {
if (mViewPager != null) {
loadPageData(mViewPager.getCurrentItem());
}
}
@ -217,12 +285,13 @@ public class MainListActivity extends AbsActivity {
@Subscribe(threadMode = ThreadMode.MAIN)
public void onFollowEvent(FollowEvent e) {
if (mViewHolders != null) {
for (AbsMainListChildViewHolder vh : mViewHolders) {
if (vh != null) {
vh.onFollowEvent(e.getToUid(), e.getIsAttention());
}
}
}
}
@Override
public void onItemClick(ListBean bean, int position) {
}
}

View File

@ -22,6 +22,7 @@ import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.custom.MyRadioButton;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.SVGAViewUtils;
@ -44,16 +45,11 @@ import pl.droidsonroids.gif.GifImageView;
public class MainListAdapter extends RefreshAdapter<ListBean> {
public static final int TYPE_PROFIT = 1;//收益榜
public static final int TYPE_CONTRIBUTE = 0;//贡献榜
private static final int HEAD = 0;
private static final int NORMAL = 1;
private String mCoinName;
private String mFollow;
private String mFollowing;
private View.OnClickListener mFollowClickListener1;
private View.OnClickListener mFollowClickListener2;
private View.OnClickListener mItemClickListener;
private List<ListBean> mTopList;
private HeadVh mHeadVh;
private int mType;
private List<String> outRankHide = new ArrayList<>();
@ -61,69 +57,46 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
public MainListAdapter(Context context, int type) {
super(context);
mType = type;
CommonAppConfig appConfig = CommonAppConfig.getInstance();
mCoinName = type == TYPE_PROFIT ? appConfig.getVotesName() : appConfig.getCoinName();
mTopList = new ArrayList<>();
mFollow = ("+" + WordUtil.getString(R.string.follow));
mFollow = (WordUtil.getString(R.string.follow));
mFollowing = WordUtil.getString(R.string.following);
mItemClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewClicksAntiShake.clicksAntiShake(v, () -> {
Object tag = v.getTag();
if (tag != null && mOnItemClickListener != null) {
ListBean model = (ListBean) tag;
if (model.isHide()) {
ToastUtil.show(R.string.can_not_go);
} else {
mOnItemClickListener.onItemClick(model, 0);
mItemClickListener = v -> ViewClicksAntiShake.clicksAntiShake(v, () -> {
Object tag = v.getTag();
if (tag != null && mOnItemClickListener != null) {
ListBean model = (ListBean) tag;
if (model.isHide()) {
ToastUtil.show(R.string.can_not_go);
} else {
mOnItemClickListener.onItemClick(model, 0);
}
}
});
mFollowClickListener2 = v -> ViewClicksAntiShake.clicksAntiShake(v, () -> {
if (!canClick()) {
return;
}
Object tag = v.getTag();
if (tag != null) {
final int position = (int) tag;
final ListBean bean = mList.get(position);
CommonHttpUtil.setAttention(bean.getUid(), new CommonCallback<Integer>() {
@Override
public void callback(Integer bean) {
if (bean != null && bean == 1) {
v.setVisibility(View.INVISIBLE);
}
}
});
}
};
mFollowClickListener1 = new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewClicksAntiShake.clicksAntiShake(v, () -> {
if (!canClick()) {
return;
}
Object tag = v.getTag();
if (tag != null) {
final ListBean bean = (ListBean) tag;
CommonHttpUtil.setAttention(bean.getUid(), null);
}
});
}
};
mFollowClickListener2 = new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewClicksAntiShake.clicksAntiShake(v, () -> {
if (!canClick()) {
return;
}
Object tag = v.getTag();
if (tag != null) {
final int position = (int) tag;
final ListBean bean = mList.get(position);
CommonHttpUtil.setAttention(bean.getUid(), null);
}
});
}
};
});
}
@Override
public int getItemCount() {
if (mList != null && mTopList.size() > 0) {
return mList.size() + 1;
return mList.size();
}
return 0;
}
@ -180,14 +153,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (viewType == HEAD) {
if (mHeadVh == null) {
mHeadVh = new HeadVh(mInflater.inflate(R.layout.item_main_list_head, parent, false));
}
return mHeadVh;
} else {
return new Vh(mInflater.inflate(R.layout.item_main_list, parent, false));
}
return new Vh(mInflater.inflate(R.layout.item_main_list, parent, false));
}
@Override
@ -198,313 +164,8 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position, @NonNull List payloads) {
Object payload = payloads.size() > 0 ? payloads.get(0) : null;
if (vh instanceof Vh) {
((Vh) vh).setData(mList.get(position - 1), position - 1, payload);
} else {
((HeadVh) vh).setData(payload);
}
((Vh) vh).setData(mList.get(position), position, payload);
}
class HeadVh extends RecyclerView.ViewHolder {
View mItem1;
View mItem2;
View mItem3;
GifImageView liveing1;
GifImageView liveing2;
GifImageView liveing3;
ImageView mAvatar1;
ImageView mAvatar2;
ImageView mAvatar3;
TextView mName1;
TextView mName2;
TextView mName3;
TextView mVotes1;
TextView mVotes2;
TextView mVotes3;
ImageView mSex1;
ImageView mSex2;
ImageView mSex3;
ImageView mLevel1;
ImageView mLevel2;
ImageView mLevel3;
MyRadioButton mBtnFollow1;
MyRadioButton mBtnFollow2;
MyRadioButton mBtnFollow3;
SVGAImageView svga1;
SVGAImageView svga2;
SVGAImageView svga3;
public HeadVh(View itemView) {
super(itemView);
mItem1 = itemView.findViewById(R.id.item_1);
mItem2 = itemView.findViewById(R.id.item_2);
mItem3 = itemView.findViewById(R.id.item_3);
liveing1 = itemView.findViewById(R.id.liveing1);
liveing2 = itemView.findViewById(R.id.liveing2);
liveing3 = itemView.findViewById(R.id.liveing3);
mItem1.setOnClickListener(mItemClickListener);
mItem2.setOnClickListener(mItemClickListener);
mItem3.setOnClickListener(mItemClickListener);
mAvatar1 = (ImageView) itemView.findViewById(R.id.avatar_1);
mAvatar2 = (ImageView) itemView.findViewById(R.id.avatar_2);
mAvatar3 = (ImageView) itemView.findViewById(R.id.avatar_3);
mName1 = (TextView) itemView.findViewById(R.id.name_1);
mName2 = (TextView) itemView.findViewById(R.id.name_2);
mName3 = (TextView) itemView.findViewById(R.id.name_3);
mVotes1 = (TextView) itemView.findViewById(R.id.votes_1);
mVotes2 = (TextView) itemView.findViewById(R.id.votes_2);
mVotes3 = (TextView) itemView.findViewById(R.id.votes_3);
mSex1 = (ImageView) itemView.findViewById(R.id.sex_1);
mSex2 = (ImageView) itemView.findViewById(R.id.sex_2);
mSex3 = (ImageView) itemView.findViewById(R.id.sex_3);
mLevel1 = (ImageView) itemView.findViewById(R.id.level_1);
mLevel2 = (ImageView) itemView.findViewById(R.id.level_2);
mLevel3 = (ImageView) itemView.findViewById(R.id.level_3);
mBtnFollow1 = (MyRadioButton) itemView.findViewById(R.id.btn_follow_1);
mBtnFollow2 = (MyRadioButton) itemView.findViewById(R.id.btn_follow_2);
mBtnFollow3 = (MyRadioButton) itemView.findViewById(R.id.btn_follow_3);
mBtnFollow1.setOnClickListener(mFollowClickListener1);
mBtnFollow2.setOnClickListener(mFollowClickListener1);
mBtnFollow3.setOnClickListener(mFollowClickListener1);
svga1 = (SVGAImageView) itemView.findViewById(R.id.svga1);
svga2 = (SVGAImageView) itemView.findViewById(R.id.svga2);
svga3 = (SVGAImageView) itemView.findViewById(R.id.svga3);
}
void setData(Object payload) {
int topSize = mTopList.size();
if (topSize > 0) {
ListBean bean = mTopList.get(0);
svga1.setVisibility(View.GONE);
if (bean.getDress_head() != null) {
if (bean.getDress_head().contains("svga")) {
svga1.setVisibility(View.VISIBLE);
try {
new SVGAParser(mContext).parse(new URL(bean.getDress_head()), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga1.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga1,false);
}
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else {
Log.e("eee", bean.getDress_head());
ImgLoader.display(mContext, bean.getDress_head(), svga1);
}
}
mItem1.setVisibility(View.GONE);
if (payload == null) {
mItem1.setTag(bean);
mItem1.setVisibility(View.VISIBLE);
if (bean.isHide()) {
mName1.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar1);
mSex1.setVisibility(View.GONE);
svga1.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar1);
mName1.setText(bean.getUserNiceName());
mSex1.setVisibility(View.VISIBLE);
svga1.setVisibility(View.VISIBLE);
}
mVotes1.setText(bean.getTotalCoinFormat());
mSex1.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = null;
if (mType == TYPE_PROFIT) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
} else {
levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
}
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel1);
}
}
mBtnFollow1.setTag(bean);
liveing1.setVisibility(View.INVISIBLE);
if (bean.getIslive() == 1) {
liveing1.setVisibility(View.VISIBLE);
} else {
liveing1.setVisibility(View.INVISIBLE);
}
mBtnFollow1.setVisibility(bean.isHide() ? View.GONE : View.VISIBLE);
if (bean.getAttention() == 1) {
mBtnFollow1.doChecked(true);
mBtnFollow1.setText(mFollowing);
mBtnFollow1.setBackgroundResource(R.drawable.background_dbdbdb);
mBtnFollow1.setTextColor(Color.parseColor("#FFFFFF"));
} else {
mBtnFollow1.doChecked(false);
mBtnFollow1.setText(mFollow);
mBtnFollow1.setBackgroundResource(R.drawable.background_yellow);
mBtnFollow1.setTextColor(Color.parseColor("#FFFFFF"));
}
}
if (topSize > 1) {
ListBean bean = mTopList.get(1);
svga2.setVisibility(View.GONE);
if (bean.getDress_head() != null) {
if (bean.getDress_head().contains("svga")) {
svga2.setVisibility(View.VISIBLE);
try {
new SVGAParser(mContext).parse(new URL(bean.getDress_head()), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga2.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga2,false);
}
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else {
Log.e("eee", bean.getDress_head());
ImgLoader.display(mContext, bean.getDress_head(), svga2);
}
}
mItem2.setVisibility(View.GONE);
if (payload == null) {
mItem2.setVisibility(View.VISIBLE);
mItem2.setTag(bean);
if (bean.isHide()) {
mName2.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar2);
mSex2.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar2);
mName2.setText(bean.getUserNiceName());
mSex2.setVisibility(View.VISIBLE);
}
mVotes2.setText(bean.getTotalCoinFormat() + " ");
mSex2.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = null;
if (mType == TYPE_PROFIT) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
} else {
levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
}
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel2);
}
}
mBtnFollow2.setTag(bean);
liveing2.setVisibility(View.INVISIBLE);
if (bean.getIslive() == 1) {
liveing2.setVisibility(View.VISIBLE);
} else {
liveing2.setVisibility(View.INVISIBLE);
}
mBtnFollow2.setVisibility(bean.isHide() ? View.GONE : View.VISIBLE);
svga2.setVisibility(bean.isHide() ? View.GONE : View.VISIBLE);
if (bean.getAttention() == 1) {
mBtnFollow2.doChecked(true);
mBtnFollow2.setText(mFollowing);
mBtnFollow2.setBackgroundResource(R.drawable.background_dbdbdb);
mBtnFollow2.setTextColor(Color.parseColor("#FFFFFF"));
} else {
mBtnFollow2.doChecked(false);
mBtnFollow2.setText(mFollow);
mBtnFollow2.setBackgroundResource(R.drawable.background_yellow);
mBtnFollow2.setTextColor(Color.parseColor("#FFFFFF"));
}
}
if (topSize > 2) {
ListBean bean = mTopList.get(2);
if (bean.getDress_head() != null) {
svga3.setVisibility(View.GONE);
if (bean.getDress_head().contains("svga")) {
svga3.setVisibility(View.VISIBLE);
try {
new SVGAParser(mContext).parse(new URL(bean.getDress_head()), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga3.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga3,false);
}
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else {
Log.e("eee", bean.getDress_head());
ImgLoader.display(mContext, bean.getDress_head(), svga3);
}
}
mItem3.setVisibility(View.GONE);
if (payload == null) {
mItem3.setVisibility(View.VISIBLE);
mItem3.setTag(bean);
if (bean.isHide()) {
mName3.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar3);
mSex3.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar3);
mName3.setText(bean.getUserNiceName());
mSex3.setVisibility(View.VISIBLE);
}
mVotes3.setText(bean.getTotalCoinFormat() + " ");
mSex3.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = null;
if (mType == TYPE_PROFIT) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
} else {
levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
}
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel3);
}
}
mBtnFollow3.setTag(bean);
liveing3.setVisibility(View.INVISIBLE);
if (bean.getIslive() == 1) {
liveing3.setVisibility(View.VISIBLE);
} else {
liveing3.setVisibility(View.INVISIBLE);
}
mBtnFollow3.setVisibility(bean.isHide() ? View.GONE : View.VISIBLE);
svga3.setVisibility(bean.isHide() ? View.GONE : View.VISIBLE);
if (bean.getAttention() == 1) {
mBtnFollow3.doChecked(true);
mBtnFollow3.setText(mFollowing);
mBtnFollow3.setBackgroundResource(R.drawable.background_dbdbdb);
mBtnFollow3.setTextColor(Color.parseColor("#FFFFFF"));
} else {
mBtnFollow3.doChecked(false);
mBtnFollow3.setText(mFollow);
mBtnFollow3.setBackgroundResource(R.drawable.background_yellow);
mBtnFollow3.setTextColor(Color.parseColor("#FFFFFF"));
}
}
}
}
class Vh extends RecyclerView.ViewHolder {
TextView mOrder;
@ -544,7 +205,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga,false);
SVGAViewUtils.playEndClear(svga, false);
}
@Override
@ -598,11 +259,12 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
mBtnFollow.setText(mFollowing);
mBtnFollow.setBackgroundResource(R.drawable.background_dbdbdb);
mBtnFollow.setTextColor(Color.parseColor("#FFFFFF"));
mBtnFollow.setVisibility(View.INVISIBLE);
} else {
mBtnFollow.doChecked(false);
mBtnFollow.setText(mFollow);
mBtnFollow.setBackgroundResource(R.drawable.background_yellow);
mBtnFollow.setTextColor(Color.parseColor("#FFFFFF"));
mBtnFollow.setBackgroundResource(R.drawable.background_ff7bbaff);
mBtnFollow.setTextColor(Color.parseColor("#7BBAFF"));
}
}
}

View File

@ -128,4 +128,21 @@ public class ListBean {
public void setSex(int sex) {
this.sex = sex;
}
@Override
public String toString() {
return "ListBean{" +
"totalCoin=" + totalCoin +
", uid='" + uid + '\'' +
", userNiceName='" + userNiceName + '\'' +
", avatarThumb='" + avatarThumb + '\'' +
", sex=" + sex +
", levelAnchor=" + levelAnchor +
", level=" + level +
", attention=" + attention +
", islive=" + islive +
", dress_head='" + dress_head + '\'' +
", isHide=" + isHide +
'}';
}
}

View File

@ -180,7 +180,7 @@ public class MainHttpUtil {
}
//排行榜 收益
//排行榜 魅力
public static void profitList(String type, int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.profitList", MainHttpConsts.PROFIT_LIST)
.params("type", type)
@ -188,7 +188,7 @@ public class MainHttpUtil {
.execute(callback);
}
//排行榜 贡献
//排行榜 豪气
public static void consumeList(String type, int p, HttpCallback callback) {
HttpClient.getInstance().get("Home.consumeList", MainHttpConsts.CONSUME_LIST)
.params("type", type)

View File

@ -1,21 +1,48 @@
package com.yunbao.main.views;
import android.content.Context;
import androidx.recyclerview.widget.LinearLayoutManager;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.MyRadioButton;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.main.R;
import com.yunbao.main.adapter.MainListAdapter;
import com.yunbao.main.bean.ListBean;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import pl.droidsonroids.gif.GifImageView;
/**
* Created by cxf on 2019/2/23.
*/
@ -29,6 +56,13 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
protected String mType;
protected CommonRefreshView mRefreshView;
public MainListAdapter mAdapter;
protected OnLoadData loadData;
protected List<ListBean> list;
private HeadView hv;
private View mBackgroundLayout;
private OnAppbarListener appbarListener;
private AppBarLayout rootView;
private CollapsingToolbarLayout toolbarLayout;
public AbsMainListChildViewHolder(Context context, ViewGroup parentView) {
super(context, parentView);
@ -37,18 +71,39 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
@Override
protected int getLayoutId() {
return R.layout.view_main_list_page;
return R.layout.activity_main_list;
}
@Override
public void init() {
mRefreshView = (CommonRefreshView) findViewById(R.id.refreshView);
mBackgroundLayout = findViewById(R.id.bg_layout);
rootView = (AppBarLayout) findViewById(R.id.rootView);
toolbarLayout= (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);
hv = new HeadView(rootView);
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_list);
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
findViewById(R.id.btn_day).setOnClickListener(this);
findViewById(R.id.btn_week).setOnClickListener(this);
findViewById(R.id.btn_month).setOnClickListener(this);
findViewById(R.id.btn_total).setOnClickListener(this);
loadData = list -> {
Log.i("测试", "onData: " + list.size());
hv.setData(list.get(0), 0);
hv.setData(list.get(1), 1);
hv.setData(list.get(2), 2);
};
rootView.addOnOffsetChangedListener(new AppBarLayout.BaseOnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (appbarListener != null) {
if (verticalOffset == 0) {
appbarListener.onShow(true);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {
appbarListener.onShow(false);
}
}
}
});
}
public void setAppbarColor(int color){
toolbarLayout.setContentScrimColor(color);
}
@Override
@ -75,7 +130,11 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
@Override
public void onItemClick(ListBean bean, int position) {
RouteUtil.forwardUserHome(mContext, bean.getUid(),0);
RouteUtil.forwardUserHome(mContext, bean.getUid(), 0);
}
public void setAppbarListener(OnAppbarListener appbarListener) {
this.appbarListener = appbarListener;
}
@Override
@ -86,10 +145,6 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
type = DAY;
} else if (i == R.id.btn_week) {
type = WEEK;
} else if (i == R.id.btn_month) {
type = MONTH;
} else if (i == R.id.btn_total) {
type = TOTAL;
}
if (!TextUtils.isEmpty(type) && !type.equals(mType)) {
mType = type;
@ -99,4 +154,184 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
}
}
public void setType(int position, String type) {
if (type != null) {
this.mType = type;
}
if (mRefreshView != null) {
mRefreshView.initData();
}
if (position == 0) {
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour_top);
} else {
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour2_top);
}
}
public interface OnLoadData {
void onData(List<ListBean> list);
}
public interface OnAppbarListener {
void onShow(boolean isShow);
}
class HeadView {
View mItem1;
View mItem2;
View mItem3;
GifImageView liveing1;
GifImageView liveing2;
GifImageView liveing3;
ImageView mAvatar1;
ImageView mAvatar2;
ImageView mAvatar3;
TextView mName1;
TextView mName2;
TextView mName3;
TextView mVotes1;
TextView mVotes2;
TextView mVotes3;
ImageView mSex1;
ImageView mSex2;
ImageView mSex3;
ImageView mLevel1;
ImageView mLevel2;
ImageView mLevel3;
MyRadioButton mBtnFollow1;
MyRadioButton mBtnFollow2;
MyRadioButton mBtnFollow3;
SVGAImageView svga1;
SVGAImageView svga2;
SVGAImageView svga3;
public HeadView(View itemView) {
mItem1 = itemView.findViewById(R.id.item_1);
mItem2 = itemView.findViewById(R.id.item_2);
mItem3 = itemView.findViewById(R.id.item_3);
liveing1 = itemView.findViewById(R.id.liveing1);
liveing2 = itemView.findViewById(R.id.liveing2);
liveing3 = itemView.findViewById(R.id.liveing3);
mAvatar1 = (ImageView) itemView.findViewById(R.id.avatar_1);
mAvatar2 = (ImageView) itemView.findViewById(R.id.avatar_2);
mAvatar3 = (ImageView) itemView.findViewById(R.id.avatar_3);
mName1 = (TextView) itemView.findViewById(R.id.name_1);
mName2 = (TextView) itemView.findViewById(R.id.name_2);
mName3 = (TextView) itemView.findViewById(R.id.name_3);
mVotes1 = (TextView) itemView.findViewById(R.id.votes_1);
mVotes2 = (TextView) itemView.findViewById(R.id.votes_2);
mVotes3 = (TextView) itemView.findViewById(R.id.votes_3);
mSex1 = (ImageView) itemView.findViewById(R.id.sex_1);
mSex2 = (ImageView) itemView.findViewById(R.id.sex_2);
mSex3 = (ImageView) itemView.findViewById(R.id.sex_3);
mLevel1 = (ImageView) itemView.findViewById(R.id.level_1);
mLevel2 = (ImageView) itemView.findViewById(R.id.level_2);
mLevel3 = (ImageView) itemView.findViewById(R.id.level_3);
mBtnFollow1 = (MyRadioButton) itemView.findViewById(R.id.btn_follow_1);
mBtnFollow2 = (MyRadioButton) itemView.findViewById(R.id.btn_follow_2);
mBtnFollow3 = (MyRadioButton) itemView.findViewById(R.id.btn_follow_3);
svga1 = (SVGAImageView) itemView.findViewById(R.id.svga1);
svga2 = (SVGAImageView) itemView.findViewById(R.id.svga2);
svga3 = (SVGAImageView) itemView.findViewById(R.id.svga3);
}
public void setData(ListBean bean, int position) {
if (bean == null) {
return;
}
Log.i("排行榜", bean.toString() + " | position = " + position);
setVisibility(View.GONE, -1, svga1, svga2, svga3);
if (bean.getDress_head() != null) {
if (bean.getDress_head().contains("svga")) {
setVisibility(View.VISIBLE, position, svga1, svga2, svga3);
try {
new SVGAParser(mContext).parse(new URL(bean.getDress_head()), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
getItem(position, svga1, svga2, svga3).setImageDrawable(drawable);
SVGAViewUtils.playEndClear(getItem(position, svga1, svga2, svga3), false);
}
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else {
Log.e("eee", bean.getDress_head());
ImgLoader.display(mContext, bean.getDress_head(), getItem(position, svga1, svga2, svga3));
}
}
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTag(bean);
setVisibility(View.INVISIBLE, position, liveing1, liveing2, liveing3);
if (bean.getIslive() == 1) {
setVisibility(View.VISIBLE, position, liveing1, liveing2, liveing3);
}
setVisibility(bean.isHide() ? View.GONE : View.VISIBLE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3);
if (bean.getAttention() != 1) {
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).doChecked(true);
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + WordUtil.getString(R.string.follow));
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2);
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
} else {
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.INVISIBLE);
}
getItem(position, mVotes1, mVotes2, mVotes3).setText(bean.getTotalCoinFormat());
if (bean.isHide()) {
getItem(position, mName1, mName2, mName3).setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, getItem(position, mAvatar1, mAvatar2, mAvatar3));
getItem(position, mSex1, mSex2, mSex3).setVisibility(View.GONE);
getItem(position, mVotes1, mVotes2, mVotes3).setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), getItem(position, mAvatar1, mAvatar2, mAvatar3));
getItem(position, mName1, mName2, mName3).setText(bean.getUserNiceName());
getItem(position, mSex1, mSex2, mSex3).setVisibility(View.VISIBLE);
getItem(position, svga1, svga2, svga3).setVisibility(View.VISIBLE);
}
getItem(position, mSex1, mSex2, mSex3).setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setOnClickListener(v -> {
CommonHttpUtil.setAttention(bean.getUid(), new CommonCallback<Integer>() {
@Override
public void callback(Integer bean) {
if (bean != null && bean == 1) {
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.INVISIBLE);
}
Log.i("测试", "callback: " + bean);
}
});
});
getItem(position, mItem1, mItem2, mItem3).setOnClickListener(v -> {
ViewClicksAntiShake.clicksAntiShake(v, () -> {
if (bean.isHide()) {
ToastUtil.show(R.string.can_not_go);
} else {
RouteUtil.forwardUserHome(mContext, bean.getUid(), 0);
}
});
});
}
private <T> T getItem(int position, T... views) {
return views[position];
}
private void setVisibility(int type, int position, View... views) {
if (position == -1) {
for (View view : views) {
view.setVisibility(type);
}
} else {
views[position].setVisibility(type);
}
}
}
}

View File

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.main.adapter.MainListAdapter;
import com.yunbao.main.bean.ListBean;
import com.yunbao.main.http.MainHttpConsts;
@ -51,7 +52,13 @@ public class MainListContributeViewHolder extends AbsMainListChildViewHolder {
@Override
public List<ListBean> processData(String[] info) {
return JSON.parseArray(Arrays.toString(info), ListBean.class);
list=JSON.parseArray(Arrays.toString(info), ListBean.class);
if(mRefreshView.getPageCount()==1){
if (loadData != null) {
loadData.onData(list);
}
}
return list;
}
@Override

View File

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.main.adapter.MainListAdapter;
import com.yunbao.main.bean.ListBean;
import com.yunbao.main.http.MainHttpConsts;
@ -41,14 +42,20 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder {
@Override
public void loadData(int p, HttpCallback callback) {
if(!mType.isEmpty()){
if (!mType.isEmpty()) {
MainHttpUtil.profitList(mType, p, callback);
}
}
@Override
public List<ListBean> processData(String[] info) {
return JSON.parseArray(Arrays.toString(info), ListBean.class);
list = JSON.parseArray(Arrays.toString(info), ListBean.class);
if(mRefreshView.getPageCount()==1){
if (loadData != null) {
loadData.onData(list);
}
}
return list;
}
@Override

View File

@ -0,0 +1,25 @@
package com.yunbao.main.views;
import android.content.Context;
import com.yunbao.common.utils.DpUtil;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ClipPagerTitleView;
public class MyClipPagerTitleView extends ClipPagerTitleView {
public MyClipPagerTitleView(Context context) {
super(context);
}
@Override
public void onSelected(int index, int totalCount) {
super.onSelected(index, totalCount);
setTextSize(DpUtil.dp2px(20));
}
@Override
public void onDeselected(int index, int totalCount) {
super.onDeselected(index, totalCount);
setTextSize(DpUtil.dp2px(16));
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="25dp" />
<solid android:color="#33FFFFFF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="68dp" android:height="28dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ff7bbaff" />
<corners android:radius="14dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="62dp" android:height="26dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffffff" />
<solid android:color="#ffff79c2" />
<corners android:radius="14dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,428 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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.google.android.material.appbar.AppBarLayout
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="100dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:toolbarId="@+id/toolbar">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bg_layout"
android:layout_width="match_parent"
android:layout_height="421dp"
android:background="@mipmap/bg_glamour_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/item_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginBottom="40dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/item_2"
app:layout_constraintEnd_toStartOf="@+id/item_3"
app:layout_constraintStart_toEndOf="@+id/item_2">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_1"
android:layout_width="60dp"
android:layout_height="60dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
</RelativeLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga1"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp" />
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/liveing1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="50dp"
android:src="@mipmap/icon_user_home_living" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/name_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lines="1"
android:maxEms="4"
android:singleLine="true"
android:text="名字"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<ImageView
android:id="@+id/sex_1"
android:layout_width="12dp"
android:layout_height="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/diamond" />
<TextView
android:id="@+id/votes_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="11111"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/btn_follow_1"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/background_dbdbdb"
android:button="@null"
android:gravity="center"
android:text="@string/shield_gift_effect"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/item_2"
android:layout_width="0dp"
android:layout_height="152dp"
android:layout_marginStart="25dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="70dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/item_1"
app:layout_constraintStart_toStartOf="parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_2"
android:layout_width="66dp"
android:layout_height="66dp"
android:scaleType="centerCrop"
app:riv_border_color="#B6B6B6"
app:riv_border_width="2dp"
app:riv_oval="true" />
</RelativeLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga2"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp" />
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/liveing2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="50dp"
android:src="@mipmap/icon_user_home_living" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/name_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lines="1"
android:maxEms="4"
android:singleLine="true"
android:text="名字"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<ImageView
android:id="@+id/sex_2"
android:layout_width="12dp"
android:layout_height="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/diamond" />
<TextView
android:id="@+id/votes_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="11111"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/btn_follow_2"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/background_dbdbdb"
android:button="@null"
android:gravity="center"
android:text="已关注"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/item_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="25dp"
android:layout_marginBottom="60dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/item_1">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_3"
android:layout_width="66dp"
android:layout_height="66dp"
android:scaleType="centerCrop"
app:riv_border_color="#B6B6B6"
app:riv_border_width="2dp"
app:riv_oval="true" />
</RelativeLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga3"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp" />
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/liveing3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="50dp"
android:src="@mipmap/icon_user_home_living" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/name_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lines="1"
android:maxEms="4"
android:singleLine="true"
android:text="名字"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<ImageView
android:id="@+id/sex_3"
android:layout_width="12dp"
android:layout_height="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/diamond" />
<TextView
android:id="@+id/votes_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="11111"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/btn_follow_3"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/background_dbdbdb"
android:button="@null"
android:gravity="center"
android:text="已关注"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<com.yunbao.common.custom.CommonRefreshView
android:id="@+id/refreshView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_white_up"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,73 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="110dp"
>
<com.yunbao.common.custom.RatioImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
app:ri_ratio="1.13067"
/>
</FrameLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
/>
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
</androidx.viewpager.widget.ViewPager>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bg_layout"
android:layout_width="match_parent"
android:layout_height="421dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="377dp"
app:layout_constraintBottom_toBottomOf="@+id/indicator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/indicator"
app:srcCompat="@mipmap/icon_back_white" />
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/indicator"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="32dp"
>
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginTop="59dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:onClick="backClick"
android:padding="9dp"
android:src="@mipmap/top_back"
/>
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:background="@drawable/background_33ffffff"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/indicator">
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/indicator"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_height="36dp"
android:background="@drawable/background_f8f8f8"
<RadioButton
android:id="@+id/btn_day"
android:layout_width="60dp"
android:layout_height="26dp"
android:background="@drawable/bg_list_btn"
android:button="@null"
android:checked="true"
android:gravity="center"
android:text="@string/main_list_day"
android:textColor="#FF82C1"
android:textSize="16sp"
android:textStyle="bold" />
/>
<RadioButton
android:id="@+id/btn_week"
android:layout_width="60dp"
android:layout_height="26dp"
android:layout_marginLeft="20dp"
android:background="@drawable/bg_list_btn"
android:button="@null"
android:gravity="center"
android:text="@string/main_list_week"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
</RadioGroup>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,89 +1,418 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
android:background="#00FFFFFF"
android:orientation="vertical">
<FrameLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bg_layout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="70dp"
>
android:layout_height="421dp"
android:background="@mipmap/bg_glamour_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RadioGroup
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/item_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
android:layout_marginEnd="16dp"
android:layout_marginBottom="40dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/item_2"
app:layout_constraintEnd_toStartOf="@+id/item_3"
app:layout_constraintStart_toEndOf="@+id/item_2">
<RadioButton
android:id="@+id/btn_day"
android:layout_width="60dp"
android:layout_height="26dp"
android:background="@drawable/bg_list_btn"
android:button="@null"
android:checked="true"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_1"
android:layout_width="60dp"
android:layout_height="60dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
</RelativeLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga1"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp" />
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/liveing1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="50dp"
android:src="@mipmap/icon_user_home_living" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/name_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lines="1"
android:maxEms="4"
android:singleLine="true"
android:text="名字"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<ImageView
android:id="@+id/sex_1"
android:layout_width="12dp"
android:layout_height="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/main_list_day"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="bold"
/>
android:orientation="horizontal">
<RadioButton
android:id="@+id/btn_week"
android:layout_width="60dp"
android:layout_height="26dp"
android:layout_marginLeft="20dp"
android:background="@drawable/bg_list_btn"
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/diamond" />
<TextView
android:id="@+id/votes_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="11111"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/btn_follow_1"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/background_dbdbdb"
android:button="@null"
android:gravity="center"
android:text="@string/main_list_week"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="bold"
/>
android:text="@string/shield_gift_effect"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<RadioButton
android:id="@+id/btn_month"
android:layout_width="60dp"
android:layout_height="26dp"
android:layout_marginLeft="20dp"
android:background="@drawable/bg_list_btn"
<LinearLayout
android:id="@+id/item_2"
android:layout_width="0dp"
android:layout_height="152dp"
android:layout_marginStart="25dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="70dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/item_1"
app:layout_constraintStart_toStartOf="parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_2"
android:layout_width="66dp"
android:layout_height="66dp"
android:scaleType="centerCrop"
app:riv_border_color="#B6B6B6"
app:riv_border_width="2dp"
app:riv_oval="true" />
</RelativeLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga2"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp" />
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/liveing2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="50dp"
android:src="@mipmap/icon_user_home_living" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/name_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lines="1"
android:maxEms="4"
android:singleLine="true"
android:text="名字"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<ImageView
android:id="@+id/sex_2"
android:layout_width="12dp"
android:layout_height="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/diamond" />
<TextView
android:id="@+id/votes_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="11111"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/btn_follow_2"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/background_dbdbdb"
android:button="@null"
android:gravity="center"
android:text="@string/main_list_month"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone"
/>
android:text="已关注"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<RadioButton
android:id="@+id/btn_total"
android:layout_width="60dp"
android:layout_height="26dp"
android:layout_marginLeft="20dp"
android:background="@drawable/bg_list_btn"
<LinearLayout
android:id="@+id/item_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="25dp"
android:layout_marginBottom="60dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/item_1">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_3"
android:layout_width="66dp"
android:layout_height="66dp"
android:scaleType="centerCrop"
app:riv_border_color="#B6B6B6"
app:riv_border_width="2dp"
app:riv_oval="true" />
</RelativeLayout>
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga3"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp" />
<RelativeLayout
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/liveing3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="50dp"
android:src="@mipmap/icon_user_home_living" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/name_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:lines="1"
android:maxEms="4"
android:singleLine="true"
android:text="名字"
android:textColor="#FFFFFF"
android:textSize="15sp" />
<ImageView
android:id="@+id/sex_3"
android:layout_width="12dp"
android:layout_height="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/diamond" />
<TextView
android:id="@+id/votes_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="11111"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/btn_follow_3"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/background_dbdbdb"
android:button="@null"
android:gravity="center"
android:text="@string/main_list_all"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone"
/>
android:text="已关注"
android:textColor="@color/white"
android:textSize="11sp" />
</RadioGroup>
</FrameLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.yunbao.common.custom.CommonRefreshView
android:id="@+id/refreshView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
android:layout_height="0dp"
android:layout_marginTop="-15dp"
android:background="@drawable/background_white_up"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bg_layout" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B