新增战令系统
@@ -158,6 +158,7 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.UserAvatarSelectActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.BattlePassActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,233 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow;
|
||||
import com.yunbao.common.dialog.ActivityEndPopupWindow;
|
||||
import com.yunbao.common.dialog.LiberalBattlePassPopupWindow;
|
||||
import com.yunbao.common.dialog.PromotionElitePopupWindow;
|
||||
import com.yunbao.common.dialog.RuleOfWarPopupWindow;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
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.event.BattlePassTypeEvent;
|
||||
import com.yunbao.main.fragment.BattlePassExchangeFragment;
|
||||
import com.yunbao.main.fragment.BattlePassMissionFragment;
|
||||
import com.yunbao.main.fragment.BattlePassRewardFragment;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 战令
|
||||
*/
|
||||
@Route(path = RouteUtil.PATH_BattlePassActivity)
|
||||
public class BattlePassActivity extends AbsActivity {
|
||||
ImageView rule, tab1, tab2, tab3;
|
||||
ViewPager2 viewPager;
|
||||
List<BaseFragment> fragments;
|
||||
TextView sessionView;
|
||||
TextView timeView;
|
||||
TextView levelView;
|
||||
ProgressBar levelProgressView;
|
||||
TextView integralView;
|
||||
Button moreIntegralButton;
|
||||
String enjoySpendMoney = "";
|
||||
String quintessenceSpendMoney = "";
|
||||
|
||||
BattlePassUserInfoBean data;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_battlepass;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
super.main(savedInstanceState);
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
fragments = new ArrayList<>();
|
||||
rule = findViewById(R.id.rule);
|
||||
tab1 = findViewById(R.id.tab_1);
|
||||
tab2 = findViewById(R.id.tab_2);
|
||||
tab3 = findViewById(R.id.tab_3);
|
||||
viewPager = findViewById(R.id.context_layout);
|
||||
fragments.add(new BattlePassRewardFragment());
|
||||
fragments.add(new BattlePassMissionFragment());
|
||||
fragments.add(new BattlePassExchangeFragment());
|
||||
viewPager.setAdapter(new FragmentStateAdapter(this) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
});
|
||||
viewPager.setUserInputEnabled(false);
|
||||
ViewClicksAntiShake.clicksAntiShake(tab1, () -> clickView(0));
|
||||
ViewClicksAntiShake.clicksAntiShake(tab2, () -> clickView(1));
|
||||
ViewClicksAntiShake.clicksAntiShake(tab3, () -> clickView(2));
|
||||
|
||||
sessionView = findViewById(R.id.session);
|
||||
timeView = findViewById(R.id.time);
|
||||
levelView = findViewById(R.id.level);
|
||||
levelProgressView = findViewById(R.id.level_progress);
|
||||
integralView = findViewById(R.id.integral);
|
||||
moreIntegralButton = findViewById(R.id.more_integral);
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(moreIntegralButton, () -> {
|
||||
if(data.getBattlePassUserRecords3()==2){
|
||||
return;
|
||||
}
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight(mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new PromotionElitePopupWindow(mContext,
|
||||
enjoySpendMoney,
|
||||
quintessenceSpendMoney,
|
||||
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
System.out.println("code = " + code + ", msg = " + msg);
|
||||
fragments.get(viewPager.getCurrentItem()).updateData();
|
||||
}
|
||||
},
|
||||
String.valueOf(data.getLive_battle_pass_type().get(1).getId()),
|
||||
String.valueOf(data.getLive_battle_pass_type().get(2).getId())
|
||||
))
|
||||
.show();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(rule, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(BattlePassActivity.this)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight(BattlePassActivity.this) - DpUtil.dp2px(34))
|
||||
.asCustom(new RuleOfWarPopupWindow(
|
||||
BattlePassActivity.this
|
||||
))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void clickView(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
tab1.setImageResource(R.mipmap.ic_zl_tab1);
|
||||
tab2.setImageResource(R.mipmap.ic_zl_tab2_unselect);
|
||||
tab3.setImageResource(R.mipmap.ic_zl_tab3_unselect);
|
||||
break;
|
||||
case 1:
|
||||
tab1.setImageResource(R.mipmap.ic_zl_tab1_unselect);
|
||||
tab2.setImageResource(R.mipmap.ic_zl_tab2);
|
||||
tab3.setImageResource(R.mipmap.ic_zl_tab3_unselect);
|
||||
break;
|
||||
case 2:
|
||||
tab1.setImageResource(R.mipmap.ic_zl_tab1_unselect);
|
||||
tab2.setImageResource(R.mipmap.ic_zl_tab2_unselect);
|
||||
tab3.setImageResource(R.mipmap.ic_zl_tab3);
|
||||
break;
|
||||
}
|
||||
viewPager.setCurrentItem(position, false);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getBattlePassUserInfo(new HttpCallback<BattlePassUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(BattlePassUserInfoBean data) {
|
||||
BattlePassActivity.this.data = data;
|
||||
sessionView.setText(data.getBattlePassName());
|
||||
timeView.setText(data.getStartTime() + " - " + data.getEndTime());
|
||||
levelView.setText("Lv." + data.getLevel());
|
||||
levelProgressView.setMax(data.getNextLevelExp());
|
||||
levelProgressView.setMin(data.getLastLevelExp());
|
||||
levelProgressView.setProgress(data.getBattlePassExp());
|
||||
integralView.setText(String.format(WordUtil.getNewString(R.string.battlepass_user_my_integral), data.getPoints()));
|
||||
|
||||
for (LiveBattlePassRewardsBean.BattlePassType passType : data.getLive_battle_pass_type()) {
|
||||
if (passType.getId() == 2) {
|
||||
quintessenceSpendMoney = String.valueOf(passType.getDiamond_value());
|
||||
}
|
||||
if (passType.getId() == 3) {
|
||||
enjoySpendMoney = String.valueOf(passType.getDiamond_value());
|
||||
}
|
||||
}
|
||||
if(!data.isBattlePassStatus() && !SpUtil.getInstance().getBooleanValue("is_battle_pass_status")){
|
||||
SpUtil.getInstance().setBooleanValue("is_battle_pass_status",true);//ActivityEndPopupWindow
|
||||
new XPopup.Builder(BattlePassActivity.this)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight(BattlePassActivity.this) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivityEndPopupWindow(
|
||||
BattlePassActivity.this
|
||||
))
|
||||
.show();
|
||||
|
||||
}
|
||||
if(data.isBattlePassStatus()){
|
||||
SpUtil.getInstance().removeValue("is_battle_pass_status");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void event(BattlePassTypeEvent event) {
|
||||
if(event.getType()==0){
|
||||
initData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.dialog.WarOrderExchangeDetailsPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassExchangeAdapter extends RecyclerView.Adapter<BattlePassExchangeAdapter.VH> {
|
||||
private Context mContext;
|
||||
List<BattlePassPoints> mList = new ArrayList<>();
|
||||
int point;
|
||||
OnItemClickListener<BattlePassPoints> onItemClickListener;
|
||||
|
||||
public BattlePassExchangeAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setPoint(int point) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public void setList(List<BattlePassPoints> mList) {
|
||||
this.mList = mList;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<BattlePassPoints> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public BattlePassExchangeAdapter.VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new BattlePassExchangeAdapter.VH(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_exchange, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BattlePassExchangeAdapter.VH holder, int position) {
|
||||
holder.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
private ImageView icon;
|
||||
private ImageView indicator;
|
||||
private TextView title;
|
||||
private TextView content;
|
||||
private Button submit;
|
||||
private View mark;
|
||||
private TextView markText;
|
||||
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
icon = itemView.findViewById(R.id.tab_1);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
content = itemView.findViewById(R.id.content);
|
||||
submit = itemView.findViewById(R.id.submit);
|
||||
indicator = itemView.findViewById(R.id.indicator);
|
||||
mark = itemView.findViewById(R.id.mark_layout);
|
||||
markText = itemView.findViewById(R.id.mark_text);
|
||||
indicator.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void setData(BattlePassPoints battlePassPoints) {
|
||||
ImgLoader.display(mContext, battlePassPoints.getImageUrl(), icon);
|
||||
title.setText(battlePassPoints.getRewardsName());
|
||||
content.setText(battlePassPoints.getPointsThresholdText());
|
||||
if (StringUtil.isEmpty(battlePassPoints.getExchangeMark())) {
|
||||
mark.setVisibility(View.GONE);
|
||||
} else {
|
||||
mark.setVisibility(View.VISIBLE);
|
||||
markText.setText(battlePassPoints.getExchangeMark());
|
||||
}
|
||||
if (battlePassPoints.getExchangeStatus() == 1) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_exchange_submit_lock));
|
||||
submit.setBackgroundResource(R.mipmap.bg_zl_battlepass_exchange_btn_lock);
|
||||
submit.setTextColor(Color.parseColor("#E4E5E8"));
|
||||
return;
|
||||
}
|
||||
if (battlePassPoints.getUserQuintyCount() == battlePassPoints.getExchangeQuantity()) {
|
||||
submit.setTextColor(Color.parseColor("#5773B1"));
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_exchange_submit_exchange));
|
||||
submit.setBackgroundResource(R.mipmap.bg_zl_battlepass_exchange_btn_over);
|
||||
} else {
|
||||
submit.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
submit.setText(String.format("%s\n(%s/%s)",
|
||||
WordUtil.getNewString(R.string.battlepass_exchange_submit_unexchange),
|
||||
battlePassPoints.getUserQuintyCount(),
|
||||
battlePassPoints.getExchangeQuantity()
|
||||
));
|
||||
submit.setBackgroundResource(R.mipmap.bg_zl_battlepass_exchange_btn_exchange);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(submit, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new WarOrderExchangeDetailsPopupWindow(mContext,
|
||||
battlePassPoints.getExchangeQuantity()-battlePassPoints.getUserQuintyCount(),
|
||||
point,
|
||||
Integer.parseInt(battlePassPoints.getPointsThreshold()),
|
||||
battlePassPoints.getImageUrl(),
|
||||
String.valueOf(battlePassPoints.getId()),
|
||||
new WarOrderExchangeDetailsPopupWindow.WarOrderExchangeDetailsCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
ToastUtil.show(msg);
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(battlePassPoints, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.dialog.OrderLevelPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassMissionAdapter extends RecyclerView.Adapter<BattlePassMissionAdapter.VH> {
|
||||
private Context mContext;
|
||||
private List<BattlePassTask.Task> mList = new ArrayList<>();
|
||||
private OnItemClickListener<BattlePassTask.Task> onItemClickListener;
|
||||
|
||||
public BattlePassMissionAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<BattlePassTask.Task> mList) {
|
||||
this.mList = mList;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<BattlePassTask.Task> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (mList.get(position).getId() < 0) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public BattlePassMissionAdapter.VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == 0) {
|
||||
return new BattlePassMissionAdapter.TypeOfTitle(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_mission_type_title, parent, false));
|
||||
}
|
||||
return new BattlePassMissionAdapter.TypeOfMission(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_mission_type_mission, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BattlePassMissionAdapter.VH holder, int position) {
|
||||
holder.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static abstract class VH extends RecyclerView.ViewHolder {
|
||||
protected static final int SUBMIT_BUY = 0;
|
||||
protected static final int SUBMIT_FINISHED = 1;
|
||||
protected static final int SUBMIT_OVER = 2;
|
||||
protected static final int SUBMIT_DEF = 3;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
public abstract void setData(BattlePassTask.Task task);
|
||||
}
|
||||
|
||||
private static class TypeOfTitle extends VH {
|
||||
TextView title;
|
||||
|
||||
public TypeOfTitle(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(BattlePassTask.Task task) {
|
||||
if (task.getId() == -1) {
|
||||
title.setText(WordUtil.getNewString(R.string.battlepass_mission_line_title_daily));
|
||||
} else if (task.getId() == -2) {
|
||||
title.setText(WordUtil.getNewString(R.string.battlepass_mission_line_title_season));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class TypeOfMission extends VH {
|
||||
ImageView icon;
|
||||
TextView title;
|
||||
TextView content;
|
||||
Button submit;
|
||||
|
||||
|
||||
public TypeOfMission(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
icon = itemView.findViewById(R.id.icon);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
content = itemView.findViewById(R.id.content);
|
||||
submit = itemView.findViewById(R.id.submit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(BattlePassTask.Task task) {
|
||||
/* if (task.getId() == 1) {
|
||||
task.setReceivedTask(1);
|
||||
task.setUserTaskSuccess(1);
|
||||
task.setNotReceivedTask(0);
|
||||
}
|
||||
if (task.getId() == 2) {
|
||||
task.setUserTaskSuccess(2);
|
||||
task.setReceivedTask(5);
|
||||
task.setNotReceivedTask(5);
|
||||
}*/
|
||||
if (task.getTaskSuccess() > 0) {
|
||||
title.setText(String.format("%s(%s/%s)",
|
||||
task.getNameText(),
|
||||
task.getUserTaskSuccess(),
|
||||
task.getTaskSuccess())
|
||||
);
|
||||
} else {
|
||||
title.setText(task.getNameText());
|
||||
}
|
||||
content.setText(task.getRemarkText());
|
||||
ImgLoader.display(itemView.getContext(), task.getImagePath(), icon);
|
||||
submit.setTag(SUBMIT_DEF);
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_unfinished));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_unfinished);
|
||||
if (task.isBuy()) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_buy));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_buy);
|
||||
submit.setTag(SUBMIT_BUY);
|
||||
} else {
|
||||
if (task.getNotReceivedTask() > 0) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_finished));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_finished);
|
||||
submit.setTag(SUBMIT_FINISHED);
|
||||
}
|
||||
if (task.getNotReceivedTask() == 0 && task.getTaskSuccess() == task.getUserTaskSuccess()) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_over));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_over);
|
||||
submit.setTag(SUBMIT_OVER);
|
||||
submit.setTextColor(Color.parseColor("#0D21B2"));
|
||||
}
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(submit, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if ((int) submit.getTag() == SUBMIT_FINISHED) {
|
||||
subTask(task);
|
||||
}
|
||||
if ((int) submit.getTag() == SUBMIT_BUY) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(task, -2);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void subTask(BattlePassTask.Task task) {
|
||||
LiveNetManager.get(itemView.getContext())
|
||||
.getBattlePassTaskOver(String.valueOf(task.getId()), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(data.getCode() + "|" + data.getMsg());
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(task, data.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(task, -1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewardAdapter.VH> {
|
||||
private Context mContext;
|
||||
private List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> mList = new ArrayList<>();
|
||||
private int userLevel;
|
||||
private int userType;
|
||||
private OnItemClickListener<LiveBattlePassRewardsBean.LiveBattlePassReward> onItemClickListener;
|
||||
|
||||
public void setList(List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> mList) {
|
||||
this.mList = mList;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<LiveBattlePassRewardsBean.LiveBattlePassReward> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public void setUserLevel(int userLevel) {
|
||||
this.userLevel = userLevel;
|
||||
}
|
||||
|
||||
public void setUserType(int userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public BattlePassRewardAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new VH(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_reward_type_top, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
holder.setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
View lineBg, line, point;
|
||||
View tab1Layout, tab2Layout, tab3Layout;
|
||||
Button lv;
|
||||
ImageView tab1, tab2, tab3;
|
||||
ImageView tab1Unlock, tab2Unlock, tab3Unlock;
|
||||
ImageView tab1Mask, tab2Mask, tab3Mask;
|
||||
ImageView tab1Subscript, tab2Subscript, tab3Subscript;
|
||||
ImageView tab1Received, tab2Received, tab3Received;
|
||||
TextView tab1Title, tab2Title, tab3Title;
|
||||
|
||||
|
||||
Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward> data;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
lineBg = itemView.findViewById(R.id.line_bg);
|
||||
line = itemView.findViewById(R.id.line);
|
||||
point = itemView.findViewById(R.id.point);
|
||||
lv = itemView.findViewById(R.id.reward_lv);
|
||||
tab1Layout = itemView.findViewById(R.id.tab_1_layout);
|
||||
tab2Layout = itemView.findViewById(R.id.tab_2_layout);
|
||||
tab3Layout = itemView.findViewById(R.id.tab_3_layout);
|
||||
tab1 = itemView.findViewById(R.id.tab_1);
|
||||
tab2 = itemView.findViewById(R.id.tab_2);
|
||||
tab3 = itemView.findViewById(R.id.tab_3);
|
||||
tab1Unlock = itemView.findViewById(R.id.tab_1_item_unlock);
|
||||
tab2Unlock = itemView.findViewById(R.id.tab_2_item_unlock);
|
||||
tab3Unlock = itemView.findViewById(R.id.tab_3_item_unlock);
|
||||
tab1Mask = itemView.findViewById(R.id.tab_1_unlock);
|
||||
tab2Mask = itemView.findViewById(R.id.tab_2_unlock);
|
||||
tab3Mask = itemView.findViewById(R.id.tab_3_unlock);
|
||||
tab1Subscript = itemView.findViewById(R.id.tab_1_subscript);
|
||||
tab2Subscript = itemView.findViewById(R.id.tab_2_subscript);
|
||||
tab3Subscript = itemView.findViewById(R.id.tab_3_subscript);
|
||||
tab1Title = itemView.findViewById(R.id.tab_1_title);
|
||||
tab2Title = itemView.findViewById(R.id.tab_2_title);
|
||||
tab3Title = itemView.findViewById(R.id.tab_3_title);
|
||||
tab1Received = itemView.findViewById(R.id.tab_1_item_received);
|
||||
tab2Received = itemView.findViewById(R.id.tab_2_item_received);
|
||||
tab3Received = itemView.findViewById(R.id.tab_3_item_received);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setData(Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward> data, int position) {
|
||||
this.data = data;
|
||||
if (position == 0) {
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) lineBg.getLayoutParams();
|
||||
ConstraintLayout.LayoutParams params1 = (ConstraintLayout.LayoutParams) line.getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(3);
|
||||
params1.topMargin = DpUtil.dp2px(3);
|
||||
}
|
||||
setVisibility(View.VISIBLE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
setVisibility(View.GONE, -1, tab1Unlock, tab1Unlock, tab1Unlock);
|
||||
setVisibility(View.GONE, -1, tab1Subscript, tab2Subscript, tab3Subscript);
|
||||
|
||||
line.setVisibility(View.GONE);
|
||||
point.setVisibility(View.GONE);
|
||||
if (userLevel > (position + 1) && userLevel < mList.size()) {
|
||||
setVisibility(View.GONE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
point.setVisibility(View.GONE);
|
||||
line.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (userLevel == (position + 1) && userLevel < mList.size()) {
|
||||
setVisibility(View.GONE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) line.getLayoutParams();
|
||||
params.bottomMargin = DpUtil.dp2px(70);
|
||||
line.setVisibility(View.VISIBLE);
|
||||
point.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (userLevel >= mList.size()) {
|
||||
setVisibility(View.GONE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
line.setVisibility(View.VISIBLE);
|
||||
point.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
lv.setText("V" + (position + 1));
|
||||
getAllView((reward, view) -> ImgLoader.display(mContext, reward.getImageUrl(), view), tab1, tab2, tab3);
|
||||
getAllView(((reward, view) -> {
|
||||
{
|
||||
if (userLevel < (position + 1)) {
|
||||
view.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (reward.getLock() == 1) {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
view.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}), tab1Unlock, tab2Unlock, tab3Unlock);
|
||||
getAllView(((reward, view) -> {
|
||||
view.setText(reward.getRewardName());
|
||||
}), tab1Title, tab2Title, tab3Title);
|
||||
getAllView(((reward, view) -> {
|
||||
if (reward.getReceived() == 1) {
|
||||
view.setVisibility(View.GONE);
|
||||
} else {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}), tab1Received, tab2Received, tab3Received);
|
||||
getAllView(((reward, view) -> {
|
||||
ViewClicksAntiShake.clicksAntiShake(view, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
getReward(reward);
|
||||
}
|
||||
});
|
||||
}), tab1, tab2, tab3);
|
||||
|
||||
}
|
||||
private void getReward(LiveBattlePassRewardsBean.LiveBattlePassReward reward){
|
||||
if(userLevel<reward.getLiveBattlePassLevel()){
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_reward_item_lock));
|
||||
return;
|
||||
}
|
||||
if(reward.getLock()==1){
|
||||
//ToastUtil.show("锁了");
|
||||
return;
|
||||
}
|
||||
|
||||
if(userType<reward.getLiveBattlePassTypeId()){
|
||||
ToastUtil.show("没购买");
|
||||
return;
|
||||
}
|
||||
LiveNetManager.get(mContext)
|
||||
.getRewards(String.valueOf(reward.getLiveBattlePassLevel()), String.valueOf(reward.getId()), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_reward_item_get));
|
||||
if(onItemClickListener!=null){
|
||||
onItemClickListener.onItemClick(reward,reward.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if(onItemClickListener!=null){
|
||||
onItemClickListener.onItemClick(reward,reward.getId());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setVisibility(int visibility, int position, View... views) {
|
||||
if (position == -1) {
|
||||
for (View view : views) {
|
||||
view.setVisibility(visibility);
|
||||
}
|
||||
} else {
|
||||
views[position].setVisibility(visibility);
|
||||
}
|
||||
}
|
||||
|
||||
private <T> void getAllView(ViewData<T> viewData, T... views) {
|
||||
getView(1, viewData, views);
|
||||
getView(2, viewData, views);
|
||||
getView(3, viewData, views);
|
||||
}
|
||||
|
||||
private <T> void getView(int type, ViewData<T> viewData, T... views) {
|
||||
if (data.containsKey(type) && data.get(type) != null && Objects.requireNonNull(data.get(type)).getId() != 0) {
|
||||
viewData.onData(data.get(type), views[type - 1]);
|
||||
} else {
|
||||
setVisibility(View.INVISIBLE, type - 1, tab1Layout, tab2Layout, tab3Layout);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private interface ViewData<T> {
|
||||
void onData(LiveBattlePassRewardsBean.LiveBattlePassReward reward, T view);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yunbao.main.event;
|
||||
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassTypeEvent {
|
||||
int type;
|
||||
|
||||
public BattlePassTypeEvent(int liveBattlePassType) {
|
||||
this.type=liveBattlePassType;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.yunbao.main.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.BattlePassActivity;
|
||||
import com.yunbao.main.adapter.BattlePassExchangeAdapter;
|
||||
import com.yunbao.main.adapter.BattlePassMissionAdapter;
|
||||
import com.yunbao.main.event.BattlePassTypeEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassExchangeFragment extends BaseFragment {
|
||||
RecyclerView mRecyclerView;
|
||||
BattlePassExchangeAdapter adapter;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
return inflater.inflate(R.layout.fragment_battlepass_exchange, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateData() {
|
||||
super.updateData();
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
mRecyclerView = findViewById(R.id.recycler_view);
|
||||
adapter = new BattlePassExchangeAdapter(getContext());
|
||||
adapter.setOnItemClickListener(new OnItemClickListener<BattlePassPoints>() {
|
||||
@Override
|
||||
public void onItemClick(BattlePassPoints bean, int position) {
|
||||
updateData();
|
||||
Bus.get().post(new BattlePassTypeEvent(0));
|
||||
}
|
||||
});
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
}
|
||||
private void initData() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getBattlePassUserInfo(new HttpCallback<BattlePassUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(BattlePassUserInfoBean data) {
|
||||
if(adapter!=null) {
|
||||
adapter.setPoint(data.getPoints());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void loadData() {
|
||||
initData();
|
||||
LiveNetManager.get(getContext())
|
||||
.getBattlePassPoints(new HttpCallback<List<BattlePassPoints>>() {
|
||||
@Override
|
||||
public void onSuccess(List<BattlePassPoints> data) {
|
||||
adapter.setList(data);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.yunbao.main.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.dialog.OrderLevelPopupWindow;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.BattlePassMissionAdapter;
|
||||
import com.yunbao.main.event.BattlePassTypeEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassMissionFragment extends BaseFragment {
|
||||
RecyclerView mRecyclerView;
|
||||
BattlePassMissionAdapter adapter;
|
||||
BattlePassUserInfoBean userInfoBean;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
return inflater.inflate(R.layout.fragment_battlepass_mission, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateData() {
|
||||
super.updateData();
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
mRecyclerView = findViewById(R.id.recycler_view);
|
||||
adapter = new BattlePassMissionAdapter(getContext());
|
||||
ItemDecoration decoration = new ItemDecoration(getContext(), 0x00000000, 1, DpUtil.dp2px(10));
|
||||
decoration.setOnlySetItemOffsetsButNoDraw(true);
|
||||
//mRecyclerView.addItemDecoration(decoration);
|
||||
adapter.setOnItemClickListener(new OnItemClickListener<BattlePassTask.Task>() {
|
||||
@Override
|
||||
public void onItemClick(BattlePassTask.Task bean, int position) {
|
||||
if (position == -2) {
|
||||
if (userInfoBean.getNextLevelExp() == 0) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_user_level_max));
|
||||
return;
|
||||
}
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new OrderLevelPopupWindow(getContext(),
|
||||
userInfoBean.getBattlePassExp() - userInfoBean.getLastLevelExp(),
|
||||
userInfoBean.getNextLevelExp() - userInfoBean.getLastLevelExp(),
|
||||
String.valueOf(userInfoBean.getLevel()),
|
||||
String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getCoin()),
|
||||
new OrderLevelPopupWindow.OrderLevelCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
ToastUtil.show(msg);
|
||||
Bus.get().post(new BattlePassTypeEvent(0));
|
||||
updateData();
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
.show();
|
||||
} else {
|
||||
loadData();
|
||||
}
|
||||
}
|
||||
});
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getBattlePassTask(new HttpCallback<BattlePassTask>() {
|
||||
@Override
|
||||
public void onSuccess(BattlePassTask data) {
|
||||
List<BattlePassTask.Task> tasks = new ArrayList<>();
|
||||
tasks.add(new BattlePassTask.Task(-1));
|
||||
tasks.addAll(data.getDaily());
|
||||
tasks.add(new BattlePassTask.Task(-2));
|
||||
tasks.addAll(data.getSeason());
|
||||
adapter.setList(tasks);
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
LiveNetManager.get(getContext())
|
||||
.getBattlePassUserInfo(new HttpCallback<BattlePassUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(BattlePassUserInfoBean data) {
|
||||
userInfoBean = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.yunbao.main.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow;
|
||||
import com.yunbao.common.dialog.LiberalBattlePassPopupWindow;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.BattlePassRewardAdapter;
|
||||
import com.yunbao.main.event.BattlePassTypeEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class BattlePassRewardFragment extends BaseFragment {
|
||||
ImageView tab1;
|
||||
ImageView tab2;
|
||||
ImageView tab3;
|
||||
RecyclerView recyclerView;
|
||||
|
||||
BattlePassRewardAdapter adapter;
|
||||
String enjoySpendMoney = "";
|
||||
String quintessenceSpendMoney = "";
|
||||
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
return inflater.inflate(R.layout.fragment_battlepass_reward, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateData() {
|
||||
super.updateData();
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
tab1 = findViewById(R.id.tab_1);
|
||||
tab2 = findViewById(R.id.tab_2);
|
||||
tab3 = findViewById(R.id.tab_3);
|
||||
recyclerView = findViewById(R.id.recycler_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
adapter = new BattlePassRewardAdapter(getContext());
|
||||
adapter.setOnItemClickListener(new OnItemClickListener<LiveBattlePassRewardsBean.LiveBattlePassReward>() {
|
||||
@Override
|
||||
public void onItemClick(LiveBattlePassRewardsBean.LiveBattlePassReward bean, int position) {
|
||||
loadData();
|
||||
Bus.get().post(new BattlePassTypeEvent(0));
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(tab2, () -> {
|
||||
if(tab2.getTag()!=null){
|
||||
return;
|
||||
}
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(
|
||||
getContext(),
|
||||
quintessenceSpendMoney,
|
||||
true,
|
||||
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
ToastUtil.show(msg);
|
||||
loadData();
|
||||
Bus.get().post(new BattlePassTypeEvent(0));
|
||||
}
|
||||
},
|
||||
"2"
|
||||
))
|
||||
.show();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(tab3, () -> {
|
||||
if(tab3.getTag()!=null){
|
||||
return;
|
||||
}
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(),
|
||||
enjoySpendMoney,
|
||||
false,
|
||||
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
loadData();
|
||||
Bus.get().post(new BattlePassTypeEvent(0));
|
||||
}
|
||||
},
|
||||
"3"
|
||||
))
|
||||
.show();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveBattlePassRewards(new HttpCallback<LiveBattlePassRewardsBean>() {
|
||||
@Override
|
||||
public void onSuccess(LiveBattlePassRewardsBean data) {
|
||||
|
||||
int level = data.getLevel();
|
||||
int type = 1;
|
||||
for (LiveBattlePassRewardsBean.BattlePassType passType : data.getLive_battle_pass_type()) {
|
||||
if (passType.getId() == 2) {
|
||||
quintessenceSpendMoney = String.valueOf(passType.getDiamond_value());
|
||||
}
|
||||
if (passType.getId() == 3) {
|
||||
enjoySpendMoney = String.valueOf(passType.getDiamond_value());
|
||||
}
|
||||
if (passType.getLock() == 2) {
|
||||
type = passType.getId();
|
||||
}
|
||||
}
|
||||
Collection<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> values = data.getLive_battle_pass_rewards().values();
|
||||
List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> list = new ArrayList<>(values);
|
||||
/* list.get(1).get(1).setReceived(2);
|
||||
list.get(0).get(2).setLock(2);
|
||||
list.get(1).get(2).setLock(2);
|
||||
type = 1;
|
||||
level = 3;*/
|
||||
setTab(type);
|
||||
adapter.setUserLevel(level);
|
||||
adapter.setUserType(type);
|
||||
adapter.setList(list);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setTab(int type) {
|
||||
if (type == 1) {
|
||||
tab1.setTag(true);
|
||||
tab1.setImageResource(R.mipmap.ic_reward_tab_normal);
|
||||
tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade_unselect);
|
||||
tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate_unselect);
|
||||
} else if (type == 2) {
|
||||
tab1.setTag(true);
|
||||
tab2.setTag(true);
|
||||
tab1.setImageResource(R.mipmap.ic_reward_tab_normal);
|
||||
tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade);
|
||||
tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate_unselect);
|
||||
} else {
|
||||
tab1.setTag(true);
|
||||
tab2.setTag(true);
|
||||
tab3.setTag(true);
|
||||
tab1.setImageResource(R.mipmap.ic_reward_tab_normal);
|
||||
tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade);
|
||||
tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
@@ -9,6 +10,7 @@ import android.widget.ImageView;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
/**
|
||||
@@ -41,6 +43,14 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
|
||||
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
||||
|
||||
img_trophy.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setCurPosition(int position) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="65dp" android:height="30dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#EF8311" android:endColor="#FFCE47" android:angle="90" />
|
||||
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="65dp" android:height="30dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#B94FFF" android:endColor="#ffeba7ff" android:angle="90" />
|
||||
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="65dp" android:height="30dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#D7D2FC" android:endColor="#C9D7FE" android:angle="90" />
|
||||
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="65dp" android:height="30dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#9935FF" android:endColor="#ffeba7ff" android:angle="90" />
|
||||
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="315dp" android:height="71dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff6378ff" android:endColor="#ff6e53ff" android:angle="180" />
|
||||
<corners android:topLeftRadius="6dp" android:topRightRadius="6dp" android:bottomLeftRadius="6dp" android:bottomRightRadius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item >
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFF" />
|
||||
<corners android:radius="270dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
15
main/src/main/res/drawable/bg_text_battlepass_reward_lv.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="27dp" android:height="16dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFECA9" />
|
||||
<corners android:topLeftRadius="8dp" android:topRightRadius="8dp" android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="0.3dp" android:bottom="0.3dp" android:left="0.3dp" android:right="0.3dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ff342524" />
|
||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp" android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item >
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFFCEA" />
|
||||
<corners android:radius="270dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:left="1.9dp"
|
||||
android:right="1.9dp"
|
||||
android:top="1.9dp"
|
||||
android:bottom="1.9dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFD89F" />
|
||||
<corners android:radius="270dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
23
main/src/main/res/drawable/bg_zl_user_level_progres.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#DFD5FC" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#fff"
|
||||
android:startColor="#fff" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
21
main/src/main/res/drawable/bg_zl_vp.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/background_order_dialog_out_layout">
|
||||
<shape android:shape="oval" >
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="#CCBEF3" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:bottom="8dp" android:top="8dp" android:left="8dp" android:right="8dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="25dp" />
|
||||
<solid android:color="#6781E6" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:bottom="15dp" android:top="15dp" android:left="15dp" android:right="15dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<solid android:color="#fff" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
95
main/src/main/res/layout/activity_battlepass.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="#140F1F"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView9"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/bg_zl"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.56">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_back"
|
||||
android:onClick="backClick"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_rule"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_height="35dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1"
|
||||
android:layout_width="100dp"
|
||||
android:layout_marginEnd="9.5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_tab1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_2"
|
||||
android:layout_marginEnd="9.5dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_tab2_unselect" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_3"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_tab3_unselect" />
|
||||
</LinearLayout>
|
||||
<include
|
||||
layout="@layout/view_battlepass_user"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:layout_marginTop="26dp"
|
||||
android:id="@+id/context_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/color_b14066"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ProgressBar
|
||||
@@ -33,7 +32,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rootView"
|
||||
android:background="@drawable/backgroud_custom_drawer_popup"
|
||||
android:background="#FFF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" />
|
||||
|
||||
25
main/src/main/res/layout/fragment_battlepass_exchange.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:spanCount="3"
|
||||
tools:listitem="@layout/item_battlepass_exchange" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
22
main/src/main/res/layout/fragment_battlepass_mission.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_battlepass_mission_type_mission"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
46
main/src/main/res/layout/fragment_battlepass_reward.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginStart="45dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/ic_reward_tab_normal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_2"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/ic_reward_tab_upgrade_unselect" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_3"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/ic_reward_tab_ultimate_unselect" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_weight="1"
|
||||
tools:listitem="@layout/item_battlepass_reward_type_top" />
|
||||
</LinearLayout>
|
||||
109
main/src/main/res/layout/item_battlepass_exchange.xml
Normal file
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="95dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/tab_1_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@mipmap/bg_zl_battlepass_reward_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/ic_integral"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mark_layout"
|
||||
android:layout_width="66dp"
|
||||
android:layout_height="23.5dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tab_1"
|
||||
android:background="@mipmap/bg_battlepass_reward_item_mark"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mark_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="9sp"
|
||||
android:gravity="center"
|
||||
tools:text="戰令5級解鎖\n123" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlpas_exchange_subscript"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="彩鑽之翼(92天)"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_1_layout" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/battlepass_integral"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:background="@mipmap/bg_zl_battlepass_exchange_btn_exchange"
|
||||
android:text="兌換\n(0/10)"
|
||||
android:textColor="#FFF"
|
||||
app:autoSizeMaxTextSize="13sp"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/content" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@drawable/bg_battlepass_mission_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="49dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginStart="13dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/icon_live_record_play" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="每日簽到(0/1)"
|
||||
android:textColor="#F2F9FF"
|
||||
android:textStyle="bold"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintEnd_toStartOf="@+id/submit"
|
||||
app:layout_constraintStart_toEndOf="@+id/icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="#F2F9FF"
|
||||
android:textSize="12sp"
|
||||
android:text="獎勵100經驗值/次"
|
||||
app:layout_constraintStart_toEndOf="@+id/icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="@string/battlepass_mission_submit_btn_unfinished"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/bg_battlepass_mission_btn_unfinished"
|
||||
android:textSize="14sp"
|
||||
android:stateListAnimator="@null"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/battlepass_mission_line_title_daily"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
274
main/src/main/res/layout/item_battlepass_reward_type_top.xml
Normal file
@@ -0,0 +1,274 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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="130dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/line_bg"
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#8D8E9C"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/reward_lv"
|
||||
app:layout_constraintStart_toStartOf="@+id/reward_lv"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFAC5D"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/line_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/line_bg"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/reward_lv"
|
||||
android:layout_width="27dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@drawable/bg_text_battlepass_reward_lv"
|
||||
android:text="v1"
|
||||
android:textColor="#FFECA9"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/point"
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_marginBottom="70dp"
|
||||
android:background="@drawable/bg_text_battlepass_reward_point"
|
||||
app:layout_constraintEnd_toEndOf="@+id/reward_lv"
|
||||
app:layout_constraintStart_toStartOf="@+id/reward_lv"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toEndOf="@+id/reward_lv"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/tab_1_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/bg_zl_battlepass_reward_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@mipmap/ic_integral"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_1_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tab_1_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1_unlock"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@mipmap/bg_zl_battlepass_reward_item_unlock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tab_1_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_1_item_unlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlepass_reward_item_unlock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_1_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/tab_1_bg" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_1_item_received"
|
||||
android:layout_width="49.5dp"
|
||||
android:layout_height="17dp"
|
||||
android:src="@mipmap/ic_zl_battlepass_reward_item_received"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_1_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/tab_1_bg" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_1_subscript"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlpas_exchange_subscript"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_1_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="甜蜜氣球\n&積分30"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_1_bg" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/tab_2_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_2_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/bg_zl_battlepass_reward_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@mipmap/ic_integral"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_2_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tab_2_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_2_unlock"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@mipmap/bg_zl_battlepass_reward_item_unlock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tab_2_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_2_item_unlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlepass_reward_item_unlock"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_2_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/tab_2_bg" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_2_item_received"
|
||||
android:layout_width="49.5dp"
|
||||
android:layout_height="17dp"
|
||||
android:src="@mipmap/ic_zl_battlepass_reward_item_received"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_2_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/tab_2_bg" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_2_subscript"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlpas_exchange_subscript2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/tab_2_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="甜蜜氣球\n&積分30"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_2_bg" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/tab_3_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/tab_3_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/bg_zl_battlepass_reward_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@mipmap/ic_integral"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_3_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tab_3_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_3_unlock"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@mipmap/bg_zl_battlepass_reward_item_unlock"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tab_3_item_unlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlepass_reward_item_unlock"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_3_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/tab_3_bg" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_3_item_received"
|
||||
android:layout_width="49.5dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:src="@mipmap/ic_zl_battlepass_reward_item_received"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tab_3_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/tab_3_bg" />
|
||||
<ImageView
|
||||
android:id="@+id/tab_3_subscript"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_zl_battlpas_exchange_subscript"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/tab_3_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="甜蜜氣球\n&積分30"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_3_bg" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
114
main/src/main/res/layout/view_battlepass_user.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="210dp">
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:background="@mipmap/bg_zl_user_top"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/session"
|
||||
android:text="@string/battlepass_user_session"
|
||||
android:textColor="#40227D"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:layout_gravity="end"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<ImageView
|
||||
android:id="@+id/imageView10"
|
||||
android:layout_marginStart="15.5dp"
|
||||
android:layout_width="101dp"
|
||||
android:layout_height="19dp"
|
||||
android:src="@mipmap/zl_user_pass" />
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_marginTop="11.5dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:text="@string/battlepass_user_time"
|
||||
android:textColor="#442787"
|
||||
android:textSize="14sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/userLevel"
|
||||
android:layout_marginTop="11.5dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="15dp"
|
||||
android:text="@string/battlepass_user_level"
|
||||
android:textColor="#442787"
|
||||
android:textSize="14sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/level"
|
||||
android:textStyle="bold"
|
||||
android:text="Lv.1"
|
||||
android:textColor="#442787"
|
||||
android:textSize="14sp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/level_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:progressDrawable="@drawable/bg_zl_user_level_progres" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="-60dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@mipmap/bg_zl_user_bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/integral"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/battlepass_user_my_integral"
|
||||
android:textColor="#442787"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<ImageView
|
||||
android:src="@mipmap/ic_integral"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/more_integral"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@mipmap/bg_zl_user_button"
|
||||
android:text="@string/battlepass_user_more_integral"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
BIN
main/src/main/res/mipmap-b+en+us/ic_reward_tab_normal.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_reward_tab_ultimate.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 13 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_reward_tab_upgrade.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_zl_tab1.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_zl_tab1_unselect.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_zl_tab2.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_zl_tab2_unselect.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_zl_tab3.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
main/src/main/res/mipmap-b+en+us/ic_zl_tab3_unselect.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
main/src/main/res/mipmap-b+en+us/zl_user_pass.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 719 B |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 49 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/bg_zl_battlepass_reward_item.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/bg_zl_user_bottom.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/bg_zl_user_button.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/bg_zl_user_top.png
Normal file
|
After Width: | Height: | Size: 330 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_reward_tab_normal.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_reward_tab_ultimate.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 12 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_reward_tab_upgrade.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 15 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_back.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_rule.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_tab1.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_tab1_unselect.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_tab2.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_tab2_unselect.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_tab3.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_zl_tab3_unselect.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/zl_user_pass.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
main/src/main/res/mipmap-xxxhdpi/bg_zl.png
Normal file
|
After Width: | Height: | Size: 440 KiB |
23
main/src/main/res/values-zh/strings.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="battlepass_user_session">Session 1</string>
|
||||
<string name="battlepass_user_time">活動時間:%s</string>
|
||||
<string name="battlepass_user_level">我的等級:</string>
|
||||
<string name="battlepass_user_level_max">等級已滿</string>
|
||||
<string name="battlepass_user_my_integral">我的積分:%s</string>
|
||||
<string name="battlepass_user_more_integral">更多積分</string>
|
||||
<string name="battlepass_integral">%s積分</string>
|
||||
<string name="battlepass_mission_submit_btn_unfinished">未完成</string>
|
||||
<string name="battlepass_mission_submit_btn_finished">領取</string>
|
||||
<string name="battlepass_mission_submit_btn_over">已領取</string>
|
||||
<string name="battlepass_mission_submit_btn_buy">購買</string>
|
||||
<string name="battlepass_mission_line_title_daily">每日任務</string>
|
||||
<string name="battlepass_mission_line_title_season">每期任務</string>
|
||||
<string name="battlepass_exchange_submit_unexchange">兌換</string>
|
||||
<string name="battlepass_exchange_submit_exchange">已兌換</string>
|
||||
<string name="battlepass_exchange_submit_lock">未解鎖</string>
|
||||
<string name="battlepass_reward_item_lock">暫未達到等級</string>
|
||||
<string name="battlepass_reward_item_get">領取成功</string>
|
||||
<string name="battlepass_zl_get">開通成功</string>
|
||||
|
||||
</resources>
|
||||
@@ -1 +1,22 @@
|
||||
<resources></resources>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="battlepass_user_session">Session 1</string>
|
||||
<string name="battlepass_user_time">Activity time:%s</string>
|
||||
<string name="battlepass_user_level">My level:</string>
|
||||
<string name="battlepass_user_level_max">Experience full</string>
|
||||
<string name="battlepass_user_my_integral">My points:%s</string>
|
||||
<string name="battlepass_user_more_integral">More points</string>
|
||||
<string name="battlepass_integral">points</string>
|
||||
<string name="battlepass_mission_submit_btn_unfinished">Undone</string>
|
||||
<string name="battlepass_mission_submit_btn_finished">Receive</string>
|
||||
<string name="battlepass_mission_submit_btn_over">Received</string>
|
||||
<string name="battlepass_mission_submit_btn_buy">Buy</string>
|
||||
<string name="battlepass_mission_line_title_daily">Daily tasks</string>
|
||||
<string name="battlepass_mission_line_title_season">Season tasks</string>
|
||||
<string name="battlepass_exchange_submit_unexchange">exchange</string>
|
||||
<string name="battlepass_exchange_submit_exchange">Redeemed</string>
|
||||
<string name="battlepass_exchange_submit_lock">Unlocked</string>
|
||||
<string name="battlepass_reward_item_lock">Not yet reached level</string>
|
||||
<string name="battlepass_reward_item_get">Successfully claimed</string>
|
||||
<string name="battlepass_zl_get">Successfully opened</string>
|
||||
</resources>
|
||||
|
||||