补充排行榜颜色
This commit is contained in:
parent
e3f9f21287
commit
8b3b0ce2ea
@ -202,8 +202,7 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
|||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
MainListActivity.this.position = position;
|
MainListActivity.this.position = position;
|
||||||
mDay.setChecked(true);
|
mDay.setChecked(true);
|
||||||
mDay.setTextColor(Color.parseColor("#FF82C1"));
|
setRadioColor(position, mDay, mWeek);
|
||||||
mWeek.setTextColor(Color.parseColor("#FFFFFF"));
|
|
||||||
loadPageData(position, DAY);
|
loadPageData(position, DAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,13 +213,11 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
|||||||
});
|
});
|
||||||
mDay.setOnClickListener(v -> {
|
mDay.setOnClickListener(v -> {
|
||||||
loadPageData(position, DAY);
|
loadPageData(position, DAY);
|
||||||
mDay.setTextColor(Color.parseColor("#FF82C1"));
|
setRadioColor(mViewPager.getCurrentItem(),mDay,mWeek);
|
||||||
mWeek.setTextColor(Color.parseColor("#FFFFFF"));
|
|
||||||
});
|
});
|
||||||
mWeek.setOnClickListener(v -> {
|
mWeek.setOnClickListener(v -> {
|
||||||
loadPageData(position, WEEK);
|
loadPageData(position, WEEK);
|
||||||
mWeek.setTextColor(Color.parseColor("#FF82C1"));
|
setRadioColor(mViewPager.getCurrentItem(),mWeek,mDay);
|
||||||
mDay.setTextColor(Color.parseColor("#FFFFFF"));
|
|
||||||
});
|
});
|
||||||
mBack.setOnClickListener(v -> {
|
mBack.setOnClickListener(v -> {
|
||||||
finish();
|
finish();
|
||||||
@ -230,6 +227,16 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
|||||||
loadPageData(0, DAY);
|
loadPageData(0, DAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setRadioColor(int position, RadioButton select, RadioButton unSelect) {
|
||||||
|
if (position == 0) {
|
||||||
|
select.setTextColor(Color.parseColor("#FF82C1"));
|
||||||
|
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||||
|
} else {
|
||||||
|
select.setTextColor(Color.parseColor("#7BBAFF"));
|
||||||
|
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void loadPageData(int position, String rank) {
|
private void loadPageData(int position, String rank) {
|
||||||
if (mViewHolders == null) {
|
if (mViewHolders == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -52,6 +52,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
|||||||
private List<ListBean> mTopList;
|
private List<ListBean> mTopList;
|
||||||
private int mType;
|
private int mType;
|
||||||
private List<String> outRankHide = new ArrayList<>();
|
private List<String> outRankHide = new ArrayList<>();
|
||||||
|
protected boolean isRankOne;//是否为魅力榜 (第一个tab)
|
||||||
|
|
||||||
|
|
||||||
public MainListAdapter(Context context, int type) {
|
public MainListAdapter(Context context, int type) {
|
||||||
@ -93,6 +94,10 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRankOne(boolean rankOne) {
|
||||||
|
isRankOne = rankOne;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
if (mList != null && mTopList.size() > 0) {
|
if (mList != null && mTopList.size() > 0) {
|
||||||
@ -263,11 +268,16 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
|||||||
} else {
|
} else {
|
||||||
mBtnFollow.doChecked(false);
|
mBtnFollow.doChecked(false);
|
||||||
mBtnFollow.setText(mFollow);
|
mBtnFollow.setText(mFollow);
|
||||||
|
if(isRankOne){
|
||||||
|
mBtnFollow.setBackgroundResource(R.drawable.background_ff82c1);
|
||||||
|
mBtnFollow.setTextColor(Color.parseColor("#FF82C1"));
|
||||||
|
}else {
|
||||||
mBtnFollow.setBackgroundResource(R.drawable.background_ff7bbaff);
|
mBtnFollow.setBackgroundResource(R.drawable.background_ff7bbaff);
|
||||||
mBtnFollow.setTextColor(Color.parseColor("#7BBAFF"));
|
mBtnFollow.setTextColor(Color.parseColor("#7BBAFF"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateItem(String id, int attention) {
|
public void updateItem(String id, int attention) {
|
||||||
|
@ -54,6 +54,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
|||||||
public static final String MONTH = "month";
|
public static final String MONTH = "month";
|
||||||
public static final String TOTAL = "total";
|
public static final String TOTAL = "total";
|
||||||
protected String mType;
|
protected String mType;
|
||||||
|
protected boolean isRankOne;//是否为魅力榜 (第一个tab)
|
||||||
protected CommonRefreshView mRefreshView;
|
protected CommonRefreshView mRefreshView;
|
||||||
public MainListAdapter mAdapter;
|
public MainListAdapter mAdapter;
|
||||||
protected OnLoadData loadData;
|
protected OnLoadData loadData;
|
||||||
@ -278,8 +279,14 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
|||||||
if (bean.getAttention() != 1) {
|
if (bean.getAttention() != 1) {
|
||||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).doChecked(true);
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).doChecked(true);
|
||||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + WordUtil.getString(R.string.follow));
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + WordUtil.getString(R.string.follow));
|
||||||
|
if(isRankOne) {
|
||||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2);
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2);
|
||||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||||
|
}else{
|
||||||
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_7bbaff);
|
||||||
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||||
|
}
|
||||||
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.INVISIBLE);
|
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ public class MainListContributeViewHolder extends AbsMainListChildViewHolder {
|
|||||||
|
|
||||||
public MainListContributeViewHolder(Context context, ViewGroup parentView) {
|
public MainListContributeViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
|
isRankOne = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -37,6 +38,7 @@ public class MainListContributeViewHolder extends AbsMainListChildViewHolder {
|
|||||||
public RefreshAdapter<ListBean> getAdapter() {
|
public RefreshAdapter<ListBean> getAdapter() {
|
||||||
if (mAdapter == null) {
|
if (mAdapter == null) {
|
||||||
mAdapter = new MainListAdapter(mContext, MainListAdapter.TYPE_CONTRIBUTE);
|
mAdapter = new MainListAdapter(mContext, MainListAdapter.TYPE_CONTRIBUTE);
|
||||||
|
mAdapter.setRankOne(isRankOne);
|
||||||
mAdapter.setOnItemClickListener(MainListContributeViewHolder.this);
|
mAdapter.setOnItemClickListener(MainListContributeViewHolder.this);
|
||||||
}
|
}
|
||||||
mAdapter.setHide(outRankHide);
|
mAdapter.setHide(outRankHide);
|
||||||
|
@ -25,6 +25,7 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder {
|
|||||||
|
|
||||||
public MainListProfitViewHolder(Context context, ViewGroup parentView) {
|
public MainListProfitViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
|
isRankOne = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -35,6 +36,7 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder {
|
|||||||
public RefreshAdapter<ListBean> getAdapter() {
|
public RefreshAdapter<ListBean> getAdapter() {
|
||||||
if (mAdapter == null) {
|
if (mAdapter == null) {
|
||||||
mAdapter = new MainListAdapter(mContext, MainListAdapter.TYPE_PROFIT);
|
mAdapter = new MainListAdapter(mContext, MainListAdapter.TYPE_PROFIT);
|
||||||
|
mAdapter.setRankOne(isRankOne);
|
||||||
mAdapter.setOnItemClickListener(MainListProfitViewHolder.this);
|
mAdapter.setOnItemClickListener(MainListProfitViewHolder.this);
|
||||||
}
|
}
|
||||||
return mAdapter;
|
return mAdapter;
|
||||||
@ -87,5 +89,4 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
10
main/src/main/res/drawable/background_7bbaff.xml
Normal file
10
main/src/main/res/drawable/background_7bbaff.xml
Normal 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="#ff80beff" />
|
||||||
|
<corners android:radius="14dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
9
main/src/main/res/drawable/background_ff82c1.xml
Normal file
9
main/src/main/res/drawable/background_ff82c1.xml
Normal 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="#ffff82c1" />
|
||||||
|
<corners android:radius="14dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -86,6 +86,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="50dp"
|
||||||
|
android:visibility="invisible"
|
||||||
android:src="@mipmap/icon_user_home_living" />
|
android:src="@mipmap/icon_user_home_living" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -107,7 +108,7 @@
|
|||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxEms="4"
|
android:maxEms="4"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="名字"
|
android:text=""
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
@ -135,7 +136,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="11111"
|
android:text=""
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@ -151,6 +152,7 @@
|
|||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/shield_gift_effect"
|
android:text="@string/shield_gift_effect"
|
||||||
|
android:visibility="invisible"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="11sp" />
|
android:textSize="11sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@ -215,6 +217,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="invisible"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="50dp"
|
||||||
android:src="@mipmap/icon_user_home_living" />
|
android:src="@mipmap/icon_user_home_living" />
|
||||||
|
|
||||||
@ -237,7 +240,7 @@
|
|||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxEms="4"
|
android:maxEms="4"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="名字"
|
android:text=""
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
@ -265,7 +268,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="11111"
|
android:text=""
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@ -280,6 +283,7 @@
|
|||||||
android:background="@drawable/background_dbdbdb"
|
android:background="@drawable/background_dbdbdb"
|
||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:visibility="invisible"
|
||||||
android:text="已关注"
|
android:text="已关注"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="11sp" />
|
android:textSize="11sp" />
|
||||||
@ -345,6 +349,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="50dp"
|
||||||
|
android:visibility="invisible"
|
||||||
android:src="@mipmap/icon_user_home_living" />
|
android:src="@mipmap/icon_user_home_living" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -366,7 +371,7 @@
|
|||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxEms="4"
|
android:maxEms="4"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="名字"
|
android:text=""
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
@ -394,7 +399,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="11111"
|
android:text=""
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@ -410,6 +415,7 @@
|
|||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="已关注"
|
android:text="已关注"
|
||||||
|
android:visibility="invisible"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="11sp" />
|
android:textSize="11sp" />
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user