1:修改头像截取设置默认宽高
2:修改首页默认展示房间列表tab 3:修改创建房间,提示需要签约10个徒弟的功能 4:修改注销用户的时候,当有手机号的时候,进行二次验证码确认 5:首页推荐房间弹框
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/8 16:30
|
||||
* 用途:首页弹框推荐房间
|
||||
*/
|
||||
class IndexRecommendRoom {
|
||||
var room_id: String? = ""
|
||||
var user_id: String? =""
|
||||
var room_name: String? = ""
|
||||
var room_cover: String? = ""
|
||||
|
||||
/* "id": "string",
|
||||
"user_id": "string",
|
||||
"room_name": "string",
|
||||
"room_cover": "string"*/
|
||||
}
|
||||
@@ -21,5 +21,6 @@ public class RoomTypeModel {
|
||||
private String label_name;
|
||||
private String type;
|
||||
private String sort;
|
||||
private int default_index; //1 选中 0 未选中
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
private int charm_level; //魅力等级
|
||||
private int is_use_code; //是否是靓号 0否 1是
|
||||
private String tencent_im;
|
||||
private String token;
|
||||
private String jia_jia;//坐骑
|
||||
private int is_in_pit;//是否在麦上,1在0不在
|
||||
private int is_open_live_remind;//是否设置开播提醒
|
||||
@@ -70,6 +71,7 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
|
||||
private RelationshipBean qinmi;
|
||||
private RelationshipBean zhenai;
|
||||
private String mobile;//手机号
|
||||
|
||||
private int heartId; // "heartId": 4,
|
||||
private int heartNum; //
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
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.DialogInviteBinding;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
/**
|
||||
*@author lxj
|
||||
*@data 2025年5月14日
|
||||
*@description: 房间邀请弹窗
|
||||
*/
|
||||
public class InviteDialog extends BaseDialog<DialogInviteBinding> {
|
||||
public InviteDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_invite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -398,13 +398,16 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_MY_CP_ROOM_LIST)
|
||||
Call<BaseModel<List<MyCpRoom>>> myCpRoom();
|
||||
|
||||
@GET(Constants.CHECK_CREATE_ROOM)
|
||||
Call<BaseModel<String>> checkCreateRoom();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.CLEAR_LOGIN_INFO)
|
||||
Call<BaseModel<String>> clearLoginInfo(@Field("token") String token);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.CANCEL)
|
||||
Call<BaseModel<String>> cancel(@Field("token") String token);
|
||||
Call<BaseModel<String>> cancel(@Field("token") String token,@Field("sms_code")String sms_code);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_MODIFY_HIDE_STATUS)
|
||||
@@ -540,6 +543,9 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_ACTIVITIES_PERMISSION)
|
||||
Call<BaseModel<ActivitiesPermission>> activitiesPermission();
|
||||
|
||||
@GET(Constants.GET_INDEX_RECOMMEND_ROOM)
|
||||
Call<BaseModel<IndexRecommendRoom>> index_recommend_room();
|
||||
|
||||
@GET(Constants.GET_DAY_DROP_GIFT)
|
||||
Call<BaseModel<HeavenGiftBean>> getDayDropGift();
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ public class RetrofitClient {
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
} else {
|
||||
observer.onNext(baseModel.getMsg());
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2338,6 +2338,39 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void check_create_room(BaseObserver<String> observer){
|
||||
sApiServer.checkCreateRoom().enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<String> stringBaseModel = response.body();
|
||||
if (stringBaseModel.getCode() == 1) {
|
||||
observer.onNext("");
|
||||
}else if (stringBaseModel.getCode() == 0) {
|
||||
com.hjq.toast.ToastUtils.show(stringBaseModel.getMsg());
|
||||
}else if(stringBaseModel.getCode()==301){
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
ToastUtils.showShort(stringBaseModel.getMsg());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
LogUtils.e("check_create_room", response.message());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
LogUtils.e("check_create_room", t);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void startPk(String pk_id, String pk_times, BaseObserver<String> observer) {
|
||||
sApiServer.startPk(pk_id, pk_times).enqueue(new Callback<ResponseBody>() {
|
||||
@Override
|
||||
@@ -2389,6 +2422,7 @@ public class RetrofitClient {
|
||||
if (activitiesPermissionBaseModel.getCode() == 1) {
|
||||
observer.onNext(activitiesPermissionBaseModel.getData());
|
||||
} else if (activitiesPermissionBaseModel.getCode() == 0) {
|
||||
observer.onNext(new ActivitiesPermission());
|
||||
ToastUtils.showShort(activitiesPermissionBaseModel.getMsg());
|
||||
} else if (activitiesPermissionBaseModel.getCode() == 301) {
|
||||
try {
|
||||
@@ -2408,6 +2442,36 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void index_recommend_room(BaseObserver<IndexRecommendRoom> observer) {
|
||||
sApiServer.index_recommend_room().enqueue(new Callback<BaseModel<IndexRecommendRoom>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<IndexRecommendRoom>> call, Response<BaseModel<IndexRecommendRoom>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<IndexRecommendRoom> indexRecommendRoomBaseModel = response.body();
|
||||
if (indexRecommendRoomBaseModel.getCode() == 1) {
|
||||
observer.onNext(indexRecommendRoomBaseModel.getData());
|
||||
} else if (indexRecommendRoomBaseModel.getCode() == 0) {
|
||||
ToastUtils.showShort(indexRecommendRoomBaseModel.getMsg());
|
||||
} else if (indexRecommendRoomBaseModel.getCode() == 301) {
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
ToastUtils.showShort(indexRecommendRoomBaseModel.getMsg());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<IndexRecommendRoom>> call, Throwable t) {
|
||||
LogUtils.e("首页房间推荐",t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void wallet(BaseObserver<WalletBean> observer) {
|
||||
sApiServer.wallet().enqueue(new Callback<BaseModel<WalletBean>>() {
|
||||
@Override
|
||||
@@ -3847,8 +3911,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void cancel(BaseObserver<String> observer) {
|
||||
sApiServer.cancel(SpUtil.getToken()).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void cancel(String sms_code,BaseObserver<String> observer) {
|
||||
sApiServer.cancel(SpUtil.getToken(),sms_code).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
|
||||
@@ -335,6 +335,7 @@ public class Constants {
|
||||
public static final String POST_AUCTION_MODE = "/api/RoomAuction/room_auction_mode";//修改房间竞拍模式
|
||||
public static final String POST_ROOM_AUCTION_LIST = "/api/RoomAuction/room_auction_list";//房间竞拍列表
|
||||
public static final String GET_MY_CP_ROOM_LIST = "/api/Room/my_cp_room";//我的Cp房
|
||||
public static final String CHECK_CREATE_ROOM = "/api/Room/check_create_room";//创建房间检测
|
||||
public static final String POST_SEARCH_PK_ROOM = "/api/RoomPk/search_pk_room";//搜索 或推荐的pk房间
|
||||
public static final String POST_SEND_PK = "/api/RoomPk/send_pk";//发起PK邀请
|
||||
public static final String ACCEPT_PK = "/api/RoomPk/accept_pk";//接受/拒绝 PK邀请
|
||||
@@ -383,6 +384,7 @@ public class Constants {
|
||||
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_INDEX_RECOMMEND_ROOM = "/api/Index/index_recommend_room";//首页弹窗推荐房间
|
||||
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
|
||||
|
||||
@@ -137,11 +137,11 @@ public class PictureSelectorUtil {
|
||||
public UCrop.Options buildOptions() {
|
||||
UCrop.Options options = new UCrop.Options();
|
||||
options.setHideBottomControls(true);//是否显示裁剪
|
||||
options.setFreeStyleCropEnabled(true);//裁剪是否可以拖动
|
||||
options.setFreeStyleCropEnabled(false);//裁剪是否可以拖动
|
||||
options.setShowCropFrame(true);//是否显示裁剪边缘
|
||||
options.setShowCropGrid(true);//是否显示裁剪网格
|
||||
options.setCircleDimmedLayer(false);//圆形头像裁剪
|
||||
options.withAspectRatio(1, 1);
|
||||
options.withAspectRatio(1, 1);//裁剪比例
|
||||
options.isCropDragSmoothToCenter(false);
|
||||
options.isForbidCropGifWebp(false);
|
||||
options.isForbidSkipMultipleCrop(true);
|
||||
|
||||
BIN
BaseModule/src/main/res/mipmap-hdpi/invite_bj.png
Normal file
BIN
BaseModule/src/main/res/mipmap-hdpi/invite_bj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
BIN
BaseModule/src/main/res/mipmap-xhdpi/invite_bj.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xhdpi/invite_bj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
BaseModule/src/main/res/mipmap-xxhdpi/invite_bj.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xxhdpi/invite_bj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB |
@@ -1,14 +1,22 @@
|
||||
package com.xscm.modulemain
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import com.blankj.utilcode.util.AppUtils
|
||||
import com.blankj.utilcode.util.CrashUtils
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.Utils
|
||||
import com.opensource.svgaplayer.utils.log.SVGALogger
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
||||
import com.scwang.smartrefresh.layout.header.ClassicsHeader
|
||||
import com.xscm.modulemain.dialog.InviteDialog
|
||||
import com.xscm.modulemain.widget.WheatLayoutSingManager
|
||||
import com.xscm.moduleutil.base.CommonAppContext
|
||||
import com.xscm.moduleutil.bean.IndexRecommendRoom
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
|
||||
open class Application : CommonAppContext() {
|
||||
@@ -19,6 +27,7 @@ open class Application : CommonAppContext() {
|
||||
var CRASHUTILS_SAVE_PATH = ""
|
||||
|
||||
var isAgoraStop = false
|
||||
var inviteDialog: InviteDialog? = null
|
||||
|
||||
// 单例实例
|
||||
companion object {
|
||||
@@ -55,6 +64,33 @@ open class Application : CommonAppContext() {
|
||||
initLogUtils()
|
||||
initCrashUtils()
|
||||
initSmartRefreshLayout()
|
||||
AppUtils.registerAppStatusChangedListener(object : Utils.OnAppStatusChangedListener {
|
||||
override fun onForeground(activity: Activity?) {//应用切换到前台
|
||||
|
||||
if (!CommonAppContext.getInstance().isPlaying) {
|
||||
RetrofitClient.getInstance()
|
||||
.index_recommend_room(object : BaseObserver<IndexRecommendRoom>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: IndexRecommendRoom) {
|
||||
if (t != null) {
|
||||
inviteDialog = activity?.let { InviteDialog(it, t) }
|
||||
if (inviteDialog?.isShowing == false) {
|
||||
inviteDialog?.setData(t)
|
||||
inviteDialog?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackground(activity: Activity?) {//应用切换到后台
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun initLogUtils() {
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
package com.xscm.modulemain.activity.login.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.engine.CropFileEngine;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.luck.picture.lib.style.PictureSelectorStyle;
|
||||
import com.xscm.modulemain.R;
|
||||
@@ -25,10 +36,14 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
import com.xscm.moduleutil.widget.picker.PictureSelectorUtil;
|
||||
import com.yalantis.ucrop.UCrop;
|
||||
import com.yalantis.ucrop.UCropImageEngine;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -196,18 +211,65 @@ public class ImproveInfoActivity extends BaseMvpActivity<ImproveInfoPresenter, A
|
||||
private void startChoosePhoto(int mimeType, int requestCode) {
|
||||
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .setSelectorUIStyle(new PictureSelectorStyle())
|
||||
// .isGif(false)
|
||||
// .setImageEngine(GlideEngine.createGlideEngine())
|
||||
// .setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
// .setMaxSelectNum(1)
|
||||
// .isPreviewImage(true)
|
||||
// .isDisplayCamera(false)
|
||||
// .setOutputCameraDir(Constants.FILE_PATH)
|
||||
// .isOriginalSkipCompress(true)
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelectorUtil pictureSelectorUtil = new PictureSelectorUtil();
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.setSelectorUIStyle(new PictureSelectorStyle())
|
||||
.isGif(false)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(1)
|
||||
.isPreviewImage(true)
|
||||
.isPreviewImage(false)
|
||||
.isDisplayCamera(false)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setImageEngine(GlideEngine.createGlideEngine()) // 选择器展示不出图片则添加
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setCropEngine(new CropFileEngine() {
|
||||
@Override
|
||||
public void onStartCrop(Fragment fragment, Uri srcUri, Uri destinationUri, ArrayList<String> dataSource, int requestCode) {
|
||||
UCrop.Options options = pictureSelectorUtil.buildOptions();
|
||||
UCrop uCrop = UCrop.of(srcUri, destinationUri, dataSource);
|
||||
uCrop.withOptions(options);
|
||||
uCrop.setImageEngine(new UCropImageEngine() {
|
||||
@Override
|
||||
public void loadImage(Context context, String url, ImageView imageView) {
|
||||
Glide.with(context).load(url).override(180, 180).into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadImage(Context context, Uri url, int maxWidth, int maxHeight, OnCallbackListener<Bitmap> call) {
|
||||
Glide.with(context).asBitmap().load(url).override(maxWidth, maxHeight).into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @org.jetbrains.annotations.Nullable Transition<? super Bitmap> transition) {
|
||||
if (call != null) {
|
||||
call.onCall(resource);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@org.jetbrains.annotations.Nullable Drawable placeholder) {
|
||||
if (call != null) {
|
||||
call.onCall(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
uCrop.start(fragment.requireActivity(), fragment, requestCode);
|
||||
}
|
||||
})
|
||||
.forResult(requestCode);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,14 @@ import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.bean.FirstChargeBean;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.HeavenGiftBean;
|
||||
import com.xscm.moduleutil.bean.IndexRecommendRoom;
|
||||
import com.xscm.moduleutil.bean.PermissionPicBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
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.HeavenGiftDialog;
|
||||
import com.xscm.modulemain.dialog.InviteDialog;
|
||||
import com.xscm.moduleutil.dialog.NewPeopleDialog;
|
||||
import com.xscm.moduleutil.dialog.RechargeDialogFragment;
|
||||
import com.xscm.moduleutil.event.RoomOutEvent;
|
||||
@@ -91,6 +93,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
@Route(path = ARouteConstants.ME)
|
||||
public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBinding>
|
||||
implements HomeContacts.View, View.OnClickListener, LocationProvider.LocationCallback {
|
||||
@@ -114,6 +117,8 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
private int selectedTextColor = 0; // 选中文字颜色 (从服务器获取)
|
||||
private int unselectedTextColor = 0; // 未选中文字颜色 (从服务器获取)
|
||||
|
||||
private InviteDialog inviteDialog;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_main;
|
||||
@@ -494,6 +499,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
|
||||
MvpPre.activitiesPermission();//获取悬浮框权限
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void requestGpsPermissions() {
|
||||
@@ -637,6 +643,12 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
CommonAppContext.getInstance().onAppForeground();
|
||||
}
|
||||
|
||||
public void dialogUp(){
|
||||
if (!CommonAppContext.getInstance().isPlaying) {
|
||||
MvpPre.index_recommend_room();
|
||||
}
|
||||
}
|
||||
|
||||
private final Runnable mRivAnimationTask = () -> {
|
||||
Animation rivRotateAnimation = AnimationUtils.loadAnimation(MainActivity.this, com.xscm.moduleutil.R.anim.rotate_anim);
|
||||
mBinding.riv.startAnimation(rivRotateAnimation);
|
||||
@@ -768,6 +780,10 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
BackgroundManager.getInstance().setBackgroundUrl(themeBean.getApp_bg());
|
||||
loadNetworkBackground();
|
||||
}
|
||||
|
||||
if (themeBean.getTheme_color() != null) {
|
||||
ColorManager.getInstance().updateColors(themeBean.getTheme_color(), themeBean.getBtn_text_color());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -864,12 +880,22 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
}
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
mBinding.dvr.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void index_recommend_room(IndexRecommendRoom indexRecommendRoom) {
|
||||
|
||||
if (indexRecommendRoom != null) {
|
||||
inviteDialog = new InviteDialog(this, indexRecommendRoom);
|
||||
inviteDialog.setData(indexRecommendRoom);
|
||||
inviteDialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/10/12 天降好礼
|
||||
private void heavenGiftDialog() {
|
||||
HeavenGiftDialog heavenGiftDialog = new HeavenGiftDialog(this);
|
||||
|
||||
@@ -33,6 +33,8 @@ public final class HomeContacts {
|
||||
|
||||
void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission);
|
||||
|
||||
void index_recommend_room(IndexRecommendRoom indexRecommendRoom);
|
||||
|
||||
}
|
||||
|
||||
public interface IHomePre extends IPresenter {
|
||||
@@ -61,6 +63,7 @@ public final class HomeContacts {
|
||||
void getRoomOnline(String roomId, String page, String page_limit);//在线列表
|
||||
|
||||
void activitiesPermission();//活动弹框权限
|
||||
void index_recommend_room();//首页推荐房间
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,4 +414,22 @@ public class HomePresenter extends BasePresenter<HomeContacts.View> implements H
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void index_recommend_room() {
|
||||
api.index_recommend_room(new BaseObserver<IndexRecommendRoom>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(IndexRecommendRoom indexRecommendRoom) {
|
||||
if (MvpRef==null)
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
MvpRef.get().index_recommend_room(indexRecommendRoom);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,32 +61,32 @@ public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, Activ
|
||||
protected void convert(BaseViewHolder helper, NewsMessageList item) {
|
||||
String time = TimeUtils.getDateToStringNoZ(Long.parseLong(item.getCreatetime()) * 1000L);
|
||||
helper.setText(R.id.tv_sys_time, time);
|
||||
|
||||
if (item.getType() == 6) {
|
||||
// TODO: 2025/12/8 type==6,是工会邀请 type=7,是公会调整用户益调消息
|
||||
if (item.getType() == 6 || item.getType() == 7) {
|
||||
helper.getView(R.id.ll_system).setVisibility(GONE);
|
||||
helper.getView(R.id.ll_gh).setVisibility(VISIBLE);
|
||||
|
||||
helper.setText(R.id.tv_sys_cons, item.getContent());
|
||||
if (item.getGuild_invited_status()==0){
|
||||
if (item.getGuild_invited_status() == 0) {
|
||||
helper.getView(R.id.ll_but).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.tv_cancel2).setVisibility(GONE);
|
||||
}else if (item.getGuild_invited_status()==1){
|
||||
} else if (item.getGuild_invited_status() == 1) {
|
||||
helper.getView(R.id.ll_but).setVisibility(GONE);
|
||||
helper.getView(R.id.tv_cancel2).setVisibility(VISIBLE);
|
||||
helper.setText(R.id.tv_cancel2,"已同意");
|
||||
}else if (item.getGuild_invited_status()==2){
|
||||
helper.setText(R.id.tv_cancel2, "已同意");
|
||||
} else if (item.getGuild_invited_status() == 2) {
|
||||
helper.getView(R.id.ll_but).setVisibility(GONE);
|
||||
helper.getView(R.id.tv_cancel2).setVisibility(VISIBLE);
|
||||
helper.setText(R.id.tv_cancel2,"已拒绝");
|
||||
helper.setText(R.id.tv_cancel2, "已拒绝");
|
||||
}
|
||||
helper.getView(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MvpPre.postInvite(item.getId()+"","2");
|
||||
MvpPre.postInvite(item.getId() + "", "2");
|
||||
helper.getView(R.id.ll_but).setVisibility(GONE);
|
||||
helper.getView(R.id.tv_cancel2).setVisibility(VISIBLE);
|
||||
helper.setText(R.id.tv_cancel2,"已拒绝");
|
||||
helper.setText(R.id.tv_cancel2, "已拒绝");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -94,11 +94,11 @@ public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, Activ
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MvpPre.postInvite(item.getId()+"","1");
|
||||
MvpPre.postInvite(item.getId() + "", "1");
|
||||
helper.getView(R.id.ll_but).setVisibility(GONE);
|
||||
helper.getView(R.id.tv_cancel2).setVisibility(VISIBLE);
|
||||
helper.setText(R.id.tv_cancel2,"已同意");
|
||||
MvpPre.getMessagetitle(type, "1", "10");
|
||||
helper.setText(R.id.tv_cancel2, "已同意");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -174,6 +174,6 @@ public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, Activ
|
||||
|
||||
@Override
|
||||
public void postInvite() {
|
||||
|
||||
MvpPre.getMessagetitle(type, "1", "10");
|
||||
}
|
||||
}
|
||||
@@ -339,12 +339,19 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
}
|
||||
});
|
||||
|
||||
// 设置默认选中的标签
|
||||
// TODO: 2025/12/8 根据传递的参数, default_index,展示默认显示的位置,默认是0,有值的事1
|
||||
if (mBinding.slidingTabLayout.getTabCount() > 0) {
|
||||
mBinding.slidingTabLayout.selectTab(mBinding.slidingTabLayout.getTabAt(0));
|
||||
int defaultIndex = 0; // 默认选中第一项
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i).getDefault_index() == 1) {
|
||||
defaultIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mBinding.slidingTabLayout.selectTab(mBinding.slidingTabLayout.getTabAt(defaultIndex));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBanners(List<BannerModel> bannerModels) {
|
||||
|
||||
@@ -8,8 +8,10 @@ import android.view.View;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.modulemain.R;
|
||||
import com.xscm.modulemain.activity.main.activity.MainActivity;
|
||||
import com.xscm.modulemain.activity.room.activity.RankingListActivity;
|
||||
import com.xscm.modulemain.activity.room.activity.SearchActivity;
|
||||
import com.xscm.modulemain.activity.room.contacts.VoiceContacts;
|
||||
@@ -99,7 +101,6 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
MvpPre.activitiesPermission();
|
||||
|
||||
// 在这里可以继续显示其他弹窗,如首充弹窗
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -111,8 +112,10 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
firstChargeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
setDialog();
|
||||
//首充弹窗关闭后,弹首充
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -168,7 +171,15 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
if (activitiesPermission != null) {
|
||||
if (activitiesPermission.getFirst_charge_permission() == 1) {
|
||||
firstCharge();
|
||||
}else if (activitiesPermission.getFirst_charge_permission() == 0) {
|
||||
setDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setDialog(){
|
||||
if(ActivityUtils.getTopActivity() instanceof MainActivity){
|
||||
((MainActivity)ActivityUtils.getTopActivity()).dialogUp();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,8 +270,8 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
|
||||
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||
return;
|
||||
}
|
||||
startActivity(new Intent(MyRoomActivity.this, CreatedRoomActivity.class));
|
||||
finish();
|
||||
|
||||
MvpPre.check_create_room();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -317,6 +317,12 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check_create_room() {
|
||||
startActivity(new Intent(MyRoomActivity.this, CreatedRoomActivity.class));
|
||||
finish();
|
||||
}
|
||||
|
||||
private static class MyFragmentAdapter extends FragmentStatePagerAdapter {
|
||||
private SparseArray<Fragment> fragments = new SparseArray<>();
|
||||
private String[] titles = new String[]{"我创建的", "我主持的", "我管理的", "我关注的"};
|
||||
|
||||
@@ -4,8 +4,15 @@ import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
@@ -24,8 +31,10 @@ import com.xscm.modulemain.databinding.ActivitySettingBinding;
|
||||
import com.xscm.modulemain.dialog.YouthModelDialog;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.RealNameDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
|
||||
@@ -39,9 +48,9 @@ import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/8/14
|
||||
*@description: 设置
|
||||
* @author qx
|
||||
* @data 2025/8/14
|
||||
* @description: 设置
|
||||
*/
|
||||
public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivitySettingBinding> implements SettingConacts.View {
|
||||
|
||||
@@ -64,9 +73,9 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
if (userInfo != null) {
|
||||
if (userInfo.getIs_hide() != null && userInfo.getIs_hide().equals("1")) {
|
||||
mBinding.llQhdz.setVisibility(View.VISIBLE);
|
||||
if (userInfo.getHide_status()!=null && userInfo.getHide_status().equals("1")){
|
||||
if (userInfo.getHide_status() != null && userInfo.getHide_status().equals("1")) {
|
||||
mBinding.swit.setChecked(true);
|
||||
}else {
|
||||
} else {
|
||||
mBinding.swit.setChecked(false);
|
||||
}
|
||||
} else {
|
||||
@@ -178,7 +187,7 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (MvpPre == null){
|
||||
if (MvpPre == null) {
|
||||
MvpPre = bindPresenter();
|
||||
}
|
||||
|
||||
@@ -193,23 +202,28 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null).create().show();
|
||||
}else if (id == R.id.ll_zhxiao){
|
||||
} else if (id == R.id.ll_zhxiao) {
|
||||
new AlertDialog.Builder(this).setMessage("确定要注销账号吗?")
|
||||
.setMessage("注销后您当前的账户金币及钻石将无法找回,\n 30天内本账号将无法登陆,请谨慎操作!")
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (MvpPre==null){
|
||||
MvpPre=bindPresenter();
|
||||
if( SpUtil.getUserBean().getMobile()==null){
|
||||
if (MvpPre == null) {
|
||||
MvpPre = bindPresenter();
|
||||
}
|
||||
MvpPre.cancel();
|
||||
MvpPre.cancel("");
|
||||
}else {
|
||||
showSecondaryVerificationDialog();
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null).create().show();
|
||||
}else if (id == R.id.ll_gywm){
|
||||
} else if (id == R.id.ll_gywm) {
|
||||
startActivity(new Intent(this, AboutUsActivity.class));
|
||||
} else if (id == R.id.ll_bbh) {
|
||||
if (SpUtil.getShelf()==1) {
|
||||
if (SpUtil.getShelf() == 1) {
|
||||
// 移除之前的重置任务
|
||||
handler.removeCallbacks(resetRunnable);
|
||||
clickCount++;
|
||||
@@ -223,9 +237,9 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
handler.postDelayed(resetRunnable, RESET_DELAY);
|
||||
}
|
||||
}
|
||||
}else if (id == R.id.ll_send_log){
|
||||
} else if (id == R.id.ll_send_log) {
|
||||
MvpPre.sendAppLog();
|
||||
}else if (id == R.id.tv_share) {
|
||||
} else if (id == R.id.tv_share) {
|
||||
// showLoading("正在生成分享文件...");
|
||||
// Observable.create(new ObservableOnSubscribe<Boolean>() {
|
||||
// @SuppressLint("CheckResult")
|
||||
@@ -273,6 +287,110 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
}
|
||||
LogUtils.e("点击了~" + viewName);
|
||||
}
|
||||
|
||||
private void showSecondaryVerificationDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
View dialogView = getLayoutInflater().inflate(R.layout.dialog_secondary_verification, null);
|
||||
builder.setView(dialogView);
|
||||
|
||||
final EditText etVerificationCode = dialogView.findViewById(R.id.ed_password);
|
||||
final ImageView tvGetCode = dialogView.findViewById(R.id.tv_get_code);
|
||||
final TextView tvCancel = dialogView.findViewById(R.id.tv_send_code);
|
||||
final TextView tvConfirm = dialogView.findViewById(R.id.tv_confirm);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(tvConfirm, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
tvConfirm.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
|
||||
|
||||
tvCancel.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MvpPre.sendCode(SpUtil.getUserBean().getMobile(), 5);
|
||||
com.hjq.toast.ToastUtils.show("验证码已发送");
|
||||
tvCancel.setEnabled(false);
|
||||
startCountDown(tvCancel);
|
||||
}
|
||||
});
|
||||
|
||||
tvGetCode.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 模拟发送验证码逻辑
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
tvConfirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(code) && code.length() >= 6) {
|
||||
|
||||
if (MvpPre == null) {
|
||||
MvpPre = bindPresenter();
|
||||
}
|
||||
MvpPre.cancel(code);
|
||||
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
com.hjq.toast.ToastUtils.show("请输入正确的验证码");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// // 验证码输入完成时的处理
|
||||
// etVerificationCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
// @Override
|
||||
// public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
// String code = etVerificationCode.getText().toString().trim();
|
||||
// if (!TextUtils.isEmpty(code)) {
|
||||
// // 验证码验证逻辑
|
||||
// MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
// dialog.dismiss();
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
|
||||
etVerificationCode.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void startCountDown(final TextView tvGetCode) {
|
||||
final int[] count = {60};
|
||||
tvGetCode.setText("重新发送(" + count[0] + ")");
|
||||
new CountDownTimer(60000, 1000) {
|
||||
public void onTick(long millisUntilFinished) {
|
||||
tvGetCode.setText("重新发送(" + (count[0]--) + ")");
|
||||
}
|
||||
|
||||
public void onFinish() {
|
||||
tvGetCode.setText("获取验证码");
|
||||
tvGetCode.setEnabled(true);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void showYouthModelDialog() {
|
||||
YouthModelDialog youthModelDialog = new YouthModelDialog(this, null);
|
||||
youthModelDialog.show();
|
||||
@@ -286,6 +404,7 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_setting;
|
||||
|
||||
@@ -204,7 +204,9 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
|
||||
final EditText etVerificationCode = dialogView.findViewById(R.id.ed_password);
|
||||
final ImageView tvGetCode = dialogView.findViewById(R.id.tv_get_code);
|
||||
final TextView tvCancel = dialogView.findViewById(R.id.tv_send_code);
|
||||
|
||||
final TextView tvConfirm=dialogView.findViewById(R.id.tv_confirm);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(tvConfirm, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
tvConfirm.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
@@ -228,6 +230,20 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
|
||||
}
|
||||
});
|
||||
|
||||
tvConfirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(code) && code.length() >= 6) {
|
||||
// 验证码验证逻辑
|
||||
MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
com.hjq.toast.ToastUtils.show("请输入正确的验证码");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// // 验证码输入完成时的处理
|
||||
// etVerificationCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
// @Override
|
||||
@@ -258,12 +274,7 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(code) && code.length() >= 6) {
|
||||
// 验证码验证逻辑
|
||||
MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public final class MyRoomListContacts {
|
||||
void setAttentionListData(List<AttentionResp> attentionResps);
|
||||
|
||||
void myCpRoom(List<MyCpRoom> list);
|
||||
|
||||
void check_create_room();
|
||||
}
|
||||
|
||||
public interface IRankingListPre extends IPresenter {
|
||||
@@ -49,6 +51,9 @@ public final class MyRoomListContacts {
|
||||
void getAttentionList();
|
||||
|
||||
void myCpRoom();
|
||||
|
||||
|
||||
void check_create_room();
|
||||
}
|
||||
|
||||
public interface DeatilsView extends IView<Activity> {
|
||||
|
||||
@@ -14,10 +14,12 @@ public class SettingConacts {
|
||||
public interface IMePre extends IPresenter {
|
||||
void clearLoginInfo();
|
||||
|
||||
void cancel();
|
||||
void cancel(String sms_code);
|
||||
|
||||
void getModifyHideStatus(String hide_status);
|
||||
|
||||
void sendAppLog();
|
||||
|
||||
void sendCode(String phoneNumber,int type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,4 +179,9 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
|
||||
MvpPre.getMyFoot(1);
|
||||
adapter.submitList(viewItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check_create_room() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -152,4 +152,9 @@ public class MyFollowFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check_create_room() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -157,4 +157,9 @@ public class MyManageFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check_create_room() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -251,4 +251,9 @@ public class MyRoomListFragment extends BaseMvpFragment<MyRoomPresenter, RoomFra
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check_create_room() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -202,4 +202,19 @@ public class MyRoomPresenter extends BasePresenter<MyRoomListContacts.View> impl
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check_create_room() {
|
||||
api.check_create_room(new BaseObserver<String>(){
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
api.cancel(new BaseObserver<String>() {
|
||||
public void cancel(String sms_code) {
|
||||
api.cancel(sms_code,new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -176,4 +176,21 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCode(String phoneNumber, int type) {
|
||||
api.sendCode(phoneNumber, type + "", new BaseObserver<Object>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Object o) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.xscm.modulemain.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.os.CountDownTimer
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogInviteBinding
|
||||
import com.xscm.modulemain.manager.RoomManager
|
||||
import com.xscm.moduleutil.bean.IndexRecommendRoom
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/8 16:19
|
||||
* 用途:首页推荐房间
|
||||
*/
|
||||
class InviteDialog(context: Context, data: IndexRecommendRoom?) : BaseDialog<DialogInviteBinding>(context) {
|
||||
private var countDownTimer: CountDownTimer? = null // 倒计时器
|
||||
private var data: IndexRecommendRoom? = data // 将构造函数参数赋值给成员变量
|
||||
// companion object {
|
||||
// // 修改方法签名,允许 data 为空
|
||||
// fun show(context: Context, data: IndexRecommendRoom?) {
|
||||
// // 创建并显示对话框,即使 data 为空也显示
|
||||
// val dialog = InviteDialog(context, data)
|
||||
// dialog.show()
|
||||
// }
|
||||
// }
|
||||
init {
|
||||
// 设置对话框从底部弹出
|
||||
window?.setGravity(Gravity.CENTER)
|
||||
// 设置对话框的宽度为屏幕宽度
|
||||
window?.setLayout(
|
||||
(ScreenUtils.getScreenWidth() * 315f / 375).toInt(),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
// 添加动画效果
|
||||
window?.setWindowAnimations(com.xscm.moduleutil.R.style.DialogAnimationt)
|
||||
setCancelable(false)
|
||||
setCanceledOnTouchOutside(false)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_invite
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
// 设置邀请按钮文本
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
mBinding.btnPositive,
|
||||
ColorManager.getInstance().getPrimaryColorInt(),
|
||||
53
|
||||
)
|
||||
mBinding.btnPositive.setTextColor(ColorManager.getInstance().getButtonColorInt())
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
mBinding.btnPositive.setOnClickListener {
|
||||
// 如果有房间数据,进入房间;否则只关闭对话框
|
||||
data?.let { roomData ->
|
||||
RoomManager.getInstance()
|
||||
.fetchRoomDataAndEnter(context, roomData.room_id, "", null)
|
||||
} ?: run {
|
||||
// 没有数据时,可以显示提示或执行其他操作
|
||||
// 这里我们只关闭对话框
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
fun setData(data: IndexRecommendRoom?) {
|
||||
this.data = data
|
||||
// 设置房间数据
|
||||
data?.let { roomData ->
|
||||
// 设置房间封面
|
||||
ImageUtils.loadHead(roomData.room_cover, mBinding.invitePic)
|
||||
|
||||
// 启动倒计时
|
||||
startCountDown()
|
||||
} ?: run {
|
||||
|
||||
// 仍然启动倒计时,让用户可以关闭对话框
|
||||
startCountDown()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始倒计时
|
||||
*/
|
||||
private fun startCountDown() {
|
||||
|
||||
countDownTimer = object : CountDownTimer(9 * 1000L, 1000) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
val secondsLeft = (millisUntilFinished / 1000).toInt()
|
||||
mBinding.btnNegative.setText("拒接" + " (" + secondsLeft + "s)")
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
// 检查是否被主动取消
|
||||
dismiss()
|
||||
}
|
||||
}.start()
|
||||
|
||||
|
||||
|
||||
// 设置点击事件,点击按钮也关闭对话框
|
||||
mBinding.btnNegative.setOnClickListener({ v ->
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer?.cancel()
|
||||
}
|
||||
dismiss()
|
||||
})
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
// 在对话框关闭前取消倒计时
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer?.cancel()
|
||||
}
|
||||
super.dismiss()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,28 +13,33 @@
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/invite_bj"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="275:180"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
<com.xscm.moduleutil.widget.CircularImage
|
||||
android:id="@+id/invite_pic"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:layout_width="@dimen/dp_65"
|
||||
android:layout_height="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@mipmap/invite_tx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_bg"
|
||||
app:riv_border_color="@color/color_white"
|
||||
app:riv_border_width="1dp"
|
||||
app:riv_corner_radius="50dp"
|
||||
app:riv_mutate_background="true" />
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:src="@mipmap/invite_tx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_bg"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_c"
|
||||
@@ -62,7 +67,8 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_c" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_c"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
@@ -73,9 +79,53 @@
|
||||
android:src="@mipmap/index_close_youth"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_bg" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_bg"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_c"
|
||||
>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_negative"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:text="拒接"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:paddingHorizontal="@dimen/dp_20"
|
||||
android:paddingVertical="@dimen/dp_10"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:background="@drawable/bg_r53_f3f3f3"
|
||||
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_positive"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingHorizontal="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_22"
|
||||
android:paddingVertical="@dimen/dp_10"
|
||||
android:text="接受"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/cs"/>
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
@@ -12,7 +12,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
>
|
||||
|
||||
|
||||
<TextView
|
||||
@@ -42,10 +46,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_36"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/bg_r16_ffeff2f8"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title">
|
||||
|
||||
@@ -94,5 +96,24 @@
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:background="@drawable/cs"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_code"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="确认"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintWidth_percent="0.7"
|
||||
android:id="@+id/tv_confirm" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user