盲盒全服通知逻辑
This commit is contained in:
@@ -45,6 +45,7 @@ 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.MainListBoxBlindViewHolder;
|
||||
import com.yunbao.main.views.MainListContributeViewHolder;
|
||||
import com.yunbao.main.views.MainListProfitViewHolder;
|
||||
import com.yunbao.main.views.MyClipPagerTitleView;
|
||||
@@ -72,7 +73,7 @@ import java.util.List;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
public class MainListActivity extends AbsActivity implements OnItemClickListener<ListBean> {
|
||||
private static final int PAGE_COUNT = 2;
|
||||
private static final int PAGE_COUNT = 3;
|
||||
public static final String DAY = "day";
|
||||
public static final String WEEK = "week";
|
||||
public static final String MONTH = "month";
|
||||
@@ -121,7 +122,8 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
|
||||
final String[] titles = new String[]{
|
||||
(mContext.getString(R.string.glamour_list)),
|
||||
(mContext.getString(R.string.magnificent_list))
|
||||
(mContext.getString(R.string.magnificent_list)),
|
||||
(mContext.getString(R.string.blind_box_list))
|
||||
};
|
||||
CommonNavigator commonNavigator = new CommonNavigator(mContext);
|
||||
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
||||
@@ -231,9 +233,12 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
if (position == 0) {
|
||||
select.setTextColor(Color.parseColor("#FF82C1"));
|
||||
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else {
|
||||
} else if (position == 1){
|
||||
select.setTextColor(Color.parseColor("#7BBAFF"));
|
||||
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}else if (position == 2){
|
||||
select.setTextColor(Color.parseColor("#ff9072"));
|
||||
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,6 +261,11 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
mContributeViewHolder.setHide(outRankHide);
|
||||
vh = mContributeViewHolder;
|
||||
vh.setAppbarColor(Color.parseColor("#73B2FF"));
|
||||
}else if (position == 2) {
|
||||
MainListBoxBlindViewHolder mainListBoxBlindViewHolder = new MainListBoxBlindViewHolder(mContext,parent);
|
||||
mainListBoxBlindViewHolder.setHide(outRankHide);
|
||||
vh = mainListBoxBlindViewHolder;
|
||||
vh.setAppbarColor(Color.parseColor("#ff9072"));
|
||||
}
|
||||
if (vh == null) {
|
||||
return;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
private List<ListBean> mTopList;
|
||||
private int mType;
|
||||
private List<String> outRankHide = new ArrayList<>();
|
||||
protected boolean isRankOne;//是否为魅力榜 (第一个tab)
|
||||
protected int isRankOne;//是否为魅力榜 (第一个tab)
|
||||
|
||||
|
||||
public MainListAdapter(Context context, int type) {
|
||||
@@ -93,7 +93,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
|
||||
}
|
||||
|
||||
public void setRankOne(boolean rankOne) {
|
||||
public void setRankOne(int rankOne) {
|
||||
isRankOne = rankOne;
|
||||
}
|
||||
|
||||
@@ -267,12 +267,15 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
} else {
|
||||
mBtnFollow.doChecked(false);
|
||||
mBtnFollow.setText(mFollow);
|
||||
if(isRankOne){
|
||||
if(isRankOne==0){
|
||||
mBtnFollow.setBackgroundResource(R.drawable.background_ff82c1);
|
||||
mBtnFollow.setTextColor(Color.parseColor("#FF82C1"));
|
||||
}else {
|
||||
}else if(isRankOne==1){
|
||||
mBtnFollow.setBackgroundResource(R.drawable.background_ff7bbaff);
|
||||
mBtnFollow.setTextColor(Color.parseColor("#7BBAFF"));
|
||||
}else if(isRankOne==2){
|
||||
mBtnFollow.setBackgroundResource(R.drawable.background_ffff9072);
|
||||
mBtnFollow.setTextColor(Color.parseColor("#ff9072"));
|
||||
}
|
||||
}
|
||||
mSex.setVisibility(View.INVISIBLE);
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MainHttpConsts {
|
||||
public static final String GET_NEAR = "getNear";
|
||||
public static final String PROFIT_LIST = "profitList";
|
||||
public static final String CONSUME_LIST = "consumeList";
|
||||
public static final String BLIND_BOX_LIST = "blindBoxList";
|
||||
public static final String GET_BASE_INFO = "getBaseInfo";
|
||||
public static final String SET_BLACK = "setBlack";
|
||||
public static final String GET_SETTING_LIST = "getSettingList";
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("Login.userLoginByThird", MainHttpConsts.LOGIN_BY_THIRD)
|
||||
.params("openid", openid)
|
||||
.params("nicename", nicename)
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3")
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY == true ? "1" : "3")
|
||||
.params("avatar", avatar)
|
||||
.params("type", type)
|
||||
.params("source", DEVICE)
|
||||
@@ -77,11 +77,11 @@ public class MainHttpUtil {
|
||||
* 第三方登录---增加参数:推广码,手机唯一标识
|
||||
*/
|
||||
|
||||
public static void loginByThird(String UserID,String openid, String promoCode, String uuidDevice, String nicename, String avatar, String type, HttpCallback callback) {
|
||||
public static void loginByThird(String UserID, String openid, String promoCode, String uuidDevice, String nicename, String avatar, String type, HttpCallback callback) {
|
||||
String sign = MD5Util.getMD5("openid=" + openid + "&" + SALT);
|
||||
HttpClient.getInstance().get("Login.userLoginByThird", MainHttpConsts.LOGIN_BY_THIRD)
|
||||
.params("openid", openid)
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3")
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY == true ? "1" : "3")
|
||||
.params("admin_id", promoCode)
|
||||
.params("uuid_Device", uuidDevice)
|
||||
.params("nicename", nicename)
|
||||
@@ -198,6 +198,14 @@ public class MainHttpUtil {
|
||||
|
||||
}
|
||||
|
||||
//排行榜 盲盒榜
|
||||
public static void blindBoxList(String type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Home.blindBoxList", MainHttpConsts.BLIND_BOX_LIST)
|
||||
.params("type", type)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取谷歌
|
||||
@@ -324,10 +332,11 @@ public class MainHttpUtil {
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
public static void searchnew(String fan_key, String jian_key,int type, int p, HttpCallback callback) {
|
||||
public static void searchnew(String fan_key, String jian_key, int type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("", MainHttpConsts.SEARCH)
|
||||
.params("jian_key", jian_key)
|
||||
.params("fan_key", fan_key)
|
||||
@@ -553,10 +562,10 @@ public class MainHttpUtil {
|
||||
/**
|
||||
* 手机注册接口---增加参数:推广码,手机唯一标识,国家代码
|
||||
*/
|
||||
public static void register(String UserID,String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) {
|
||||
public static void register(String UserID, String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Login.userReg", MainHttpConsts.REGISTER)
|
||||
.params("user_login", user_login)
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3")
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY == true ? "1" : "3")
|
||||
//增加参数:推广码
|
||||
.params("user_activation_key", promo_code)
|
||||
.params("admin_id", promo_code)
|
||||
@@ -696,9 +705,10 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("User.isInstructor", MainHttpConsts.ISINSTRUCTOR)
|
||||
.execute(callback);
|
||||
}
|
||||
//
|
||||
public static void setMessageReadAll(){
|
||||
HttpClient.getInstance().get("User.getUserInstructor","")
|
||||
|
||||
//
|
||||
public static void setMessageReadAll() {
|
||||
HttpClient.getInstance().get("User.getUserInstructor", "")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -706,10 +716,11 @@ public class MainHttpUtil {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备号有没有注册过
|
||||
*/
|
||||
public static void getDeviceLoginType( HttpCallback callback) {
|
||||
public static void getDeviceLoginType(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Login.getDeviceLoginType", "Login.getDeviceLoginType")
|
||||
.params("uuid_Device", DeviceUtils.getUniqueDeviceId())
|
||||
.execute(callback);
|
||||
|
||||
@@ -31,7 +31,6 @@ 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.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -57,7 +56,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
public static final String MONTH = "month";
|
||||
public static final String TOTAL = "total";
|
||||
protected String mType;
|
||||
protected boolean isRankOne;//是否为魅力榜 (第一个tab)
|
||||
protected int isRankOne;//是否为魅力榜 (第一个tab)
|
||||
protected CommonRefreshView mRefreshView;
|
||||
public MainListAdapter mAdapter;
|
||||
protected OnLoadData loadData;
|
||||
@@ -94,7 +93,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
if (outRankHide != null) {
|
||||
for (String hideId : outRankHide) {
|
||||
if (i < 3) {
|
||||
hv.setData(list.get(i).setHide(TextUtils .equals(list.get(i).getUid(), hideId)), i);
|
||||
hv.setData(list.get(i).setHide(TextUtils.equals(list.get(i).getUid(), hideId)), i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -216,8 +215,10 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
}
|
||||
if (position == 0) {
|
||||
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour_top);
|
||||
} else {
|
||||
} else if (position == 1) {
|
||||
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour2_top);
|
||||
} else if (position == 2) {
|
||||
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour3_top);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,13 +336,16 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
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("+" +mContext.getString(R.string.follow));
|
||||
if (isRankOne) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + mContext.getString(R.string.follow));
|
||||
if (isRankOne==0) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else {
|
||||
} else if (isRankOne==1){
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_7bbaff);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else if (isRankOne == 2) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ff9072);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
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.main.adapter.MainListAdapter;
|
||||
import com.yunbao.main.bean.ListBean;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排行榜,盲盒榜
|
||||
*/
|
||||
public class MainListBoxBlindViewHolder extends AbsMainListChildViewHolder {
|
||||
private List<String> outRankHide = new ArrayList<>();
|
||||
|
||||
public MainListBoxBlindViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
isRankOne = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<ListBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<ListBean> getAdapter() {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainListAdapter(mContext, MainListAdapter.TYPE_CONTRIBUTE);
|
||||
mAdapter.setRankOne(isRankOne);
|
||||
mAdapter.setOnItemClickListener(MainListBoxBlindViewHolder.this);
|
||||
}
|
||||
mAdapter.setHide(outRankHide);
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
if (!mType.isEmpty()) {
|
||||
MainHttpUtil.blindBoxList(mType, p, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ListBean> processData(String[] info) {
|
||||
list = JSON.parseArray(Arrays.toString(info), ListBean.class);
|
||||
if (mRefreshView.getPageCount() == 1) {
|
||||
if (loadData != null) {
|
||||
loadData.onData(list, outRankHide);
|
||||
}
|
||||
}
|
||||
mAdapter.setHide(outRankHide);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<ListBean> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<ListBean> loadItemList, int loadItemCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置隐藏数据
|
||||
*
|
||||
* @param outRankHide
|
||||
*/
|
||||
public void setHide(List<String> outRankHide) {
|
||||
this.outRankHide = outRankHide;
|
||||
if (mAdapter != null)
|
||||
mAdapter.setHide(outRankHide);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class MainListContributeViewHolder extends AbsMainListChildViewHolder {
|
||||
|
||||
public MainListContributeViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
isRankOne = false;
|
||||
isRankOne = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder {
|
||||
|
||||
public MainListProfitViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
isRankOne = true;
|
||||
isRankOne = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
10
main/src/main/res/drawable/background_ff9072.xml
Normal file
10
main/src/main/res/drawable/background_ff9072.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="#FF9072" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
main/src/main/res/drawable/background_ffff9072.xml
Normal file
9
main/src/main/res/drawable/background_ffff9072.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="#FF9072" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -16,6 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</androidx.viewpager.widget.ViewPager>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bg_layout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -91,5 +92,4 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
main/src/main/res/mipmap-xxhdpi/bg_glamour3_top.png
Normal file
BIN
main/src/main/res/mipmap-xxhdpi/bg_glamour3_top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 277 KiB |
Reference in New Issue
Block a user