修改BUG
This commit is contained in:
@@ -63,7 +63,7 @@ public class PolicyDialog extends Dialog {
|
||||
ds.setUnderlineText(true);
|
||||
}
|
||||
};
|
||||
spanUtils.append("欢迎使用羽声!\n").append("在使用我们的产品和服务之前,请您先阅读并了解").append("《用户协议》").setClickSpan(clickSpan).append("和").append("《隐私协议》").setClickSpan(ysClickSpan).append("。我们将严格按照上述协议为" +
|
||||
spanUtils.append("欢迎使用秘地!\n").append("在使用我们的产品和服务之前,请您先阅读并了解").append("《用户协议》").setClickSpan(clickSpan).append("和").append("《隐私协议》").setClickSpan(ysClickSpan).append("。我们将严格按照上述协议为" +
|
||||
"您提供服务,保护您的信息安全,点" +
|
||||
"击“同意”即表示您已阅读并同意全部" +
|
||||
"条款,可以继续使用我们的产品和服" +
|
||||
|
||||
@@ -4,8 +4,10 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@@ -39,12 +41,27 @@ import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity;
|
||||
public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
|
||||
String mUrl;
|
||||
int type;//10:天空之境 11:岁月之城 12:时空之巅
|
||||
|
||||
public WebViewDialog(@NonNull Context context,String url) {
|
||||
public WebViewDialog(@NonNull Context context, Bundle args) {
|
||||
super(context, R.style.BaseDialogStyleH);
|
||||
this.mUrl=url;
|
||||
this.mUrl = args.getString("url");
|
||||
this.type = args.getInt("type");
|
||||
initData1();
|
||||
}
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (getWindow() != null) {
|
||||
// 获取屏幕尺寸
|
||||
android.util.DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
|
||||
// 设置高度为屏幕高度的80%
|
||||
android.view.WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.height = (int) (displayMetrics.heightPixels * 0.7);
|
||||
params.width = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
getWindow().setAttributes(params);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.web_view_dialog;
|
||||
@@ -52,19 +69,34 @@ public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
setCancelable(true);
|
||||
setCanceledOnTouchOutside(true);
|
||||
Window window = getWindow();
|
||||
assert window != null;
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 320.f / 375), WindowManager.LayoutParams.MATCH_PARENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
//
|
||||
}
|
||||
|
||||
if (type==10){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.tkzj);
|
||||
mBinding.imGz.setImageResource(R.mipmap.tkzj_gz);
|
||||
}else if (type==11){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.syzc);
|
||||
mBinding.imGz.setImageResource(R.mipmap.syzc_gz);
|
||||
}else if (type==12){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.skzj);
|
||||
mBinding.imGz.setImageResource(R.mipmap.skzj_gz);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void initData1() {
|
||||
WebSettings webSettings = mBinding.webView.getSettings();
|
||||
webSettings.setUseWideViewPort(true);
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class GiftLotteryAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolde
|
||||
helper.setText(R.id.tv_gift_time, item.getCreatetime());
|
||||
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.iv_gift_image));
|
||||
// 使用 SpannableString 给 "x4" 设置不同颜色
|
||||
TextView giftNameTextView = helper.getView(R.id.tv_gift_name);
|
||||
TextView giftNameTextView = helper.getView(R.id.gift_name);
|
||||
TextView nickNameTextView = helper.getView(R.id.tv_user_name);
|
||||
if (giftNameTextView != null) {
|
||||
String baseName = item.getGift_name();
|
||||
|
||||
@@ -34,5 +34,7 @@ public class GiftLotteryContacts {
|
||||
void giftSend(String send_id);
|
||||
|
||||
void wallet();
|
||||
|
||||
void xlh(String room_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,8 +332,13 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
} else if (id == R.id.sw_tex) {//特效
|
||||
isOpenSpecial = mBinding.mirroeSky.swTex.isChecked();
|
||||
} else if (id == R.id.tv_gz) {//规则
|
||||
WebViewDialog webViewDialog = new WebViewDialog(getActivity(), getRule_url);
|
||||
webViewDialog.show();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", getRule_url);
|
||||
bundle.putInt("type", type);
|
||||
WebViewDialog dialog = new WebViewDialog(getActivity(), bundle);
|
||||
dialog.show();
|
||||
// WebViewDialog webViewDialog = new WebViewDialog(getActivity(), getRule_url);
|
||||
// webViewDialog.show();
|
||||
} else if (id == R.id.tv_jc) {
|
||||
if (giftLists != null && !giftLists.isEmpty()) {
|
||||
PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity());
|
||||
@@ -351,6 +356,8 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
|
||||
giftLotteryDialogFragment = GiftLotteryDialogFragment.newInstance(giftBagId);
|
||||
giftLotteryDialogFragment.show(getChildFragmentManager(), "GiftLotteryDialogFragment");
|
||||
}else if (id == R.id.tv_start){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,6 +586,8 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
@Override
|
||||
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
|
||||
if (blindBoxBean != null && blindBoxBean.getGift_list() != null) {
|
||||
|
||||
upTitle(blindBoxBean.getBox_price());
|
||||
giftLists = blindBoxBean.getGift_list();
|
||||
getRule_url = blindBoxBean.getRule_url();
|
||||
// 确保数据数量不超过视图数量
|
||||
@@ -616,7 +625,25 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void upTitle(int boxPrice){
|
||||
if (type==10){
|
||||
mBinding.mirroeSky.oneTitle.setText(boxPrice+"币一次");
|
||||
mBinding.mirroeSky.tenTitle.setText((boxPrice*10)+"币十次");
|
||||
mBinding.mirroeSky.hundredTitle.setText((boxPrice*100)+"币十次");
|
||||
}else if (type==11){
|
||||
mBinding.cityTime.oneTitle.setText(boxPrice+"币一次");
|
||||
mBinding.cityTime.tenTitle.setText((boxPrice*10)+"币十次");
|
||||
mBinding.cityTime.hundredTitle.setText((boxPrice*100)+"币十次");
|
||||
|
||||
}else if (type==12){
|
||||
mBinding.pinnacleTime.oneTitle.setText(boxPrice+"币一次");
|
||||
mBinding.pinnacleTime.tenTitle.setText((boxPrice*10)+"币十次");
|
||||
mBinding.pinnacleTime.hundredTitle.setText((boxPrice*100)+"币十次");
|
||||
}
|
||||
}
|
||||
|
||||
private void UpView(BlindBoxBean.XlhData xlhData) {
|
||||
if (xlhData != null) {
|
||||
|
||||
@@ -739,7 +766,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMusicPlay(RoomMessageEvent message) {
|
||||
if (message.getMsgType() == 1056){
|
||||
UpView(message.getText().getXlh_Data());
|
||||
UpView(message.getText().getXlh_data());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
@@ -39,6 +40,7 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
private String giftBagId;
|
||||
private int type=1;
|
||||
private GiftLotteryAdapter adapter;
|
||||
private GiftRecordAdapte giftRecordAdapte;
|
||||
private List<GiftBean> data=new ArrayList<>();
|
||||
|
||||
@Override
|
||||
@@ -147,16 +149,11 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
columns = 3;
|
||||
}
|
||||
adapter=new GiftLotteryAdapter();
|
||||
giftRecordAdapte=new GiftRecordAdapte();
|
||||
|
||||
// PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
|
||||
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
mBinding.recyclerView.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.recyclerView);
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
dianj(1);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
@@ -169,10 +166,20 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
}
|
||||
public void dianj(int type1){
|
||||
if (type1==1) {
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
mBinding.recyclerView.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.recyclerView);
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
type=1;
|
||||
setTextViewStyle(mBinding.textView2, false);
|
||||
setTextViewStyle(mBinding.textView1, true);
|
||||
}else if (type1==2){
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
|
||||
mBinding.recyclerView.setAdapter(giftRecordAdapte);
|
||||
type=2;
|
||||
setTextViewStyle(mBinding.textView2, true);
|
||||
setTextViewStyle(mBinding.textView1, false);
|
||||
@@ -227,15 +234,16 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
|
||||
@Override
|
||||
public void getAllRecordSuccess(List<GiftBean> data) {
|
||||
|
||||
if (data != null){
|
||||
if (page==1){
|
||||
adapter.setNewData(data);
|
||||
giftRecordAdapte.setNewData(data);
|
||||
}else {
|
||||
adapter.addData(data);
|
||||
giftRecordAdapte.addData(data);
|
||||
}
|
||||
}else {
|
||||
if (page == 1) {
|
||||
adapter.setNewData(null);
|
||||
giftRecordAdapte.setNewData(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,9 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlh(String room_id) {
|
||||
// api.xlh(room_id, new BaseObserver<String>() {)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.GiftAdapter;
|
||||
@@ -48,7 +49,7 @@ public class PrizePoolDialog extends BaseDialog<DialogPrizePoolBinding> {
|
||||
android.util.DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
|
||||
// 设置高度为屏幕高度的80%
|
||||
android.view.WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.height = (int) (displayMetrics.heightPixels * 0.8);
|
||||
params.height = (int) (displayMetrics.heightPixels * 0.7);
|
||||
params.width = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
getWindow().setAttributes(params);
|
||||
}
|
||||
@@ -94,13 +95,13 @@ public class PrizePoolDialog extends BaseDialog<DialogPrizePoolBinding> {
|
||||
float density = mContext.getResources().getDisplayMetrics().density;
|
||||
|
||||
if (density <= 2.0) { // 低密度屏幕(如mdpi, hdpi)
|
||||
rows = 5;
|
||||
rows = 4;
|
||||
columns = 3;
|
||||
} else if (density <= 3.0) { // 中密度屏幕(如xhdpi)
|
||||
rows = 5;
|
||||
rows = 4;
|
||||
columns = 3;
|
||||
} else { // 高密度屏幕(如xxhdpi, xxxhdpi)
|
||||
rows = 5;
|
||||
rows = 4;
|
||||
columns = 3;
|
||||
}
|
||||
|
||||
@@ -108,12 +109,13 @@ public class PrizePoolDialog extends BaseDialog<DialogPrizePoolBinding> {
|
||||
this.gift_list = newData;
|
||||
if (mBinding != null && mContext != null) {
|
||||
PrizePoolAdapter prizePoolAdapter = new PrizePoolAdapter();
|
||||
PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 3);
|
||||
// PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
|
||||
mBinding.gvGift.setLayoutManager(layoutManager);
|
||||
mBinding.gvGift.setOnFlingListener(null);
|
||||
// mBinding.gvGift.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.gvGift);
|
||||
// PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
// pageSnapHelper.attachToRecyclerView(mBinding.gvGift);
|
||||
mBinding.gvGift.setAdapter(prizePoolAdapter);
|
||||
prizePoolAdapter.setNewData(gift_list);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.databinding.FragmentTourClubDialogBinding;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPresenter, FragmentTourClubDialogBinding> implements GiftLotteryContacts.View {
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
return new GiftLotteryPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.tvJc.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id==R.id.tv_jc){
|
||||
// if (giftLists != null && !giftLists.isEmpty()) {
|
||||
// PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity());
|
||||
// prizePoolDialog.updateData(giftLists, type);
|
||||
// prizePoolDialog.show();
|
||||
// } else {
|
||||
// com.hjq.toast.ToastUtils.show("奖池数据加载中,请稍后再试");
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_tour_club_dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGiftListSuccess(BlindReslutBean blindReslutBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMyRecordSuccess(List<GiftBean> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllRecordSuccess(List<GiftBean> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefreshLoadMore() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.databinding.DialogHeavenGiftBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogXlhObtainBinding;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/2
|
||||
*@description: 巡乐会恭喜或得礼弹窗
|
||||
*/
|
||||
public class XlhObtainDialog extends BaseDialog<DialogXlhObtainBinding> {
|
||||
public XlhObtainDialog(@NonNull Context context) {
|
||||
super(context,R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_xlh_obtain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.xlhClose.setOnClickListener(v -> dismiss());
|
||||
mBinding.ivAgain.setOnClickListener(v -> dismiss());///在玩一次
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user