1:修改拍卖房转盘问题
2:添加转盘参数竞拍问题
@@ -11,10 +11,6 @@ android {
|
||||
namespace 'com.xscm.midi'
|
||||
compileSdk 35
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.xscm.midi"
|
||||
minSdk 24
|
||||
@@ -164,11 +160,11 @@ android {
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
}
|
||||
dexOptions {
|
||||
dexInProcess true
|
||||
preDexLibraries true
|
||||
javaMaxHeapSize "6g"
|
||||
}
|
||||
// dexOptions {
|
||||
// dexInProcess true
|
||||
// preDexLibraries true
|
||||
// javaMaxHeapSize "6g"
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ isBuildModule=false
|
||||
#org.gradle.deamon=false
|
||||
android.injected.testOnly=false
|
||||
|
||||
APP_VERSION_NAME=1.2.6
|
||||
APP_VERSION_CODE=178
|
||||
APP_VERSION_NAME=1.2.7
|
||||
APP_VERSION_CODE=179
|
||||
|
||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||
|
||||
@@ -75,6 +75,8 @@ webpdecoder = "1.6.4.9.0"
|
||||
wechatSdkAndroid = "6.8.30"
|
||||
xbanner = "1.7.0"
|
||||
appcompatVersion = "1.3.1"
|
||||
legacySupportV4 = "1.0.0"
|
||||
fragmentKtx = "1.5.6"
|
||||
|
||||
[libraries]
|
||||
alipay-alipaysdk-android = { module = "com.alipay.sdk:alipaysdk-android", version.ref = "alipayAlipaysdkAndroid" }
|
||||
@@ -157,6 +159,8 @@ wechat-sdk-android = { module = "com.tencent.mm.opensdk:wechat-sdk-android", ver
|
||||
xbanner = { module = "com.github.xiaohaibin:XBanner", version.ref = "xbanner" }
|
||||
zcw-togglebutton-library = { module = "com.zcw:togglebutton-library", version.ref = "togglebuttonLibraryVersion" }
|
||||
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompatVersion" }
|
||||
androidx-legacy-support-v4 = { group = "androidx.legacy", name = "legacy-support-v4", version.ref = "legacySupportV4" }
|
||||
androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragmentKtx" }
|
||||
|
||||
|
||||
[plugins]
|
||||
|
||||
7448
hs_err_pid167656.log
4085
hs_err_pid409616.log
5498
hs_err_pid619772.log
@@ -12,7 +12,6 @@ apply plugin: 'kotlin-kapt'
|
||||
|
||||
android {
|
||||
compileSdkVersion 35
|
||||
buildToolsVersion build_versions.build_tools
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 28
|
||||
|
||||
@@ -216,6 +216,9 @@ dependencies {
|
||||
api 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
|
||||
api 'io.github.mayzs:paho.mqtt.android:1.2.1'
|
||||
|
||||
// ShapeView:https://github.com/getActivity/ShapeView
|
||||
// api 'com.github.getActivity:ShapeView:10.0'
|
||||
|
||||
|
||||
// room数据库
|
||||
// def room_version = "2.5.0"
|
||||
|
||||
@@ -36,7 +36,6 @@ import java.util.List;
|
||||
|
||||
public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter, RoomVpGiftBinding> implements RewardGiftContacts.View {
|
||||
private String id;
|
||||
private GiftTwoAdapter mAdapter;
|
||||
private GiftRoomAdapter roomAdapter;
|
||||
private GiftPackAdapter packAdapter;
|
||||
private String tag;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
* @Description: 首页活动弹窗权限
|
||||
* @Author: xscm
|
||||
* @Date: 2021/9/27 14:05
|
||||
*/
|
||||
@Data
|
||||
public class ActivitiesPermission {
|
||||
private int first_charge_permission;//首充权限 1:有 0:无
|
||||
private int day_drop_permission;//天降好礼权限 1:有 0:无
|
||||
private int n_people_permission;//新人好礼权限 1:有 0:无
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public class FirstChargeGiftBean {
|
||||
private String title2;
|
||||
private String money;
|
||||
private List<RoonGiftModel> gift_list;
|
||||
private int status;
|
||||
|
||||
// @Data
|
||||
// public static class GiftList {
|
||||
|
||||
@@ -2,12 +2,37 @@ package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HeavenGiftBean {
|
||||
private String title;
|
||||
private String picture;
|
||||
private int type;
|
||||
private String quantity;
|
||||
private String gold;
|
||||
private String days;
|
||||
|
||||
private String name; //活动名称
|
||||
private String bag_name;//礼包名称
|
||||
private String effective_time;//倒计时时间 秒
|
||||
private String rule;//规则地址
|
||||
private Counter counter;//礼包说明
|
||||
private List<GiftList> gift_list;
|
||||
private int type;
|
||||
private String icon;
|
||||
|
||||
@Data
|
||||
public static class Counter{
|
||||
private String counter;
|
||||
private String money;
|
||||
private String diamond;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class GiftList{
|
||||
private String name;
|
||||
private String num;
|
||||
private String gold;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.stx.xhb.xbanner.entity.SimpleBannerInfo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PermissionPicBean extends SimpleBannerInfo {
|
||||
private int picId;
|
||||
private int type;//类型 1:首充、2:天降 ;3:新人
|
||||
|
||||
@Override
|
||||
public Object getXBannerUrl() {
|
||||
return picId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xscm.moduleutil.bean.room;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 红包的结果集
|
||||
*/
|
||||
@Data
|
||||
public class RedResultBean {
|
||||
private String redUserName;//发布红包的用户名称
|
||||
private String redUserAvatar;//发布红包的用户头像
|
||||
private String redTitle;//发布红包的备注
|
||||
private String redJb;//中奖的金币
|
||||
private String redyl;//已经领取的个数
|
||||
|
||||
private List<RedBean> redList;
|
||||
|
||||
@Data
|
||||
public static class RedBean {
|
||||
private String redUserName;
|
||||
private String redUserAvatar;
|
||||
private String redNum;
|
||||
private String redTime;
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ public class RoomSettingBean implements MultiItemEntity {
|
||||
/// 意见反馈
|
||||
public static final int QXRoomSettingTypeRoomReport = 26;
|
||||
public static final int QXRoomSettingTypeRoomFloatingScreen = 29;
|
||||
public static final int QXRoomSettingTypeRoomFloatingRed = 30;
|
||||
|
||||
public static final int ITEM_TYPE_DEFAULT = 0;
|
||||
public static final int ITEM_TYPE_WITH_ICON = 1;
|
||||
|
||||
@@ -66,7 +66,6 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
mBinding.tvTitle2.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
heavenGiftAdapter = new HeavenGiftAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setAutoPlay(false)
|
||||
.setRevealWidth(0, 0)
|
||||
.setIndicatorVisibility(View.VISIBLE)
|
||||
@@ -160,18 +159,6 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
}
|
||||
});
|
||||
|
||||
// List<HeavenGiftBean> list = new ArrayList<>();
|
||||
// for (int i = 0; i < 7; i++) {
|
||||
// HeavenGiftBean bean = new HeavenGiftBean();
|
||||
// bean.setTitle("礼物" + i);
|
||||
// bean.setPicture("");
|
||||
// bean.setType(1);
|
||||
// bean.setQuantity("x" + i);
|
||||
// bean.setGold(i + "");
|
||||
// bean.setDays(i + "天");
|
||||
// list.add(bean);
|
||||
// }
|
||||
// mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
}
|
||||
|
||||
private List<BaseListData<RoonGiftModel>> baseListData(List<RoonGiftModel> list, int chunkSize) {
|
||||
@@ -207,6 +194,7 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||
mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||
list.addAll(firstChargeGiftBean.getGift_bag().get(0).getGift_list());
|
||||
// mBinding.tvTitle22.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
|
||||
mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
@@ -14,12 +15,18 @@ import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.GiftAdapter;
|
||||
import com.xscm.moduleutil.adapter.HeavenGiftAdapter;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.HeavenGiftBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.DialogHeavenGiftBinding;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import com.zhpan.bannerview.indicator.DrawableIndicator;
|
||||
import com.zhpan.indicator.base.IIndicator;
|
||||
import com.zhpan.indicator.enums.IndicatorSlideMode;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -32,6 +39,8 @@ public class HeavenGiftDialog extends BaseDialog<DialogHeavenGiftBinding> {
|
||||
|
||||
GiftAdapter giftAdapter;
|
||||
HeavenGiftAdapter heavenGiftAdapter;
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
public HeavenGiftDialog(@NonNull Context context) {
|
||||
super(context,R.style.BaseDialogStyleH);
|
||||
}
|
||||
@@ -64,29 +73,87 @@ public class HeavenGiftDialog extends BaseDialog<DialogHeavenGiftBinding> {
|
||||
.setIndicatorSlideMode(IndicatorSlideMode.NORMAL)
|
||||
.setAdapter(heavenGiftAdapter)
|
||||
.create();
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvInvite, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvInvite.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
List<HeavenGiftBean> list=new ArrayList<>();
|
||||
for (int i = 0; i < 7; i++){
|
||||
HeavenGiftBean bean=new HeavenGiftBean();
|
||||
bean.setTitle("礼物"+i);
|
||||
bean.setPicture("");
|
||||
bean.setType(1);
|
||||
bean.setQuantity("x"+i);
|
||||
bean.setGold(i+"");
|
||||
bean.setDays(i+"天");
|
||||
list.add(bean);
|
||||
|
||||
RetrofitClient.getInstance().getDayDropGift(new BaseObserver<HeavenGiftBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(HeavenGiftBean heavenGiftBean) {
|
||||
if (heavenGiftBean != null){
|
||||
mBinding.tvTitle.setText(heavenGiftBean.getCounter().getCounter());
|
||||
// 示例:假设从 HeavenGiftBean 中获取倒计时时间(单位:秒)
|
||||
long countdownTime =Integer.parseInt(heavenGiftBean.getEffective_time()) * 1000L; // 转换为毫秒
|
||||
startCountdown(countdownTime);
|
||||
mBinding.bannerViewPager.create(baseListData(heavenGiftBean.getGift_list(),4));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// List<HeavenGiftBean> list=new ArrayList<>();
|
||||
// for (int i = 0; i < 7; i++){
|
||||
// HeavenGiftBean bean=new HeavenGiftBean();
|
||||
// bean.setTitle("礼物"+i);
|
||||
// bean.setPicture("");
|
||||
// bean.setQuantity("x"+i);
|
||||
// bean.setGold(i+"");
|
||||
// bean.setDays(i+"天");
|
||||
// list.add(bean);
|
||||
// }
|
||||
//// giftAdapter.setNewData(list);
|
||||
// mBinding.bannerViewPager.create(baseListData(list,4));
|
||||
}
|
||||
private void startCountdown(long millisInFuture) {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
// giftAdapter.setNewData(list);
|
||||
mBinding.bannerViewPager.create(baseListData(list,4));
|
||||
|
||||
countDownTimer = new CountDownTimer(millisInFuture, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
updateCountdownDisplay(millisUntilFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
// 倒计时结束时的处理
|
||||
mBinding.tvSj.setText("00:00:00");
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private List<BaseListData<HeavenGiftBean>> baseListData(List<HeavenGiftBean> list, int chunkSize){
|
||||
List<BaseListData<HeavenGiftBean>> baseListData = new ArrayList<>();
|
||||
private void updateCountdownDisplay(long millisUntilFinished) {
|
||||
long totalSeconds = millisUntilFinished / 1000;
|
||||
long hours = totalSeconds / 3600;
|
||||
long minutes = (totalSeconds % 3600) / 60;
|
||||
long seconds = totalSeconds % 60;
|
||||
|
||||
String timeFormatted = String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
mBinding.tvSj.setText(timeFormatted);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
}
|
||||
private List<BaseListData<HeavenGiftBean.GiftList>> baseListData(List<HeavenGiftBean.GiftList> list, int chunkSize){
|
||||
List<BaseListData<HeavenGiftBean.GiftList>> baseListData = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i += chunkSize) {
|
||||
BaseListData<HeavenGiftBean> baseListData1 = new BaseListData<>();
|
||||
BaseListData<HeavenGiftBean.GiftList> baseListData1 = new BaseListData<>();
|
||||
baseListData1.setData(list.subList(i, Math.min(i + chunkSize, list.size())));
|
||||
baseListData.add(baseListData1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Paint;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.RadioGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.GiftAdapter;
|
||||
import com.xscm.moduleutil.adapter.HeavenGiftAdapter;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.DialogFirstChargeBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogNewPeopleBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogNewPeopleBindingImpl;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import com.zhpan.bannerview.indicator.DrawableIndicator;
|
||||
import com.zhpan.indicator.base.IIndicator;
|
||||
import com.zhpan.indicator.enums.IndicatorSlideMode;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @data
|
||||
* @description: 新人好礼
|
||||
*/
|
||||
public class NewPeopleDialog extends BaseDialog<DialogNewPeopleBinding> {
|
||||
|
||||
GiftAdapter giftAdapter;
|
||||
HeavenGiftAdapter heavenGiftAdapter;
|
||||
FirstChargeGiftBean firstChargeGiftBean;
|
||||
private int type;
|
||||
|
||||
public NewPeopleDialog(@NonNull Context context) {
|
||||
super(context, R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_new_people;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
mBinding.tvTitle2.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
heavenGiftAdapter = new HeavenGiftAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setAutoPlay(false)
|
||||
.setRevealWidth(0, 0)
|
||||
.setIndicatorVisibility(View.VISIBLE)
|
||||
.setIndicatorView(getVectorDrawableIndicator())
|
||||
.setIndicatorSlideMode(IndicatorSlideMode.NORMAL)
|
||||
.setAdapter(heavenGiftAdapter)
|
||||
.create();
|
||||
|
||||
mBinding.rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup radioGroup, int i) {
|
||||
if (firstChargeGiftBean== null || firstChargeGiftBean.getGift_bag().size() == 0){
|
||||
ToastUtils.showShort("暂无礼包");
|
||||
return;
|
||||
}
|
||||
|
||||
if (i == R.id.btn_0) {
|
||||
List<RoonGiftModel> list = new ArrayList<>();
|
||||
if (firstChargeGiftBean.getGift_bag().size() > 1) {
|
||||
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle1());
|
||||
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||
mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||
list.addAll(firstChargeGiftBean.getGift_bag().get(0).getGift_list());
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
}
|
||||
type=1;
|
||||
} else if (i == R.id.btn_1) {
|
||||
List<RoonGiftModel> list = new ArrayList<>();
|
||||
if (firstChargeGiftBean.getGift_bag().size() > 2) {
|
||||
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(1).getTitle1());
|
||||
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(1).getTitle2());
|
||||
mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||
list.addAll(firstChargeGiftBean.getGift_bag().get(1).getGift_list());
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
}
|
||||
type=2;
|
||||
} else if (i == R.id.btn_2) {
|
||||
List<RoonGiftModel> list = new ArrayList<>();
|
||||
if (firstChargeGiftBean.getGift_bag().size() == 3) {
|
||||
if (firstChargeGiftBean.getGift_bag().get(2)!=null) {
|
||||
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(2).getTitle1());
|
||||
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(2).getTitle2());
|
||||
mBinding.btn2.setText(firstChargeGiftBean.getGift_bag().get(2).getName());
|
||||
list.addAll(firstChargeGiftBean.getGift_bag().get(2).getGift_list());
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
type = 3;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.tvInvite.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// RechargeDialogFragment.show(roomId, getSupportFragmentManager());
|
||||
if (listener != null) {
|
||||
listener.onFirstChargeConfirmed(firstChargeGiftBean,type);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvInvite, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvInvite.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
public interface OnFirstChargeListener {
|
||||
void onFirstChargeConfirmed(FirstChargeGiftBean giftBean,int type);
|
||||
void onFirstChargeCancelled();
|
||||
}
|
||||
private OnFirstChargeListener listener;
|
||||
// 设置监听器的方法
|
||||
public void setOnFirstChargeListener(OnFirstChargeListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
@Override
|
||||
public void initData() {
|
||||
RetrofitClient.getInstance().getNewChargeGift(new BaseObserver<FirstChargeGiftBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(FirstChargeGiftBean firstChargeGiftBean) {
|
||||
if (firstChargeGiftBean != null) {
|
||||
showGift(firstChargeGiftBean);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private List<BaseListData<RoonGiftModel>> baseListData(List<RoonGiftModel> list, int chunkSize) {
|
||||
List<BaseListData<RoonGiftModel>> baseListData = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i += chunkSize) {
|
||||
BaseListData<RoonGiftModel> baseListData1 = new BaseListData<>();
|
||||
baseListData1.setData(list.subList(i, Math.min(i + chunkSize, list.size())));
|
||||
baseListData.add(baseListData1);
|
||||
}
|
||||
return baseListData;
|
||||
}
|
||||
|
||||
private IIndicator getVectorDrawableIndicator() {
|
||||
int dp6 = getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_6);
|
||||
return new DrawableIndicator(getContext())
|
||||
.setIndicatorGap(getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_2_5))
|
||||
.setIndicatorDrawable(com.xscm.moduleutil.R.drawable.banner_indicator_nornal, com.xscm.moduleutil.R.drawable.banner_indicator_focus)
|
||||
.setIndicatorSize(getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_13), dp6, getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_13), dp6);
|
||||
}
|
||||
|
||||
private Resources getResources() {
|
||||
return getContext().getResources();
|
||||
}
|
||||
|
||||
public void showGift(FirstChargeGiftBean firstChargeGiftBean) {
|
||||
this.firstChargeGiftBean = firstChargeGiftBean;
|
||||
mBinding.rg.check(R.id.btn_0);
|
||||
if (firstChargeGiftBean.getGift_bag() != null && firstChargeGiftBean.getGift_bag().size() > 0) {
|
||||
if (firstChargeGiftBean.getGift_bag().size() >=0) {
|
||||
type=1;
|
||||
List<RoonGiftModel> list = new ArrayList<>();
|
||||
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle1());
|
||||
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||
mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||
list.addAll(firstChargeGiftBean.getGift_bag().get(0).getGift_list());
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
|
||||
|
||||
mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||
mBinding.btn2.setText(firstChargeGiftBean.getGift_bag().get(2).getName());
|
||||
mBinding.btn3.setText(firstChargeGiftBean.getGift_bag().get(3).getName());
|
||||
} else if (firstChargeGiftBean.getGift_bag().size() == 2) {
|
||||
// mBinding.rg.check(R.id.btn_0);
|
||||
// mBinding.btn1.setVisibility(View.VISIBLE);
|
||||
// mBinding.btn2.setVisibility(View.INVISIBLE);
|
||||
} else if (firstChargeGiftBean.getGift_bag().size() == 3) {
|
||||
// mBinding.rg.check(R.id.btn_0);
|
||||
// mBinding.btn1.setVisibility(View.VISIBLE);
|
||||
// mBinding.btn2.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// mBinding.rg.check(R.id.btn_0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class GiftLotteryContacts {
|
||||
public interface IRoomPre extends IPresenter {
|
||||
void getGiftList(String giftBagId,String roomId);
|
||||
|
||||
void drawGiftList(String giftBagId,String gift_user_ids,String roomId,String num,String heart_id);
|
||||
void drawGiftList(String giftBagId,String gift_user_ids,String roomId,String num,String heart_id,String auction_id);
|
||||
|
||||
void getMyRecord(String giftBagId,String page,String pageSize,int type);//我的抽奖记录 type: 1:我的抽奖 2:全服抽奖
|
||||
|
||||
|
||||
@@ -100,19 +100,21 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
private BlindBoxBean.XlhData xlhData;
|
||||
private int icon;//金币金额
|
||||
private String heart_id = "";
|
||||
private String auction_id="";
|
||||
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
return new GiftLotteryPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
public static GiftLotteryDialog newInstance(String giftBagId, String roomId, String userIds, String heart_id) {
|
||||
public static GiftLotteryDialog newInstance(String giftBagId, String roomId, String userIds, String heart_id,String auction_id) {
|
||||
GiftLotteryDialog dialog = new GiftLotteryDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("giftBagId", giftBagId);
|
||||
args.putString("roomId", roomId);
|
||||
args.putString("userIds", userIds);
|
||||
args.putString("heart_id", heart_id);
|
||||
args.putString("auction_id", auction_id);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
@@ -136,6 +138,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
// 根据userIds确定类型
|
||||
userIdType = LotteryEvent.fromLotteryEvent(giftBagId);
|
||||
heart_id = getArguments().getString("heart_id");
|
||||
auction_id = getArguments().getString("auction_id");
|
||||
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
@@ -379,7 +382,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
isDrawing = true;
|
||||
// init(1);
|
||||
startType = 1;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "1", heart_id);
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "1", heart_id,auction_id);
|
||||
} else {
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
return;
|
||||
@@ -389,7 +392,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
isDrawing = true;
|
||||
// init(2);
|
||||
startType = 2;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "6", heart_id);
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "6", heart_id,auction_id);
|
||||
|
||||
} else {
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
@@ -399,7 +402,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
isDrawing = true;
|
||||
// init(3);
|
||||
startType = 3;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "9", heart_id);
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "9", heart_id,auction_id);
|
||||
} else {
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,String heart_id) {
|
||||
api.drawGiftList(giftBagId, gift_user_ids, roomId, num,heart_id, new BaseObserver<BlindReslutBean>() {
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,String heart_id,String auction_id) {
|
||||
api.drawGiftList(giftBagId, gift_user_ids, roomId, num,heart_id,auction_id, new BaseObserver<BlindReslutBean>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
@@ -1,65 +1,7 @@
|
||||
package com.xscm.moduleutil.http;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.bean.AppPay;
|
||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.BindDetail;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.BlackUserBean;
|
||||
import com.xscm.moduleutil.bean.CharmRankingResp;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.FirstChargeBean;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.GiftBoxRecordBean;
|
||||
import com.xscm.moduleutil.bean.GiftLabelBean;
|
||||
import com.xscm.moduleutil.bean.GiftName;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.GiftPackListCount;
|
||||
import com.xscm.moduleutil.bean.GiftUserWallBean;
|
||||
import com.xscm.moduleutil.bean.HeadlineBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.bean.HostBean;
|
||||
import com.xscm.moduleutil.bean.MusicSongBean;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.bean.NewsDataBean;
|
||||
import com.xscm.moduleutil.bean.NewsMessageList;
|
||||
import com.xscm.moduleutil.bean.PersonaltyBean;
|
||||
import com.xscm.moduleutil.bean.PkSwTokenBean;
|
||||
import com.xscm.moduleutil.bean.PlaceholderBean;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
import com.xscm.moduleutil.bean.RelationCardBean;
|
||||
import com.xscm.moduleutil.bean.RevenueBean;
|
||||
import com.xscm.moduleutil.bean.RewardUserBean;
|
||||
import com.xscm.moduleutil.bean.RoomBgBean;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.RoomDetails;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomTime;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.bean.SearchAll;
|
||||
import com.xscm.moduleutil.bean.SongMusicBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.UserTagBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.bean.*;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
@@ -520,6 +462,14 @@ public interface ApiServer {
|
||||
|
||||
@GET(Constants.GET_FIRST_CHARGE_GIFT)
|
||||
Call<BaseModel<FirstChargeGiftBean>> firstChargeGift();
|
||||
@GET(Constants.GET_NEW_CHARGE_GIFT)
|
||||
Call<BaseModel<FirstChargeGiftBean>> getNewChargeGift();
|
||||
|
||||
@GET(Constants.GET_ACTIVITIES_PERMISSION)
|
||||
Call<BaseModel<ActivitiesPermission>> activitiesPermission();
|
||||
|
||||
@GET(Constants.GET_DAY_DROP_GIFT)
|
||||
Call<BaseModel<HeavenGiftBean>> getDayDropGift();
|
||||
|
||||
@GET(Constants.GET_WALLET)
|
||||
Call<BaseModel<WalletBean>> wallet();
|
||||
@@ -754,7 +704,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_DRAW_GIFT_LIST)
|
||||
Call<BaseModel<BlindReslutBean>> drawGiftList(@Field("gift_bag_id") String gift_bag_id, @Field("gift_user_ids") String gift_user_ids,@Field("room_id")String room_id,@Field("num")String num,@Field("heart_id") String heart_id);
|
||||
Call<BaseModel<BlindReslutBean>> drawGiftList(@Field("gift_bag_id") String gift_bag_id, @Field("gift_user_ids") String gift_user_ids,@Field("room_id")String room_id,@Field("num")String num,@Field("heart_id") String heart_id,@Field("auction_id") String auction_id);
|
||||
|
||||
@GET(Constants.GET_MY_RECORD)
|
||||
Call<BaseModel<List<GiftBean>>> getMyRecord(@Query("gift_bag_id")String gift_bag_id,@Query("page")String page,@Query("page_size")String page_size);
|
||||
|
||||
@@ -16,68 +16,7 @@ import com.franmontiel.persistentcookiejar.cache.SetCookieCache;
|
||||
import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.bean.AppPay;
|
||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.BindDetail;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.BlackUserBean;
|
||||
import com.xscm.moduleutil.bean.CharmRankingResp;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.FirstChargeBean;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.GiftBoxBean;
|
||||
import com.xscm.moduleutil.bean.GiftBoxRecordBean;
|
||||
import com.xscm.moduleutil.bean.GiftLabelBean;
|
||||
import com.xscm.moduleutil.bean.GiftName;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.GiftPackListCount;
|
||||
import com.xscm.moduleutil.bean.GiftUserWallBean;
|
||||
import com.xscm.moduleutil.bean.HeadlineBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.bean.HostBean;
|
||||
import com.xscm.moduleutil.bean.MusicSongBean;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.bean.NewsDataBean;
|
||||
import com.xscm.moduleutil.bean.NewsMessageList;
|
||||
import com.xscm.moduleutil.bean.PersonaltyBean;
|
||||
import com.xscm.moduleutil.bean.PkSwTokenBean;
|
||||
import com.xscm.moduleutil.bean.PlaceholderBean;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
import com.xscm.moduleutil.bean.RelationCardBean;
|
||||
import com.xscm.moduleutil.bean.RevenueBean;
|
||||
import com.xscm.moduleutil.bean.RewardUserBean;
|
||||
import com.xscm.moduleutil.bean.RoomBgBean;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.RoomDetails;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.bean.RoomSingleton;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidyDetails;
|
||||
import com.xscm.moduleutil.bean.RoomTime;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.bean.SearchAll;
|
||||
import com.xscm.moduleutil.bean.SongMusicBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.UserTagBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.bean.*;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
@@ -1265,13 +1204,22 @@ public class RetrofitClient {
|
||||
BaseModel<RealNameBean> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData());
|
||||
}else if (baseModel.getCode() == 0){
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
}else if (baseModel.getCode() == 301){
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RealNameBean>> call, Throwable t) {
|
||||
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1397,11 +1345,11 @@ public class RetrofitClient {
|
||||
observer.onNext(null);
|
||||
}else if (listBaseModel.getCode()==301){
|
||||
try {
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1430,11 +1378,12 @@ public class RetrofitClient {
|
||||
observer.onNext(null);
|
||||
}else if (listBaseModel.getCode()==301){
|
||||
try {
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1459,10 +1408,11 @@ public class RetrofitClient {
|
||||
}else if (listBaseModel.getCode() == 301) {
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1965,8 +1915,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getRoomOnline(String roomId, String page, String
|
||||
page_limit, BaseObserver<RoomOnline> observer) {
|
||||
public void getRoomOnline(String roomId, String page, String page_limit, BaseObserver<RoomOnline> observer) {
|
||||
sApiServer.getRoomOnline(roomId, page, page_limit).enqueue(new Callback<BaseModel<RoomOnline>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomOnline>> call, Response<BaseModel<RoomOnline>> response) {
|
||||
@@ -1985,6 +1934,33 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void activitiesPermission(BaseObserver<ActivitiesPermission> observer){
|
||||
sApiServer.activitiesPermission().enqueue(new Callback<BaseModel<ActivitiesPermission>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<ActivitiesPermission>> call, Response<BaseModel<ActivitiesPermission>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<ActivitiesPermission> activitiesPermissionBaseModel = response.body();
|
||||
if (activitiesPermissionBaseModel.getCode() == 1) {
|
||||
observer.onNext(activitiesPermissionBaseModel.getData());
|
||||
}else if (activitiesPermissionBaseModel.getCode()==0){
|
||||
ToastUtils.showShort(activitiesPermissionBaseModel.getMsg());
|
||||
}else if (activitiesPermissionBaseModel.getCode()==301){
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
ToastUtils.showShort(activitiesPermissionBaseModel.getMsg());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<ActivitiesPermission>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void wallet(BaseObserver<WalletBean> observer) {
|
||||
sApiServer.wallet().enqueue(new Callback<BaseModel<WalletBean>>() {
|
||||
@Override
|
||||
@@ -2282,7 +2258,11 @@ public class RetrofitClient {
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).enqueue(new ApiResponseCallback<RoomAuction.AuctionListBean>(CommonAppContext.getInstance()) {
|
||||
@Override
|
||||
public void onSuccess(RoomAuction.AuctionListBean data) {
|
||||
observer.onNext(data);
|
||||
if (data != null) {
|
||||
observer.onNext(data);
|
||||
}else {
|
||||
observer.onNext(new RoomAuction.AuctionListBean());
|
||||
}
|
||||
}
|
||||
});
|
||||
// .enqueue(new Callback<BaseModel<RoomAuction.AuctionListBean>>() {
|
||||
@@ -2543,6 +2523,27 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getDayDropGift(BaseObserver<HeavenGiftBean> observer){
|
||||
sApiServer.getDayDropGift().enqueue(new Callback<BaseModel<HeavenGiftBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<HeavenGiftBean>> call, Response<BaseModel<HeavenGiftBean>> response) {
|
||||
if (response.code()==200){
|
||||
BaseModel<HeavenGiftBean> data = response.body();
|
||||
if (data.getCode()==1){
|
||||
observer.onNext(data.getData());
|
||||
}else if (data.getCode()==0){
|
||||
ToastUtils.showShort(data.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<HeavenGiftBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void firstChargeGift(BaseObserver<FirstChargeGiftBean> observer) {
|
||||
// sApiServer.firstChargeGift().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||
sApiServer.firstChargeGift().enqueue(new Callback<BaseModel<FirstChargeGiftBean>>() {
|
||||
@@ -2558,63 +2559,28 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<FirstChargeGiftBean>> call, Throwable t) {
|
||||
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getNewChargeGift(BaseObserver<FirstChargeGiftBean> observer) {
|
||||
sApiServer.getNewChargeGift().enqueue(new Callback<BaseModel<FirstChargeGiftBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<FirstChargeGiftBean>> call, Response<BaseModel<FirstChargeGiftBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<FirstChargeGiftBean> data = response.body();
|
||||
if (data.getCode() == 1) {
|
||||
observer.onNext(data.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<FirstChargeGiftBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
// .enqueue(new Callback<ResponseBody>() {
|
||||
// @Override
|
||||
// public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||
// if (response.code() == 200) {
|
||||
// try {
|
||||
// String json = response.body().string();
|
||||
// BaseModel<FirstChargeGiftBean> data =GsonUtils.fromJson(json, BaseModel.class);
|
||||
//// String data1=GsonUtils.toJson(data.getData());
|
||||
//// LogUtils.e("data1",data.getData());
|
||||
//// FirstChargeGiftBean firstChargeGiftBean=new FirstChargeGiftBean();
|
||||
//// firstChargeGiftBean.setName(data.getData().getName());
|
||||
//// List<FirstChargeGiftBean.GiftBag> giftBags=new ArrayList<>();
|
||||
//// for (int i=0;i<data.getData().getGift_bag().size();i++){
|
||||
////
|
||||
//// FirstChargeGiftBean.GiftBag giftBag=new FirstChargeGiftBean.GiftBag();
|
||||
//// giftBag.setName(data.getData().getGift_bag().get(i).getName());
|
||||
//// giftBag.setMoney(data.getData().getGift_bag().get(i).getMoney());
|
||||
//// giftBag.setTitle1(data.getData().getGift_bag().get(i).getTitle1());
|
||||
//// giftBag.setTitle2(data.getData().getGift_bag().get(i).getTitle2());
|
||||
//// List<RoonGiftModel> roonGiftModels=new ArrayList<>();
|
||||
//// for (int j=0;j<data.getData().getGift_bag().get(i).getGift_list().size();j++){
|
||||
//// RoonGiftModel roonGiftModel=new RoonGiftModel();
|
||||
//// roonGiftModel.setGift_name(data.getData().getGift_bag().get(i).getGift_list().get(j).getGift_name());
|
||||
//// roonGiftModel.setNum(data.getData().getGift_bag().get(i).getGift_list().get(j).getNum());
|
||||
//// roonGiftModel.setGift_price(data.getData().getGift_bag().get(i).getGift_list().get(j).getGift_price());
|
||||
//// roonGiftModel.setType(data.getData().getGift_bag().get(i).getGift_list().get(j).getType());
|
||||
//// roonGiftModel.setBase_image(data.getData().getGift_bag().get(i).getGift_list().get(j).getBase_image());
|
||||
//// roonGiftModels.add(roonGiftModel);
|
||||
//// }
|
||||
//// giftBag.setGift_list(roonGiftModels);
|
||||
//// giftBags.add(giftBag);
|
||||
//// }
|
||||
////
|
||||
//// firstChargeGiftBean.setGift_bag(giftBags);
|
||||
//
|
||||
//
|
||||
//
|
||||
//// List<FirstChargeGiftBean> data2=GsonUtils.fromJson(data1, new TypeToken<List<FirstChargeGiftBean>>(){}.getType());
|
||||
//// observer.onNext(data2.get(0));
|
||||
//// FirstChargeGiftBean firstChargeGiftBean = GsonUtils.fromJson(data1, FirstChargeGiftBean.class);
|
||||
//// Object data3=GsonUtils.fromJson(data1, FirstChargeGiftBean.class);
|
||||
//// LogUtils.e("data3",data3);
|
||||
// observer.onNext(data.getData());
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(Call<ResponseBody> call, Throwable t) {
|
||||
// t.printStackTrace();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public void applyPit(String roomId, String pitNumber, BaseObserver<String> observer) {
|
||||
@@ -3599,9 +3565,8 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
/// 盲盒转盘抽奖
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String
|
||||
num, String heart_id, BaseObserver<BlindReslutBean> observer) {
|
||||
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num, heart_id).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num, String heart_id,String auction_id, BaseObserver<BlindReslutBean> observer) {
|
||||
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num, heart_id, auction_id).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<BlindReslutBean>> call, Response<BaseModel<BlindReslutBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
|
||||
@@ -9,6 +9,7 @@ public class ARouteConstants {
|
||||
public static final String USER_ALBUM_DETAIL = "/modulevocal/AlbumDetailActivity";
|
||||
public static final String CREATE_ALBUM = "/modulevocal/CreateAlbumActivity";
|
||||
public static final String ROOM_DETAILS = "/moduleroom/RoomActivity";
|
||||
public static final String ROOM_RED_RESULT = "/moduleroom/RedResultActivity";//红包结果展示页面
|
||||
public static final String UNDERAGE_ACTIVITY = "/modulevocal/UnderageActivity";
|
||||
|
||||
public static final String MY_ROOM = "/modulevocal/MyRoomActivity";
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xscm.moduleutil.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.xscm.moduleutil.R;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* 这是抢红包的自定义view
|
||||
*/
|
||||
public class CustomDialogView extends ConstraintLayout {
|
||||
public CustomDialogView(@NonNull @NotNull Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public CustomDialogView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public CustomDialogView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
public CustomDialogView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
// 初始化视图
|
||||
// 设置背景色
|
||||
setBackground(ContextCompat.getDrawable(getContext(), R.drawable.bg_red_16_envel));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,860 @@
|
||||
package com.xscm.moduleutil.view;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.InputType;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import com.xscm.moduleutil.R;
|
||||
|
||||
public class QXRedBagSendView extends FrameLayout {
|
||||
|
||||
// Properties
|
||||
private String redBagType = "1";
|
||||
private String redBagContentType = "1";
|
||||
private String redBagTime = "0";
|
||||
private int currentPage = 0;
|
||||
private boolean isFromRule = false;
|
||||
|
||||
// UI Components
|
||||
private LinearLayout mainContainer;
|
||||
private ImageView bgImageView;
|
||||
private TextView titleLabel;
|
||||
private Button helpBtn;
|
||||
private Button backBtn;
|
||||
private Button closeBtn;
|
||||
private Button nextBtn;
|
||||
private Button commitBtn;
|
||||
|
||||
private LinearLayout firstContentView;
|
||||
private Button normalRedBagBtn;
|
||||
private Button pwdRedBagBtn;
|
||||
private LinearLayout firstPwdView;
|
||||
private EditText pwdTextField;
|
||||
private LinearLayout firstTimeView;
|
||||
private View scrollBgView;
|
||||
private Button coinRedBagBtn;
|
||||
private Button diamondRedBagBtn;
|
||||
private Button selectedRedBagTimeBtn;
|
||||
|
||||
private LinearLayout nextContentView;
|
||||
private TextView moneyLabel;
|
||||
private TextView moneyUnitLabel;
|
||||
private EditText moneyTextField;
|
||||
private EditText countTextField;
|
||||
private EditText remarkTextField;
|
||||
private Button noDrawAuthBtn;
|
||||
private Button collectDrawAuthBtn;
|
||||
private Button upSeatDrawAuthBtn;
|
||||
|
||||
private LinearLayout ruleContentView;
|
||||
private WebView webView;
|
||||
|
||||
private final int[] timeArray = {0, 1, 2, 5, 10};
|
||||
private final int[] drawAuthArray = {0, 1, 2};
|
||||
|
||||
public QXRedBagSendView(Context context) {
|
||||
super(context);
|
||||
init(context);
|
||||
}
|
||||
|
||||
public QXRedBagSendView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(context);
|
||||
}
|
||||
|
||||
public QXRedBagSendView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
setLayoutParams(new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
setBackgroundColor(Color.parseColor("#80000000"));
|
||||
|
||||
initMainContainer(context);
|
||||
initTitleBar(context);
|
||||
initContentArea(context);
|
||||
initButtons(context);
|
||||
|
||||
// 默认选择普通红包
|
||||
selectedRedBagTypeAction(normalRedBagBtn);
|
||||
}
|
||||
|
||||
private void initMainContainer(Context context) {
|
||||
mainContainer = new LinearLayout(context);
|
||||
mainContainer.setOrientation(LinearLayout.VERTICAL);
|
||||
LayoutParams containerParams = new LayoutParams(
|
||||
dpToPx(345),
|
||||
dpToPx(454)
|
||||
);
|
||||
containerParams.gravity = Gravity.CENTER;
|
||||
mainContainer.setLayoutParams(containerParams);
|
||||
|
||||
// 背景图片
|
||||
bgImageView = new ImageView(context);
|
||||
bgImageView.setLayoutParams(new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
// 设置背景资源,需要你在res/drawable中添加对应的图片
|
||||
bgImageView.setBackgroundResource(R.mipmap.red_en);
|
||||
// bgImageView.setBackgroundColor(Color.parseColor("#FFD700")); // 临时颜色
|
||||
|
||||
// 将背景图片添加到主容器
|
||||
mainContainer.addView(bgImageView);
|
||||
|
||||
addView(mainContainer);
|
||||
}
|
||||
|
||||
private void initTitleBar(Context context) {
|
||||
// 标题栏容器
|
||||
LinearLayout titleContainer = new LinearLayout(context);
|
||||
titleContainer.setOrientation(LinearLayout.HORIZONTAL);
|
||||
titleContainer.setGravity(Gravity.CENTER_VERTICAL);
|
||||
LinearLayout.LayoutParams titleContainerParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
titleContainerParams.setMargins(0, dpToPx(15), 0, 0);
|
||||
titleContainer.setLayoutParams(titleContainerParams);
|
||||
|
||||
// 帮助按钮
|
||||
helpBtn = createIconButton(context);
|
||||
helpBtn.setBackgroundColor(Color.TRANSPARENT);
|
||||
helpBtn.setOnClickListener(v -> helpAction());
|
||||
titleContainer.addView(helpBtn);
|
||||
|
||||
// 返回按钮
|
||||
backBtn = createIconButton(context);
|
||||
backBtn.setBackgroundColor(Color.TRANSPARENT);
|
||||
backBtn.setOnClickListener(v -> backAction());
|
||||
backBtn.setVisibility(View.GONE);
|
||||
titleContainer.addView(backBtn);
|
||||
|
||||
// 标题
|
||||
titleLabel = new TextView(context);
|
||||
titleLabel.setText("直播间红包");
|
||||
titleLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
|
||||
titleLabel.setTextColor(Color.WHITE);
|
||||
titleLabel.setTypeface(titleLabel.getTypeface(), android.graphics.Typeface.BOLD);
|
||||
LinearLayout.LayoutParams titleParams = new LinearLayout.LayoutParams(
|
||||
0, ViewGroup.LayoutParams.WRAP_CONTENT, 1
|
||||
);
|
||||
titleLabel.setLayoutParams(titleParams);
|
||||
titleLabel.setGravity(Gravity.CENTER);
|
||||
titleContainer.addView(titleLabel);
|
||||
|
||||
// 关闭按钮
|
||||
closeBtn = createIconButton(context);
|
||||
closeBtn.setBackgroundColor(Color.TRANSPARENT);
|
||||
closeBtn.setOnClickListener(v -> closeAction());
|
||||
titleContainer.addView(closeBtn);
|
||||
|
||||
// 将标题栏添加到主容器(在背景图片之上)
|
||||
mainContainer.addView(titleContainer);
|
||||
}
|
||||
|
||||
private void initContentArea(Context context) {
|
||||
// 内容区域容器
|
||||
LinearLayout contentArea = new LinearLayout(context);
|
||||
contentArea.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout.LayoutParams contentParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
0, 1
|
||||
);
|
||||
contentParams.setMargins(dpToPx(15), dpToPx(15), dpToPx(15), dpToPx(15));
|
||||
contentArea.setLayoutParams(contentParams);
|
||||
|
||||
initFirstContentView(context, contentArea);
|
||||
initNextContentView(context, contentArea);
|
||||
initRuleView(context, contentArea);
|
||||
|
||||
mainContainer.addView(contentArea);
|
||||
}
|
||||
|
||||
private void initButtons(Context context) {
|
||||
// 按钮容器
|
||||
LinearLayout buttonContainer = new LinearLayout(context);
|
||||
buttonContainer.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout.LayoutParams buttonParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
buttonParams.setMargins(dpToPx(15), 0, dpToPx(15), dpToPx(15));
|
||||
buttonContainer.setLayoutParams(buttonParams);
|
||||
|
||||
// 下一步按钮
|
||||
nextBtn = createActionButton(context, "下一步");
|
||||
nextBtn.setOnClickListener(v -> nextAction());
|
||||
buttonContainer.addView(nextBtn);
|
||||
|
||||
// 提交按钮
|
||||
commitBtn = createActionButton(context, "发红包");
|
||||
commitBtn.setOnClickListener(v -> commitAction());
|
||||
commitBtn.setVisibility(View.GONE);
|
||||
buttonContainer.addView(commitBtn);
|
||||
|
||||
mainContainer.addView(buttonContainer);
|
||||
}
|
||||
|
||||
private void initFirstContentView(Context context, ViewGroup parent) {
|
||||
firstContentView = new LinearLayout(context);
|
||||
firstContentView.setOrientation(LinearLayout.VERTICAL);
|
||||
firstContentView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
parent.addView(firstContentView);
|
||||
|
||||
// 顶部视图 - 参与领取限制
|
||||
LinearLayout firstTopView = createCardView(context);
|
||||
firstTopView.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout.LayoutParams topParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
dpToPx(88)
|
||||
);
|
||||
topParams.bottomMargin = dpToPx(12);
|
||||
firstTopView.setLayoutParams(topParams);
|
||||
firstContentView.addView(firstTopView);
|
||||
|
||||
TextView topTitleLabel = createTitleLabel(context, "参与领取限制");
|
||||
firstTopView.addView(topTitleLabel);
|
||||
|
||||
LinearLayout typeButtonContainer = new LinearLayout(context);
|
||||
typeButtonContainer.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
typeButtonContainer.setWeightSum(2);
|
||||
firstTopView.addView(typeButtonContainer);
|
||||
|
||||
normalRedBagBtn = createTypeButton(context, "普通红包");
|
||||
normalRedBagBtn.setOnClickListener(v -> selectedRedBagTypeAction(normalRedBagBtn));
|
||||
typeButtonContainer.addView(normalRedBagBtn);
|
||||
|
||||
pwdRedBagBtn = createTypeButton(context, "口令红包");
|
||||
pwdRedBagBtn.setOnClickListener(v -> selectedRedBagTypeAction(pwdRedBagBtn));
|
||||
typeButtonContainer.addView(pwdRedBagBtn);
|
||||
|
||||
// 口令输入视图
|
||||
firstPwdView = createInputCard(context, "口令", "请输入口令");
|
||||
pwdTextField = (EditText) ((LinearLayout) firstPwdView).getChildAt(1);
|
||||
firstContentView.addView(firstPwdView);
|
||||
|
||||
// 时间选择视图
|
||||
firstTimeView = createCardView(context);
|
||||
firstTimeView.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout.LayoutParams timeParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
dpToPx(88)
|
||||
);
|
||||
timeParams.bottomMargin = dpToPx(12);
|
||||
firstTimeView.setLayoutParams(timeParams);
|
||||
firstContentView.addView(firstTimeView);
|
||||
|
||||
TextView timeTitleLabel = createTitleLabel(context, "开奖倒计时");
|
||||
firstTimeView.addView(timeTitleLabel);
|
||||
|
||||
LinearLayout timeButtonContainer = new LinearLayout(context);
|
||||
timeButtonContainer.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
firstTimeView.addView(timeButtonContainer);
|
||||
|
||||
// 创建时间选择按钮
|
||||
for (int time : timeArray) {
|
||||
Button timeBtn = createTimeButton(context, time);
|
||||
timeBtn.setOnClickListener(v -> redBagTimeAction(timeBtn));
|
||||
if (time == 0) {
|
||||
timeBtn.setSelected(true);
|
||||
selectedRedBagTimeBtn = timeBtn;
|
||||
}
|
||||
timeButtonContainer.addView(timeBtn);
|
||||
}
|
||||
|
||||
// 红包类型选择
|
||||
LinearLayout bottomView = createCardView(context);
|
||||
bottomView.setOrientation(LinearLayout.HORIZONTAL);
|
||||
bottomView.setGravity(Gravity.CENTER_VERTICAL);
|
||||
LinearLayout.LayoutParams bottomParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
dpToPx(48)
|
||||
);
|
||||
bottomView.setLayoutParams(bottomParams);
|
||||
firstContentView.addView(bottomView);
|
||||
|
||||
TextView redBagTypeLabel = createTitleLabel(context, "红包类型");
|
||||
bottomView.addView(redBagTypeLabel);
|
||||
|
||||
// 红包类型切换容器
|
||||
RelativeLayout typeSwitchContainer = new RelativeLayout(context);
|
||||
LinearLayout.LayoutParams switchParams = new LinearLayout.LayoutParams(
|
||||
dpToPx(130),
|
||||
dpToPx(26)
|
||||
);
|
||||
switchParams.gravity = Gravity.CENTER_VERTICAL;
|
||||
typeSwitchContainer.setLayoutParams(switchParams);
|
||||
typeSwitchContainer.setBackgroundColor(Color.parseColor("#BA230A"));
|
||||
typeSwitchContainer.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2));
|
||||
bottomView.addView(typeSwitchContainer);
|
||||
|
||||
scrollBgView = new View(context);
|
||||
RelativeLayout.LayoutParams scrollParams = new RelativeLayout.LayoutParams(
|
||||
dpToPx(63),
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
);
|
||||
scrollBgView.setLayoutParams(scrollParams);
|
||||
scrollBgView.setBackgroundColor(Color.parseColor("#FDE8A3"));
|
||||
typeSwitchContainer.addView(scrollBgView);
|
||||
|
||||
coinRedBagBtn = createContentTypeButton(context, "金币红包");
|
||||
coinRedBagBtn.setSelected(true);
|
||||
coinRedBagBtn.setOnClickListener(v -> redBagContentTypeAction(coinRedBagBtn));
|
||||
typeSwitchContainer.addView(coinRedBagBtn);
|
||||
|
||||
diamondRedBagBtn = createContentTypeButton(context, "钻石红包");
|
||||
diamondRedBagBtn.setOnClickListener(v -> redBagContentTypeAction(diamondRedBagBtn));
|
||||
typeSwitchContainer.addView(diamondRedBagBtn);
|
||||
}
|
||||
|
||||
private void initNextContentView(Context context, ViewGroup parent) {
|
||||
nextContentView = new LinearLayout(context);
|
||||
nextContentView.setOrientation(LinearLayout.VERTICAL);
|
||||
nextContentView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
nextContentView.setVisibility(View.GONE);
|
||||
parent.addView(nextContentView);
|
||||
|
||||
// 可用余额标签
|
||||
moneyLabel = new TextView(context);
|
||||
moneyLabel.setText("-金币可用");
|
||||
moneyLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);
|
||||
moneyLabel.setTextColor(Color.WHITE);
|
||||
LinearLayout.LayoutParams moneyLabelParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
moneyLabelParams.gravity = Gravity.END;
|
||||
moneyLabel.setLayoutParams(moneyLabelParams);
|
||||
nextContentView.addView(moneyLabel);
|
||||
|
||||
// 金额输入
|
||||
LinearLayout moneyBgView = createInputCard(context, "金额", "请输入红包金额");
|
||||
moneyTextField = (EditText) moneyBgView.getChildAt(1);
|
||||
|
||||
moneyUnitLabel = new TextView(context);
|
||||
moneyUnitLabel.setText("金币");
|
||||
moneyUnitLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);
|
||||
moneyUnitLabel.setTextColor(Color.parseColor("#666666"));
|
||||
LinearLayout.LayoutParams unitParams = new LinearLayout.LayoutParams(
|
||||
dpToPx(30),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
moneyUnitLabel.setLayoutParams(unitParams);
|
||||
moneyBgView.addView(moneyUnitLabel);
|
||||
|
||||
nextContentView.addView(moneyBgView);
|
||||
|
||||
// 个数输入
|
||||
LinearLayout countBgView = createInputCard(context, "个数", "请输入红包数量");
|
||||
countTextField = (EditText) countBgView.getChildAt(1);
|
||||
|
||||
TextView countUnitLabel = new TextView(context);
|
||||
countUnitLabel.setText("个");
|
||||
countUnitLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);
|
||||
countUnitLabel.setTextColor(Color.parseColor("#666666"));
|
||||
countUnitLabel.setLayoutParams(unitParams);
|
||||
countBgView.addView(countUnitLabel);
|
||||
|
||||
nextContentView.addView(countBgView);
|
||||
|
||||
// 领取条件
|
||||
LinearLayout drawAuthBgView = createCardView(context);
|
||||
drawAuthBgView.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout.LayoutParams authParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
dpToPx(88)
|
||||
);
|
||||
authParams.bottomMargin = dpToPx(12);
|
||||
drawAuthBgView.setLayoutParams(authParams);
|
||||
nextContentView.addView(drawAuthBgView);
|
||||
|
||||
TextView authTitleLabel = createTitleLabel(context, "条件");
|
||||
drawAuthBgView.addView(authTitleLabel);
|
||||
|
||||
LinearLayout authButtonContainer = new LinearLayout(context);
|
||||
authButtonContainer.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
drawAuthBgView.addView(authButtonContainer);
|
||||
|
||||
// 创建领取条件按钮
|
||||
noDrawAuthBtn = createAuthButton(context, "无");
|
||||
noDrawAuthBtn.setSelected(true);
|
||||
noDrawAuthBtn.setOnClickListener(v -> drawAuthAction(noDrawAuthBtn));
|
||||
authButtonContainer.addView(noDrawAuthBtn);
|
||||
|
||||
collectDrawAuthBtn = createAuthButton(context, "收藏房间");
|
||||
collectDrawAuthBtn.setOnClickListener(v -> drawAuthAction(collectDrawAuthBtn));
|
||||
authButtonContainer.addView(collectDrawAuthBtn);
|
||||
|
||||
upSeatDrawAuthBtn = createAuthButton(context, "仅麦上用户");
|
||||
upSeatDrawAuthBtn.setOnClickListener(v -> drawAuthAction(upSeatDrawAuthBtn));
|
||||
authButtonContainer.addView(upSeatDrawAuthBtn);
|
||||
|
||||
// 备注输入
|
||||
LinearLayout remarkBgView = createInputCard(context, "备注", "请输入备注");
|
||||
remarkTextField = (EditText) remarkBgView.getChildAt(1);
|
||||
nextContentView.addView(remarkBgView);
|
||||
}
|
||||
|
||||
private void initRuleView(Context context, ViewGroup parent) {
|
||||
ruleContentView = new LinearLayout(context);
|
||||
ruleContentView.setOrientation(LinearLayout.VERTICAL);
|
||||
ruleContentView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
ruleContentView.setBackgroundColor(Color.WHITE);
|
||||
ruleContentView.setPadding(dpToPx(15), dpToPx(15), dpToPx(15), dpToPx(15));
|
||||
ruleContentView.setVisibility(View.GONE);
|
||||
parent.addView(ruleContentView);
|
||||
|
||||
webView = new WebView(context);
|
||||
webView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
));
|
||||
ruleContentView.addView(webView);
|
||||
}
|
||||
|
||||
// 工具方法
|
||||
private Button createIconButton(Context context) {
|
||||
Button button = new Button(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
dpToPx(40),
|
||||
dpToPx(40)
|
||||
);
|
||||
button.setLayoutParams(params);
|
||||
return button;
|
||||
}
|
||||
|
||||
private Button createActionButton(Context context, String text) {
|
||||
Button button = new Button(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
dpToPx(44)
|
||||
);
|
||||
button.setLayoutParams(params);
|
||||
button.setText(text);
|
||||
button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
|
||||
button.setTextColor(Color.parseColor("#F35248"));
|
||||
button.setTypeface(button.getTypeface(), android.graphics.Typeface.BOLD);
|
||||
button.setBackgroundColor(Color.parseColor("#FDE8A3")); // 临时背景色
|
||||
return button;
|
||||
}
|
||||
|
||||
private LinearLayout createCardView(Context context) {
|
||||
LinearLayout card = new LinearLayout(context);
|
||||
card.setBackgroundColor(Color.WHITE);
|
||||
card.setPadding(dpToPx(15), dpToPx(11), dpToPx(15), dpToPx(5));
|
||||
return card;
|
||||
}
|
||||
|
||||
private TextView createTitleLabel(Context context, String text) {
|
||||
TextView label = new TextView(context);
|
||||
label.setText(text);
|
||||
label.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
|
||||
label.setTextColor(Color.parseColor("#666666"));
|
||||
label.setTypeface(label.getTypeface(), android.graphics.Typeface.BOLD);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
dpToPx(26)
|
||||
);
|
||||
label.setLayoutParams(params);
|
||||
return label;
|
||||
}
|
||||
|
||||
private Button createTypeButton(Context context, String text) {
|
||||
Button button = new Button(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
0, dpToPx(36), 1
|
||||
);
|
||||
params.setMargins(0, 0, dpToPx(10), 0);
|
||||
button.setLayoutParams(params);
|
||||
button.setText(text);
|
||||
button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
|
||||
button.setTextColor(Color.WHITE);
|
||||
button.setTypeface(button.getTypeface(), android.graphics.Typeface.BOLD);
|
||||
button.setBackgroundColor(Color.parseColor("#FF9999")); // 临时背景色
|
||||
return button;
|
||||
}
|
||||
|
||||
private LinearLayout createInputCard(Context context, String title, String hint) {
|
||||
LinearLayout card = new LinearLayout(context);
|
||||
card.setOrientation(LinearLayout.HORIZONTAL);
|
||||
card.setGravity(Gravity.CENTER_VERTICAL);
|
||||
LinearLayout.LayoutParams cardParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
dpToPx(48)
|
||||
);
|
||||
cardParams.bottomMargin = dpToPx(12);
|
||||
card.setLayoutParams(cardParams);
|
||||
card.setBackgroundColor(Color.WHITE);
|
||||
card.setPadding(dpToPx(15), 0, dpToPx(15), 0);
|
||||
|
||||
TextView titleLabel = createTitleLabel(context, title);
|
||||
card.addView(titleLabel);
|
||||
|
||||
EditText editText = new EditText(context);
|
||||
LinearLayout.LayoutParams editParams = new LinearLayout.LayoutParams(
|
||||
0, ViewGroup.LayoutParams.MATCH_PARENT, 1
|
||||
);
|
||||
editParams.setMargins(dpToPx(15), 0, dpToPx(15), 0);
|
||||
editText.setLayoutParams(editParams);
|
||||
editText.setHint(hint);
|
||||
editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
|
||||
editText.setTextColor(Color.parseColor("#666666"));
|
||||
editText.setGravity(Gravity.END);
|
||||
editText.setBackground(null);
|
||||
editText.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
card.addView(editText);
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
private Button createTimeButton(Context context, int minutes) {
|
||||
Button button = new Button(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
dpToPx(49), dpToPx(36)
|
||||
);
|
||||
params.setMargins(0, 0, dpToPx(10), 0);
|
||||
button.setLayoutParams(params);
|
||||
|
||||
String text = minutes == 0 ? "立刻" : minutes + "分钟";
|
||||
button.setText(text);
|
||||
button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
button.setTypeface(button.getTypeface(), android.graphics.Typeface.BOLD);
|
||||
button.setBackgroundColor(Color.parseColor("#EEEEEE")); // 临时背景色
|
||||
return button;
|
||||
}
|
||||
|
||||
private Button createContentTypeButton(Context context, String text) {
|
||||
Button button = new Button(context);
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
|
||||
dpToPx(63), ViewGroup.LayoutParams.MATCH_PARENT
|
||||
);
|
||||
button.setLayoutParams(params);
|
||||
button.setText(text);
|
||||
button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
button.setBackgroundColor(Color.TRANSPARENT);
|
||||
button.setTextColor(Color.parseColor("#FFC9C7"));
|
||||
return button;
|
||||
}
|
||||
|
||||
private Button createAuthButton(Context context, String text) {
|
||||
Button button = new Button(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
0, dpToPx(36), 1
|
||||
);
|
||||
params.setMargins(0, 0, dpToPx(10), 0);
|
||||
button.setLayoutParams(params);
|
||||
button.setText(text);
|
||||
button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
button.setTypeface(button.getTypeface(), android.graphics.Typeface.BOLD);
|
||||
button.setBackgroundColor(Color.parseColor("#EEEEEE")); // 临时背景色
|
||||
return button;
|
||||
}
|
||||
|
||||
private int dpToPx(int dp) {
|
||||
return (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dp,
|
||||
getResources().getDisplayMetrics()
|
||||
);
|
||||
}
|
||||
|
||||
// Action Methods
|
||||
private void nextAction() {
|
||||
currentPage = 1;
|
||||
moneyUnitLabel.setText(redBagContentType.equals("1") ? "金币" : "钻石");
|
||||
|
||||
backBtn.setVisibility(View.GONE);
|
||||
helpBtn.setVisibility(View.VISIBLE);
|
||||
nextBtn.setVisibility(View.GONE);
|
||||
commitBtn.setVisibility(View.VISIBLE);
|
||||
|
||||
switchContentView(firstContentView, nextContentView);
|
||||
}
|
||||
|
||||
private void commitAction() {
|
||||
// 实现发红包逻辑
|
||||
}
|
||||
|
||||
private void helpAction() {
|
||||
isFromRule = true;
|
||||
webView.loadUrl("http://www.baidu.com");
|
||||
|
||||
backBtn.setVisibility(View.VISIBLE);
|
||||
helpBtn.setVisibility(View.GONE);
|
||||
nextBtn.setVisibility(View.GONE);
|
||||
commitBtn.setVisibility(View.GONE);
|
||||
|
||||
View currentView = currentPage == 1 ? nextContentView : firstContentView;
|
||||
switchContentView(currentView, ruleContentView);
|
||||
}
|
||||
|
||||
private void closeAction() {
|
||||
hide();
|
||||
}
|
||||
|
||||
private void backAction() {
|
||||
backBtn.setVisibility(View.GONE);
|
||||
helpBtn.setVisibility(View.VISIBLE);
|
||||
|
||||
View currentView = currentPage == 1 ? nextContentView : firstContentView;
|
||||
|
||||
nextBtn.setVisibility(currentPage == 0 ? View.VISIBLE : View.GONE);
|
||||
commitBtn.setVisibility(currentPage == 1 ? View.VISIBLE : View.GONE);
|
||||
|
||||
switchContentView(ruleContentView, currentView);
|
||||
isFromRule = false;
|
||||
}
|
||||
|
||||
private void selectedRedBagTypeAction(Button sender) {
|
||||
if (sender.isSelected()) return;
|
||||
|
||||
if (sender == normalRedBagBtn) {
|
||||
pwdRedBagBtn.setSelected(false);
|
||||
normalRedBagBtn.setSelected(true);
|
||||
firstPwdView.setVisibility(View.GONE);
|
||||
|
||||
// 调整时间视图位置
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) firstTimeView.getLayoutParams();
|
||||
params.topMargin = 0;
|
||||
params.bottomMargin = dpToPx(12);
|
||||
firstTimeView.setLayoutParams(params);
|
||||
|
||||
redBagType = "1";
|
||||
} else {
|
||||
pwdRedBagBtn.setSelected(true);
|
||||
normalRedBagBtn.setSelected(false);
|
||||
firstPwdView.setVisibility(View.VISIBLE);
|
||||
|
||||
// 调整时间视图位置
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) firstTimeView.getLayoutParams();
|
||||
params.topMargin = dpToPx(60);
|
||||
params.bottomMargin = dpToPx(12);
|
||||
firstTimeView.setLayoutParams(params);
|
||||
|
||||
redBagType = "2";
|
||||
}
|
||||
|
||||
// 更新按钮背景色
|
||||
updateButtonSelection(normalRedBagBtn, sender == normalRedBagBtn);
|
||||
updateButtonSelection(pwdRedBagBtn, sender == pwdRedBagBtn);
|
||||
}
|
||||
|
||||
private void redBagContentTypeAction(Button sender) {
|
||||
if (sender.isSelected()) return;
|
||||
|
||||
if (sender == coinRedBagBtn) {
|
||||
diamondRedBagBtn.setSelected(false);
|
||||
coinRedBagBtn.setSelected(true);
|
||||
redBagContentType = "1";
|
||||
animateSwitchBg(true);
|
||||
} else {
|
||||
coinRedBagBtn.setSelected(false);
|
||||
diamondRedBagBtn.setSelected(true);
|
||||
redBagContentType = "2";
|
||||
animateSwitchBg(false);
|
||||
}
|
||||
|
||||
// 更新按钮文字颜色
|
||||
updateContentTypeButtonColor(coinRedBagBtn, coinRedBagBtn.isSelected());
|
||||
updateContentTypeButtonColor(diamondRedBagBtn, diamondRedBagBtn.isSelected());
|
||||
}
|
||||
|
||||
private void drawAuthAction(Button sender) {
|
||||
if (sender == noDrawAuthBtn) {
|
||||
noDrawAuthBtn.setSelected(true);
|
||||
collectDrawAuthBtn.setSelected(false);
|
||||
upSeatDrawAuthBtn.setSelected(false);
|
||||
} else if (sender == collectDrawAuthBtn) {
|
||||
collectDrawAuthBtn.setSelected(!collectDrawAuthBtn.isSelected());
|
||||
if (upSeatDrawAuthBtn.isSelected() || collectDrawAuthBtn.isSelected()) {
|
||||
noDrawAuthBtn.setSelected(false);
|
||||
} else {
|
||||
noDrawAuthBtn.setSelected(true);
|
||||
}
|
||||
} else if (sender == upSeatDrawAuthBtn) {
|
||||
noDrawAuthBtn.setSelected(false);
|
||||
upSeatDrawAuthBtn.setSelected(!upSeatDrawAuthBtn.isSelected());
|
||||
if (upSeatDrawAuthBtn.isSelected() || collectDrawAuthBtn.isSelected()) {
|
||||
noDrawAuthBtn.setSelected(false);
|
||||
} else {
|
||||
noDrawAuthBtn.setSelected(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新按钮背景色
|
||||
updateAuthButtonSelection(noDrawAuthBtn, noDrawAuthBtn.isSelected());
|
||||
updateAuthButtonSelection(collectDrawAuthBtn, collectDrawAuthBtn.isSelected());
|
||||
updateAuthButtonSelection(upSeatDrawAuthBtn, upSeatDrawAuthBtn.isSelected());
|
||||
}
|
||||
|
||||
private void redBagTimeAction(Button sender) {
|
||||
if (sender.isSelected()) return;
|
||||
|
||||
if (selectedRedBagTimeBtn != null) {
|
||||
selectedRedBagTimeBtn.setSelected(false);
|
||||
updateTimeButtonSelection(selectedRedBagTimeBtn, false);
|
||||
}
|
||||
|
||||
sender.setSelected(true);
|
||||
selectedRedBagTimeBtn = sender;
|
||||
int minutes = 0;
|
||||
try {
|
||||
String text = sender.getText().toString();
|
||||
if (text.equals("立刻")) {
|
||||
minutes = 0;
|
||||
} else {
|
||||
minutes = Integer.parseInt(text.replace("分钟", ""));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
minutes = 0;
|
||||
}
|
||||
redBagTime = String.valueOf(minutes * 60);
|
||||
|
||||
updateTimeButtonSelection(sender, true);
|
||||
}
|
||||
|
||||
// Helper Methods
|
||||
private void switchContentView(View hideView, View showView) {
|
||||
hideView.setVisibility(View.GONE);
|
||||
showView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void updateButtonSelection(Button button, boolean selected) {
|
||||
button.setBackgroundColor(selected ?
|
||||
Color.parseColor("#FF5555") : Color.parseColor("#FF9999"));
|
||||
}
|
||||
|
||||
private void updateTimeButtonSelection(Button button, boolean selected) {
|
||||
button.setBackgroundColor(selected ?
|
||||
Color.parseColor("#FF5555") : Color.parseColor("#EEEEEE"));
|
||||
}
|
||||
|
||||
private void updateAuthButtonSelection(Button button, boolean selected) {
|
||||
button.setBackgroundColor(selected ?
|
||||
Color.parseColor("#FF5555") : Color.parseColor("#EEEEEE"));
|
||||
}
|
||||
|
||||
private void updateContentTypeButtonColor(Button button, boolean selected) {
|
||||
button.setTextColor(selected ?
|
||||
Color.parseColor("#D01717") : Color.parseColor("#FFC9C7"));
|
||||
}
|
||||
|
||||
private void animateSwitchBg(boolean toLeft) {
|
||||
int targetX = toLeft ? 0 : dpToPx(63);
|
||||
|
||||
ValueAnimator animator = ValueAnimator.ofInt(
|
||||
((RelativeLayout.LayoutParams) scrollBgView.getLayoutParams()).leftMargin,
|
||||
targetX
|
||||
);
|
||||
animator.addUpdateListener(animation -> {
|
||||
int value = (int) animation.getAnimatedValue();
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) scrollBgView.getLayoutParams();
|
||||
params.leftMargin = value;
|
||||
scrollBgView.setLayoutParams(params);
|
||||
});
|
||||
animator.setDuration(300);
|
||||
animator.setInterpolator(new DecelerateInterpolator());
|
||||
animator.start();
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public void showInView(ViewGroup parent) {
|
||||
parent.addView(this);
|
||||
|
||||
// 添加入场动画
|
||||
mainContainer.setTranslationY(-getHeight());
|
||||
mainContainer.animate()
|
||||
.translationY(0)
|
||||
.setDuration(300)
|
||||
.setInterpolator(new DecelerateInterpolator())
|
||||
.start();
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
// 添加退场动画
|
||||
mainContainer.animate()
|
||||
.translationY(getHeight())
|
||||
.setDuration(300)
|
||||
.setInterpolator(new DecelerateInterpolator())
|
||||
.withEndAction(() -> {
|
||||
ViewGroup parent = (ViewGroup) getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(QXRedBagSendView.this);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
// Getter methods
|
||||
public String getRedBagType() {
|
||||
return redBagType;
|
||||
}
|
||||
|
||||
public String getRedBagContentType() {
|
||||
return redBagContentType;
|
||||
}
|
||||
|
||||
public String getRedBagTime() {
|
||||
return redBagTime;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return pwdTextField.getText().toString();
|
||||
}
|
||||
|
||||
public String getMoney() {
|
||||
return moneyTextField.getText().toString();
|
||||
}
|
||||
|
||||
public String getCount() {
|
||||
return countTextField.getText().toString();
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remarkTextField.getText().toString();
|
||||
}
|
||||
|
||||
public int getDrawAuth() {
|
||||
if (noDrawAuthBtn.isSelected()) return 0;
|
||||
if (collectDrawAuthBtn.isSelected()) return 1;
|
||||
if (upSeatDrawAuthBtn.isSelected()) return 2;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
countDownTime(bean.getCount_down());
|
||||
|
||||
setCardiac(pitBean.getCharm(), getTzbl());
|
||||
setPitData(bean);
|
||||
|
||||
|
||||
if (bean.getUser_id()!=null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()) {
|
||||
if (CommonAppContext.getInstance().getOnlineMap()!=null&&CommonAppContext.getInstance().getOnlineMap().get(bean.getUser_id())!=null) {
|
||||
@@ -179,6 +179,8 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
iv_on_line.setVisibility(GONE);
|
||||
}
|
||||
|
||||
setPitData(bean);
|
||||
|
||||
// if (bean.getIs_online() == 2 && bean.getUser_id()!=null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()){
|
||||
// iv_on_line.setVisibility(VISIBLE);
|
||||
// }else {
|
||||
|
||||
@@ -367,6 +367,9 @@ public class Constants {
|
||||
public static final String POST_DELETE_RELATION_CARD = "/api/Room/delete_relation_card";//删除关系
|
||||
public static final String GET_FIRST_CHARGE = "/api/Activities/first_charge_gift_permission";//首充好礼弹框权限
|
||||
public static final String GET_FIRST_CHARGE_GIFT = "/api/Activities/first_charge_gift";//首充好礼列表接口
|
||||
public static final String GET_NEW_CHARGE_GIFT = "/api/Activities/new_charge_gift";//新人好礼列表接口(弹框)
|
||||
public static final String GET_ACTIVITIES_PERMISSION = "/api/Activities/activities_permission";//活动弹框权限
|
||||
public static final String GET_DAY_DROP_GIFT = "/api/Activities/day_drop_gift";//天降好礼列表接口(弹框)
|
||||
public static final String dailyTasksReceive = "/api/Dailytasks/dailyTasksReceive";//领取每日任务奖励
|
||||
public static final String postRoomSwToken = "/api/Room/update_user_sw_token";//获取用户声网token
|
||||
public static final String dailyTasksComplete = "/api/Dailytasks/dailyTasksComplete";//领取每日任务奖励
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
package com.xscm.moduleutil.widget;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewAnimationUtils;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.utils.BarUtils;
|
||||
|
||||
/**
|
||||
* 这是红包入口悬浮框
|
||||
*/
|
||||
public class DropRedView extends LinearLayout {
|
||||
|
||||
private int rightMargin = 0;
|
||||
private float lastX, lastY;
|
||||
private int screenWidth;
|
||||
private int screenHeight; // 添加屏幕高度变量
|
||||
|
||||
public DropRedView(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public DropRedView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public DropRedView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
void init() {
|
||||
// 初始化屏幕尺寸
|
||||
screenWidth = ScreenUtils.getScreenWidth();
|
||||
screenHeight = ScreenUtils.getScreenHeight();
|
||||
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//设置初始位置
|
||||
int sh = ScreenUtils.getScreenHeight();
|
||||
int sw = ScreenUtils.getScreenWidth();
|
||||
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
||||
int y = (int) (0.5f * sh) - getHeight();
|
||||
// 确保Y坐标不会超出屏幕范围
|
||||
y = Math.max(0, Math.min(y, sh - getHeight()));
|
||||
// int x = sw - getWidth();//这是靠右边展示的
|
||||
int x=20 ;//这里这只一小的数值,就是靠左展示的
|
||||
setTranslationX(x);
|
||||
setTranslationY(y);
|
||||
}
|
||||
});
|
||||
|
||||
updateSize();
|
||||
mStatusBarHeight = BarUtils.getStatusBarHeight();
|
||||
}
|
||||
/**
|
||||
* 更新屏幕尺寸信息
|
||||
*/
|
||||
protected void updateSize() {
|
||||
ViewGroup viewGroup = (ViewGroup) getParent();
|
||||
if (viewGroup != null) {
|
||||
mScreenWidth = viewGroup.getWidth();
|
||||
mScreenHeight = viewGroup.getHeight();
|
||||
} else {
|
||||
// 如果父视图为空,使用屏幕的实际宽度和高度
|
||||
mScreenWidth = getResources().getDisplayMetrics().widthPixels;
|
||||
mScreenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
}
|
||||
}
|
||||
|
||||
boolean starDrap = false;
|
||||
float X1;
|
||||
float X2;
|
||||
float Y1;
|
||||
float Y2;
|
||||
// 记录视图初始位置
|
||||
private float originalX;
|
||||
private float originalY;
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||
if (starDrap) return true;
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
X1 = event.getRawX();
|
||||
Y1 = event.getRawY();
|
||||
// 记录视图当前位置
|
||||
originalX = getTranslationX();
|
||||
originalY = getTranslationY();
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
X2 = event.getRawX();
|
||||
Y2 = event.getRawY();
|
||||
Action(X1, X2, Y1, Y2);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return starDrap;
|
||||
}
|
||||
|
||||
String TAG = "DropHourlView";
|
||||
|
||||
public boolean Action(float X1, float X2, float Y1, float Y2) {
|
||||
float ComparedX = X2 - X1;//第二次的X坐标的位置减去第一次X坐标的位置,代表X坐标上的变化情况
|
||||
float ComparedY = Y2 - Y1;//同理
|
||||
//当X坐标的变化量的绝对值大于Y坐标的变化量的绝对值,以X坐标的变化情况作为判断依据
|
||||
//上下左右的判断,都在一条直线上,但手指的操作不可能划直线,所有选择变化量大的方向上的量
|
||||
//作为判断依据
|
||||
if (Math.abs(ComparedX) > 30 || Math.abs(ComparedY) > 30) {
|
||||
Log.i(TAG, "Action: 拖动");
|
||||
starDrap = true;
|
||||
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
||||
return true;
|
||||
} else {
|
||||
starDrap = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private float mOriginalRawX;
|
||||
private float mOriginalRawY;
|
||||
private float mOriginalX;
|
||||
private float mOriginalY;
|
||||
protected int mScreenWidth;
|
||||
private int mScreenHeight;
|
||||
private int mStatusBarHeight;
|
||||
|
||||
private void updateViewPosition(MotionEvent event) {
|
||||
// 计算新的Y位置
|
||||
float desY = mOriginalY + event.getRawY() - mOriginalRawY;
|
||||
|
||||
// 限制Y位置不超出屏幕边界
|
||||
if (desY < mStatusBarHeight) {
|
||||
desY = mStatusBarHeight;
|
||||
}
|
||||
if (desY > mScreenHeight - getHeight()) {
|
||||
desY = mScreenHeight - getHeight();
|
||||
}
|
||||
|
||||
// 计算新的X位置
|
||||
float desX = mOriginalX + event.getRawX() - mOriginalRawX;
|
||||
|
||||
// 限制X位置不超出屏幕边界
|
||||
if (desX < 0) {
|
||||
desX = 0;
|
||||
}
|
||||
if (desX > mScreenWidth - getWidth()) {
|
||||
desX = mScreenWidth - getWidth();
|
||||
}
|
||||
|
||||
// 设置视图的新位置
|
||||
setX(desX);
|
||||
setY(desY);
|
||||
}
|
||||
private void changeOriginalTouchParams(MotionEvent event) {
|
||||
mOriginalX = getX();//getX()相对于控件X坐标的距离
|
||||
mOriginalY = getY();
|
||||
mOriginalRawX = event.getRawX();//getRawX()指控件在屏幕上的X坐标
|
||||
mOriginalRawY = event.getRawY();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (event == null) {
|
||||
return false;
|
||||
}
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
changeOriginalTouchParams(event);
|
||||
updateSize(); // 添加这行确保尺寸是最新的
|
||||
// ... 其他现有代码 ...
|
||||
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
|
||||
updateViewPosition(event); // 使用更新后的带边界检查的方法
|
||||
|
||||
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
||||
// 使用屏幕绝对坐标计算新位置
|
||||
// float newX = originalX + (event.getRawX() - X1);
|
||||
// float newY = originalY + (event.getRawY() - Y1);
|
||||
//
|
||||
// // 限制X和Y坐标在屏幕范围内
|
||||
// newX = Math.max(0, Math.min(newX, screenWidth - getWidth()));
|
||||
// newY = Math.max(0, Math.min(newY, screenHeight - getHeight()));
|
||||
//
|
||||
// setTranslationX(newX);
|
||||
// setTranslationY(newY);
|
||||
// X2 = event.getRawX();
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
starDrap = false;
|
||||
int sw = ScreenUtils.getScreenWidth();
|
||||
Log.i(TAG, "onTouchEvent: " + sw + "," + X2);
|
||||
boolean isR = getTranslationX() + getWidth() / 2 >= sw / 2;//贴边方向
|
||||
|
||||
// 获取当前Y坐标
|
||||
float currentY = getTranslationY();
|
||||
|
||||
// 创建X轴和Y轴的动画
|
||||
ObjectAnimator animX = ObjectAnimator.ofFloat(this, "translationX", isR ? sw - getWidth() : 0f).setDuration(200);
|
||||
// Y轴保持当前位置,但确保在屏幕范围内
|
||||
currentY = Math.max(0, Math.min(currentY, screenHeight - getHeight()));
|
||||
ObjectAnimator animY = ObjectAnimator.ofFloat(this, "translationY", currentY).setDuration(200);
|
||||
|
||||
animX.start();
|
||||
animY.start();
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void doRevealAnimation(View mPuppet, boolean flag) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
int[] vLocation = new int[2];
|
||||
getLocationInWindow(vLocation);
|
||||
int centerX = vLocation[0] + getMeasuredWidth() / 2;
|
||||
int centerY = vLocation[1] + getMeasuredHeight() / 2;
|
||||
|
||||
int height = ScreenUtils.getScreenHeight();
|
||||
int width = ScreenUtils.getScreenWidth();
|
||||
int maxRradius = (int) Math.hypot(height, width);
|
||||
Log.e("hei", maxRradius + "");
|
||||
|
||||
if (flag) {
|
||||
mPuppet.setVisibility(VISIBLE);
|
||||
Animator animator = ViewAnimationUtils.createCircularReveal(mPuppet, centerX, centerY, maxRradius, 0);
|
||||
animator.setDuration(600);
|
||||
animator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
super.onAnimationEnd(animation);
|
||||
mPuppet.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
animator.start();
|
||||
flag = false;
|
||||
} else {
|
||||
Animator animator = ViewAnimationUtils.createCircularReveal(mPuppet, centerX, centerY, 0, maxRradius);
|
||||
animator.setDuration(1000);
|
||||
animator.addListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
mPuppet.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
}
|
||||
});
|
||||
animator.start();
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -75,6 +75,7 @@ public class RoomSingSongWheatView extends BaseWheatView {
|
||||
updateSexIcon();
|
||||
// updateCharmViewVisibility(bean);
|
||||
updatePkState(bean);
|
||||
iv_on_line.setVisibility(GONE);
|
||||
}
|
||||
|
||||
private void handleOnState(RoomPitBean bean) {
|
||||
|
||||
BIN
moduleUtil/src/main/res/drawable-xxxhdpi/red_bag_btn_bg_nor.png
Normal file
|
After Width: | Height: | Size: 682 B |
BIN
moduleUtil/src/main/res/drawable-xxxhdpi/red_bag_btn_bg_sel.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
moduleUtil/src/main/res/drawable-xxxhdpi/red_bag_next_btn_bg.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 574 B |
|
After Width: | Height: | Size: 3.6 KiB |
BIN
moduleUtil/src/main/res/drawable-xxxhdpi/room_redbag_back.png
Normal file
|
After Width: | Height: | Size: 291 B |
BIN
moduleUtil/src/main/res/drawable-xxxhdpi/room_redbag_help.png
Normal file
|
After Width: | Height: | Size: 1006 B |
8
moduleUtil/src/main/res/drawable/bg_r10_bott.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FFF5DA"/>
|
||||
<corners android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="0dp"/>
|
||||
</shape>
|
||||
10
moduleUtil/src/main/res/drawable/bg_r395_ba230a.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#ffba230a"/>
|
||||
<corners
|
||||
android:topLeftRadius="395dp"
|
||||
android:topRightRadius="395dp"
|
||||
android:bottomLeftRadius="395dp"
|
||||
android:bottomRightRadius="395dp"/>
|
||||
</shape>
|
||||
10
moduleUtil/src/main/res/drawable/bg_r8_c51a0c.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#C51A0C"/>
|
||||
<corners
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="8dp"
|
||||
android:bottomLeftRadius="8dp"
|
||||
android:bottomRightRadius="8dp"/>
|
||||
</shape>
|
||||
10
moduleUtil/src/main/res/drawable/bg_r8_fff.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#ffffffff"/>
|
||||
<corners
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="8dp"
|
||||
android:bottomLeftRadius="8dp"
|
||||
android:bottomRightRadius="8dp"/>
|
||||
</shape>
|
||||
21
moduleUtil/src/main/res/drawable/bg_red_16_envel.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<stroke
|
||||
android:width="4dp"
|
||||
android:color="#fffab884"/>
|
||||
<gradient
|
||||
android:type="linear"
|
||||
android:useLevel="true"
|
||||
android:startColor="#fff3624c"
|
||||
android:endColor="#fff34746"
|
||||
android:angle="137"/>
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp"/>
|
||||
<item android:name="android:shadowColor">#4d000000</item>
|
||||
<item android:name="android:shadowDx">0</item>
|
||||
<item android:name="android:shadowDy">4</item>
|
||||
</shape>
|
||||
5
moduleUtil/src/main/res/drawable/bg_red_xian.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#fff7c695" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 选中状态 - 使用选中时的背景图片 -->
|
||||
<item android:state_selected="true" android:drawable="@drawable/red_bag_btn_bg_sel" />
|
||||
<!-- 默认状态 - 使用默认背景图片 -->
|
||||
<item android:drawable="@drawable/red_bag_btn_bg_nor" />
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 选中状态下的背景图片 (a图) -->
|
||||
<item android:state_checked="true" android:drawable="@drawable/red_bag_btn_bg_sel" />
|
||||
<!-- 未选中状态下的背景图片 (b图) -->
|
||||
<item android:drawable="@drawable/red_bag_btn_bg_nor" />
|
||||
</selector>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 选中状态 -->
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFD700"/>
|
||||
<corners android:radius="@dimen/dp_20"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 未选中状态 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/transparent"/>
|
||||
<corners android:radius="@dimen/dp_20"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
174
moduleUtil/src/main/res/layout/dialog_new_people.xml
Normal file
@@ -0,0 +1,174 @@
|
||||
<?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="wrap_content"
|
||||
android:background="@color/color_transparent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/h_bj_b"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_t"
|
||||
android:layout_width="@dimen/dp_276"
|
||||
android:layout_height="@dimen/dp_338"
|
||||
android:background="@mipmap/new_people_bj"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_98"
|
||||
android:gravity="center|right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:text="首次充值"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="#F4DF39"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_title2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginEnd="@dimen/dp_23"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:text="首次充值"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_122"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/btn_0"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/btn_first_charge"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/btn_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/btn_first_charge"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/btn_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/btn_first_charge"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/btn_3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/xr_ykj"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_rc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_112"
|
||||
android:layout_below="@+id/rg"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_24"
|
||||
android:background="@mipmap/tk_bj">
|
||||
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/rv_head"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_99"-->
|
||||
<!-- tools:listitem="@layout/item_gift" />-->
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
app:bvp_indicator_visibility="visible"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_invite"
|
||||
android:layout_width="@dimen/dp_178"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_below="@+id/rl_rc"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:gravity="center"
|
||||
android:text="立即充值"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:src="@mipmap/index_close_youth"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_t" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -1,94 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/cl_gift"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/bg_r5_e9e9"
|
||||
>
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/cl_gift"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:background="@drawable/bg_r5_e9e9"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_iv_down_on"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:padding="5dp">
|
||||
android:id="@+id/cl_iv_down_on"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:padding="5dp">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_pic"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:src="@mipmap/default_image"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:id="@+id/iv_gift_pic"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:src="@mipmap/default_image"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_down_on"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/room_gift_select_bg"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
android:id="@+id/iv_down_on"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/room_gift_select_bg"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:singleLine="true"
|
||||
android:text="甜蜜奶酪"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="7sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_gift_pic" />
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:singleLine="true"
|
||||
android:text="甜蜜奶酪"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="7sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_gift_pic"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="1"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:drawablePadding="@dimen/dp_3"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:textColor="@color/color_FFFFBC00"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name" />
|
||||
|
||||
android:id="@+id/tv_gift_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="1"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:drawablePadding="@dimen/dp_3"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:textColor="@color/color_FFFFBC00"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_gift_pic"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_9"
|
||||
android:background="@mipmap/text_bj"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingRight="3dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="5sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="x100" />
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_9"
|
||||
android:background="@mipmap/text_bj"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingRight="3dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="5sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="x100"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
BIN
moduleUtil/src/main/res/mipmap-mdpi/red_tx.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/heave_g.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/new_people_bj.webp
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red.webp
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_bj.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_bott_b.webp
Normal file
|
After Width: | Height: | Size: 366 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_en.webp
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_f_bj.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_im_bot.png
Normal file
|
After Width: | Height: | Size: 100 B |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_k.webp
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_k_top.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_text.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_top_b.webp
Normal file
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 140 B |
|
After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 12 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/tianjhl.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xinrhl.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xr_ykj.webp
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
@@ -138,6 +138,8 @@
|
||||
<color name="color_FFFFB5B5">#FFFFB5B5</color>
|
||||
<color name="color_FFFFE1E1">#FFFFE1E1</color>
|
||||
<color name="color_FFFA447D">#FFFA447D</color>
|
||||
<color name="color_FFBA230A">#FFBA230A</color>
|
||||
<color name="color_FFFDE8A3">#FFFDE8A3</color>
|
||||
<color name="color_FF53D7FF">#FF53D7FF</color>
|
||||
<color name="color_FF43D3FF">#FF43D3FF</color>
|
||||
<color name="color_FFFFC1C1">#FFFFC1C1</color>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.xscm.modulemain.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@@ -18,55 +17,42 @@ import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.FragmentUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.example.modulecircle.fragment.CircleFragment;
|
||||
import com.example.modulenews.fragment.NewsFragment;
|
||||
import com.example.moduleroom.activity.RoomActivity;
|
||||
import com.example.modulevocal.fragment.VocalRangeFragment;
|
||||
import com.example.modulevoice.fragment.VoiceFragment;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
import com.permissionx.guolindev.callback.ExplainReasonCallback;
|
||||
import com.permissionx.guolindev.callback.ForwardToSettingsCallback;
|
||||
import com.permissionx.guolindev.callback.RequestCallback;
|
||||
import com.permissionx.guolindev.request.ExplainScope;
|
||||
import com.permissionx.guolindev.request.ForwardScope;
|
||||
import com.stx.xhb.xbanner.XBanner;
|
||||
import com.xscm.modulemain.R;
|
||||
import com.xscm.modulemain.contacts.HomeContacts;
|
||||
import com.xscm.modulemain.databinding.ActivityMainBinding;
|
||||
import com.xscm.modulemain.presenter.HomePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.adapter.AppUpdateDialog;
|
||||
import com.xscm.moduleutil.base.AppStateManager;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.bean.FirstChargeBean;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
import com.xscm.moduleutil.bean.*;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnlineBean;
|
||||
import com.xscm.moduleutil.dialog.FirstChargeDialog;
|
||||
import com.xscm.moduleutil.dialog.NewPeopleDialog;
|
||||
import com.xscm.moduleutil.dialog.RechargeDialogFragment;
|
||||
import com.xscm.moduleutil.event.RoomOutEvent;
|
||||
import com.xscm.moduleutil.event.UnreadCountEvent;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.BackgroundManager;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.*;
|
||||
import com.xscm.moduleutil.utils.location.LocationProvider;
|
||||
import com.xscm.moduleutil.utils.location.SystemLocationProvider;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
@@ -77,6 +63,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -331,7 +318,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
mBinding.rlMe.setOnClickListener(this);
|
||||
mBinding.ivGuanbi.setOnClickListener(this);
|
||||
mBinding.riv.setOnClickListener(this);
|
||||
mBinding.ivShouchl.setOnClickListener(this);
|
||||
mBinding.ivShouchl.setOnClickListener( this);
|
||||
requestGpsPermissions();
|
||||
}
|
||||
|
||||
@@ -405,7 +392,8 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
//// RoomManager.instance( CommonAppContext.getInstance()).joinRoomWithRoomId(roomId, true);
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", roomId).navigation();
|
||||
// }
|
||||
} else if (id == R.id.iv_shouchl) {//首充
|
||||
}
|
||||
else if (id == R.id.iv_shouchl) {//首充
|
||||
FirstChargeDialog firstChargeDialog = new FirstChargeDialog(this);
|
||||
firstChargeDialog.show();
|
||||
firstChargeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@@ -561,6 +549,9 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
|
||||
MvpPre.getMyInfo(SpUtil.getUserId() + "");//获取首充是否需要展示
|
||||
|
||||
// MvpPre.activitiesPermission();
|
||||
|
||||
|
||||
// mBinding.ivShouchl.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
@@ -808,6 +799,110 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission) {
|
||||
List<PermissionPicBean> list ;
|
||||
if (activitiesPermission != null) {
|
||||
list = new ArrayList<>();
|
||||
if (activitiesPermission.getFirst_charge_permission() == 1) {
|
||||
PermissionPicBean bean = new PermissionPicBean();
|
||||
bean.setPicId( com.xscm.moduleutil.R.mipmap.shouchl);
|
||||
bean.setType(1);
|
||||
list.add(bean);
|
||||
// list.add(ResourcesCompat.getDrawable(getResources(), com.xscm.moduleutil.R.mipmap.shouchl, null));
|
||||
}
|
||||
|
||||
if (activitiesPermission.getDay_drop_permission() == 1) {
|
||||
PermissionPicBean bean = new PermissionPicBean();
|
||||
bean.setPicId( com.xscm.moduleutil.R.mipmap.tianjhl);
|
||||
bean.setType(2);
|
||||
list.add(bean);
|
||||
// list.add(ResourcesCompat.getDrawable(getResources(), com.xscm.moduleutil.R.mipmap.tianjhl, null));
|
||||
}
|
||||
|
||||
if (activitiesPermission.getN_people_permission() == 1) {
|
||||
PermissionPicBean bean = new PermissionPicBean();
|
||||
bean.setPicId( com.xscm.moduleutil.R.mipmap.xinrhl);
|
||||
bean.setType(3);
|
||||
list.add(bean);
|
||||
// list.add(ResourcesCompat.getDrawable(getResources(), com.xscm.moduleutil.R.mipmap.xinrhl, null));
|
||||
}
|
||||
|
||||
// mBinding.banner.setBannerData(list);
|
||||
//
|
||||
// mBinding.banner.loadImage(new XBanner.XBannerAdapter() {
|
||||
//
|
||||
// @Override
|
||||
// public void loadBanner(XBanner banner, Object model, View view, int position) {
|
||||
// PermissionPicBean permissionPicBean = (PermissionPicBean) model;
|
||||
// ImageView imageView = (ImageView) view;
|
||||
// imageView.setImageResource(permissionPicBean.getPicId());
|
||||
// }
|
||||
// });
|
||||
// mBinding.banner.setOnItemClickListener(new XBanner.OnItemClickListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onItemClick(XBanner banner, Object model, View view, int position) {
|
||||
// PermissionPicBean bannerModel = (PermissionPicBean) model;
|
||||
// if (bannerModel.getType() == 1){//首充
|
||||
// firstCharge();
|
||||
// }else if (bannerModel.getType() == 2){//天降
|
||||
//
|
||||
// }else if (bannerModel.getType() == 3){//新人
|
||||
// newPeople();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void newPeople(){
|
||||
NewPeopleDialog newPeopleDialog = new NewPeopleDialog(this);
|
||||
newPeopleDialog.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// TODO: 2025/10/12 首充好礼
|
||||
private void firstCharge(){
|
||||
FirstChargeDialog firstChargeDialog = new FirstChargeDialog(this);
|
||||
firstChargeDialog.show();
|
||||
firstChargeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
//首充弹窗关闭后,弹首充
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
firstChargeDialog.setOnFirstChargeListener(new FirstChargeDialog.OnFirstChargeListener() {
|
||||
@Override
|
||||
public void onFirstChargeConfirmed(FirstChargeGiftBean giftBean, int type) {
|
||||
String s = null;
|
||||
if (type == 1) {
|
||||
s = giftBean.getGift_bag().get(0).getMoney();
|
||||
|
||||
} else if (type == 2) {
|
||||
s = giftBean.getGift_bag().get(1).getMoney();
|
||||
} else if (type == 3) {
|
||||
s = giftBean.getGift_bag().get(2).getMoney();
|
||||
}
|
||||
if (s == null) {
|
||||
ToastUtils.showShort("暂无礼物");
|
||||
return;
|
||||
}
|
||||
|
||||
RechargeDialogFragment.show(null, s, getSupportFragmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstChargeCancelled() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateAllTabUI() {
|
||||
index = 0;
|
||||
// 更新图标
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.bean.FirstChargeBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
@@ -31,6 +32,8 @@ public final class HomeContacts {
|
||||
|
||||
void getRoomOnline(RoomOnline onlineBean);
|
||||
|
||||
void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission);
|
||||
|
||||
}
|
||||
|
||||
public interface IHomePre extends IPresenter {
|
||||
@@ -58,5 +61,7 @@ public final class HomeContacts {
|
||||
|
||||
void getRoomOnline(String roomId, String page, String page_limit);//在线列表
|
||||
|
||||
void activitiesPermission();//活动弹框权限
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.xscm.modulemain.contacts.HomeContacts;
|
||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.bean.FirstChargeBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.*;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
@@ -26,6 +23,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class HomePresenter extends BasePresenter<HomeContacts.View> implements HomeContacts.IHomePre {
|
||||
|
||||
@@ -397,4 +395,24 @@ public class HomePresenter extends BasePresenter<HomeContacts.View> implements H
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activitiesPermission() {
|
||||
api.activitiesPermission(new BaseObserver<ActivitiesPermission>() {
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
addDisposable( d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull ActivitiesPermission activitiesPermission) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().activitiesPermissionSuccess(activitiesPermission);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,232 +1,255 @@
|
||||
<?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"
|
||||
tools:context=".activity.MainActivity">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false" />
|
||||
>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/transparent"
|
||||
android:clipChildren="false"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom_bar"
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/home_bbar_yuan"
|
||||
android:orientation="horizontal">
|
||||
android:clipChildren="false"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/transparent"
|
||||
android:clipChildren="false"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/home_bbar_yuan"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_media"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/rl_media"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_sy"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_media" />
|
||||
android:id="@+id/im_sy"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_media"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_media"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab1"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
android:id="@+id/tv_media"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab1"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_trend"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/rl_trend"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_trend"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_tend" />
|
||||
android:id="@+id/im_trend"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_tend"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_trend"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab2"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
android:id="@+id/tv_trend"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab2"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_news"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/rl_news"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_news"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_news" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_toRightOf="@+id/iv_news"
|
||||
android:background="@drawable/ease_bg_msg_count"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingTop="1.5dp"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
tools:text="99+"
|
||||
tools:visibility="visible" />
|
||||
android:layout_marginTop="-3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_news"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_news"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_toRightOf="@+id/iv_news"
|
||||
android:background="@drawable/ease_bg_msg_count"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingTop="1.5dp"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
tools:text="99+"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_news"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/iv_news"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab3"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
android:id="@+id/tv_news"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/iv_news"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab3"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_me"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/rl_me"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_me"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_me" />
|
||||
android:id="@+id/im_me"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_me"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_me"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab4"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
android:id="@+id/tv_me"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab4"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<com.xscm.moduleutil.widget.DropView
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:gav_border_color="#FFF"
|
||||
app:gav_border_width="@dimen/dp_2"
|
||||
app:riv_border_color="#FFF"
|
||||
app:riv_border_width="@dimen/dp_2"
|
||||
app:riv_oval="true" />
|
||||
android:id="@+id/riv"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:gav_border_color="#FFF"
|
||||
app:gav_border_width="@dimen/dp_2"
|
||||
app:riv_border_color="#FFF"
|
||||
app:riv_border_width="@dimen/dp_2"
|
||||
app:riv_oval="true"/>
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
android:layout_marginRight="@dimen/dp_7"
|
||||
android:background="#FFFFFFFF"
|
||||
android:visibility="visible"/>
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
android:layout_marginRight="@dimen/dp_7"
|
||||
android:background="#FFFFFFFF"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_guanbi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/dp_14"
|
||||
android:src="@mipmap/icon_guanbi" />
|
||||
android:id="@+id/iv_guanbi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/dp_14"
|
||||
android:src="@mipmap/icon_guanbi"/>
|
||||
</com.xscm.moduleutil.widget.DropView>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_shouchl"
|
||||
android:layout_width="@dimen/dp_57"
|
||||
android:layout_height="@dimen/dp_57"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:src="@mipmap/shouchl" />
|
||||
android:id="@+id/iv_shouchl"
|
||||
android:layout_width="@dimen/dp_57"
|
||||
android:layout_height="@dimen/dp_57"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:src="@mipmap/shouchl"/>
|
||||
|
||||
<!-- <com.stx.xhb.xbanner.XBanner-->
|
||||
<!-- android:id="@+id/banner"-->
|
||||
<!-- android:layout_width="@dimen/dp_75"-->
|
||||
<!-- android:layout_height="@dimen/dp_85"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- app:AutoPlayTime="3000"-->
|
||||
<!-- android:layout_alignParentBottom="true"-->
|
||||
<!-- android:layout_alignParentEnd="true"-->
|
||||
<!-- app:pageChangeDuration="3000"-->
|
||||
<!-- app:pointContainerPosition="BOTTOM"-->
|
||||
<!-- app:pointNormal="@mipmap/room_ic_banner_point_normal"-->
|
||||
<!-- app:pointSelect="@mipmap/room_ic_banner_point_select"-->
|
||||
<!-- app:pointTopBottomPadding="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_20"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_100"-->
|
||||
<!-- app:pointsPosition="CENTER"-->
|
||||
<!-- app:pointsVisibility="true"-->
|
||||
<!-- android:clickable="true"-->
|
||||
<!-- android:focusable="true"-->
|
||||
<!-- />-->
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
@@ -47,6 +47,10 @@ dependencies {
|
||||
implementation libs.material
|
||||
implementation libs.activity
|
||||
implementation libs.constraintlayout
|
||||
implementation libs.androidx.legacy.support.v4
|
||||
implementation libs.lifecycle.livedata.ktx
|
||||
implementation libs.lifecycle.viewmodel.ktx
|
||||
implementation libs.androidx.fragment.ktx
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<activity android:name=".activity.RedResultActivity"
|
||||
android:exported="true"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.example.moduleroom.activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
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.utils.ARouteConstants;
|
||||
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;
|
||||
|
||||
public static RedResultActivity newInstance() {
|
||||
return new RedResultActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RedEnvelopesPresenter bindPresenter() {
|
||||
return new RedEnvelopesPresenter( this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,23 +11,13 @@ import android.content.pm.ActivityInfo
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.CountDownTimer
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.*
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.TextUtils
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.util.Log
|
||||
import android.view.GestureDetector
|
||||
import android.view.Gravity
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.view.*
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Button
|
||||
import android.widget.EditText
|
||||
@@ -48,28 +38,11 @@ import com.blankj.utilcode.util.ThreadUtils
|
||||
import com.blankj.utilcode.util.TimeUtils
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.example.moduleroom.R
|
||||
|
||||
import com.example.moduleroom.contacts.RoomContacts
|
||||
import com.example.moduleroom.databinding.ActivityRoomBinding
|
||||
|
||||
import com.example.moduleroom.dialog.ExitRoomBottomSheet
|
||||
import com.example.moduleroom.dialog.*
|
||||
import com.example.moduleroom.dialog.ExitRoomBottomSheet.OnOptionSelectedListener
|
||||
import com.example.moduleroom.dialog.FriendsDialogFragment
|
||||
import com.example.moduleroom.dialog.HourlyChartDialog
|
||||
import com.example.moduleroom.dialog.PublishCommentDialogFragment
|
||||
import com.example.moduleroom.dialog.RequestDialogFragment
|
||||
import com.example.moduleroom.dialog.RoomGiftDialogFragment
|
||||
import com.example.moduleroom.dialog.RoomMessageDialogFragment
|
||||
import com.example.moduleroom.dialog.RoomOnlineDialogFragment
|
||||
import com.example.moduleroom.dialog.RoomPkDialogFragment
|
||||
import com.example.moduleroom.dialog.RoomSettingFragment
|
||||
import com.example.moduleroom.dialog.SoundEffectsDialogFragment
|
||||
import com.example.moduleroom.fragment.PublicScreenEaseChatFragment
|
||||
import com.example.moduleroom.fragment.RoomCabinFragment
|
||||
import com.example.moduleroom.fragment.RoomChartsFragment
|
||||
import com.example.moduleroom.fragment.RoomFragment
|
||||
import com.example.moduleroom.fragment.RoomNoticeDialogFragment
|
||||
import com.example.moduleroom.fragment.RoomPasswordSetDialogFragment
|
||||
import com.example.moduleroom.fragment.*
|
||||
import com.example.moduleroom.presenter.RoomPresenter
|
||||
import com.example.moduleroom.service.ForegroundService
|
||||
import com.example.moduleroom.service.RoomPlayService
|
||||
@@ -89,46 +62,20 @@ import com.xscm.moduleutil.base.AppStateListener
|
||||
import com.xscm.moduleutil.base.AppStateManager
|
||||
import com.xscm.moduleutil.base.CommonAppContext
|
||||
import com.xscm.moduleutil.base.RoomManager
|
||||
import com.xscm.moduleutil.bean.GiftBean
|
||||
import com.xscm.moduleutil.bean.HeadlineBean
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean
|
||||
import com.xscm.moduleutil.bean.RoomInputEvent
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
import com.xscm.moduleutil.bean.*
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent.T
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent.text
|
||||
import com.xscm.moduleutil.bean.RoomSettingEvent
|
||||
import com.xscm.moduleutil.bean.RoomSingleton
|
||||
import com.xscm.moduleutil.bean.UserInfo
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean
|
||||
import com.xscm.moduleutil.bean.room.*
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo.HeartList
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction.AuctionListBean
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction.AuctionUserBean
|
||||
import com.xscm.moduleutil.bean.room.RoomBean
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline
|
||||
import com.xscm.moduleutil.bean.room.RoomOnlineBean
|
||||
import com.xscm.moduleutil.bean.room.RoomOwnerBean
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog
|
||||
import com.xscm.moduleutil.dialog.RechargeDialogFragment
|
||||
import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryDialog
|
||||
import com.xscm.moduleutil.dialog.giftLottery.TourClubDialogFragment
|
||||
import com.xscm.moduleutil.event.ColoseCardEvent
|
||||
import com.xscm.moduleutil.event.EffectEvent
|
||||
import com.xscm.moduleutil.event.MusicEvent
|
||||
import com.xscm.moduleutil.event.QXRoomSeatViewType
|
||||
import com.xscm.moduleutil.event.RoomGiftGiveEvent
|
||||
import com.xscm.moduleutil.event.RoomInputHideEvent
|
||||
import com.xscm.moduleutil.event.RoomJoinMountModel
|
||||
import com.xscm.moduleutil.event.RoomOutEvent
|
||||
import com.xscm.moduleutil.event.RoomTaskEvent
|
||||
import com.xscm.moduleutil.event.*
|
||||
import com.xscm.moduleutil.event.RoomWheatEvent
|
||||
import com.xscm.moduleutil.event.SurfaceEvent
|
||||
import com.xscm.moduleutil.event.UnreadCountEvent
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.interfaces.OnMusicItemClickListener
|
||||
@@ -137,16 +84,9 @@ import com.xscm.moduleutil.listener.MessageListenerSingleton.OnMessageReceivedLi
|
||||
import com.xscm.moduleutil.rtc.AgoraManager
|
||||
import com.xscm.moduleutil.rtc.MusicPlayBean
|
||||
import com.xscm.moduleutil.service.MyRoomSingleton
|
||||
import com.xscm.moduleutil.utils.ARouteConstants
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
import com.xscm.moduleutil.utils.SystemUtils
|
||||
import com.xscm.moduleutil.widget.CircularProgressView
|
||||
import com.xscm.moduleutil.widget.CustomMusicFloatingView
|
||||
import com.xscm.moduleutil.widget.QXGiftPlayerManager
|
||||
import com.xscm.moduleutil.widget.SilentCountDownTimer
|
||||
import com.xscm.moduleutil.widget.ViewUtils
|
||||
import com.xscm.moduleutil.utils.*
|
||||
import com.xscm.moduleutil.view.QXRedBagSendView
|
||||
import com.xscm.moduleutil.widget.*
|
||||
import com.xscm.moduleutil.widget.ViewUtils.OnViewCreatedListener
|
||||
import com.xscm.moduleutil.widget.floatingView.Floa
|
||||
import io.agora.musiccontentcenter.Music
|
||||
@@ -159,8 +99,7 @@ import pub.devrel.easypermissions.EasyPermissions
|
||||
import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks
|
||||
import java.lang.ref.WeakReference
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.util.Arrays
|
||||
import java.util.Date
|
||||
import java.util.*
|
||||
import java.util.stream.Collectors
|
||||
|
||||
@Route(path = ARouteConstants.ROOM_DETAILS)
|
||||
@@ -915,6 +854,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 发红包
|
||||
fun redDialogView(){
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).navigation();
|
||||
|
||||
RedBagSendDialog(this).show()
|
||||
// 在Activity中使用
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
super.initView()
|
||||
floatingMagnetView = findViewById(R.id.flaoat)
|
||||
@@ -977,6 +925,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
val fragment = HourlyChartDialog.newInstance()
|
||||
fragment.show(supportFragmentManager, "HourlyChartDialog")
|
||||
}
|
||||
|
||||
mBinding!!.drvRed.visibility = View.GONE
|
||||
mBinding!!.redBj.setOnClickListener {
|
||||
val redListDialog = RedListDialog(this)
|
||||
redListDialog.show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun onGiftGiveProgressClcik() {
|
||||
@@ -997,6 +951,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
override fun onNext(auctionListBean: AuctionListBean) {
|
||||
if (auctionListBean == null) {
|
||||
// 处理空响应
|
||||
Log.e("RoomActivity", "AuctionListBean is null")
|
||||
hideGiftGiveProgress()
|
||||
return
|
||||
}
|
||||
showGiftGiveProgress()
|
||||
}
|
||||
|
||||
@@ -3226,7 +3186,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
val text = etContent.text.toString()
|
||||
if (TextUtils.isEmpty(text)) {
|
||||
ToastUtils.show("发送消息不哪呢过为空")
|
||||
ToastUtils.show("发送消息不能为空")
|
||||
return@OnClickListener
|
||||
}
|
||||
EventBus.getDefault().post(RoomInputEvent(text))
|
||||
@@ -4314,7 +4274,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
stopkeepLiveService() //停止service
|
||||
CommonAppContext.getInstance().onlineMap.clear()
|
||||
|
||||
ImageUtils.clearDiskCache(this)
|
||||
// ImageUtils.clearDiskCache(this)
|
||||
} catch (e: Exception) {
|
||||
LogUtils.e("cleanupResources error: " + e.message)
|
||||
}
|
||||
|
||||
@@ -483,8 +483,8 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
if (shouldAddToAdapter(data)) {
|
||||
super.addData(data);
|
||||
// 确保适配器数据量也不超过限制
|
||||
if (mData.size() > 20) {
|
||||
int removeCount = mData.size() - 20;
|
||||
if (mData.size() > 100) {
|
||||
int removeCount = mData.size() - 100;
|
||||
mData.subList(0, removeCount).clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@@ -515,8 +515,8 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
}
|
||||
|
||||
private void trimListToMaxSize(List<EMMessageInfo> list) {
|
||||
if (list.size() > 20) {
|
||||
int removeCount = list.size() - 20;
|
||||
if (list.size() > 100) {
|
||||
int removeCount = list.size() - 100;
|
||||
list.subList(0, removeCount).clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
|
||||
}
|
||||
|
||||
public int getSelectCount() {
|
||||
int count = 1;
|
||||
int count = 0;
|
||||
List<RewardUserBean> data = getData();
|
||||
for (RewardUserBean item : data) {
|
||||
if (!item.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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.RedResultBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomHourBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class RedAdapter extends BaseQuickAdapter<RedResultBean.RedBean, BaseViewHolder> {
|
||||
public RedAdapter() {
|
||||
super(R.layout.item_red);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder baseViewHolder, RedResultBean.RedBean redBean) {
|
||||
ImageUtils.loadHeadCC(redBean.getRedUserAvatar(), baseViewHolder.getView(R.id.red_user_avatar));
|
||||
baseViewHolder.setText(R.id.tv_user_name, redBean.getRedUserName());
|
||||
baseViewHolder.setText(R.id.tv_red_num, redBean.getRedNum()+"");
|
||||
baseViewHolder.setText(R.id.tv_time, redBean.getRedTime());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
|
||||
/**
|
||||
* 红包的列表适配器
|
||||
*/
|
||||
public class RedBagAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
public RedBagAdapter() {
|
||||
super(R.layout.item_red_bag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, String item) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,8 @@ public class RoomSettingAdapter extends BaseMultiItemQuickAdapter<RoomSettingBea
|
||||
return com.xscm.moduleutil.R.mipmap.ic_report;
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen:
|
||||
return b ? com.xscm.moduleutil.R.mipmap.ic_close_floating_screen : com.xscm.moduleutil.R.mipmap.ic_open_floating_screen;
|
||||
// case RoomSettingBean.QXRoomSettingTypeRoomFloatingRed:
|
||||
// return com.xscm.moduleutil.R.mipmap.red_tx;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.example.moduleroom.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
public class RedEnvelopesContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
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.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
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;//红包类型 0:普通红包 1:口令红包
|
||||
private int redTime;//开奖倒计时 0:立刻 1:1分钟;2:2分钟;5:5分钟 10:10分钟(这里传递给服务的时候,需要乘60)
|
||||
private int redGold;//红包类型 0:金币红包 1:钻石红包
|
||||
private int redCount;//条件 0:无 1:收藏房间 2:仅麦上用户
|
||||
|
||||
public RedBagSendDialog(@NonNull @NotNull Context context) {
|
||||
super(context, com.xscm.moduleutil.R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_red_bag_send;
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
setView(1);
|
||||
mBinding.imHelp.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (type!=3){
|
||||
setView(3);
|
||||
setWebView("https://www.baidu.com");
|
||||
}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("下一步")){
|
||||
setView(2);
|
||||
setFRed();
|
||||
}else {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.rgXz.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
if (checkedId==R.id.bt_pt){
|
||||
redType=0;
|
||||
mBinding.lKl.setVisibility(GONE);
|
||||
}else if (checkedId==R.id.bt_kl){
|
||||
redType=1;
|
||||
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=0;
|
||||
} 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=1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 设置点击监听器
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
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==0){
|
||||
mBinding.tvJeTitle.setText("-"+"金币可用");
|
||||
mBinding.tvJ.setText("金币");
|
||||
}else if (redGold==1){
|
||||
mBinding.tvJeTitle.setText("-"+"钻石可用");
|
||||
mBinding.tvJ.setText("钻石");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
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.widget.dialog.BaseDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 这是红包列表
|
||||
*/
|
||||
public class RedListDialog extends BaseDialog<DialogRedListBinding> {
|
||||
|
||||
RedBagAdapter redBagAdapter;
|
||||
|
||||
public RedListDialog(@NonNull Context context) {
|
||||
super(context, com.xscm.moduleutil.R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_red_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
|
||||
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_60);
|
||||
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);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("1");
|
||||
list.add("2");
|
||||
list.add("3");
|
||||
list.add("4");
|
||||
list.add("5");
|
||||
list.add("4");
|
||||
list.add("5");
|
||||
list.add("4");
|
||||
list.add("5");
|
||||
list.add("4");
|
||||
list.add("5");
|
||||
redBagAdapter.setNewData(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Resources getResources() {
|
||||
return getContext().getResources();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,6 +54,7 @@ import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.dialog.RechargeDialogFragment;
|
||||
import com.xscm.moduleutil.dialog.WebViewDialog;
|
||||
import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryDialog;
|
||||
@@ -404,7 +405,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
oldSelectedIds.addAll(gifyuseradapter.getAllSelectedIds());
|
||||
} else if (view1.getId() == R.id.tv_bb_qs) {
|
||||
int count = gifyuseradapter.getSelectCount();
|
||||
if (count < 0) {
|
||||
if (count <=0) {
|
||||
ToastUtils.show("请选择打赏的用户");
|
||||
return;
|
||||
}
|
||||
@@ -419,10 +420,24 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
auction_id = "";
|
||||
}
|
||||
}
|
||||
MvpPre.getGiftPack(roomId, gifyuseradapter.getUserIdToString(), heart_id, auction_id);
|
||||
queren();
|
||||
}
|
||||
}
|
||||
|
||||
private void queren() {
|
||||
// 创建并显示确认对话框
|
||||
new ConfirmDialog(getActivity(),
|
||||
"提示",
|
||||
"是否确认将背包礼物全部送出?",
|
||||
"确认",
|
||||
"取消",
|
||||
v -> {
|
||||
// 点击“确认”按钮时执行删除操作
|
||||
MvpPre.getGiftPack(roomId, gifyuseradapter.getUserIdToString(), heart_id, auction_id);
|
||||
},
|
||||
v -> {
|
||||
// 点击“取消”按钮时什么都不做
|
||||
}, false, 0).show();
|
||||
}
|
||||
private String giftNumber = "";
|
||||
private RoomGiftGiveEvent roomGiftGiveEvent;
|
||||
|
||||
@@ -474,8 +489,14 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
|
||||
FragmentManager fm = getParentFragmentManager();
|
||||
if (fm != null && !fm.isDestroyed()) {
|
||||
if (jingp==1){
|
||||
auction_id= userInfo.getAuction_id() ;
|
||||
}
|
||||
if (auction_id==null || auction_id.isEmpty()){
|
||||
auction_id="";
|
||||
}
|
||||
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
|
||||
String.valueOf(gift.getGift_bag()), roomId, userId, heart_id);
|
||||
String.valueOf(gift.getGift_bag()), roomId, userId, heart_id,auction_id);
|
||||
newDialog.show(fm, "GiftLotteryDialog");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -789,7 +810,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
|
||||
@Override
|
||||
public void roomAuctionJoin(RoomAuction.AuctionListBean auctionListBean) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("竞拍成功");
|
||||
// com.blankj.utilcode.util.ToastUtils.showShort("竞拍成功");
|
||||
if (roomGiftGiveEvent != null) {
|
||||
EventBus.getDefault().post(roomGiftGiveEvent);
|
||||
roomGiftGiveEvent = null;
|
||||
|
||||
@@ -3,12 +3,10 @@ package com.example.moduleroom.dialog;
|
||||
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomOrderMic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.*;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
@@ -42,6 +40,7 @@ import com.xscm.moduleutil.bean.room.RoomSettingBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import com.xscm.moduleutil.view.QXRedBagSendView;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@@ -163,6 +162,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
dataList.add(new RoomSettingBean("背景图片", "ic_bg_image", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgImage, read, isSelected, false, false));
|
||||
|
||||
dataList.add(new RoomSettingBean("更多操作", null, null, null, -1, read, isSelected, false, false));
|
||||
// dataList.add(new RoomSettingBean("发红包", "ic_red", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingRed, read, isSelected, false, false));
|
||||
dataList.add(new RoomSettingBean("离开房间", "ic_leave", null, null, RoomSettingBean.QXRoomSettingTypeRoomLeave, read, isSelected, false, false));
|
||||
// dataList.add(new RoomSettingBean("分享房间", "ic_share", null, null, RoomSettingBean.QXRoomSettingTypeRoomShare, read, isSelected, false, false));
|
||||
dataList.add(new RoomSettingBean("调音台", "ic_my_dress", null, null, RoomSettingBean.QXRoomSettingTypeRoomMyDress, read, isSelected, false, false));
|
||||
@@ -320,6 +320,15 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
}
|
||||
upAdapter();
|
||||
}
|
||||
// else if (bean.getType()==RoomSettingBean.QXRoomSettingTypeRoomFloatingRed){
|
||||
//
|
||||
// if (getActivity() instanceof RoomActivity) {
|
||||
// ((RoomActivity) getActivity()).redDialogView();
|
||||
// }
|
||||
// dismiss();
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -48,11 +48,9 @@ import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.ClickUtils;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.StringUtil;
|
||||
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
||||
import com.xscm.moduleutil.widget.RoomSingSongWheatView;
|
||||
import com.xscm.moduleutil.widget.SharedViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -1707,7 +1705,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
topIsAnimate = false;
|
||||
centerIsAnimate = false;
|
||||
bottomIsAnimate = false;
|
||||
ImageUtils.clearDiskCache(getActivity());
|
||||
// 停止倒计时器
|
||||
releaseCountDownTimer();
|
||||
|
||||
@@ -1722,6 +1719,12 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
dialogFragment.dismissAllowingStateLoss();
|
||||
dialogFragment = null;
|
||||
}
|
||||
// // 将磁盘缓存清理放在后台线程执行
|
||||
// new Thread(() -> {
|
||||
// if (getActivity() != null) {
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
// }
|
||||
// }).start();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.example.moduleroom.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
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.example.moduleroom.R;
|
||||
import com.example.moduleroom.databinding.FragmentRedEnvelopesBinding;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.view.QXRedBagSendView;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author xscm
|
||||
* @ClassName RedEnvelopesFragment
|
||||
* @Description 抢红包的dialog
|
||||
* @Date 2021/12/28 10:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class RedEnvelopesFragment extends BaseDialog<FragmentRedEnvelopesBinding> {
|
||||
public RedEnvelopesFragment(@NonNull @NotNull Context context) {
|
||||
super(context, com.xscm.moduleutil.R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
|
||||
@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);
|
||||
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) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).navigation();
|
||||
|
||||
// QXRedBagSendView redBagView = new QXRedBagSendView(getContext());
|
||||
// redBagView.showInView((ViewGroup) getWindow().getDecorView());
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.fragment_red_envelopes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.moduleroom.fragment;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class RedViewModel extends ViewModel {
|
||||
// TODO: Implement the ViewModel
|
||||
}
|
||||
@@ -1674,7 +1674,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
}
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upTop();
|
||||
ImageUtils.clearDiskCache(getActivity());
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
}
|
||||
isButtonsInflated = false;
|
||||
releaseCountDownTimer();
|
||||
|
||||
@@ -830,7 +830,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
|
||||
public void releaseResources(){
|
||||
releaseCountDownTimer();
|
||||
ImageUtils.clearDiskCache(getActivity());
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
if (mediaProjection[0] != null) {
|
||||
mediaProjection[0].stop();
|
||||
mediaProjection[0] = null;
|
||||
|
||||
@@ -355,7 +355,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
ImageUtils.clearDiskCache(getActivity());
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
// 释放SVGA动画资源
|
||||
if (mBinding != null && mBinding.svgaNobility != null) {
|
||||
mBinding.svgaNobility.release();
|
||||
|
||||
@@ -612,7 +612,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
ImageUtils.clearDiskCache(getActivity());
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
}
|
||||
|
||||
//开始旋转
|
||||
|
||||
@@ -1765,7 +1765,6 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
releaseCountDownTimer();
|
||||
ImageUtils.clearDiskCache(getActivity());
|
||||
if (wheatLayoutSingManager != null) {
|
||||
wheatLayoutSingManager.release();
|
||||
}
|
||||
@@ -1783,7 +1782,12 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
if (MvpPre != null) {
|
||||
MvpPre.detachView();
|
||||
}
|
||||
|
||||
// 将磁盘缓存清理放在后台线程执行
|
||||
// new Thread(() -> {
|
||||
// if (getActivity() != null) {
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
// }
|
||||
// }).start();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.example.moduleroom.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.example.moduleroom.contacts.RedEnvelopesContacts;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
public class RedEnvelopesPresenter extends BasePresenter<RedEnvelopesContacts.View> implements RedEnvelopesContacts.IRoomPre{
|
||||
public RedEnvelopesPresenter(RedEnvelopesContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,6 +47,44 @@
|
||||
|
||||
</com.xscm.moduleutil.widget.DropHourlView>
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.DropRedView
|
||||
android:id="@+id/drv_red"
|
||||
android:layout_width="@dimen/dp_65"
|
||||
android:layout_height="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_160"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible"
|
||||
android:elevation="4dp"
|
||||
android:visibility="invisible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/red_bj"
|
||||
android:layout_width="@dimen/dp_58"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:src="@mipmap/red_bj"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/red_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_marginStart="-20dp"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
tools:text="x0"
|
||||
android:textColor="#FFFEB2"
|
||||
android:textSize="14sp"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
|
||||
</com.xscm.moduleutil.widget.DropRedView>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="0dp"
|
||||
@@ -131,42 +169,6 @@
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_10"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_15"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- app:layout_constraintBottom_toTopOf="@+id/ll_bottom"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/room_top">-->
|
||||
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/vp_room_pager"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="2"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_5"-->
|
||||
<!-- android:clipChildren="false"-->
|
||||
<!-- android:clipToPadding="false" />-->
|
||||
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/ease_container"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_5"-->
|
||||
<!-- android:minHeight="@dimen/dp_80">-->
|
||||
|
||||
<!-- <com.xscm.moduleutil.widget.AvatarFrameView-->
|
||||
<!-- android:id="@+id/svga_ride"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:minHeight="@dimen/dp_80" />-->
|
||||
<!-- </FrameLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<com.xscm.moduleutil.widget.RoomMessageInputMenu
|
||||
android:id="@+id/input_menu1"
|
||||
android:layout_width="0dp"
|
||||
@@ -551,9 +553,6 @@
|
||||
</com.xscm.moduleutil.widget.DropViewRoom>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.floatingView.Floa
|
||||
android:id="@+id/flaoat"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
|
||||
628
moduleroom/src/main/res/layout/dialog_red_bag_send.xml
Normal file
@@ -0,0 +1,628 @@
|
||||
<?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="454dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/red_f_bj"
|
||||
app:layout_constraintTop_toTopOf="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_15"
|
||||
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_15"
|
||||
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_15"
|
||||
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_15"
|
||||
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_15"
|
||||
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"
|
||||
/>
|
||||
|
||||
<!-- 金额 -->
|
||||
<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"
|
||||
>
|
||||
|
||||
<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: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: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"
|
||||
>
|
||||
|
||||
<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: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: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">
|
||||
|
||||
<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">
|
||||
|
||||
<!-- 无 -->
|
||||
<Button
|
||||
android:id="@+id/bt_none"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="无"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
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="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="收藏房间"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
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="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="仅麦上用户"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
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"
|
||||
>
|
||||
|
||||
<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: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>
|
||||