1:羽声新版本
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
package com.example.moduleroom.activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.adapter.RedAdapter;
|
||||
import com.example.moduleroom.contacts.RedEnvelopesContacts;
|
||||
import com.example.moduleroom.databinding.FragmentRedBinding;
|
||||
import com.example.moduleroom.fragment.RedViewModel;
|
||||
import com.example.moduleroom.presenter.RedEnvelopesPresenter;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.RedpacketDetail;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/9/29
|
||||
* @description:红包最终的展示页面
|
||||
*/
|
||||
@Route(path = ARouteConstants.ROOM_RED_RESULT)
|
||||
public class RedResultActivity extends BaseMvpActivity<RedEnvelopesPresenter, FragmentRedBinding> implements RedEnvelopesContacts.View {
|
||||
|
||||
private RedViewModel mViewModel;
|
||||
private RedAdapter redAdapter;
|
||||
private int page = 1;
|
||||
private String redpacketId;
|
||||
|
||||
// public static RedResultActivity newInstance() {
|
||||
// return new RedResultActivity();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
redpacketId = getIntent().getStringExtra("redpacketId");
|
||||
if (redpacketId == null || redpacketId.isEmpty()) {
|
||||
// 处理红包ID为空的情况
|
||||
return;
|
||||
}
|
||||
if (MvpPre==null){
|
||||
MvpPre = new RedEnvelopesPresenter(this, this);
|
||||
}
|
||||
MvpPre.getRedpacketDetail(redpacketId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RedEnvelopesPresenter bindPresenter() {
|
||||
return new RedEnvelopesPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
redAdapter = new RedAdapter();
|
||||
mBinding.recyclerView.setAdapter(redAdapter);
|
||||
// 确保最后一项完全可见
|
||||
mBinding.recyclerView.setClipToPadding(false);
|
||||
mBinding.recyclerView.setPadding(
|
||||
0,
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_12),
|
||||
0,
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_12)
|
||||
);
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
// MvpPre.getRoomHourRanking(page+"", "20");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
// MvpPre.getRoomHourRanking(page+"", "20");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_red;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redPacketDetail(RedpacketDetail redpacketDetail) {
|
||||
// 检查 Activity 是否已经销毁
|
||||
if (isFinishing() || isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
if (redpacketDetail != null) {
|
||||
ImageUtils.loadHeadCC(redpacketDetail.getRedpacket_info().getAvatar(), mBinding.userAvatar);
|
||||
mBinding.userName.setText(redpacketDetail.getRedpacket_info().getNickname());
|
||||
mBinding.tvRedTitle.setText(redpacketDetail.getRedpacket_info().getRemark());
|
||||
mBinding.tvJb.setText(redpacketDetail.getRedpacket_info().getCoin_type() == 1 ? "金币" : "钻石");
|
||||
if (redpacketDetail.getMy_record() != null) {
|
||||
mBinding.tvRedJb.setText(redpacketDetail.getMy_record().getAmount());
|
||||
}else {
|
||||
mBinding.tvRedJb.setText("0.00");
|
||||
}
|
||||
mBinding.tvLq.setText("已领取"+redpacketDetail.getRecords().size() + "/" + redpacketDetail.getRedpacket_info().getTotal_count());
|
||||
redAdapter.setNewData(redpacketDetail.getRecords());
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.room.EmotionDeatils;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class EmotionAdapter extends BaseQuickAdapter<EmotionDeatils, BaseViewHolder> {
|
||||
// 转换后的 Java 代码
|
||||
private OnEmotionClickListener onEmotionClickListener;
|
||||
|
||||
// 定义接口
|
||||
public interface OnEmotionClickListener {
|
||||
void onEmotionClick(EmotionDeatils emotion);
|
||||
}
|
||||
|
||||
// 转换后的 Java 代码
|
||||
public void setOnEmotionClickListener(OnEmotionClickListener listener) {
|
||||
this.onEmotionClickListener = listener;
|
||||
}
|
||||
public EmotionAdapter() {
|
||||
super(R.layout.item_emotion);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, EmotionDeatils item) {
|
||||
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.iv_emotion));
|
||||
helper.setText(R.id.tv_emotion_name, item.getName());
|
||||
|
||||
// 设置点击事件
|
||||
helper.itemView.setOnClickListener(v -> {
|
||||
if (onEmotionClickListener != null) {
|
||||
onEmotionClickListener.onEmotionClick(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.RedpacketDetail;
|
||||
import com.xscm.moduleutil.bean.room.RedResultBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomHourBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class RedAdapter extends BaseQuickAdapter<RedpacketDetail.Records, BaseViewHolder> {
|
||||
public RedAdapter() {
|
||||
super(R.layout.item_red);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder baseViewHolder,RedpacketDetail.Records redBean) {
|
||||
ImageUtils.loadHeadCC(redBean.getAvatar(), baseViewHolder.getView(R.id.red_user_avatar));
|
||||
baseViewHolder.setText(R.id.tv_user_name, redBean.getNickname());
|
||||
baseViewHolder.setText(R.id.tv_red_num, redBean.getAmount());
|
||||
baseViewHolder.setText(R.id.tv_time, redBean.getCreatetime());
|
||||
}
|
||||
|
||||
private String formatTimestamp(long timestamp) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
||||
return sdf.format(new Date(timestamp));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 红包的列表适配器
|
||||
*/
|
||||
public class RedBagAdapter extends BaseQuickAdapter<RedPacketInfo, BaseViewHolder> {
|
||||
private Map<Integer,View> viewMap;
|
||||
public RedBagAdapter() {
|
||||
super(R.layout.item_red_bag);
|
||||
viewMap=new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RedPacketInfo item) {
|
||||
viewMap.put(helper.getLayoutPosition(),helper.itemView);
|
||||
ImageView iv_red_bag= helper.getView(R.id.iv_red_bag);
|
||||
if (item.getIs_qiang()==1){
|
||||
iv_red_bag.setImageResource(com.xscm.moduleutil.R.mipmap.red_bj_h);
|
||||
helper.setText(R.id.tv_djs, "已领取");
|
||||
}else {
|
||||
iv_red_bag.setImageResource(com.xscm.moduleutil.R.mipmap.red);
|
||||
|
||||
if (item.getType()==2){
|
||||
helper.setVisible(R.id.im_list_bj,true);
|
||||
}else {
|
||||
helper.setVisible(R.id.im_list_bj,false);
|
||||
}
|
||||
|
||||
// 显示倒计时
|
||||
if (item.getCountdown() > 0) {
|
||||
helper.setVisible(R.id.tv_djs, true);
|
||||
long minutes = item.getCountdown() / 60;
|
||||
long seconds = item.getCountdown() % 60;
|
||||
String timeFormat = String.format("%02d:%02d", minutes, seconds);
|
||||
helper.setText(R.id.tv_djs, timeFormat);
|
||||
} else {
|
||||
helper.setVisible(R.id.tv_djs, false);
|
||||
}
|
||||
}
|
||||
|
||||
helper.setText(R.id.tv_user_name, item.getNickname());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新指定位置的倒计时显示,不刷新整个item
|
||||
* @param position 列表位置
|
||||
* @param countdown 倒计时时间(秒)
|
||||
*/
|
||||
public void updateCountdown(int position, long countdown) {
|
||||
if (position >= 0 && position < getData().size()) {
|
||||
// 获取对应位置的item view
|
||||
View view = viewMap.get(position);
|
||||
if (view != null) {
|
||||
// 直接更新倒计时文本,不刷新整个item
|
||||
TextView tvDjs = view.findViewById(R.id.tv_djs);
|
||||
if (tvDjs != null) {
|
||||
// 格式化倒计时显示
|
||||
long minutes = countdown / 60;
|
||||
long seconds = countdown % 60;
|
||||
String timeFormat = String.format("%02d:%02d", minutes, seconds);
|
||||
tvDjs.setText(timeFormat);
|
||||
|
||||
// 控制倒计时显示状态
|
||||
if (countdown > 0) {
|
||||
tvDjs.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tvDjs.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据位置获取item view
|
||||
* @param position 位置
|
||||
* @return item对应的view
|
||||
*/
|
||||
private View getViewByPosition(int position) {
|
||||
RecyclerView recyclerView = getRecyclerView();
|
||||
if (recyclerView != null) {
|
||||
RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
// 检查 position 是否在可见范围内
|
||||
if (layoutManager instanceof LinearLayoutManager) {
|
||||
LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
|
||||
int firstVisiblePosition = linearLayoutManager.findFirstVisibleItemPosition();
|
||||
int lastVisiblePosition = linearLayoutManager.findLastVisibleItemPosition();
|
||||
|
||||
// 确保 position 在可见范围内
|
||||
if (position >= firstVisiblePosition && position <= lastVisiblePosition) {
|
||||
return layoutManager.findViewByPosition(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 魅力详情适配器
|
||||
*/
|
||||
public class RoomCharmAdapter extends BaseQuickAdapter<RoomUserCharmListBean, BaseViewHolder> {
|
||||
public RoomCharmAdapter() {
|
||||
super(R.layout.item_charm_dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RoomUserCharmListBean item) {
|
||||
helper.setText(R.id.tv_nick_name, item.getNickname());
|
||||
helper.setText(R.id.tv_charm, item.getCharm()+"");
|
||||
helper.setText(R.id.tv_user_id,"ID:"+item.getUser_code());
|
||||
MeHeadView headView = helper.getView(R.id.im_user);
|
||||
headView.setData(item.getAvatar(), "", "");
|
||||
|
||||
LinearLayout llContainer =helper.getView(R.id.ll_in);
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
if (item.getIcon() == null){
|
||||
return;
|
||||
}
|
||||
List<String> images = item.getIcon(); // 获取图片列表
|
||||
|
||||
for (String url : images) {
|
||||
if (url.contains("http")) {
|
||||
ImageView imageView1 = new ImageView(getContext());
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
|
||||
);
|
||||
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
|
||||
imageView1.setLayoutParams(params);
|
||||
imageView1.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView1);
|
||||
|
||||
llContainer.addView(imageView1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.room.RoomHourBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class RoomHourlyAdapter extends BaseQuickAdapter<RoomHourBean.RoomListBean, BaseViewHolder> {
|
||||
public RoomHourlyAdapter() {
|
||||
super(R.layout.item_hourly);
|
||||
}
|
||||
|
||||
// 定义点击监听器接口
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(RoomHourBean.RoomListBean item, int position);
|
||||
}
|
||||
|
||||
private OnItemClickListener mOnItemClickListener;
|
||||
|
||||
// 设置监听器的方法
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.mOnItemClickListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder baseViewHolder, RoomHourBean.RoomListBean roomListBean) {
|
||||
// 获取当前项的索引
|
||||
int position = baseViewHolder.getLayoutPosition();
|
||||
if (position == 0){
|
||||
baseViewHolder.setText(R.id.tv_num, "");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_num, com.xscm.moduleutil.R.mipmap.top1);
|
||||
}else if (position == 1){
|
||||
baseViewHolder.setText(R.id.tv_num, "");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_num, com.xscm.moduleutil.R.mipmap.top2);
|
||||
}else if (position == 2){
|
||||
baseViewHolder.setText(R.id.tv_num, "");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_num, com.xscm.moduleutil.R.mipmap.top3);
|
||||
}else {
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_num, com.xscm.moduleutil.R.mipmap.hourly_num);
|
||||
baseViewHolder.setText(R.id.tv_num, position+1+"");
|
||||
}
|
||||
|
||||
ImageUtils.loadHeadCC(roomListBean.getRoom_cover(), baseViewHolder.getView(R.id.room_tx));
|
||||
if (roomListBean.getXlh_status()==1){
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.GONE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.GONE);
|
||||
baseViewHolder.setText(R.id.tv_sta, "进行中");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_sta, com.xscm.moduleutil.R.mipmap.jxz);
|
||||
}else if (roomListBean.getXlh_status()==2){
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.GONE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.GONE);
|
||||
baseViewHolder.setText(R.id.tv_sta, "即将开始");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_sta, com.xscm.moduleutil.R.mipmap.jiks);
|
||||
}else {
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.GONE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.GONE);
|
||||
}
|
||||
if (roomListBean.getRedpacket_status()==0){
|
||||
baseViewHolder.getView(R.id.im_red).setVisibility(View.GONE);
|
||||
}else {
|
||||
baseViewHolder.getView(R.id.im_red).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
baseViewHolder.setText(R.id.room_name, roomListBean.getRoom_name());
|
||||
ImageUtils.loadHeadCC(roomListBean.getLabel_icon(), baseViewHolder.getView(R.id.iv_type));
|
||||
baseViewHolder.setText(R.id.room_hr, roomListBean.getTotal_price()+"");
|
||||
// 为整个item设置点击事件
|
||||
baseViewHolder.itemView.setOnClickListener(v -> {
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(roomListBean, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.moduleroom.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.room.RoomHourBean;
|
||||
|
||||
public class HourlyChartContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getRoomHourRanking(RoomHourBean roomHourBean);
|
||||
|
||||
void findView();
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
void getRoomHourRanking(String page,String page_limit);// 房间小时榜
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.example.moduleroom.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RedpacketDetail;
|
||||
|
||||
public class RedEnvelopesContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void redPacketDetail(RedpacketDetail redpacketDetail);
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
void getRedpacketDetail(String redpacketId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.example.moduleroom.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomCharmDialogContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void roomUserCharmList(List<RoomUserCharmListBean> roomUserCharmListBeans);
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
|
||||
void roomUserCharmList(String room_id, String user_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.example.moduleroom.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.GiftUserWallBean;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
import com.xscm.moduleutil.bean.room.CloseBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomConcernDean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomCloseContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
// TODO: 2025/3/10 获取亲密关系
|
||||
void roomRelationList(List<RoomRelationBean> list);
|
||||
|
||||
}
|
||||
|
||||
public interface IRoomToolPre extends IPresenter {
|
||||
// TODO: 2025/3/10 获取亲密关系
|
||||
void roomRelationList(String type);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.example.moduleroom.dialog
|
||||
|
||||
import android.R
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.moduleroom.adapter.EmotionAdapter
|
||||
import com.example.moduleroom.databinding.DialogEmotionPickerBinding
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.tencent.qcloud.tuikit.timcommon.util.ThreadUtils
|
||||
import com.xscm.moduleutil.bean.room.Emotion
|
||||
import com.xscm.moduleutil.bean.room.EmotionDeatils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import io.reactivex.disposables.Disposable
|
||||
import retrofit2.Retrofit
|
||||
|
||||
class EmotionPickerDialog(context: Context) : Dialog(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
private lateinit var binding: DialogEmotionPickerBinding
|
||||
private lateinit var emotionAdapter: EmotionAdapter
|
||||
private val emotions = mutableListOf<Emotion>()
|
||||
private val emotionsDeatils = mutableListOf<EmotionDeatils>()
|
||||
|
||||
private var onEmotionSelectedListener: ((EmotionDeatils) -> Unit)? = null
|
||||
private var currentPage = 1
|
||||
private var isLoading = false
|
||||
private var currentTab = "1" // 默认tab
|
||||
|
||||
init {
|
||||
binding = DialogEmotionPickerBinding.inflate(LayoutInflater.from(context))
|
||||
setContentView(binding.root)
|
||||
|
||||
setupWindow()
|
||||
setupViews()
|
||||
// loadEmotions(currentTab, 1)
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
|
||||
private fun setupViews() {
|
||||
RetrofitClient.getInstance().upEmotion(object : BaseObserver<List<Emotion>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: List<Emotion>) {
|
||||
if (t.isNotEmpty()) {
|
||||
emotions.addAll(t)
|
||||
for (i in t) {
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(i.type_name))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 设置Tab
|
||||
// 在代码中设置
|
||||
val tabLayout = binding.tabLayout
|
||||
tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab?) {
|
||||
// 设置选中状态的文本大小
|
||||
tab?.view?.findViewById<TextView>(com.google.android.material.R.id.text)?.apply {
|
||||
textSize = 16f
|
||||
setTextColor(Color.WHITE)
|
||||
}
|
||||
loadEmotions(emotions.get(tab?.position!!).id.toString(), 1);
|
||||
}
|
||||
|
||||
override fun onTabUnselected(tab: TabLayout.Tab?) {
|
||||
// 设置未选中状态的文本大小
|
||||
tab?.view?.findViewById<TextView>(com.google.android.material.R.id.text)?.apply {
|
||||
textSize = 12f
|
||||
setTextColor(Color.parseColor("#999999"))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTabReselected(tab: TabLayout.Tab?) {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 设置RecyclerView
|
||||
emotionAdapter = EmotionAdapter()
|
||||
binding.rvEmotions.layoutManager = GridLayoutManager(context, 4)
|
||||
binding.rvEmotions.adapter = emotionAdapter
|
||||
|
||||
// 在 setupViews() 方法中
|
||||
emotionAdapter.setOnEmotionClickListener { emotion ->
|
||||
onEmotionSelectedListener?.invoke( emotion)
|
||||
dismiss()
|
||||
}
|
||||
|
||||
// // 设置下拉刷新
|
||||
// binding.swipeRefreshLayout.setOnRefreshListener {
|
||||
// loadEmotions(currentTab, 1)
|
||||
// }
|
||||
//
|
||||
// // 设置上拉加载更多
|
||||
// binding.rvEmotions.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
// override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
// super.onScrolled(recyclerView, dx, dy)
|
||||
//
|
||||
// val layoutManager = recyclerView.layoutManager as LinearLayoutManager
|
||||
// val visibleItemCount = layoutManager.childCount
|
||||
// val totalItemCount = layoutManager.itemCount
|
||||
// val firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition()
|
||||
//
|
||||
// if (!isLoading && (visibleItemCount + firstVisibleItemPosition) >= totalItemCount && firstVisibleItemPosition >= 0) {
|
||||
// loadEmotions(currentTab, ++currentPage)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
|
||||
// 设置表情点击事件
|
||||
// emotionAdapter.setOnEmotionClickListener { emotion ->
|
||||
// onEmotionSelectedListener?.invoke(emotion)
|
||||
// dismiss()
|
||||
// }
|
||||
//
|
||||
// // 关闭按钮
|
||||
// binding.ivClose.setOnClickListener {
|
||||
// dismiss()
|
||||
// }
|
||||
}
|
||||
|
||||
private fun loadEmotions(type: String, page: Int) {
|
||||
if (page == 1) {
|
||||
emotionsDeatils.clear()
|
||||
}
|
||||
|
||||
isLoading = true
|
||||
|
||||
RetrofitClient.getInstance().getEmotionDeatils(type, object : BaseObserver<List<EmotionDeatils>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: List<EmotionDeatils>) {
|
||||
if (t.isNotEmpty()) {
|
||||
emotionsDeatils.addAll(t)
|
||||
emotionAdapter.setNewData(emotionsDeatils)
|
||||
}else{
|
||||
emotionsDeatils.clear()
|
||||
emotionAdapter.setNewData(emotionsDeatils)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
isLoading = false
|
||||
|
||||
}
|
||||
|
||||
fun setOnEmotionSelectedListener(listener: (EmotionDeatils) -> Unit) {
|
||||
onEmotionSelectedListener = listener
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.GifAvatarOvalView;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/8/24
|
||||
*@description:交友房关系卡成功
|
||||
*/
|
||||
public class FriendsDialogFragment extends DialogFragment {
|
||||
|
||||
private int animStyle = com.xscm.moduleutil.R.anim.anim_scale_in; // 默认使用透明度动画
|
||||
|
||||
FriendUserBean recipient;
|
||||
private OnDialogActionListener listener;
|
||||
GifAvatarOvalView avatar1,za_avatar1;
|
||||
GifAvatarOvalView avatar2,za_avatar2;
|
||||
private TextView tv_tname;
|
||||
private TextView tv_name1;
|
||||
private TextView tv_name2;
|
||||
ConstraintLayout constraintLayout_qm;
|
||||
|
||||
public interface OnDialogActionListener {
|
||||
void onKnowClicked();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
|
||||
public static void show(FriendUserBean bean, FragmentManager fragmentManager) {
|
||||
FriendsDialogFragment fragment = new FriendsDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("FriendUserBean", bean);
|
||||
fragment.setArguments(args);
|
||||
fragment.show(fragmentManager, "FriendsDialogFragment");
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
if (fragment != null && fragment.isAdded()) {
|
||||
fragment.dismiss();
|
||||
}
|
||||
}, 4000); // 4秒后关闭
|
||||
}
|
||||
|
||||
|
||||
public void setAnimationStyle(int animStyle) {
|
||||
this.animStyle = animStyle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
recipient = (FriendUserBean) getArguments().getSerializable("FriendUserBean");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
Dialog dialog = new Dialog(requireContext());
|
||||
dialog.setContentView(R.layout.dialog_friends_room);
|
||||
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
window.setGravity(Gravity.CENTER);
|
||||
}
|
||||
|
||||
avatar1= dialog.findViewById(R.id.avatar1);
|
||||
avatar2= dialog.findViewById(R.id.avatar2);
|
||||
tv_name1= dialog.findViewById(R.id.tv_name1);
|
||||
tv_name2= dialog.findViewById(R.id.tv_name2);
|
||||
tv_tname= dialog.findViewById(R.id.tv_tname);
|
||||
|
||||
za_avatar1= dialog.findViewById(R.id.za_avatar1);
|
||||
za_avatar2= dialog.findViewById(R.id.za_avatar2);
|
||||
|
||||
constraintLayout_qm= dialog.findViewById(R.id.cl_container);
|
||||
constraintLayout_qm.setVisibility(View.VISIBLE);
|
||||
ImageUtils.loadHeadCC(recipient.getUser1_avatar(),avatar1);
|
||||
ImageUtils.loadHeadCC(recipient.getUser2_avatar(),avatar2);
|
||||
tv_name1.setText(recipient.getUser1_nickname());
|
||||
tv_name2.setText(recipient.getUser2_nickname());
|
||||
tv_tname.setText(recipient.getRelation_name()+"关系成功");
|
||||
setTextViewGradient(tv_tname, ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FFFFF0F0), ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FFA4C8));
|
||||
return dialog;
|
||||
}
|
||||
private void setTextViewGradient(TextView textView, int startColor, int endColor) {
|
||||
Shader shader = new LinearGradient(
|
||||
0, 0, textView.getPaint().getTextSize() * textView.length(), 0,
|
||||
new int[]{startColor, endColor},
|
||||
null,
|
||||
Shader.TileMode.CLAMP);
|
||||
textView.getPaint().setShader(shader);
|
||||
}
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
Window window = getDialog().getWindow();
|
||||
if (window != null) {
|
||||
Animation animation = AnimationUtils.loadAnimation(requireContext(), animStyle);
|
||||
window.getDecorView().startAnimation(animation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.adapter.RoomHourlyAdapter;
|
||||
import com.example.moduleroom.contacts.HourlyChartContacts;
|
||||
import com.example.moduleroom.databinding.DialogHourlyChartFragmentBinding;
|
||||
import com.example.moduleroom.presenter.HourlyChartPresenter;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.adapter.CirleListAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.room.RoomHourBean;
|
||||
import com.xscm.moduleutil.dialog.RoomAuctionWebViewDialog;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/29
|
||||
*@description:小时榜
|
||||
*/
|
||||
public class HourlyChartDialog extends BaseMvpDialogFragment<HourlyChartPresenter, DialogHourlyChartFragmentBinding> implements HourlyChartContacts.View {
|
||||
private int page;
|
||||
|
||||
private RoomHourlyAdapter roomHourlyAdapter;
|
||||
|
||||
// 添加标志,控制对话框从右侧显示
|
||||
protected boolean mGravityRight = true;
|
||||
|
||||
@Override
|
||||
protected HourlyChartPresenter bindPresenter() {
|
||||
return new HourlyChartPresenter( this, getActivity());
|
||||
}
|
||||
|
||||
|
||||
public static HourlyChartDialog newInstance() {
|
||||
HourlyChartDialog hourlyChartDialog = new HourlyChartDialog();
|
||||
return hourlyChartDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public @NotNull Dialog onCreateDialog(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
Dialog dialog = new Dialog(requireContext(), com.xscm.moduleutil.R.style.FullScreenDialogStyle);
|
||||
return dialog;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (getDialog() != null && getDialog().getWindow() != null) {
|
||||
// 设置为全屏高度,并去掉状态栏
|
||||
getDialog().getWindow().setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
);
|
||||
// 添加全屏标志,去掉状态栏
|
||||
getDialog().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
if (mGravityRight) {
|
||||
getDialog().getWindow().setGravity(Gravity.END);
|
||||
} else {
|
||||
getDialog().getWindow().setGravity(Gravity.BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
page=1;
|
||||
MvpPre.getRoomHourRanking(page+"", "20");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
// 设置dialog的窗口属性
|
||||
if (getDialog() != null && getDialog().getWindow() != null) {
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
if (mGravityRight) {
|
||||
getDialog().getWindow().setGravity(Gravity.END);
|
||||
} else {
|
||||
getDialog().getWindow().setGravity(Gravity.BOTTOM);
|
||||
}
|
||||
}
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
roomHourlyAdapter = new RoomHourlyAdapter();
|
||||
mBinding.recyclerView.setAdapter(roomHourlyAdapter);
|
||||
// 确保最后一项完全可见
|
||||
mBinding.recyclerView.setClipToPadding(false);
|
||||
mBinding.recyclerView.setPadding(
|
||||
0,
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_12),
|
||||
0,
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_12)
|
||||
);
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
page=1;
|
||||
MvpPre.getRoomHourRanking(page+"", "20");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getRoomHourRanking(page+"", "20");
|
||||
}
|
||||
});
|
||||
|
||||
roomHourlyAdapter.setOnItemClickListener(new RoomHourlyAdapter.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(RoomHourBean.RoomListBean item, int position) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), item.getRoom_id(),"");
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.viewBackground.setOnClickListener(v -> dismiss());
|
||||
mBinding.imHourlyWf.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "api/Page/page_show?id=24");
|
||||
RoomAuctionWebViewDialog dialog = new RoomAuctionWebViewDialog(getActivity(), bundle);
|
||||
dialog.show();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_hourly_chart_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRoomHourRanking(RoomHourBean roomHourBean) {
|
||||
if (roomHourBean!=null){
|
||||
mBinding.tvHourlyDjs.setText("榜单时间 "+roomHourBean.getTime_range());
|
||||
if (page == 1) {
|
||||
if (roomHourBean.getLists() != null && !roomHourBean.getLists().isEmpty()) {
|
||||
roomHourlyAdapter.setNewData(roomHourBean.getLists());
|
||||
} else {
|
||||
roomHourlyAdapter.setNewData(new ArrayList<>()); // 清空旧数据并提示空状态
|
||||
}
|
||||
} else {
|
||||
if (roomHourBean.getLists() != null && !roomHourlyAdapter.getData().isEmpty()) {
|
||||
roomHourlyAdapter.addData(roomHourBean.getLists());
|
||||
} else {
|
||||
// 没有更多数据时可调用 finishLoadMoreWithNoMoreData()
|
||||
mBinding.smartRefreshLayout.finishLoadMoreWithNoMoreData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findView() {
|
||||
mBinding.smartRefreshLayout.finishLoadMore() ;
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDialogStyle(Window window) {
|
||||
if (mGravityRight) {
|
||||
window.setGravity(Gravity.END);
|
||||
window.setWindowAnimations(com.xscm.moduleutil.R.style.DialogSlideRightAnimation);
|
||||
} else {
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
window.setWindowAnimations(com.xscm.moduleutil.R.style.CommonShowDialogBottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,419 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.DigitsKeyListener;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.databinding.DialogRedBagSendBinding;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
private static final String TAG = "RedBagSendDialog";
|
||||
private int type;//这是第一个页面,发送红包的第一个页面,默认为1,第二个页面,是2,点击查看帮助,是type=3
|
||||
private int stype;//当前是哪个页面:1:默认第一个页面, 2:选择条件页面
|
||||
|
||||
private int redType;//红包类型 1:普通红包 2:口令红包
|
||||
private int redTime;//开奖倒计时 0:立刻 1:1分钟;2:2分钟;5:5分钟 10:10分钟(这里传递给服务的时候,需要乘60)
|
||||
private int redGold=1;//红包类型 0:金币红包 1:钻石红包
|
||||
private int redCount;//条件 0:无 1:收藏房间 2:仅麦上用户
|
||||
private String roomId;
|
||||
|
||||
public RedBagSendDialog(@NonNull @NotNull Context context, String roomId ) {
|
||||
super(context, com.xscm.moduleutil.R.style.BaseDialogStyleH);
|
||||
this.roomId = roomId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_red_bag_send;
|
||||
}
|
||||
|
||||
private boolean diaj=false;
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
// window.setLayout(345, 454);
|
||||
// window.setLayout((int) (ScreenUtils.getScreenWidth() * 345.f / 345), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 0.9), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
setView(1);
|
||||
mBinding.edText.setKeyListener(DigitsKeyListener.getInstance("0123456789"));
|
||||
mBinding.etNum.setKeyListener(DigitsKeyListener.getInstance("0123456789"));
|
||||
mBinding.imHelp.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (type != 3) {
|
||||
setView(3);
|
||||
setWebView(CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"api/Page/page_show?id=25");
|
||||
} else {
|
||||
setView(stype);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.imRedClose.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.butSub.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mBinding.butSub.getText().equals("下一步")) {
|
||||
if (redType==2){
|
||||
if (TextUtils.isEmpty(mBinding.evKl.getText().toString().trim())){
|
||||
ToastUtils.show("请输入口令");
|
||||
return;
|
||||
}
|
||||
}
|
||||
setView(2);
|
||||
setFRed();
|
||||
} else {
|
||||
if (diaj){
|
||||
return;
|
||||
}
|
||||
diaj=true;
|
||||
// 验证输入
|
||||
String numStr = mBinding.etNum.getText().toString().trim();
|
||||
String textStr = mBinding.edText.getText().toString().trim();
|
||||
|
||||
// 检查是否为空
|
||||
if (TextUtils.isEmpty(numStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入数量");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(textStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入金额");
|
||||
return;
|
||||
}
|
||||
if (redType==2){
|
||||
if (TextUtils.isEmpty(mBinding.evKl.getText().toString().trim())){
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入口令");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 转换为数字并比较
|
||||
try {
|
||||
int num = Integer.parseInt(numStr);
|
||||
int text = Integer.parseInt(textStr);
|
||||
|
||||
if (text <= num) {
|
||||
diaj=false;
|
||||
ToastUtils.show("金额必须大于数量");
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证通过,继续发送红包逻辑
|
||||
sendRedPacket();
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入有效的数字");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.rgXz.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
if (checkedId == R.id.bt_pt) {
|
||||
redType = 1;
|
||||
mBinding.lKl.setVisibility(GONE);
|
||||
} else if (checkedId == R.id.bt_kl) {
|
||||
redType = 2;
|
||||
mBinding.lKl.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.rgDjs.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
if (checkedId == R.id.rb_lk) {
|
||||
redTime = 0;
|
||||
} else if (checkedId == R.id.rb_1) {
|
||||
redTime = 1 * 60;
|
||||
} else if (checkedId == R.id.rb_2) {
|
||||
redTime = 2 * 60;
|
||||
} else if (checkedId == R.id.rb_5) {
|
||||
redTime = 5 * 60;
|
||||
} else if (checkedId == R.id.rb_10) {
|
||||
redTime = 10 * 60;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.rgRedType.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
if (checkedId == R.id.rb_gold) {
|
||||
// 选中金币红包:文字红色,背景黄色
|
||||
mBinding.rbGold.setTextColor(Color.parseColor("#D01717"));
|
||||
mBinding.rbGold.setBackgroundResource(com.xscm.moduleutil.R.drawable.selector_red_bag_type_button);
|
||||
// 钻石红包恢复默认样式
|
||||
mBinding.rbDiamond.setTextColor(Color.parseColor("#FFC9C7"));
|
||||
mBinding.rbDiamond.setBackgroundResource(com.xscm.moduleutil.R.drawable.selector_red_bag_type_button);
|
||||
redGold = 1;
|
||||
} else if (checkedId == R.id.rb_diamond) {
|
||||
// 选中钻石红包:文字白色,背景透明
|
||||
mBinding.rbDiamond.setTextColor(Color.parseColor("#D01717"));
|
||||
mBinding.rbDiamond.setBackgroundResource(com.xscm.moduleutil.R.drawable.selector_red_bag_type_button);
|
||||
|
||||
// 金币红包恢复默认样式
|
||||
mBinding.rbGold.setTextColor(Color.parseColor("#FFC9C7"));
|
||||
mBinding.rbGold.setBackgroundResource(com.xscm.moduleutil.R.drawable.selector_red_bag_type_button);
|
||||
redGold =2;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 设置点击监听器
|
||||
mBinding.btNone.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 点击"无"时,取消其他所有选项的选中状态
|
||||
mBinding.btFavoriteRoom.setSelected(false);
|
||||
mBinding.btMicUser.setSelected(false);
|
||||
// 切换"无"的选中状态
|
||||
mBinding.btNone.setSelected(!mBinding.btNone.isSelected());
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.btFavoriteRoom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 如果"无"被选中,则先取消"无"的选中状态
|
||||
if (mBinding.btNone.isSelected()) {
|
||||
mBinding.btNone.setSelected(false);
|
||||
}
|
||||
// 切换当前按钮的选中状态
|
||||
mBinding.btFavoriteRoom.setSelected(!mBinding.btFavoriteRoom.isSelected());
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.btMicUser.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 如果"无"被选中,则先取消"无"的选中状态
|
||||
if (mBinding.btNone.isSelected()) {
|
||||
mBinding.btNone.setSelected(false);
|
||||
}
|
||||
// 切换当前按钮的选中状态
|
||||
mBinding.btMicUser.setSelected(!mBinding.btMicUser.isSelected());
|
||||
}
|
||||
});
|
||||
}
|
||||
private void sendRedPacket() {
|
||||
// 获取输入值
|
||||
String numStr = mBinding.etNum.getText().toString().trim();
|
||||
String textStr = mBinding.edText.getText().toString().trim();
|
||||
String kl = "";
|
||||
|
||||
if (redType == 2) {
|
||||
kl = mBinding.evKl.getText().toString().trim();
|
||||
}
|
||||
|
||||
// 验证输入
|
||||
if (TextUtils.isEmpty(numStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入数量");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(textStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入金额");
|
||||
return;
|
||||
}
|
||||
|
||||
if (redType == 2 && TextUtils.isEmpty(kl)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入口令");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
int num = Integer.parseInt(numStr);
|
||||
int text = Integer.parseInt(textStr);
|
||||
|
||||
if (text <= num) {
|
||||
diaj=false;
|
||||
ToastUtils.show("金额必须大于数量");
|
||||
return;
|
||||
}
|
||||
|
||||
// 发送红包
|
||||
RetrofitClient.getInstance().redPacketCreate(
|
||||
redType,
|
||||
kl,
|
||||
redGold,
|
||||
textStr,
|
||||
numStr,
|
||||
getSelectedConditions(),
|
||||
redTime + "",
|
||||
roomId,
|
||||
mBinding.edBz.getText().toString(),
|
||||
new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull String redPacketBean) {
|
||||
ToastUtils.show("发送成功");
|
||||
diaj=false;
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入有效的数字");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String getSelectedConditions() {
|
||||
Button btNone = mBinding.llTj.findViewById(R.id.bt_none);
|
||||
Button btFavoriteRoom = mBinding.llTj.findViewById(R.id.bt_favorite_room);
|
||||
Button btMicUser = mBinding.llTj.findViewById(R.id.bt_mic_user);
|
||||
|
||||
if (btNone.isSelected()) {
|
||||
return "0";
|
||||
} else {
|
||||
List<String> selectedList = new ArrayList<>();
|
||||
if (btFavoriteRoom.isSelected()) {
|
||||
selectedList.add("1");
|
||||
}
|
||||
if (btMicUser.isSelected()) {
|
||||
selectedList.add("2");
|
||||
}
|
||||
return String.join(",", selectedList);
|
||||
}
|
||||
}
|
||||
|
||||
private WalletBean walletBean;
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
RetrofitClient.getInstance().wallet(new BaseObserver<WalletBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(WalletBean walletBeans) {
|
||||
walletBean = walletBeans;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setView(int types) {
|
||||
type = types;
|
||||
switch (types) {
|
||||
case 1:
|
||||
mBinding.clRedXz.setVisibility(VISIBLE);
|
||||
mBinding.lKl.setVisibility(VISIBLE);
|
||||
mBinding.lDjs.setVisibility(VISIBLE);
|
||||
mBinding.lLx.setVisibility(VISIBLE);
|
||||
mBinding.tvJeTitle.setVisibility(GONE);
|
||||
mBinding.lJine.setVisibility(GONE);
|
||||
mBinding.lGs.setVisibility(GONE);
|
||||
mBinding.llTj.setVisibility(GONE);
|
||||
mBinding.lBz.setVisibility(GONE);
|
||||
mBinding.wvWeb.setVisibility(GONE);
|
||||
mBinding.butSub.setVisibility(VISIBLE);
|
||||
mBinding.butSub.setText("下一步");
|
||||
mBinding.imHelp.setImageResource(com.xscm.moduleutil.R.drawable.room_redbag_help);
|
||||
stype = 1;
|
||||
break;
|
||||
case 2:
|
||||
mBinding.clRedXz.setVisibility(GONE);
|
||||
mBinding.lKl.setVisibility(GONE);
|
||||
mBinding.lDjs.setVisibility(GONE);
|
||||
mBinding.lLx.setVisibility(GONE);
|
||||
mBinding.tvJeTitle.setVisibility(VISIBLE);
|
||||
mBinding.lJine.setVisibility(VISIBLE);
|
||||
mBinding.lGs.setVisibility(VISIBLE);
|
||||
mBinding.llTj.setVisibility(VISIBLE);
|
||||
mBinding.lBz.setVisibility(VISIBLE);
|
||||
mBinding.wvWeb.setVisibility(GONE);
|
||||
mBinding.butSub.setVisibility(VISIBLE);
|
||||
mBinding.butSub.setText("发红包");
|
||||
mBinding.imHelp.setImageResource(com.xscm.moduleutil.R.drawable.room_redbag_help);
|
||||
stype = 2;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
mBinding.clRedXz.setVisibility(GONE);
|
||||
mBinding.lKl.setVisibility(GONE);
|
||||
mBinding.lDjs.setVisibility(GONE);
|
||||
mBinding.lLx.setVisibility(GONE);
|
||||
mBinding.tvJeTitle.setVisibility(GONE);
|
||||
mBinding.lJine.setVisibility(GONE);
|
||||
mBinding.lGs.setVisibility(GONE);
|
||||
mBinding.llTj.setVisibility(GONE);
|
||||
mBinding.lBz.setVisibility(GONE);
|
||||
mBinding.wvWeb.setVisibility(VISIBLE);
|
||||
mBinding.butSub.setVisibility(GONE);
|
||||
mBinding.imHelp.setImageResource(com.xscm.moduleutil.R.drawable.room_redbag_back);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/10/11 打开规则按钮
|
||||
private void setWebView(String url) {
|
||||
mBinding.wvWeb.getSettings().setJavaScriptEnabled(true);
|
||||
mBinding.wvWeb.loadUrl(url);
|
||||
}
|
||||
|
||||
private void setFRed() {
|
||||
if (redGold == 1) {
|
||||
mBinding.tvJeTitle.setText(walletBean.getCoin() != null ? walletBean.getCoin() : "0" + "金币可用");
|
||||
mBinding.tvJ.setText("金币");
|
||||
} else if (redGold == 2) {
|
||||
mBinding.tvJeTitle.setText(walletBean.getEarnings() != null ? walletBean.getEarnings() : "0" + "钻石可用");
|
||||
mBinding.tvJ.setText("钻石");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.adapter.RedBagAdapter;
|
||||
import com.example.moduleroom.databinding.DialogRedListBinding;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.utils.QXRedPacketManager;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
|
||||
/**
|
||||
* 这是红包列表
|
||||
*/
|
||||
public class RedListDialog extends BaseDialog<DialogRedListBinding> {
|
||||
|
||||
RedBagAdapter redBagAdapter;
|
||||
private QXRedPacketManager qxRedPacketManager;
|
||||
|
||||
public RedListDialog(@NonNull Context context) {
|
||||
super(context, com.xscm.moduleutil.R.style.BaseDialogStyleH);
|
||||
}
|
||||
// 添加获取适配器的方法
|
||||
public RedBagAdapter getAdapter() {
|
||||
return redBagAdapter;
|
||||
}
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_red_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
qxRedPacketManager=QXRedPacketManager.getInstance();
|
||||
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 0.8), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
// window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 3); // 每行显示3个
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
// 设置间距
|
||||
mBinding.recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
int spacing = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_10);
|
||||
outRect.left = spacing;
|
||||
outRect.right = spacing;
|
||||
outRect.bottom = spacing;
|
||||
if (parent.getChildAdapterPosition(view) % 3 == 0) {
|
||||
outRect.left = spacing;
|
||||
}
|
||||
if (parent.getChildAdapterPosition(view) % 3 == 2) {
|
||||
outRect.right = spacing;
|
||||
}
|
||||
}
|
||||
});
|
||||
redBagAdapter=new RedBagAdapter();
|
||||
mBinding.recyclerView.setAdapter(redBagAdapter);
|
||||
// 监听数据变化,动态调整高度
|
||||
redBagAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
||||
@Override
|
||||
public void onChanged() {
|
||||
adjustRecyclerViewHeight();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void adjustRecyclerViewHeight() {
|
||||
int itemCount = redBagAdapter.getItemCount();
|
||||
if (itemCount == 0) return;
|
||||
|
||||
// 计算需要的行数(每行3个)
|
||||
int rows = (int) Math.ceil((double) itemCount / 3);
|
||||
|
||||
// 限制最多显示2行
|
||||
int maxRows = Math.min(rows, 2);
|
||||
|
||||
// 计算总高度:2行 × item高度 + 间距
|
||||
int itemHeight = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_80);
|
||||
int spacing = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_10);
|
||||
int totalHeight = maxRows * itemHeight + (maxRows + 1) * spacing;
|
||||
|
||||
ViewGroup.LayoutParams params = mBinding.recyclerView.getLayoutParams();
|
||||
params.height = totalHeight;
|
||||
mBinding.recyclerView.setLayoutParams(params);
|
||||
|
||||
// 如果超过2行,启用滚动
|
||||
mBinding.recyclerView.setNestedScrollingEnabled(itemCount > 6);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
// RetrofitClient.getInstance().firstChargeGift(new BaseObserver<FirstChargeGiftBean>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(FirstChargeGiftBean firstChargeGiftBean) {
|
||||
// if (firstChargeGiftBean != null) {
|
||||
// showGift(firstChargeGiftBean);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
redBagAdapter.setNewData(qxRedPacketManager.getAllRedPackets()) ;
|
||||
redBagAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
|
||||
if (mListener != null) {
|
||||
mListener.onRedPacketClick(redBagAdapter.getData().get(position), position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface OnRedPacketClickListener {
|
||||
void onRedPacketClick(RedPacketInfo redPacketInfo,int position);
|
||||
}
|
||||
private OnRedPacketClickListener mListener;
|
||||
|
||||
public void setOnRedPacketClickListener(OnRedPacketClickListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
|
||||
private Resources getResources() {
|
||||
return getContext().getResources();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.adapter.RoomCharmAdapter;
|
||||
import com.example.moduleroom.contacts.RoomCharmDialogContacts;
|
||||
import com.example.moduleroom.databinding.DialogCharmFragmentBinding;
|
||||
import com.example.moduleroom.presenter.RoomCharmDialogPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 魅力弹框
|
||||
*/
|
||||
public class RoomCharmDialog extends BaseMvpDialogFragment<RoomCharmDialogPresenter, DialogCharmFragmentBinding> implements RoomCharmDialogContacts.View{
|
||||
|
||||
private String mRoomId;
|
||||
private String mUserId;
|
||||
private RoomCharmAdapter mAdapter;
|
||||
public static RoomCharmDialog newInstance(String roomId,String userId) {
|
||||
RoomCharmDialog fragment = new RoomCharmDialog();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("roomId", roomId);
|
||||
bundle.putString("userId", userId);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
mRoomId = arguments.getString("roomId");
|
||||
mUserId = arguments.getString("userId");
|
||||
}
|
||||
@Override
|
||||
protected RoomCharmDialogPresenter bindPresenter() {
|
||||
return new RoomCharmDialogPresenter(this, getActivity());
|
||||
}
|
||||
@Override
|
||||
protected void initDialogStyle(Window window) {
|
||||
super.initDialogStyle(window);
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
lp.dimAmount = 0.5f;
|
||||
// 固定对话框的宽度和高度
|
||||
lp.width = WindowManager.LayoutParams.MATCH_PARENT; // 宽度设置为屏幕宽度
|
||||
lp.height = WindowManager.LayoutParams.WRAP_CONTENT; // 高度设置为内容高度
|
||||
|
||||
window.setAttributes(lp);
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.roomUserCharmList(mRoomId, mUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.rvCharmList.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
mAdapter = new RoomCharmAdapter();
|
||||
mBinding.rvCharmList.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_charm_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomUserCharmList(List<RoomUserCharmListBean> roomUserCharmListBeans) {
|
||||
if (roomUserCharmListBeans!=null){
|
||||
mAdapter.setNewData(roomUserCharmListBeans);
|
||||
}else {
|
||||
mAdapter.setNewData(new ArrayList<>());
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.contacts.RoomCloseContacts;
|
||||
import com.example.moduleroom.databinding.RoomConcernDialogBinding;
|
||||
import com.example.moduleroom.presenter.RoomClosePresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomConcernDean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Setter;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/8/24
|
||||
*@description: 卡关系页面
|
||||
*/
|
||||
@Setter
|
||||
public class RoomConcernDialogFragment extends BaseMvpDialogFragment<RoomClosePresenter, RoomConcernDialogBinding> implements RoomCloseContacts.View {
|
||||
private int selectedPosition = -1;
|
||||
private BaseQuickAdapter<RoomRelationBean, BaseViewHolder> mAdapter;
|
||||
private FriendUserBean relationshipList;
|
||||
|
||||
public static RoomConcernDialogFragment newInstance(FriendUserBean relationshipList, OnConcernSelectedListener listener) {
|
||||
RoomConcernDialogFragment fragment = new RoomConcernDialogFragment(listener);
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("FriendUserBean", relationshipList);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
relationshipList = (FriendUserBean) arguments.getSerializable("FriendUserBean");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.room_concern_dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDialogStyle(Window window) {
|
||||
super.initDialogStyle(window);
|
||||
window.setGravity(Gravity.CENTER);
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
lp.dimAmount = 0.4f;
|
||||
|
||||
// 使用dp单位转换为像素
|
||||
lp.width = com.blankj.utilcode.util.ConvertUtils.dp2px(275); // 宽度275dp
|
||||
lp.height = com.blankj.utilcode.util.ConvertUtils.dp2px(452); // 高度452dp
|
||||
|
||||
window.setAttributes(lp);
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
||||
}
|
||||
@Override
|
||||
public void initView() {
|
||||
// getWindow().setLayout((int) (ScreenUtils.getScreenWidth() / 375.0 * 341), RadioGroup.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
ImageUtils.loadImageView(relationshipList.getUser1_avatar(), mBinding.image);
|
||||
ImageUtils.loadImageView(relationshipList.getUser2_avatar(), mBinding.image2);
|
||||
mBinding.tvName1.setText(relationshipList.getUser1_nickname());
|
||||
mBinding.tvName2.setText(relationshipList.getUser2_nickname());
|
||||
mBinding.tvZhi.setText(relationshipList.getHeart_value());
|
||||
mBinding.btnAction.setOnClickListener(this::onViewClicked);
|
||||
// mBinding.btnCancel.setOnClickListener(this::onViewClicked);
|
||||
mBinding.rlList.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
mAdapter = new BaseQuickAdapter<RoomRelationBean, BaseViewHolder>(R.layout.room_concern_item) {
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RoomRelationBean item) {
|
||||
|
||||
TextView tvRelation = helper.getView(R.id.tv_relation);
|
||||
tvRelation.setText(item.getName());
|
||||
|
||||
// 根据当前选中的位置来设置颜色
|
||||
if (helper.getAdapterPosition() == selectedPosition) {
|
||||
tvRelation.setSelected(true);
|
||||
tvRelation.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.white));
|
||||
} else {
|
||||
tvRelation.setSelected(false);
|
||||
tvRelation.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.black));
|
||||
}
|
||||
|
||||
// 设置点击事件
|
||||
tvRelation.setOnClickListener(v -> {
|
||||
// 更新选中的位置
|
||||
int previousPosition = selectedPosition;
|
||||
selectedPosition = helper.getAdapterPosition();
|
||||
|
||||
// 通知Adapter数据集已更改,以刷新视图
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition);
|
||||
}
|
||||
notifyItemChanged(selectedPosition);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
// mAdapter.setOnItemChildClickListener((adapter, view, position) -> {
|
||||
// selectedPosition = position;
|
||||
// });
|
||||
mBinding.rlList.setAdapter(mAdapter);
|
||||
mAdapter.bindToRecyclerView(mBinding.rlList);
|
||||
// mAdapter.setNewData(list);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RoomClosePresenter bindPresenter() {
|
||||
return new RoomClosePresenter(this, getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
MvpPre.roomRelationList("2");
|
||||
// MvpPre.getConcernList();
|
||||
|
||||
}
|
||||
|
||||
public OnConcernSelectedListener listener;
|
||||
|
||||
public void onViewClicked(View view) {
|
||||
if (view.getId() == R.id.btn_action) {//确认
|
||||
if (listener != null && selectedPosition != -1) {
|
||||
RoomRelationBean selectedDean = mAdapter.getItem(selectedPosition);
|
||||
listener.onConcernSelected(selectedDean, relationshipList);
|
||||
dismiss();
|
||||
}else {
|
||||
ToastUtils.show("请选择关系");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
// else if (view.getId() == R.id.btn_cancel) {//取消
|
||||
// dismiss();
|
||||
// }
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||
dialog.setCancelable(false); // 禁止通过返回键关闭对话框
|
||||
return dialog;
|
||||
}
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
Dialog dialog = getDialog();
|
||||
if (dialog != null) {
|
||||
dialog.setCanceledOnTouchOutside(false); // 禁止点击对话框外部关闭对话框
|
||||
}
|
||||
}
|
||||
|
||||
public RoomConcernDialogFragment(OnConcernSelectedListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomRelationList(List<RoomRelationBean> list) {
|
||||
mAdapter.setNewData(list);
|
||||
}
|
||||
|
||||
public interface OnConcernSelectedListener {
|
||||
void onConcernSelected(RoomRelationBean selectedDean, FriendUserBean relationshipList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,360 @@
|
||||
package com.example.moduleroom.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.activity.RoomActivity;
|
||||
import com.example.moduleroom.databinding.FragmentRedEnvelopesBinding;
|
||||
import com.xscm.moduleutil.bean.RedPackGrab;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.event.RedEnvelopeStatus;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.QXRedPacketManager;
|
||||
import com.xscm.moduleutil.view.QXRedBagSendView;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import com.xscm.moduleutil.widget.floatingView.IFloatingView;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.xscm.moduleutil.event.RedEnvelopeStatus.*;
|
||||
|
||||
/**
|
||||
* @author xscm
|
||||
* @ClassName RedEnvelopesFragment
|
||||
* @Description 抢红包的dialog
|
||||
* @Date 2021/12/28 10:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class RedEnvelopesFragment extends BaseDialog<FragmentRedEnvelopesBinding> {
|
||||
private RedEnvelopeStatus drawType;
|
||||
public RedPacketInfo mRedPacketInfo;
|
||||
public boolean isCollectedRoom;//是否收藏房间
|
||||
|
||||
public long needTime;// 倒计时
|
||||
public boolean isFromToComment;//是否是发送评论地方过来
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
private Context mContext;
|
||||
|
||||
public RedEnvelopesFragment(@NonNull @NotNull Context context) {
|
||||
super(context, com.xscm.moduleutil.R.style.BaseDialogStyleH);
|
||||
mContext=context;
|
||||
}
|
||||
|
||||
//是否收藏方法
|
||||
public void setIsCollectedRoom(boolean isCollectedRoom) {
|
||||
this.isCollectedRoom = isCollectedRoom;
|
||||
}
|
||||
|
||||
public void setFromToComment(boolean isFromToComment) {
|
||||
this.isFromToComment = isFromToComment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
// window.setLayout(345, 454);
|
||||
// window.setLayout((int) (ScreenUtils.getScreenWidth() * 345.f / 345), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 0.8), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.imRedClose.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).navigation();
|
||||
QXRedBagSendView redBagView = new QXRedBagSendView(getContext());
|
||||
redBagView.showInView((ViewGroup) getWindow().getDecorView());
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mBinding.imRedK.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RetrofitClient.getInstance().grab(mRedPacketInfo.getRedpacket_id(), new BaseObserver<RedPackGrab>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull RedPackGrab redPackGrab) {
|
||||
if (redPackGrab != null) {
|
||||
if (redPackGrab.getCode() == 1) {
|
||||
mRedPacketInfo.setIs_qiang(1);
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", mRedPacketInfo.getRedpacket_id()).navigation();
|
||||
dismiss();
|
||||
} else if (redPackGrab.getCode() == 2) {
|
||||
ToastUtils.showShort("您已经抢过红包了");
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", mRedPacketInfo.getRedpacket_id()).navigation();
|
||||
dismiss();
|
||||
} else {
|
||||
snatched();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// QXRedBagSendView redBagView = new QXRedBagSendView(getContext());
|
||||
// redBagView.showInView((ViewGroup) getWindow().getDecorView());
|
||||
|
||||
}
|
||||
});
|
||||
mBinding.tvCk.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", mRedPacketInfo.getRedpacket_id()).navigation();
|
||||
}
|
||||
});
|
||||
mBinding.textPl.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (drawType == RedEnvelopeStatus.QXRedBagDrawTypeCollect){
|
||||
RetrofitClient.getInstance().followRoom(mRedPacketInfo.getRoom_id()+"","1", new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull String s) {
|
||||
if (mContext instanceof RoomActivity) {
|
||||
((RoomActivity) mContext).setUserInfo();
|
||||
}
|
||||
|
||||
if (mRedPacketInfo.canOpenNow()){
|
||||
setType(QXRedBagDrawTypeOpen);
|
||||
}else {
|
||||
setType(QXRedBagDrawTypeTimeDown);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else if (drawType == RedEnvelopeStatus.QXRedBagDrawTypePwdSend){
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setRed_num(mRedPacketInfo.getPassword());
|
||||
EventBus.getDefault().post(userInfo);
|
||||
dismiss();
|
||||
}
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", mRedPacketInfo.getRedpacket_id()).navigation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void snatched() {
|
||||
mBinding.tvRedCount.setText("手慢,没有抢到");
|
||||
mBinding.imRedK.setVisibility(View.GONE);
|
||||
mBinding.textPl.setVisibility(View.GONE);
|
||||
mBinding.tvTitle.setVisibility(View.GONE);
|
||||
mBinding.tvPinl.setVisibility(View.GONE);
|
||||
mBinding.tvKl.setVisibility(View.GONE);
|
||||
mBinding.tvCk.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.fragment_red_envelopes;
|
||||
}
|
||||
|
||||
public void setRedPacket(RedPacketInfo redPacketInfo) {
|
||||
this.mRedPacketInfo = redPacketInfo;
|
||||
setType(getDrawTypeWithRedpacktModel(redPacketInfo));
|
||||
if (redPacketInfo.getType() == 2) {
|
||||
mBinding.imKlB.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.imKlB.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.loadHeadCC(redPacketInfo.getAvatar(), mBinding.userAvatar);
|
||||
mBinding.tvUserName.setText(redPacketInfo.getNickname() + "的红包");
|
||||
mBinding.tvRedCount.setText(redPacketInfo.getRemark());
|
||||
if (drawType == RedEnvelopeStatus.QXRedBagDrawTypeOpen) {
|
||||
mBinding.clPwd.setVisibility(View.GONE);
|
||||
mBinding.textShare.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.clPwd.setVisibility(View.VISIBLE);
|
||||
mBinding.textShare.setVisibility(View.VISIBLE);
|
||||
if (redPacketInfo.getType() == 2) {
|
||||
mBinding.tvKl.setVisibility(View.VISIBLE);
|
||||
mBinding.imKlB.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.tvKl.setVisibility(View.GONE);
|
||||
mBinding.imKlB.setVisibility(View.GONE);
|
||||
}
|
||||
if (redPacketInfo.getConditions() == null || redPacketInfo.getConditions().equals("0")) {
|
||||
mBinding.clPwd.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.clPwd.setVisibility(View.VISIBLE);
|
||||
mBinding.tvKl.setVisibility(View.VISIBLE);
|
||||
if (redPacketInfo.getConditions().equals("1")) {
|
||||
mBinding.tvKl.setText("收藏房间");
|
||||
} else if (redPacketInfo.getConditions().equals("2")) {
|
||||
mBinding.tvKl.setText("仅麦上用户");
|
||||
} else {
|
||||
mBinding.tvKl.setText("收藏房间,进麦上用户");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setNeedTime(long needTimes){
|
||||
this.needTime = needTimes;
|
||||
if (needTime > 0) {
|
||||
mBinding.textPl.setText(TimeUtils.millis2String(needTime*1000, "mm:ss")+"后开启红包");
|
||||
}
|
||||
}
|
||||
|
||||
private RedEnvelopeStatus getDrawTypeWithRedpacktModel(RedPacketInfo redPacketInfo) {
|
||||
drawType = QXRedBagDrawTypeOpen;
|
||||
if (redPacketInfo.getType() == 1) {//普通红包
|
||||
drawType = QXRedBagDrawTypeOpen;
|
||||
if (redPacketInfo.getCountdown() > 0) {
|
||||
if (redPacketInfo.remainingTime() > 0) {
|
||||
drawType = QXRedBagDrawTypeTimeDown;
|
||||
}
|
||||
}
|
||||
//收藏房间在先
|
||||
if (redPacketInfo.getConditions().contains("1") && !isCollectedRoom) {
|
||||
drawType = QXRedBagDrawTypeCollect;
|
||||
}
|
||||
} else {//口令红包
|
||||
drawType = QXRedBagDrawTypePwdSend;
|
||||
if (isFromToComment) {
|
||||
if (redPacketInfo.getConditions().contains("1") && !isCollectedRoom) {
|
||||
drawType = QXRedBagDrawTypeCollect;
|
||||
} else {
|
||||
if (redPacketInfo.canOpenNow()) {
|
||||
drawType = QXRedBagDrawTypeOpen;
|
||||
} else {
|
||||
drawType = QXRedBagDrawTypeTimeDown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return drawType;
|
||||
}
|
||||
|
||||
private void setType(RedEnvelopeStatus type) {
|
||||
this.drawType = type;
|
||||
switch (type) {
|
||||
case QXRedBagDrawTypeOpen:
|
||||
handleReadyToOpen();
|
||||
break;
|
||||
case QXRedBagDrawTypeFinished:
|
||||
qXRedBagDrawTypeFinished();
|
||||
break;
|
||||
case QXRedBagDrawTypeCollect:
|
||||
qXRedBagDrawTypeCollect();
|
||||
break;
|
||||
case QXRedBagDrawTypeTimeDown:
|
||||
qXRedBagDrawTypeTimeDown();
|
||||
break;
|
||||
|
||||
case QXRedBagDrawTypePwdSend:
|
||||
qXRedBagDrawTypePwdSend();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void qXRedBagDrawTypePwdSend() {
|
||||
mBinding.imRedK.setVisibility(View.GONE);
|
||||
mBinding.tvRedCount.setText(mRedPacketInfo.getRemark());
|
||||
mBinding.tvCk.setVisibility(View.GONE);
|
||||
mBinding.textPl.setVisibility(View.VISIBLE);
|
||||
mBinding.textPl.setText(setValue(QXRedBagDrawTypePwdSend));
|
||||
|
||||
}
|
||||
|
||||
private void qXRedBagDrawTypeTimeDown() {
|
||||
mBinding.imRedK.setVisibility(View.GONE);
|
||||
mBinding.tvRedCount.setText(mRedPacketInfo.getRemark());
|
||||
mBinding.tvCk.setVisibility(View.GONE);
|
||||
mBinding.textPl.setVisibility(View.VISIBLE);
|
||||
mBinding.textPl.setText(setValue(QXRedBagDrawTypeTimeDown));
|
||||
}
|
||||
|
||||
private void qXRedBagDrawTypeCollect() {
|
||||
mBinding.imRedK.setVisibility(View.GONE);
|
||||
mBinding.tvRedCount.setText(mRedPacketInfo.getRemark());
|
||||
mBinding.tvCk.setVisibility(View.GONE);
|
||||
mBinding.textPl.setVisibility(View.VISIBLE);
|
||||
mBinding.textPl.setText(setValue(QXRedBagDrawTypeCollect));
|
||||
mBinding.textShare.setVisibility(View.VISIBLE);
|
||||
mBinding.clPwd.setVisibility(View.VISIBLE);
|
||||
mBinding.tvPinl.setVisibility(View.GONE);
|
||||
mBinding.tvKl.setVisibility(View.VISIBLE);
|
||||
mBinding.tvKl.setText("收藏房间");
|
||||
|
||||
}
|
||||
|
||||
private String setValue(RedEnvelopeStatus type) {
|
||||
switch (type) {
|
||||
|
||||
case QXRedBagDrawTypeCollect:
|
||||
return "收藏房间抢红包";
|
||||
case QXRedBagDrawTypeTimeDown:
|
||||
return "00:00后开启红包";
|
||||
case QXRedBagDrawTypePwdSend:
|
||||
return "发送评论抢红包";
|
||||
default:
|
||||
return "点击打开红包";
|
||||
}
|
||||
}
|
||||
|
||||
private void qXRedBagDrawTypeFinished() {
|
||||
mBinding.textPl.setVisibility(View.GONE);
|
||||
mBinding.tvTitle.setVisibility(View.GONE);
|
||||
mBinding.tvPinl.setVisibility(View.GONE);
|
||||
mBinding.tvKl.setVisibility(View.GONE);
|
||||
mBinding.tvCk.setVisibility(View.VISIBLE);
|
||||
mBinding.tvRedCount.setText("手慢了,红包被领完了");
|
||||
mBinding.imRedK.setVisibility(View.GONE);
|
||||
mBinding.clPwd.setVisibility(View.GONE);
|
||||
mBinding.textShare.setVisibility(View.GONE);
|
||||
}
|
||||
private void handleReadyToOpen() {
|
||||
mBinding.textPl.setVisibility(View.GONE);
|
||||
mBinding.tvTitle.setVisibility(View.GONE);
|
||||
mBinding.tvPinl.setVisibility(View.GONE);
|
||||
mBinding.tvKl.setVisibility(View.GONE);
|
||||
mBinding.imRedK.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
// 取消倒计时,避免内存泄漏
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void changeViewType(RedEnvelopeStatus type) {
|
||||
setType(type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.moduleroom.fragment;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class RedViewModel extends ViewModel {
|
||||
// TODO: Implement the ViewModel
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.moduleroom.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.moduleroom.contacts.BidListContacts;
|
||||
import com.example.moduleroom.contacts.HourlyChartContacts;
|
||||
import com.xscm.moduleutil.bean.room.RoomHourBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class HourlyChartPresenter extends BasePresenter<HourlyChartContacts.View> implements HourlyChartContacts.IRoomPre{
|
||||
|
||||
HourlyChartContacts.View mView;
|
||||
public HourlyChartPresenter(HourlyChartContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
this.mView=view;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void getRoomHourRanking(String page, String page_limit) {
|
||||
api.getRoomHourRanking(page, page_limit, new BaseObserver<RoomHourBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull RoomHourBean roomHourBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getRoomHourRanking(roomHourBean);
|
||||
MvpRef.get().findView();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.example.moduleroom.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.example.moduleroom.contacts.RedEnvelopesContacts;
|
||||
import com.xscm.moduleutil.bean.RedpacketDetail;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class RedEnvelopesPresenter extends BasePresenter<RedEnvelopesContacts.View> implements RedEnvelopesContacts.IRoomPre{
|
||||
RedEnvelopesContacts.View mView;
|
||||
public RedEnvelopesPresenter(RedEnvelopesContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRedpacketDetail(String redpacketId) {
|
||||
api.redPacketDetail(redpacketId, new BaseObserver<RedpacketDetail>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull RedpacketDetail redpacketDetail) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().redPacketDetail(redpacketDetail);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.example.moduleroom.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.moduleroom.contacts.BidListContacts;
|
||||
import com.example.moduleroom.contacts.RoomCharmDialogContacts;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class RoomCharmDialogPresenter extends BasePresenter<RoomCharmDialogContacts.View> implements RoomCharmDialogContacts.IRoomPre {
|
||||
|
||||
RoomCharmDialogContacts.View mView;
|
||||
|
||||
public RoomCharmDialogPresenter(RoomCharmDialogContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void roomUserCharmList(String room_id, String user_id) {
|
||||
api.roomUserCharmList(room_id, user_id,new BaseObserver<List<RoomUserCharmListBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoomUserCharmListBean> roomUserCharmListBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().roomUserCharmList(roomUserCharmListBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.example.moduleroom.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
|
||||
import com.example.moduleroom.contacts.RoomCloseContacts;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class RoomClosePresenter extends BasePresenter<RoomCloseContacts.View> implements RoomCloseContacts.IRoomToolPre {
|
||||
RoomCloseContacts.View mView;
|
||||
|
||||
public RoomClosePresenter(RoomCloseContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
@Override
|
||||
public void roomRelationList(String type) {
|
||||
api.roomRelationList(type, new BaseObserver<List<RoomRelationBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoomRelationBean> roomRelationBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().roomRelationList(roomRelationBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
|
||||
|
||||
// 同时启动两个service,共享同一个NotificationID,并且将他们同时置为前台状态,
|
||||
// 此时会出现两个前台服务,但通知管理器里只有一个关联的通知。
|
||||
// 这时我们在其中一个服务中调用 stopForeground(true),
|
||||
// 这个服务前台状态会被取消,同时状态栏通知也被移除。另外一个服务并没有受到影响,还是前台服务状态,但是此时,状态栏通知已经没了!
|
||||
// 其oom_adj值还是没变的
|
||||
class CancelNoticeService : Service() {
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (null == intent) {
|
||||
//服务被系统kill掉之后重启进来的
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
ForegroundNotification.startForeground(this)
|
||||
Thread {
|
||||
SystemClock.sleep(1000)
|
||||
// stopForeground(true)
|
||||
Log.d("ForegroundService", "CancelNoticeService onStartCommand: CancelNoticeService" )
|
||||
ForegroundNotification.stopForeground(this)
|
||||
// stopSelf()
|
||||
}.start()
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d("ForegroundService", "onDestroy: CancelNoticeService")
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
|
||||
fun Context.startForegroundService() {
|
||||
Intent(this, ForegroundService::class.java).also { intent ->
|
||||
if (Build.VERSION.SDK_INT >= 34) {
|
||||
this.startForegroundService(intent)
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
this.startForegroundService(intent)
|
||||
} else {
|
||||
this.startService(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun Context.hideBackground(hide: Boolean) {
|
||||
var appTasks: List<ActivityManager.AppTask>? = null
|
||||
val activityManager = getSystemService(
|
||||
Context.ACTIVITY_SERVICE
|
||||
) as? ActivityManager
|
||||
if (activityManager != null && activityManager.appTasks.also {
|
||||
appTasks = it
|
||||
} != null && appTasks?.isNotEmpty() == true) {
|
||||
appTasks?.get(0)?.setExcludeFromRecents(hide)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun Activity.ignoreBattery() {
|
||||
val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)
|
||||
intent.data = Uri.parse("package:$packageName")
|
||||
startActivityForResult(intent, 1)
|
||||
}
|
||||
|
||||
fun Activity.startAccessibilitySetting() {
|
||||
runCatching {
|
||||
val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun isServiceRunning(context: Context, serviceName: String="com.voice.module_live.keepalive.ForegroundService"): Boolean {
|
||||
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
if (activityManager != null) {
|
||||
for (service in activityManager.getRunningServices(Int.MAX_VALUE)) {
|
||||
if (serviceName == service.service.className) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.*
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.content.getSystemService
|
||||
import com.example.moduleroom.activity.RoomActivity
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object ForegroundNotification {
|
||||
private const val CHANNEL_FOREGROUND = "foreground-notification"
|
||||
const val NOTICE_ID = 233
|
||||
private var service: Service? = null
|
||||
|
||||
private fun createChannelIfNeeded(context: Context) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
|
||||
|
||||
val foregroundChannel =
|
||||
NotificationChannel(CHANNEL_FOREGROUND, "前台服务", NotificationManager.IMPORTANCE_MIN)
|
||||
.apply {
|
||||
setShowBadge(false)
|
||||
enableLights(false)
|
||||
enableVibration(false)
|
||||
lockscreenVisibility = Notification.VISIBILITY_SECRET
|
||||
}
|
||||
context.getSystemService<NotificationManager>()
|
||||
?.createNotificationChannel(foregroundChannel)
|
||||
}
|
||||
|
||||
fun startForeground(service: Service) {
|
||||
ForegroundNotification.service = service
|
||||
createChannelIfNeeded(service)
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
service,
|
||||
0,
|
||||
Intent(service, RoomActivity::class.java),
|
||||
PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
val notification = NotificationCompat.Builder(service, CHANNEL_FOREGROUND)
|
||||
.setSmallIcon(com.xscm.moduleutil.R.mipmap.ic_launcher)
|
||||
.setContentText("正在运行")
|
||||
.setContentIntent(pendingIntent)
|
||||
.setLocalOnly(true)
|
||||
.setPriority(NotificationCompat.PRIORITY_MIN)
|
||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
|
||||
.setOngoing(true)
|
||||
.setShowWhen(false)
|
||||
.build()
|
||||
service.startForeground(NOTICE_ID, notification)
|
||||
}
|
||||
|
||||
fun stopForeground(service: Service) {
|
||||
val manager = service.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
manager?.cancel(NOTICE_ID)
|
||||
service.stopForeground(true)
|
||||
}
|
||||
|
||||
fun cancelNotice(service: Service) {
|
||||
val manager = service.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
manager?.cancel(NOTICE_ID)
|
||||
}
|
||||
|
||||
fun stopForeground() {
|
||||
val manager =
|
||||
service?.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
manager?.cancel(NOTICE_ID)
|
||||
service?.stopForeground(true)
|
||||
}
|
||||
|
||||
fun startForegroundIfNeed(service: Service) {
|
||||
val manager = service.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
var needStart = true
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
manager?.activeNotifications?.forEach {
|
||||
needStart = (it.id == NOTICE_ID).not()
|
||||
}
|
||||
}
|
||||
if (needStart) {
|
||||
startForeground(service)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.util.Log
|
||||
import com.tencent.imsdk.v2.V2TIMManager
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import java.util.*
|
||||
|
||||
//前台服务
|
||||
class ForegroundService : Service() {
|
||||
private var logInt = 0
|
||||
private var timer: Timer? = null
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
ForegroundNotification.startForeground(this)
|
||||
timer = Timer()
|
||||
timer?.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
Log.d("ForegroundService", "Timer task ${logInt++}")
|
||||
RetrofitClient.getInstance().keepXintiao();
|
||||
}
|
||||
}, 0L, 10000L)
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (null == intent) {
|
||||
//服务被系统kill掉之后重启进来的
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
ForegroundNotification.startForegroundIfNeed(this)
|
||||
if (ServiceHelper.cancelNotice) {
|
||||
Log.d("ForegroundService", "onStartCommand: CancelNoticeService")
|
||||
val intent = Intent(this, CancelNoticeService::class.java)
|
||||
startService(intent)
|
||||
}
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d("ForegroundService", "onDestroy: $timer")
|
||||
|
||||
timer?.cancel()
|
||||
ForegroundNotification.stopForeground(this)
|
||||
// 重启自己
|
||||
startForegroundService()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.example.moduleroom.service;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
|
||||
public class RoomPlayService extends Service {
|
||||
|
||||
private NotificationManager notificationManager;
|
||||
|
||||
private String notificationId = "room_play_channelId";
|
||||
|
||||
private String notificationName = "room_play_channelName";
|
||||
|
||||
//通知的唯一标识号。
|
||||
private static final int NOTIFICATION_ID = 11210666;
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
//创建NotificationChannel
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(notificationId, notificationName, NotificationManager.IMPORTANCE_HIGH);
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
startForeground(1, getNotification());
|
||||
}
|
||||
|
||||
private Notification getNotification() {
|
||||
|
||||
// PendingIntent如果用户选择此通知,则启动我们的活动
|
||||
// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0);
|
||||
|
||||
Notification.Builder builder = new Notification.Builder(this)
|
||||
.setTicker("正在运行")
|
||||
.setSmallIcon(R.mipmap.ic_launcher)
|
||||
|
||||
// .setContentIntent(pendingIntent)
|
||||
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
|
||||
.setContentText("运行中");
|
||||
|
||||
//设置Notification的ChannelID,否则不能正常显示
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
builder.setChannelId(notificationId);
|
||||
}
|
||||
Notification notification = builder.build();
|
||||
|
||||
//发送通知
|
||||
// notificationManager.notify(NOTIFICATION_ID,notification);
|
||||
return notification;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (notificationManager != null) {
|
||||
notificationManager.cancel(NOTIFICATION_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
object ServiceHelper {
|
||||
|
||||
var cancelNotice = false
|
||||
}
|
||||
15
moduleroom/src/main/res/layout/custom_tab_layou_giftt.xml
Normal file
15
moduleroom/src/main/res/layout/custom_tab_layou_giftt.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
36
moduleroom/src/main/res/layout/dialog_charm_fragment.xml
Normal file
36
moduleroom/src/main/res/layout/dialog_charm_fragment.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_tb_ffffff"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:text="魅力值详情"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_charm_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
tools:listitem="@layout/item_charm_dialog" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
62
moduleroom/src/main/res/layout/dialog_emotion_picker.xml
Normal file
62
moduleroom/src/main/res/layout/dialog_emotion_picker.xml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_rounded_top_white">
|
||||
|
||||
|
||||
<!-- TabLayout -->
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tabIndicatorColor="@color/white"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabIndicatorHeight="2dp"
|
||||
app:tabTextColor="#999999"
|
||||
app:tabTextAppearance="@style/CustomTextAppearanceTab"
|
||||
/>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#2C2A38"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_layout"/>
|
||||
|
||||
<!-- 表情列表 -->
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/swipe_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider"
|
||||
android:paddingEnd="@dimen/dp_28"
|
||||
android:paddingStart="@dimen/dp_28"
|
||||
app:srlEnableLoadMore="false"
|
||||
app:srlEnableRefresh="false"
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_emotions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"/>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
95
moduleroom/src/main/res/layout/dialog_friends_room.xml
Normal file
95
moduleroom/src/main/res/layout/dialog_friends_room.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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_container"
|
||||
android:layout_width="@dimen/dp_282"
|
||||
android:layout_height="@dimen/dp_353"
|
||||
android:background="@mipmap/jiao_kgx"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_33"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:shadowColor="#40000000"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="2"
|
||||
android:shadowRadius="3.0"
|
||||
tools:text="兄弟牵手成功"
|
||||
android:textColor="#ffffebc3"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/sp_28"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/avatar1"
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_21"
|
||||
android:layout_marginBottom="@dimen/dp_27"
|
||||
android:background="@mipmap/jiao_k_l"
|
||||
android:ellipsize="start"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="用户名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar1"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/avatar1" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/avatar2"
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_name1"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_21"
|
||||
android:layout_marginBottom="@dimen/dp_27"
|
||||
android:background="@mipmap/jiao_k_r"
|
||||
android:ellipsize="start"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="用户名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar2"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/avatar2" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<!-- 左侧透明背景,用于点击关闭dialog -->
|
||||
<View
|
||||
android:id="@+id/view_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80000000"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cl_content"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!-- 右侧内容区域 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_content"
|
||||
android:layout_width="@dimen/dp_256"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#32057F"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_bj"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_281"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@mipmap/hourly_top_bj"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hourly_djs"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
app:layout_constraintStart_toStartOf="@+id/im_bj"
|
||||
app:layout_constraintEnd_toEndOf="@+id/im_bj"
|
||||
android:background="@mipmap/hourly_djs"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:translationY="@dimen/dp_120"
|
||||
android:text="榜单时间 10:00-10:59"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FFFFFF99"
|
||||
android:textSize="@dimen/sp_12"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_hourly_wf"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/hourly_wh"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_40"/>
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/im_bj"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
tools:listitem="@layout/item_hourly"
|
||||
android:paddingBottom="@dimen/dp_12"/>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
645
moduleroom/src/main/res/layout/dialog_red_bag_send.xml
Normal file
645
moduleroom/src/main/res/layout/dialog_red_bag_send.xml
Normal file
@@ -0,0 +1,645 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:background="@color/color_transparent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="454dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/red_f_bj"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_red_close"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/head_cc"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_20"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_help"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@drawable/room_redbag_help"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="直播间红包"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_red_xz"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hiti"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:text="参与领取限制"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
<!-- 参与领取限制 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_hiti"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_15">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_xz"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/bt_pt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_weight="1"
|
||||
android:text="普通红包"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/selector_red_bag_radio_button"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/bt_kl"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:text="口令红包"
|
||||
android:button="@null"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:gravity="center"
|
||||
android:textColor="#fff"
|
||||
android:background="@drawable/selector_red_bag_radio_button"/>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 口令输入区 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/l_kl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_red_xz"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="口令"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ev_kl"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_weight="2"
|
||||
android:background="@null"
|
||||
android:gravity="end|center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:maxLength="10"
|
||||
android:textColorHint="#999"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:hint="请输入口令"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 开奖倒计时 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/l_djs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/l_kl"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:text="开奖倒计时"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_djs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_5">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_lk"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
android:text="立刻"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
android:text="1分钟"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
android:text="2分钟"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
android:text="5分钟"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_10"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
android:text="10分钟"/>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 红包类型 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/l_lx"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/l_djs"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:text="红包类型"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_red_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:background="@drawable/bg_r395_ba230a"
|
||||
android:layout_marginEnd="@dimen/dp_15">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_gold"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:paddingTop="@dimen/dp_5"
|
||||
android:paddingBottom="@dimen/dp_5"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_2"
|
||||
android:textColor="#D01717"
|
||||
android:text="金币红包"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/selector_red_bag_type_button"
|
||||
android:checked="true"
|
||||
/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_diamond"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_2"
|
||||
android:textColor="#FFC9C7"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/selector_red_bag_type_button"
|
||||
android:text="钻石红包"/>
|
||||
</RadioGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_je_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_37"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:background="@drawable/bg_r8_c51a0c"
|
||||
android:text="0金币可用"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:layout_marginTop="6dp"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
app:layout_constraintTop_toBottomOf="@+id/im_red_close"
|
||||
app:layout_constraintEnd_toEndOf="@+id/im_red_close"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
/>
|
||||
|
||||
<!-- 金额 -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/l_jine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_je_title"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="-15dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="金额"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ed_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:background="@null"
|
||||
android:gravity="end|center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:maxLength="10"
|
||||
android:layout_toStartOf="@+id/tv_j"
|
||||
android:textColorHint="#999"
|
||||
android:textColor="#333"
|
||||
android:inputType="number"
|
||||
android:hint="请输入金额"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_j"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:text="金币"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="13sp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
<!-- 个数-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/l_gs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/l_jine"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="个数"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:background="@null"
|
||||
android:gravity="end|center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:maxLength="10"
|
||||
android:layout_toStartOf="@+id/tv_g"
|
||||
android:textColorHint="#999"
|
||||
android:textColor="#333"
|
||||
android:inputType="number"
|
||||
android:hint="请输入数量"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_g"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:text="个"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="13sp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
<!-- 条件选择区域 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_tj"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/l_gs"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:text="条件"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<!-- 选项按钮 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_10">
|
||||
|
||||
<!-- 无 -->
|
||||
<Button
|
||||
android:id="@+id/bt_none"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.8"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="无"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:background="@drawable/selector_red_bag_condition_button"
|
||||
/>
|
||||
|
||||
<!-- 收藏房间 -->
|
||||
<Button
|
||||
android:id="@+id/bt_favorite_room"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="收藏房间"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:background="@drawable/selector_red_bag_condition_button"
|
||||
android:layout_marginStart="@dimen/dp_10"/>
|
||||
|
||||
<!-- 仅麦上用户 -->
|
||||
<Button
|
||||
android:id="@+id/bt_mic_user"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="仅麦上用户"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:background="@drawable/selector_red_bag_condition_button"
|
||||
android:layout_marginStart="@dimen/dp_10"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 备注 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/l_bz"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_tj"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="备注"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ed_bz"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_weight="2"
|
||||
android:background="@null"
|
||||
android:gravity="end|center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:maxLength="10"
|
||||
android:textColorHint="#999"
|
||||
android:textColor="#333"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:hint="请输入备注"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- 下一步按钮 -->
|
||||
<Button
|
||||
android:id="@+id/but_sub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_marginTop="@dimen/dp_29"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:background="@drawable/red_bag_next_btn_bg"
|
||||
android:text="下一步"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#fff35248"
|
||||
android:textSize="@dimen/sp_18"
|
||||
/>
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:id="@+id/wv_web"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
tools:ignore="WebViewLayout"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
103
moduleroom/src/main/res/layout/dialog_red_list.xml
Normal file
103
moduleroom/src/main/res/layout/dialog_red_list.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
>
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="490dp"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/red_bott_b"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/im_red_top_b"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="@dimen/dp_242"-->
|
||||
<!-- android:src="@mipmap/red_top_b"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_40"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"/>-->
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/rl_t"
|
||||
android:layout_width="@dimen/dp_280"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_252"
|
||||
android:maxHeight="@dimen/dp_338"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_1"
|
||||
android:layout_width="@dimen/dp_280"
|
||||
android:layout_height="@dimen/dp_242"
|
||||
android:src="@mipmap/red_top_b"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_x"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/im_1"
|
||||
app:layout_constraintStart_toStartOf="@+id/im_1"
|
||||
app:layout_constraintEnd_toEndOf="@+id/im_1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="-1dp"
|
||||
android:background="@drawable/bg_r10_bott"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_marginBottom="20dp"
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_25"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
android:layout_marginTop="@dimen/dp_146"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/im_x"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:itemCount="11"
|
||||
tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
tools:spanCount="3"
|
||||
tools:listitem="@layout/item_red_bag"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:src="@mipmap/index_close_youth"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_t"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
162
moduleroom/src/main/res/layout/fragment_red.xml
Normal file
162
moduleroom/src/main/res/layout/fragment_red.xml
Normal file
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".activity.RedResultActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fff"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/red_k_top"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.xscm.moduleutil.widget.CustomTopBar
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_red"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_bar"
|
||||
android:layout_marginStart="@dimen/dp_79"
|
||||
android:layout_marginEnd="@dimen/dp_79"
|
||||
android:layout_marginTop="@dimen/dp_6">
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/user_avatar"
|
||||
android:layout_width="@dimen/dp_41"
|
||||
android:layout_height="@dimen/dp_41"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:src="@mipmap/default_avatar"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_41"
|
||||
app:layout_constraintTop_toTopOf="@+id/user_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/user_avatar"
|
||||
app:layout_constraintStart_toEndOf="@+id/user_avatar"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
tools:text="用户名"
|
||||
android:gravity="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_16"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_red_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
app:layout_constraintTop_toBottomOf="@+id/user_avatar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
tools:text="恭喜发财,大吉大利"
|
||||
android:gravity="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_red_jb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_48"
|
||||
android:textStyle="bold"
|
||||
tools:text="5026"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_red_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_31"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_jb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_19"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:textStyle="bold"
|
||||
tools:text="金币"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_red_jb"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_red_jb"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_red_jb"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="已存入金币"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_red_jb"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_31"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lq"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_55"
|
||||
tools:text="已领取5/10"
|
||||
android:textColor="#999"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_19"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/im_top"
|
||||
/>
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_lq"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/dp_13"
|
||||
android:paddingEnd="@dimen/dp_13"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
tools:listitem="@layout/item_red"
|
||||
android:paddingBottom="@dimen/dp_12"/>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
197
moduleroom/src/main/res/layout/fragment_red_envelopes.xml
Normal file
197
moduleroom/src/main/res/layout/fragment_red_envelopes.xml
Normal file
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
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"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:background="@color/color_transparent">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/red_en"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_kl_b"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@mipmap/red_kl_b"
|
||||
android:scaleType="fitCenter"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_red_close"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:src="@mipmap/head_cc"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_30"/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/user_avatar"
|
||||
android:layout_width="@dimen/dp_79"
|
||||
android:layout_height="@dimen/dp_79"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_52"
|
||||
tools:src="@mipmap/default_avatar"
|
||||
app:riv_oval="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintTop_toBottomOf="@+id/user_avatar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:gravity="center"
|
||||
tools:text="用户名"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_red_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:textSize="@dimen/sp_24"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_user_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textStyle="bold"
|
||||
tools:text="恭喜发财,大吉大利"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_red_k"
|
||||
android:layout_width="@dimen/dp_126"
|
||||
android:layout_height="@dimen/dp_125"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_red_count"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:src="@mipmap/red_k"
|
||||
tools:ignore="ContentDescription"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_pl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/red_text"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_80"
|
||||
android:textColor="@color/color_FFFFFFE0"
|
||||
android:textSize="@dimen/sp_23"
|
||||
android:textStyle="bold"
|
||||
tools:text="发布评论抢红包"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:gravity="top|center"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_pwd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/text_pl">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_FFFFFFE0"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:text="口令红包参与条件"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pinl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
android:textColor="@color/color_FFFFFFE0"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
android:text="发送评论:"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_kl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_pinl"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_pinl"
|
||||
android:textColor="#FFCE47"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
android:text="这是一个口令"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_ck"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_63"
|
||||
android:text="查看大家的手气>"
|
||||
android:gravity="center"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:text="查看大家手气"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_share"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_FFFFFFE0"
|
||||
android:text="抢红包必须在本房间内"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</layout>
|
||||
82
moduleroom/src/main/res/layout/item_charm_dialog.xml
Normal file
82
moduleroom/src/main/res/layout/item_charm_dialog.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ll_szmm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_62"
|
||||
android:layout_margin="15dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/im_user"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@mipmap/default_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_user"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/im_user"
|
||||
app:layout_constraintTop_toTopOf="@+id/im_user"
|
||||
android:gravity="left"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_nick_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/color_FF333333"
|
||||
tools:text="名称" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_in"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintStart_toStartOf="@+id/ll_user"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_user"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/im_user"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_gravity="center"
|
||||
android:drawableStart="@mipmap/room_charm_b"
|
||||
app:layout_constraintTop_toTopOf="@+id/im_user"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/im_user"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
34
moduleroom/src/main/res/layout/item_emotion.xml
Normal file
34
moduleroom/src/main/res/layout/item_emotion.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_emotion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@mipmap/ic_launcher"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_emotion_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:gravity="center"
|
||||
android:textColor="#BBB9C6"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_emotion" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
120
moduleroom/src/main/res/layout/item_hourly.xml
Normal file
120
moduleroom/src/main/res/layout/item_hourly.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#430C93"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/room_tx"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_21"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:riv_corner_radius="@dimen/dp_6"
|
||||
android:background="@drawable/bg_r6_000ff"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_num"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_7"
|
||||
android:textColor="#A6A77E"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:gravity="center"
|
||||
android:background="@mipmap/hourly_num"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_11"
|
||||
android:layout_height="@dimen/dp_11"
|
||||
app:layout_constraintTop_toTopOf="@+id/room_tx"
|
||||
app:layout_constraintEnd_toEndOf="@+id/room_tx"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:background="@mipmap/hourly_d"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_red"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:src="@mipmap/red_bj"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/im_xlh"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_xlh"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:src="@mipmap/xlh_rk_bj"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sta"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/im_xlh"
|
||||
app:layout_constraintTop_toBottomOf="@+id/im_xlh"
|
||||
app:layout_constraintEnd_toEndOf="@+id/im_xlh"
|
||||
android:textColor="@color/white"
|
||||
android:background="@mipmap/jxz"
|
||||
android:gravity="center"
|
||||
tools:text="进行中"
|
||||
android:textSize="@dimen/sp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
app:layout_constraintStart_toEndOf="@+id/room_tx"
|
||||
app:layout_constraintTop_toTopOf="@+id/room_tx"
|
||||
android:textColor="@color/color_FFFFFFE0"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
tools:text="房间名称"
|
||||
android:textSize="@dimen/sp_12"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/ic_jiaoy"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintStart_toStartOf="@+id/room_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/room_name"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_hr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/room_tx"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_type"
|
||||
android:textColor="@color/color_FFFFFFE0"
|
||||
android:drawableStart="@mipmap/f_h"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
tools:text="18k"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
65
moduleroom/src/main/res/layout/item_red.xml
Normal file
65
moduleroom/src/main/res/layout/item_red.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_marginBottom="@dimen/dp_7"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/red_user_avatar"
|
||||
android:layout_width="@dimen/dp_49"
|
||||
android:layout_height="@dimen/dp_49"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:src="@mipmap/default_avatar"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:textColor="#666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="用户名"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/red_user_avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/red_user_avatar"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#999"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="11:23"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_user_name"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_red_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="5026 金币"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
60
moduleroom/src/main/res/layout/item_red_bag.xml
Normal file
60
moduleroom/src/main/res/layout/item_red_bag.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_red_bag"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:src="@mipmap/red"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_djs"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_red_bag"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:textColor="#fff"
|
||||
android:background="@drawable/bg_r6_000000"
|
||||
android:gravity="center"
|
||||
tools:text="00:00" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_red_bag"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="#D04248"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="烟花易冷" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_list_bj"
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:src="@mipmap/red_liet_bj"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_red_bag"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginEnd="-5dp"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
167
moduleroom/src/main/res/layout/room_concern_dialog.xml
Normal file
167
moduleroom/src/main/res/layout/room_concern_dialog.xml
Normal file
@@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/concern_dialog">
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.33"
|
||||
app:riv_oval="true"
|
||||
tools:src="@mipmap/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="昵称"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="@+id/image"
|
||||
app:layout_constraintStart_toStartOf="@+id/image"
|
||||
app:layout_constraintTop_toBottomOf="@+id/image" />
|
||||
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@+id/tv_name1"-->
|
||||
<!-- app:layout_constraintEnd_toStartOf="@+id/image2"-->
|
||||
<!-- app:layout_constraintStart_toEndOf="@+id/image"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@+id/image">-->
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/kagx"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/image"
|
||||
app:layout_constraintEnd_toStartOf="@+id/image2"
|
||||
app:layout_constraintStart_toEndOf="@+id/image"
|
||||
app:layout_constraintTop_toTopOf="@+id/image"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_zhi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:background="@drawable/bg_r40_fe8ec8"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
tools:text="关系"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/image"
|
||||
app:layout_constraintEnd_toStartOf="@+id/image2"
|
||||
app:layout_constraintStart_toEndOf="@+id/image"
|
||||
app:layout_constraintTop_toTopOf="@+id/image"/>
|
||||
|
||||
|
||||
<!-- </FrameLayout>-->
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/image2"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginEnd="@dimen/dp_28"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.33"
|
||||
app:riv_oval="true"
|
||||
tools:src="@mipmap/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="昵称"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="@+id/image2"
|
||||
app:layout_constraintStart_toStartOf="@+id/image2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/image2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="关系列表"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/image"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name1" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rl_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
tools:listitem="@layout/room_concern_item" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
>
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/btn_cancel"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="@dimen/dp_30"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_10"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/bg_r45_0000"-->
|
||||
<!-- android:text="取消"-->
|
||||
<!-- android:textColor="@color/color_FFFFF0F0"-->
|
||||
<!-- android:textSize="12sp"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="@dimen/dp_0"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:background="@drawable/cs"
|
||||
android:text="确认"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
13
moduleroom/src/main/res/layout/room_concern_item.xml
Normal file
13
moduleroom/src/main/res/layout/room_concern_item.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/tv_relation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_margin="5dp"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_r4_eff2f8"
|
||||
android:textSize="14sp"
|
||||
tools:text="关系"
|
||||
android:textColor="@color/color_FF333333" />
|
||||
Reference in New Issue
Block a user