fix: 游戏礼包新增兑换码功能—0228测试-客户端部分-客户端 https://jira.shanqu.cc/browse/GHZS-1448

This commit is contained in:
chenjuntao
2023-03-01 19:06:06 +08:00
parent 8b1f251c80
commit 577be922a6
4 changed files with 29 additions and 9 deletions

View File

@ -320,12 +320,27 @@ public class LibaoUtils {
// 类型为复制的,不需要登录也可以直接复制
if ("copy".equals(libaoEntity.getReceiveMethod())) {
libaoBtn.setText(R.string.libao_copy);
libaoBtn.setTextColor(ExtensionsKt.toColor(R.color.white, context));
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_style);
libaoBtn.setOnClickListener( v -> {
ExtensionsKt.copyTextAndToast(libaoEntity.getCode(), libaoEntity.getToast());
});
if ("finish".equals(libaoEntity.getStatus())) {
libaoBtn.setText(R.string.libao_finish);
libaoBtn.setBackgroundResource(R.drawable.button_border_round_gray);
libaoBtn.setTextColor(context.getResources().getColor(R.color.button_gray));
libaoBtn.setOnClickListener(v -> ToastUtils.toast("兑换码领取已结束"));
} else {
libaoBtn.setText(R.string.libao_copy);
libaoBtn.setTextColor(ExtensionsKt.toColor(R.color.white, context));
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_style);
libaoBtn.setOnClickListener(v -> {
LogUtils.uploadReceiveGift(
"game_gift_code_successful",
libaoEntity.getId(),
libaoEntity.getName(),
"游戏详情",
libaoEntity.getGame().getId(),
libaoEntity.getGame().getName()
);
ExtensionsKt.copyTextAndToast(libaoEntity.getCode(), libaoEntity.getToast());
});
}
return;
}