add 新增红包专区
add 新增红包专区进去是只有发放红包的直播间 add 新增首页红包浮窗 add 新增红包记录
This commit is contained in:
@@ -26,6 +26,7 @@ import android.view.Window;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -93,6 +94,7 @@ import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.VersionUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.APKUpdateCustomPopup;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
@@ -191,6 +193,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private FloatBannerView floatBanner;
|
||||
private boolean isfloatBannernet = true, isFirst = true;
|
||||
|
||||
private View floatRedPacket;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -236,6 +240,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
rt_main_tab = (RelativeLayout) findViewById(R.id.rt_main_tab);
|
||||
v_table_redpoint = findViewById(R.id.v_table_redpoint);
|
||||
v_table_redpoint_me = (View) findViewById(R.id.v_table_redpoint_me);
|
||||
floatRedPacket = findViewById(R.id.red_packet);
|
||||
initRedPacket();
|
||||
|
||||
Display mDisplay = getWindowManager().getDefaultDisplay();
|
||||
Height = mDisplay.getHeight();
|
||||
@@ -485,12 +491,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
initAnchorRecommendBanner();
|
||||
} else if (index == 2) {
|
||||
floatBanner.setVisibility(View.GONE);
|
||||
floatRedPacket.setVisibility(View.GONE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
isfloatBannernet = false;
|
||||
if (mainMessageViewHolder != null)
|
||||
mainMessageViewHolder.onResume();
|
||||
} else {
|
||||
floatBanner.setVisibility(View.GONE);
|
||||
floatRedPacket.setVisibility(View.GONE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
isfloatBannernet = false;
|
||||
}
|
||||
@@ -561,6 +569,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
if (!isfloatBannernet) return;
|
||||
MainNetManager.get(mContext)
|
||||
.anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onSuccess(AnchorRecommendModel data) {
|
||||
if (isFinishing()) return;
|
||||
@@ -572,6 +581,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
floatBanner.setVisibility(View.GONE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
}
|
||||
if (data.getShowRedPacket() == 0) {
|
||||
floatRedPacket.setVisibility(View.GONE);
|
||||
} else {
|
||||
floatRedPacket.setVisibility(View.VISIBLE);
|
||||
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setMax(data.getRedPacketTotal());
|
||||
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setProgress(data.getRedPacketNum());
|
||||
((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -832,9 +849,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
//获取指导员引导逻辑
|
||||
NoviceInstructorManager.get(mContext).getNoviceInstructor();
|
||||
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
|
||||
if (!isFirst) {
|
||||
initAnchorRecommendBanner();
|
||||
}
|
||||
initAnchorRecommendBanner();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1232,6 +1247,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
} else {
|
||||
isfloatBannernet = false;
|
||||
floatBanner.setVisibility(View.GONE);
|
||||
floatRedPacket.setVisibility(View.GONE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@@ -1374,4 +1390,15 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
}
|
||||
|
||||
private void initRedPacket() {
|
||||
ImageView title = floatRedPacket.findViewById(R.id.title);
|
||||
if (WordUtil.isNewZh()) {
|
||||
title.setImageResource(R.mipmap.icon_red_packet_float_text_zh);
|
||||
} else {
|
||||
title.setImageResource(R.mipmap.icon_red_packet_float_text_en);
|
||||
}
|
||||
floatRedPacket.setOnClickListener(v -> {
|
||||
mainHomeViewHolder.setCurPosition(3);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ public class MyWalletActivity extends AbsActivity {
|
||||
GoogleBillingUtilNew.getInstance().initGooglePay(mContext);
|
||||
vp_content = (ViewPager) findViewById(R.id.vp_content);
|
||||
TextView rView = (TextView) findViewById(R.id.rView);
|
||||
findViewById(R.id.redPacketMain).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.redPacketMain).setOnClickListener(v -> {
|
||||
RouteUtil.forwardRedPacketList();
|
||||
});
|
||||
rView.setOnClickListener(v -> {
|
||||
LoadingDialog loadingDialog = new LoadingDialog();
|
||||
loadingDialog.show(getSupportFragmentManager(), "LoadingDialog");
|
||||
|
||||
@@ -1,29 +1,82 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
public class RedPacketInfoActivity extends AbsActivity implements View.OnClickListener{
|
||||
@Route(path = RouteUtil.PATH_RED_PACKET_INFO)
|
||||
public class RedPacketInfoActivity extends AbsActivity implements View.OnClickListener {
|
||||
private RedPacketListBean bean;
|
||||
private ImageView icon;
|
||||
private ImageView gold;
|
||||
private TextView title;
|
||||
private TextView money;
|
||||
private TextView status;
|
||||
private TextView info;
|
||||
private TextView time;
|
||||
private TextView model;
|
||||
private TextView backAccountText;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_red_packet_info;
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void main() {
|
||||
super.main();
|
||||
findViewById(R.id.red_packet_info).setOnClickListener(this);
|
||||
bean = (RedPacketListBean) getIntent().getSerializableExtra("bean");
|
||||
icon = findViewById(R.id.icon);
|
||||
title = findViewById(R.id.title);
|
||||
money = findViewById(R.id.money);
|
||||
status = findViewById(R.id.red_packet_status);
|
||||
info = findViewById(R.id.red_packet_info);
|
||||
time = findViewById(R.id.red_packet_timer);
|
||||
model = findViewById(R.id.red_packet_model);
|
||||
gold = findViewById(R.id.gold_icon);
|
||||
backAccountText = findViewById(R.id.backAccountText);
|
||||
findViewById(R.id.btn_back).setOnClickListener(this);
|
||||
info.setOnClickListener(this);
|
||||
|
||||
title.setText(bean.getLiveNicename());
|
||||
time.setText(bean.getCreateTime());
|
||||
|
||||
money.setText("-" + bean.getAmountDiamond());
|
||||
money.setTextColor(Color.parseColor("#000000"));
|
||||
icon.setImageResource(R.mipmap.diamond);
|
||||
|
||||
if (bean.getCurrentStatus() == RedPacketListBean.RED_PACKET_CURRENT_STATUS_SUCCESS) {
|
||||
status.setText(R.string.red_packet_info_status_success);
|
||||
} else {
|
||||
status.setText(R.string.red_packet_info_status_timeout);
|
||||
}
|
||||
if (bean.getAmountRefund() == 0) {
|
||||
gold.setVisibility(View.GONE);
|
||||
backAccountText.setText(R.string.red_packet_info_residue_none);
|
||||
} else {
|
||||
gold.setVisibility(View.VISIBLE);
|
||||
backAccountText.setText(mContext.getString(R.string.red_packet_info_residue_back) + " +" + bean.getAmountRefund());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id=v.getId();
|
||||
if(id==R.id.red_packet_info){
|
||||
startActivity(new Intent(this, RedPacketUsersActivity.class));
|
||||
int id = v.getId();
|
||||
if (id == R.id.red_packet_info) {
|
||||
RouteUtil.forwardRedPacketUser(bean.getId());
|
||||
} else if (id == R.id.btn_back) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,18 @@ import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.RedPacketListRecyclerAdapter;
|
||||
import com.yunbao.main.bean.RedPacketListBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Route(path = RouteUtil.PATH_RED_PACKET_LIST)
|
||||
public class RedPacketListActivity extends AbsActivity {
|
||||
private RecyclerView recyclerView;
|
||||
private RedPacketListRecyclerAdapter adapter;
|
||||
@@ -25,7 +29,7 @@ public class RedPacketListActivity extends AbsActivity {
|
||||
@Override
|
||||
public void main() {
|
||||
super.main();
|
||||
((TextView) findViewById(R.id.titleView)).setText("紅包記錄");
|
||||
((TextView) findViewById(R.id.titleView)).setText(mContext.getString(R.string.red_packet_list_title));
|
||||
recyclerView = findViewById(R.id.recyclerView);
|
||||
|
||||
adapter = new RedPacketListRecyclerAdapter(this);
|
||||
@@ -35,15 +39,17 @@ public class RedPacketListActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
List<RedPacketListBean> list = new ArrayList<>();
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
RedPacketListBean bean = new RedPacketListBean();
|
||||
bean.setTitle("攢人氣紅包" + i);
|
||||
bean.setTimer("X月X日 " + i);
|
||||
bean.setMoney(i * 1000 + "");
|
||||
list.add(bean);
|
||||
}
|
||||
adapter.setList(list);
|
||||
LiveNetManager.get(mContext)
|
||||
.getRedPacketList(new HttpCallback<List<RedPacketListBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<RedPacketListBean> data) {
|
||||
adapter.setList(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,36 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.RedPacketUserRecyclerAdapter;
|
||||
import com.yunbao.main.bean.RedPacketListBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Route(path = RouteUtil.PATH_RED_PACKET_USER)
|
||||
public class RedPacketUsersActivity extends AbsActivity implements View.OnClickListener{
|
||||
private RecyclerView recyclerView;
|
||||
private RedPacketUserRecyclerAdapter adapter;
|
||||
private int redPacketId;
|
||||
|
||||
private RoundedImageView avatar;
|
||||
private TextView title;
|
||||
private TextView money;
|
||||
private ImageView icon;
|
||||
private TextView open;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -25,8 +40,14 @@ public class RedPacketUsersActivity extends AbsActivity implements View.OnClickL
|
||||
@Override
|
||||
protected void main() {
|
||||
super.main();
|
||||
findViewById(R.id.btn_back).setOnClickListener(this);
|
||||
recyclerView = findViewById(R.id.recyclerView);
|
||||
|
||||
avatar = findViewById(R.id.avatar);
|
||||
title = findViewById(R.id.title);
|
||||
money = findViewById(R.id.money);
|
||||
icon = findViewById(R.id.avatar);
|
||||
open = findViewById(R.id.open_packet);
|
||||
redPacketId=getIntent().getIntExtra("id",0);
|
||||
adapter = new RedPacketUserRecyclerAdapter(this);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
recyclerView.setAdapter(adapter);
|
||||
@@ -36,17 +57,32 @@ public class RedPacketUsersActivity extends AbsActivity implements View.OnClickL
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id=v.getId();
|
||||
if(id==R.id.btn_back){
|
||||
finish();
|
||||
}
|
||||
}
|
||||
private void initData() {
|
||||
List<RedPacketListBean> list = new ArrayList<>();
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
RedPacketListBean bean = new RedPacketListBean();
|
||||
bean.setTitle("攢人氣紅包 - 主播昵稱的直播間" + i);
|
||||
bean.setTimer("X月X日 " + i);
|
||||
bean.setMoney(i * 1000 + "");
|
||||
list.add(bean);
|
||||
}
|
||||
adapter.setList(list);
|
||||
LiveNetManager.get(mContext)
|
||||
.getRedPacketUserList(redPacketId, new HttpCallback<RedPacketDetailsBean>() {
|
||||
@Override
|
||||
public void onSuccess(RedPacketDetailsBean data) {
|
||||
setData(data);
|
||||
adapter.setList(data.getDetails());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void setData(RedPacketDetailsBean bean){
|
||||
ImgLoader.display(mContext,bean.getAvatarThumb(),avatar);
|
||||
title.setText(bean.getNiceName());
|
||||
money.setText(bean.getMoney()+"");
|
||||
open.setText(mContext.getString(R.string.red_packet_user_tips)+" "+bean.getAlready()+"/"+bean.getQuantity());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -11,10 +12,11 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.RedPacketInfoActivity;
|
||||
import com.yunbao.main.bean.RedPacketListBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter<RedPacketListRecyclerAdapter.ItemViewHolder> {
|
||||
@@ -23,6 +25,7 @@ public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter<RedPacket
|
||||
|
||||
public RedPacketListRecyclerAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
this.list=new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<RedPacketListBean> list) {
|
||||
@@ -56,13 +59,18 @@ public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter<RedPacket
|
||||
timer = itemView.findViewById(R.id.time);
|
||||
money = itemView.findViewById(R.id.money);
|
||||
icon = itemView.findViewById(R.id.icon);
|
||||
itemView.setOnClickListener(v -> mContext.startActivity(new Intent(mContext, RedPacketInfoActivity.class)));
|
||||
itemView.setOnClickListener(v -> {
|
||||
RouteUtil.forwardRedPacketInfo((RedPacketListBean) itemView.getTag());
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void setData(RedPacketListBean bean) {
|
||||
title.setText(bean.getTitle());
|
||||
timer.setText(bean.getTimer());
|
||||
money.setText(bean.getMoney());
|
||||
title.setText(bean.getLiveNicename()+"|"+bean.getId());
|
||||
timer.setText(bean.getCreateTime());
|
||||
money.setText("-" + bean.getAmountDiamond());
|
||||
money.setTextColor(Color.parseColor("#000000"));
|
||||
icon.setImageResource(R.mipmap.diamond);
|
||||
itemView.setTag(bean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,36 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.RedPacketInfoActivity;
|
||||
import com.yunbao.main.bean.RedPacketListBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RedPacketUserRecyclerAdapter extends RecyclerView.Adapter<RedPacketUserRecyclerAdapter.ItemViewHolder> {
|
||||
private List<RedPacketListBean> list;
|
||||
private List<RedPacketDetailsBean.Detail> list;
|
||||
private Context mContext;
|
||||
|
||||
public RedPacketUserRecyclerAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<RedPacketListBean> list) {
|
||||
this.list = list;
|
||||
public void setList(List<RedPacketDetailsBean.Detail> list) {
|
||||
if (list != null) {
|
||||
this.list = list;
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@@ -48,21 +52,22 @@ public class RedPacketUserRecyclerAdapter extends RecyclerView.Adapter<RedPacket
|
||||
|
||||
public class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView title, timer, money;
|
||||
private ImageView icon;
|
||||
private RoundedImageView icon;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
timer = itemView.findViewById(R.id.time);
|
||||
money = itemView.findViewById(R.id.money);
|
||||
icon = itemView.findViewById(R.id.icon);
|
||||
itemView.setOnClickListener(v -> mContext.startActivity(new Intent(mContext, RedPacketInfoActivity.class)));
|
||||
icon = itemView.findViewById(R.id.avatar);
|
||||
}
|
||||
|
||||
private void setData(RedPacketListBean bean) {
|
||||
title.setText(bean.getTitle());
|
||||
timer.setText(bean.getTimer());
|
||||
money.setText(bean.getMoney());
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void setData(RedPacketDetailsBean.Detail bean) {
|
||||
title.setText(bean.getNiceName());
|
||||
timer.setText(bean.getTime());
|
||||
money.setText(bean.getMoney()+"");
|
||||
ImgLoader.display(mContext,bean.getAvatarThumb(),icon);
|
||||
itemView.setTag(bean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.yunbao.main.bean;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class RedPacketListBean extends BaseModel {
|
||||
private String title;
|
||||
private String timer;
|
||||
private String money;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTimer() {
|
||||
return timer;
|
||||
}
|
||||
|
||||
public void setTimer(String timer) {
|
||||
this.timer = timer;
|
||||
}
|
||||
|
||||
public String getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(String money) {
|
||||
this.money = money;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,9 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 首页红包专区
|
||||
@@ -134,6 +136,12 @@ public class MainHomeRedPacketLiveViewHolder extends AbsMainHomeChildViewHolder
|
||||
@Override
|
||||
public void onItemClick(LiveBean bean, int position) {
|
||||
if ("1".equals(bean.getIslive())) {
|
||||
Map<String, String> map = bean.getParams();
|
||||
if(map==null){
|
||||
map=new HashMap<>();
|
||||
}
|
||||
map.put("redPacket","true");
|
||||
bean.setParams(map);
|
||||
watchLive(bean, Constants.LIVE_HOME, position);
|
||||
}else if(bean.getIs_week()!=null&&bean.getIs_week().equals("1")){
|
||||
String url = CommonAppConfig.HOST + bean.getUrl()+"?a=1";
|
||||
|
||||
@@ -41,14 +41,11 @@ 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 v) {
|
||||
mContext.startActivity(new Intent(mContext, RedPacketListActivity.class));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
public void setCurPosition(int position){
|
||||
mViewPager.setCurrentItem(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,9 +70,9 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
} else if (position == 2) {
|
||||
mainHomeRecomLiveViewHolder = new MainHomeRecomLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeRecomLiveViewHolder;
|
||||
}else if(position==3){
|
||||
mainHomeRedPacketLiveViewHolder=new MainHomeRedPacketLiveViewHolder(mContext,parent);
|
||||
vh=mainHomeRedPacketLiveViewHolder;
|
||||
} else if (position == 3) {
|
||||
mainHomeRedPacketLiveViewHolder = new MainHomeRedPacketLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeRedPacketLiveViewHolder;
|
||||
}
|
||||
|
||||
if (vh == null) {
|
||||
@@ -102,7 +99,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
mContext.getString(R.string.follow),
|
||||
mContext.getString(R.string.hot),
|
||||
mContext.getString(R.string.recomment),
|
||||
"红包专区",
|
||||
mContext.getString(R.string.main_tabs_red_packet),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
35
main/src/main/res/drawable/bg_float_red_packet.xml
Normal file
35
main/src/main/res/drawable/bg_float_red_packet.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!--背景色从左到右色值,渐变-->
|
||||
<item android:id="@android:id/background">
|
||||
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#FFF"
|
||||
android:startColor="#FFF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--进度条从左到右色值,渐变-->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip
|
||||
>
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners
|
||||
android:bottomLeftRadius="5dp"
|
||||
android:radius="5dp"
|
||||
android:topLeftRadius="5dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#E11111"
|
||||
android:startColor="#E11111" />
|
||||
</shape>
|
||||
</scale>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -19,7 +19,7 @@
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:background="#F5F5F5"
|
||||
android:text="近30天記錄 (截至到昨天)"
|
||||
android:text="@string/red_packet_list_tips"
|
||||
android:textColor="#000000"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include3" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:onClick="backClick"
|
||||
android:padding="9dp"
|
||||
android:src="@mipmap/icon_dialog_charge_close"
|
||||
android:src="@mipmap/icon_back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="@color/textColor" />
|
||||
@@ -54,6 +54,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Popularity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/red_packet_user_tips2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/money" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="0dp"
|
||||
@@ -64,89 +73,86 @@
|
||||
android:background="?android:attr/listDivider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/money" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/Popularity" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/status"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="當前狀態"
|
||||
android:text="@string/red_packet_info_status"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/red_packet_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_weight="1"
|
||||
android:text="紅包已過期"
|
||||
android:text="@string/red_packet_info_status_timeout"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/info"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/status">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="紅包詳情"
|
||||
android:text="@string/red_packet_info_details"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/red_packet_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_weight="1"
|
||||
android:text="查看"
|
||||
android:text="@string/red_packet_info_details_check"
|
||||
android:textColor="#1E73D7"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/timer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/info">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="支付時間"
|
||||
android:text="@string/red_packet_info_pay_time"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/red_packet_timer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_weight="1"
|
||||
android:text="2023年6月6日 13:50:52"
|
||||
android:textColor="#000000"
|
||||
@@ -155,30 +161,71 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/play_model"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/timer">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="支付方式"
|
||||
android:text="@string/red_packet_info_mode"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/red_packet_model"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_weight="1"
|
||||
android:text="鉆石餘額"
|
||||
android:text="@string/red_packet_info_mode_diamond"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/backAccount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/play_model">
|
||||
|
||||
<TextView
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/red_packet_info_residue"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gold_icon"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
app:srcCompat="@mipmap/gold_coin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/backAccountText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/red_packet_info_residue_none"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -14,7 +14,7 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:onClick="backClick"
|
||||
android:padding="9dp"
|
||||
android:src="@mipmap/icon_dialog_charge_close"
|
||||
android:src="@mipmap/icon_back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="@color/textColor" />
|
||||
@@ -65,7 +65,7 @@
|
||||
android:layout_marginEnd="6dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/money"
|
||||
app:layout_constraintTop_toTopOf="@+id/money"
|
||||
app:srcCompat="@mipmap/diamond" />
|
||||
app:srcCompat="@mipmap/gold_coin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/open_packet"
|
||||
@@ -83,7 +83,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginTop="55dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:background="?android:attr/listDivider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
62
main/src/main/res/layout/view_float_red_packet.xml
Normal file
62
main/src/main/res/layout/view_float_red_packet.xml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout4"
|
||||
android:layout_width="122dp"
|
||||
android:layout_height="41dp"
|
||||
android:layout_marginStart="9dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:background="@mipmap/bg_float_red_packet"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:max="100"
|
||||
android:progress="60"
|
||||
android:progressDrawable="@drawable/bg_float_red_packet"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progressText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="68/100"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView9"
|
||||
android:layout_width="31dp"
|
||||
android:layout_height="40dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/icon_red_packet" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="-10dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@mipmap/icon_red_packet_float_text_zh" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<RelativeLayout 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:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -154,19 +155,31 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/banner_click"
|
||||
android:layout_width="123dp"
|
||||
android:layout_height="35.33dp"
|
||||
android:layout_above="@id/rt_main_tab"
|
||||
android:layout_above="@id/red_packet"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/red_packet"
|
||||
layout="@layout/view_float_red_packet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/rt_main_tab"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginBottom="10dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user