礼包详情重复淘号,从存号箱和普通列表进去礼包详情 数据同步
This commit is contained in:
@ -4,8 +4,8 @@ import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
@ -214,25 +214,14 @@ public class LibaoUtils {
|
||||
libaoBtn.setBackgroundResource(R.drawable.textview_cancel_up);
|
||||
break;
|
||||
case "linged":
|
||||
int[][] states = new int[2][];
|
||||
states[0] = new int[]{android.R.attr.state_pressed};
|
||||
states[1] = new int[]{};
|
||||
int[] colors = new int[]{Color.WHITE,
|
||||
Color.parseColor("#06D0A8")};
|
||||
ColorStateList sl = new ColorStateList(states, colors);
|
||||
libaoBtn.setText("已领取");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_linged_style);
|
||||
libaoBtn.setTextColor(sl);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_linged_selector));
|
||||
break;
|
||||
case "taoed":
|
||||
int[][] states2 = new int[2][];
|
||||
states2[0] = new int[]{android.R.attr.state_pressed};
|
||||
states2[1] = new int[]{};
|
||||
int[] colors2 = new int[]{Color.WHITE, Color.parseColor("#ffb13c")};
|
||||
ColorStateList sl2 = new ColorStateList(states2, colors2);
|
||||
libaoBtn.setText("已淘号");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_taoed_style);
|
||||
libaoBtn.setTextColor(sl2);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_taoed_selector));
|
||||
break;
|
||||
case "copy":
|
||||
libaoBtn.setText("复制");
|
||||
@ -240,15 +229,9 @@ public class LibaoUtils {
|
||||
break;
|
||||
case "repeatLing":
|
||||
if (adapter == null) {
|
||||
int[][] states3 = new int[2][];
|
||||
states3[0] = new int[]{android.R.attr.state_pressed};
|
||||
states3[1] = new int[]{};
|
||||
int[] colors3 = new int[]{Color.WHITE,
|
||||
Color.parseColor("#06D0A8")};
|
||||
ColorStateList sl3 = new ColorStateList(states3, colors3);
|
||||
libaoBtn.setText("已领取");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_linged_style);
|
||||
libaoBtn.setTextColor(sl3);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_linged_selector));
|
||||
} else {
|
||||
libaoBtn.setText("再领一个");
|
||||
libaoBtn.setBackgroundResource(R.drawable.textview_cancel_up);
|
||||
@ -256,20 +239,35 @@ public class LibaoUtils {
|
||||
break;
|
||||
case "repeatLinged":
|
||||
if (adapter == null) {
|
||||
int[][] states4 = new int[2][];
|
||||
states4[0] = new int[]{android.R.attr.state_pressed};
|
||||
states4[1] = new int[]{};
|
||||
int[] colors4 = new int[]{Color.WHITE,
|
||||
Color.parseColor("#06D0A8")};
|
||||
ColorStateList sl4 = new ColorStateList(states4, colors4);
|
||||
libaoBtn.setText("已领取");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_linged_style);
|
||||
libaoBtn.setTextColor(sl4);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_linged_selector));
|
||||
} else {
|
||||
libaoBtn.setText("再领一个");
|
||||
libaoBtn.setBackgroundResource(R.drawable.textview_green_style);
|
||||
}
|
||||
break;
|
||||
|
||||
case "repeatTao":
|
||||
if (adapter == null) {
|
||||
libaoBtn.setText("已淘号");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_taoed_style);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_taoed_selector));
|
||||
} else {
|
||||
libaoBtn.setText("再淘一个");
|
||||
libaoBtn.setBackgroundResource(R.drawable.textview_cancel_up);
|
||||
}
|
||||
break;
|
||||
case "repeatTaoed":
|
||||
if (adapter == null) {
|
||||
libaoBtn.setText("已淘号");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_taoed_style);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_taoed_selector));
|
||||
} else {
|
||||
libaoBtn.setText("再领一个");
|
||||
libaoBtn.setBackgroundResource(R.drawable.textview_orange_style);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
libaoBtn.setBackgroundResource(R.drawable.textview_cancel_style);
|
||||
libaoBtn.setText("异常");
|
||||
@ -324,7 +322,12 @@ public class LibaoUtils {
|
||||
libaoLing(context, libaoBtn, libaoEntity, adapter, isInstallRequired, null, entrance);
|
||||
}
|
||||
break;
|
||||
case "再淘一个":
|
||||
case "淘号":
|
||||
if (status.equals("repeatTao")) {
|
||||
Utils.toast(context, "没到重复淘号时间, 礼包每天0点刷新");
|
||||
return;
|
||||
}
|
||||
postLibaoTao(context, libaoEntity.getId(), true, new PostLibaoListener() {
|
||||
@Override
|
||||
public void postSucced(Object response) {
|
||||
@ -414,15 +417,9 @@ public class LibaoUtils {
|
||||
Utils.toast(context, "你已领过这个礼包了");
|
||||
getCunHaoXiang(context);
|
||||
|
||||
int[][] states2 = new int[2][];
|
||||
states2[0] = new int[]{android.R.attr.state_pressed};
|
||||
states2[1] = new int[]{};
|
||||
int[] colors2 = new int[]{Color.WHITE,
|
||||
Color.parseColor("#ffb13c")};
|
||||
ColorStateList sl2 = new ColorStateList(states2, colors2);
|
||||
libaoBtn.setText("已淘号");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_taoed_style);
|
||||
libaoBtn.setTextColor(sl2);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_taoed_selector));
|
||||
libaoEntity.setStatus("taoed");
|
||||
break;
|
||||
case "try tao":
|
||||
@ -546,15 +543,9 @@ public class LibaoUtils {
|
||||
getCunHaoXiang(context);
|
||||
}
|
||||
|
||||
int[][] states = new int[2][];
|
||||
states[0] = new int[]{android.R.attr.state_pressed};
|
||||
states[1] = new int[]{};
|
||||
int[] colors = new int[]{Color.WHITE,
|
||||
Color.parseColor("#06D0A8")};
|
||||
ColorStateList sl = new ColorStateList(states, colors);
|
||||
libaoBtn.setText("已领取");
|
||||
libaoBtn.setBackgroundResource(R.drawable.libao_linged_style);
|
||||
libaoBtn.setTextColor(sl);
|
||||
libaoBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.libao_linged_selector));
|
||||
|
||||
libaoEntity.setStatus("linged");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user