Compare commits
461 Commits
branch_new
...
branch_new
| Author | SHA1 | Date | |
|---|---|---|---|
| be4356f317 | |||
| 9c7567dfd1 | |||
| 88ce3ac161 | |||
| 48506a075e | |||
| cb79afaab6 | |||
| dfc64d7a14 | |||
| 3977e3e158 | |||
| 877862e507 | |||
| 5ce33aeeb1 | |||
| 0afb5dbbfd | |||
| 3530c10772 | |||
| 5b27d91278 | |||
| 513cc23d9c | |||
| 7aa294c3a9 | |||
| 88ce0205fb | |||
| 3d0fb12565 | |||
| cb16dbb9e1 | |||
| 8ce7a9e5de | |||
| 8db507718c | |||
| e23578838c | |||
| 973fac58a4 | |||
| 8a587210cf | |||
| 8d7de418bb | |||
| 24c4af95b4 | |||
| 9450a351c5 | |||
| 9f8f8137d1 | |||
| d07ca522ab | |||
| 08c51e0273 | |||
| 60b8e901b5 | |||
| 885d6b1e7d | |||
| 3f2989664c | |||
| 76f499f022 | |||
| 1048b8f46e | |||
| 78f290eef8 | |||
| 3f49cf3790 | |||
| 9ab1f171f8 | |||
| 4e8058f200 | |||
| 4fdd5578a8 | |||
| 163340a691 | |||
| bf609a3964 | |||
| e6232f5aa2 | |||
| 0ae0cff87a | |||
| ac7a3b1325 | |||
| 16bd6d7e1a | |||
| 838a2ec64a | |||
| 87782e9caa | |||
| 0a0875fb88 | |||
| 725add62ac | |||
| 59b48e0b0f | |||
| e5f77b626e | |||
| 99b3350329 | |||
| 883a96f2c7 | |||
| 8e86ba68d0 | |||
| bf507a6264 | |||
| 716cafc62b | |||
| 267b8a0aea | |||
| 60fff84aaf | |||
| 0a968babef | |||
| b3c1ae647d | |||
| fcc690db64 | |||
| 476de595da | |||
| a4c21485a2 | |||
| e24f217ab4 | |||
| a07ee5cfe9 | |||
| 60c97447dd | |||
| b201787513 | |||
| 064338e838 | |||
| 0a0771d5a3 | |||
| f82e5c8348 | |||
| d7a27baf5c | |||
| a3551e2e33 | |||
| a1fcc56551 | |||
| cdb5f9b794 | |||
| e9ab535b2d | |||
| f5b4dde3c6 | |||
| f4f27c2c94 | |||
| 268c3cdd98 | |||
| dde6ccd578 | |||
| f01d903d2f | |||
| e3bad8ddab | |||
| 2b29b0de18 | |||
| 6e5e8abc0b | |||
| 38d1c266d6 | |||
| 6a22259c16 | |||
| b1523c2f2a | |||
| 8f4c2d1b83 | |||
| 0fd8ecd73d | |||
| 6b87252a51 | |||
| 64ced88287 | |||
| 716f292fa5 | |||
| 39b9ea73a1 | |||
| c67b07e3b9 | |||
| 5a1edb6c4a | |||
| a034e5e954 | |||
| 15ed708853 | |||
| ca4d9ea20a | |||
| 84fa4ed1f3 | |||
| 4c7a2ae3b7 | |||
| 34f4d980ad | |||
| 2589b97f29 | |||
| 5946cf97b9 | |||
| 0be33ec918 | |||
| 8264974d85 | |||
| 54b3312eac | |||
| 0ff889d72a | |||
| 7436649f71 | |||
| ea85b71e2f | |||
| 58c39962fa | |||
| 36fbc88f21 | |||
| 97f30ce233 | |||
| c355fd66d6 | |||
| 2e61fa5e4d | |||
| b5fcf232fe | |||
| 9627a476f7 | |||
| d5cbb5008c | |||
| 1b560a3806 | |||
| 34552f45ec | |||
| ab228eb05d | |||
| a8328ac8b9 | |||
| d2f2829ca2 | |||
| 43600c60c0 | |||
| e12bb36fe5 | |||
| e74bfde545 | |||
| 0b37364a11 | |||
| ac09992b01 | |||
| 26a40f8ffb | |||
| a8ae4a61c2 | |||
| fe78c968f2 | |||
| 9fbb12819f | |||
| 6338728ddf | |||
| 50d509dc12 | |||
| 1c4384f5d5 | |||
| 5f7bac8a12 | |||
| 3dcdd1e599 | |||
| d1cd2aeef7 | |||
| b76136b604 | |||
| 2f0f5ae5e8 | |||
| d48f13f266 | |||
| 5cc393fe06 | |||
| 44ebb14fb3 | |||
| 9ef4f27ed9 | |||
| 43ea35d3a2 | |||
| 3efe9c9146 | |||
| b473751913 | |||
| 0e830e411a | |||
| 5d17bf8de0 | |||
| f77b5ba4d7 | |||
| aa96aa4a3b | |||
| 8bd22ae41a | |||
| 510aa804ab | |||
| c2fd1df529 | |||
| 479e039e56 | |||
| 9126676599 | |||
| 7f881260aa | |||
| 3f1b8ee2fa | |||
| 7b6be82c54 | |||
| aab29ea784 | |||
| ab556d2519 | |||
| 4f48c55cf6 | |||
| 359f93aac7 | |||
| e6892d533c | |||
| 67c56b2d4f | |||
| fa6f40c369 | |||
| 9476655ba3 | |||
| 27485de14f | |||
| d6efdefc99 | |||
| 8b24d3ace5 | |||
| 730b94cff5 | |||
| e3751528ad | |||
| ff9677fa6d | |||
| be2306b50c | |||
| 2adc4948c7 | |||
| 6b1614d768 | |||
| 8fec498dba | |||
| e26101c35f | |||
| bb31bafa55 | |||
| 826469178e | |||
| addd97a434 | |||
| 84fb05044a | |||
| 342cfd347c | |||
| 214c339e93 | |||
| bb54407c62 | |||
| c22e88eebb | |||
| 0444a906ba | |||
| e4ed3eb9a1 | |||
| eee16d3a4a | |||
| e3d4240a82 | |||
| b7320cb51a | |||
| 4a83bbda2d | |||
| f0451bfeea | |||
| 7e6d174297 | |||
| 8b24ac310e | |||
| 9bf2de01d4 | |||
| c7018cce42 | |||
| 320f742b87 | |||
| ec2e754806 | |||
| daba3d9872 | |||
| 435d2084d1 | |||
| e3744843d9 | |||
| 9774b0bb2c | |||
| ed7632c142 | |||
| f5287becee | |||
| e21345ba61 | |||
| ca3580ad28 | |||
| 837231f4f0 | |||
| 53b9f0f034 | |||
| f34a67c2e8 | |||
| 6bd210217a | |||
| 6c8065711d | |||
| 5c607c58ae | |||
| f2363dad01 | |||
| 07dbffaa5a | |||
| b028ec883b | |||
| 552e238254 | |||
| 3fde4df00f | |||
| 471a0453fa | |||
| 420afc7a1e | |||
| 6130accb48 | |||
| e2b0c9ce8c | |||
| 894b397537 | |||
| 6207705d2a | |||
| f5fea27595 | |||
| c388d765d4 | |||
| 952621baaa | |||
| df499aaa6c | |||
| 3d8e152cd8 | |||
| 727e343d1f | |||
| ef27636564 | |||
| aa778ca1de | |||
| 90077d24f6 | |||
| 81b41ef392 | |||
| c2714ff68a | |||
| 1fbece3e62 | |||
| 7f4843b023 | |||
| ec3f3d6233 | |||
| 1b06d5725f | |||
| 0874998249 | |||
| b611147176 | |||
| ac9d9b19fd | |||
| ea2b45c1be | |||
| 19bc9dbad8 | |||
| 4b356a6ce4 | |||
| 72a7eecbcd | |||
| 9b7c586d6b | |||
| 41e4dcf2fc | |||
| a512b50343 | |||
| a9af37489e | |||
| e16878b0cf | |||
| 8dcafa37ba | |||
| a7a24b52f9 | |||
| c2f5376ec8 | |||
| 39098757fd | |||
| 7768a8f70b | |||
| 42f786f9ef | |||
| 0c8163277a | |||
| c2096a8274 | |||
| 5fb367e321 | |||
| 14782341f9 | |||
| 724046c9c6 | |||
| b915e9d044 | |||
| f80582a189 | |||
| c200c6c307 | |||
| dce92eb61a | |||
| 56d5d40214 | |||
| 98f8928bc8 | |||
| bc4e9b4bfa | |||
| fda29801b3 | |||
| 13d8e94083 | |||
| be09d0e792 | |||
| ec535432e7 | |||
| c563354117 | |||
| 71fce13074 | |||
| 1746e7a89b | |||
| d63fd43ad2 | |||
| 8faac0f526 | |||
| dfefaae153 | |||
| 23de7e5bf6 | |||
| 37395ccff3 | |||
| ebf29b2aa2 | |||
| f646493800 | |||
| 6825009aba | |||
| 17b562f194 | |||
| 89374e536d | |||
| 0d8b0134d9 | |||
| feb922624f | |||
| 6bae825d0f | |||
| d470b2fdb1 | |||
| ed0eccd0ee | |||
| ecdd2fc063 | |||
| b6bc353db1 | |||
| e386b072f5 | |||
| 3263fbd7f6 | |||
| b5b443e188 | |||
| 9d546717db | |||
| dab7e1e83a | |||
| 8232415cbf | |||
| 611c4829ce | |||
| 2b137643f2 | |||
| 913e92644c | |||
| 531d62ae3a | |||
| 19ce1dbe94 | |||
| 91e222554a | |||
| a9c2bd9878 | |||
| 75f11fdb06 | |||
| a9af0efdc9 | |||
| 0e2386ca5f | |||
| aa568d73ee | |||
| fdd7de3473 | |||
| 1dbdb9cabf | |||
| 314ce6007d | |||
| 829636f594 | |||
| b3bc8ebdcb | |||
| 0d188736b2 | |||
| 8b9fd2ba08 | |||
| 26a8188fcb | |||
| aed51479a4 | |||
| 338d704904 | |||
| 1af373846f | |||
| 079d9ab1b1 | |||
| 61106bc5eb | |||
| 0e20a463e7 | |||
| 0aa5d93571 | |||
| 233c6926ad | |||
| aeac7a9735 | |||
| 905f85abd8 | |||
| 9bea2b4e24 | |||
| 786295def1 | |||
| d6915a6305 | |||
| 83b4097fa2 | |||
| 8a32effeab | |||
| b90d1c0c98 | |||
| 1c9452d1fa | |||
| b5fab23e56 | |||
| c44ae5bc48 | |||
| e4122ef8e6 | |||
| 831537f057 | |||
| 0edbb23cf8 | |||
| 335147f962 | |||
| 87b73e7ca2 | |||
| 97dd450074 | |||
| cb9951dd66 | |||
| ad29cce6a5 | |||
| 5ee3c19afb | |||
| ed1d376bf2 | |||
| 7bcc347561 | |||
| cd80d03c7b | |||
| 0d9a283142 | |||
| 6721e8e376 | |||
| 60b910c38f | |||
| b4ffa086fb | |||
| 3fea806732 | |||
| 582adedd55 | |||
| efadb819b9 | |||
| 6e9ba920d1 | |||
| 8965243e0a | |||
| 8640c7366a | |||
| 3a193da90d | |||
| 4136077e98 | |||
| fbc2a57593 | |||
| 016e1329da | |||
| 7f200fbafc | |||
| fac83d7c23 | |||
| f985ea9aeb | |||
| a808da0df5 | |||
| dc42ad9049 | |||
| 741063f239 | |||
| 99dbd3d321 | |||
| f5c00c640d | |||
| 532f85e9e2 | |||
| b46913b920 | |||
| 2756fdb4b7 | |||
| babd07e592 | |||
| c632692982 | |||
| 56bb994377 | |||
| defb31a217 | |||
| f8460f0239 | |||
| 5b22ebd218 | |||
| ff2b5aa668 | |||
| 057f623eec | |||
| 46b0a856fe | |||
| 0f0c2d97cc | |||
| 64f538f04d | |||
| 885f981b6f | |||
| f9e9811c4b | |||
| ea188cde92 | |||
| 23a07562b7 | |||
| 22a1f420ea | |||
| 0d5e64e31a | |||
| 8e9f6fa23c | |||
| 9a4b9b973b | |||
| 50ef12ee3b | |||
| 0f054e1b69 | |||
| e0f6dff1d6 | |||
| a4c2fdb859 | |||
| 8d35790413 | |||
| dc9726d5b4 | |||
| 10e5504ce1 | |||
| d94d7a75df | |||
| 8ce028379c | |||
| 7bf2297750 | |||
| 4d2c1a5ace | |||
| 56489b3af7 | |||
| 9135198b9d | |||
| 1ec1b12e6c | |||
| 23751fd1fa | |||
| 980ec43e6c | |||
| be60810221 | |||
| 85df01db3b | |||
| 43138a56bc | |||
| d42fb54aee | |||
| 5f93d184d2 | |||
| e925a0c2a5 | |||
| 49e345db2c | |||
| 18c3f494a3 | |||
| 06ce98a3ab | |||
| 9183342636 | |||
| fd9af6a253 | |||
| 94a55bafea | |||
| 847c768e4d | |||
| 2b750c5f06 | |||
| 995d7c1e90 | |||
| 784a67214d | |||
| b089f4a56f | |||
| a22cade574 | |||
| c216099173 | |||
| 7821ef304d | |||
| dce8b08a3f | |||
| 18559d0553 | |||
| fe9e192aea | |||
| fe1ad2a732 | |||
| 2a0c3b6d7f | |||
| 603899ddef | |||
| 9887185133 | |||
| 1753d9a98d | |||
| cc42d0f90f | |||
| 0dd7c367cb | |||
| a1e123f0bf | |||
| 6edd0ed339 | |||
| c4c6072c16 | |||
| 83307295bb | |||
| a125d8d9b4 | |||
| 2a6d2e4709 | |||
| 5eac6d302c | |||
| 18b1235a80 | |||
| 95a1e21909 | |||
| 3c344e1359 | |||
| af8b87dd47 | |||
| 7e33926a03 | |||
| 1dfcf4e98c | |||
| 3c83906870 | |||
| 355141a2a8 | |||
| 117ee41ff2 | |||
| db79bafdbc | |||
| cf73819ad0 | |||
| be7c855283 | |||
| acec782e3a | |||
| 57b8ded0eb | |||
| 68dc7574bc | |||
| f7b46d7320 | |||
| b3f6d3a3fb | |||
| 88a94c7c10 |
2
.idea/.name
generated
2
.idea/.name
generated
@@ -1 +1 @@
|
||||
秘地
|
||||
羽声语音
|
||||
@@ -44,7 +44,6 @@ android {
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
// exclude 'lib/arm64-v8a/libagora-fdkaac.so'
|
||||
}
|
||||
@@ -172,7 +171,9 @@ dependencies {
|
||||
// api('com.tencent.liteav:LiteAVSDK_Professional:10.9.0.13102')
|
||||
// api('com.google.android.exoplayer:exoplayer-core:2.19.1')
|
||||
// api('com.google.android.exoplayer:exoplayer-ui:2.19.1')
|
||||
api("com.egame.vap:animplayer:2.0.8")
|
||||
// api("com.egame.vap:animplayer:2.0.8")
|
||||
api project(":animplayer")
|
||||
|
||||
api("com.liulishuo.okdownload:okdownload:1.0.7")
|
||||
|
||||
api('com.zlc.glide:webpdecoder:1.6.4.9.0')
|
||||
|
||||
BIN
BaseModule/src/main/assets/prize_call_box_default.svga
Normal file
BIN
BaseModule/src/main/assets/prize_call_box_default.svga
Normal file
Binary file not shown.
BIN
BaseModule/src/main/assets/prize_call_open_box.svga
Normal file
BIN
BaseModule/src/main/assets/prize_call_open_box.svga
Normal file
Binary file not shown.
BIN
BaseModule/src/main/assets/room_wish_crystal_animation.svga
Normal file
BIN
BaseModule/src/main/assets/room_wish_crystal_animation.svga
Normal file
Binary file not shown.
@@ -5,6 +5,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
@@ -29,6 +30,7 @@ import com.blankj.utilcode.util.BarUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.dialog.LoadingDialog;
|
||||
import com.xscm.moduleutil.utils.BackgroundManager;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
@@ -83,8 +85,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
initFestivalTheme(CommonAppContext.getInstance().is_open);
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().getDecorView().setBackgroundResource(R.mipmap.log_bj);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
// getWindow().getDecorView().setBackgroundResource(R.attr.app_bg_img);
|
||||
setContentView(getLayoutId());
|
||||
doDone();
|
||||
// 隐藏标题栏
|
||||
@@ -103,7 +107,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
// 注册背景更新监听器
|
||||
BackgroundManager.getInstance().addListener(this);
|
||||
// 尝试加载网络背景
|
||||
loadNetworkBackground();
|
||||
// loadNetworkBackground();
|
||||
// 注册颜色变化监听器
|
||||
ColorManager.getInstance().addColorChangeListener(this);
|
||||
|
||||
@@ -114,6 +118,25 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
// 节日判断+主题切换核心方法
|
||||
private void initFestivalTheme(int currentFestival) {
|
||||
switch (currentFestival) {
|
||||
case 0:
|
||||
setTheme(R.style.AppTheme_CustomAttrs);
|
||||
break;
|
||||
case 1:
|
||||
setTheme(R.style.AppTheme_Spring_CustomAttrs);
|
||||
break;
|
||||
case 2:
|
||||
setTheme(R.style.AppTheme_newYear_CustomAttrs);
|
||||
break;
|
||||
default:
|
||||
// 默认皮肤
|
||||
setTheme(R.style.AppTheme_CustomAttrs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 在Activity中
|
||||
private static final int REQUEST_OVERLAY_PERMISSION = 1001;
|
||||
|
||||
@@ -179,28 +202,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
|
||||
protected void loadNetworkBackground() {
|
||||
// 只有当已经有背景URL时才加载
|
||||
String backgroundUrl = BackgroundManager.getInstance().getBackgroundUrl();
|
||||
if (backgroundUrl != null && !backgroundUrl.isEmpty()) {
|
||||
// 检查是否有已加载的drawable
|
||||
Drawable cachedDrawable = BackgroundManager.getInstance().getBackgroundDrawable();
|
||||
if (cachedDrawable != null) {
|
||||
getWindow().getDecorView().setBackground(cachedDrawable);
|
||||
} else {
|
||||
// 加载网络背景
|
||||
BackgroundManager.getInstance().loadBackgroundDrawable(this, new BackgroundManager.BackgroundLoadCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
getWindow().getDecorView().setBackground(drawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
// 加载失败时使用默认背景
|
||||
getWindow().getDecorView().setBackgroundResource(R.mipmap.activity_bj);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// int backgroundUrl = BackgroundManager.getInstance().getBackgroundUrl();
|
||||
// getWindow().getDecorView().setBackgroundResource(backgroundUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,7 +216,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
|
||||
// 提供一个方法供子类调用,用于设置背景URL
|
||||
protected void setNetworkBackgroundUrl(String url) {
|
||||
BackgroundManager.getInstance().setBackgroundUrl(url);
|
||||
// BackgroundManager.getInstance().setBackgroundUrl(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,13 +259,14 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
|
||||
super.finish();
|
||||
LogUtils.e(this.getComponentName()+"========finish");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
// 移除背景更新监听器
|
||||
BackgroundManager.getInstance().removeListener(this);
|
||||
// 移除颜色变化监听器
|
||||
|
||||
@@ -74,8 +74,7 @@ public class AppUpdateDialog extends BaseDialog<DialogAppUpdateBinding> implemen
|
||||
mProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mProgressDialog.setMessage("下载中请稍等!!!");
|
||||
mProgressDialog.show();
|
||||
DownloadUtil downloadUtil = new DownloadUtil(getContext());
|
||||
downloadUtil.downloadFile(appUpdateModel.getUrl(), this);
|
||||
DownloadUtil downloadUtil = new DownloadUtil(getContext(),appUpdateModel.getUrl(),this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +117,7 @@ public class AppUpdateDialog extends BaseDialog<DialogAppUpdateBinding> implemen
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
try {
|
||||
LogUtils.e("installAppSuccess",localPath);
|
||||
AppUtils.installApp(localPath);
|
||||
} catch (Exception e) {
|
||||
Logger.e("installAppError", e);
|
||||
|
||||
@@ -186,7 +186,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
|
||||
helper.getView(R.id.dy_content_tv).setVisibility(GONE);
|
||||
} else {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
|
||||
helper.getView(R.id.dy_content_tv).setVisibility(VISIBLE);
|
||||
}
|
||||
helper.getView(R.id.dy_lookmore_tv).getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
||||
@@ -196,7 +196,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
TextView view = helper.getView(R.id.dy_content_tv);
|
||||
int lineCount = view.getLineCount();
|
||||
if (lineCount >= 7) {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
|
||||
helper.getView(R.id.dy_content_tv).getViewTreeObserver().removeOnPreDrawListener(this);//销毁
|
||||
} else {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
|
||||
@@ -274,9 +274,11 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
}
|
||||
|
||||
if (item.getRoom_id() != null && !item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "跟随");
|
||||
helper.setText(R.id.gensui, "");
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.gsui);
|
||||
} else if (item.getRoom_id() == null || item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "私信");
|
||||
helper.setText(R.id.gensui, "");
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.six);
|
||||
}
|
||||
//分享数
|
||||
// helper.setText(R.id.dy_zs, item.getRewards_num() != null ? item.getRewards_num() : "0");
|
||||
|
||||
@@ -14,8 +14,11 @@ import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.event.RoomGiftPackToEvent;
|
||||
@@ -31,7 +34,7 @@ import java.util.List;
|
||||
* @Time 2025年7月29日23:36:25$ $
|
||||
* @Description 背包礼物适配器$
|
||||
*/
|
||||
public class GiftPackAdapter extends BaseAdapter {
|
||||
public class GiftPackAdapter extends BaseQuickAdapter<GiftPackBean, BaseViewHolder> {
|
||||
private final List<GiftPackBean> mDatas;
|
||||
private final LayoutInflater inflater;
|
||||
private final Context mContext;
|
||||
@@ -47,6 +50,7 @@ public class GiftPackAdapter extends BaseAdapter {
|
||||
private final int pageSize = 100;
|
||||
|
||||
public GiftPackAdapter(Context context, List<GiftPackBean> mDatas, int curIndex, String type) {
|
||||
super(R.layout.item_gift_room, mDatas);
|
||||
inflater = LayoutInflater.from(context);
|
||||
this.mDatas = mDatas;
|
||||
this.curIndex = curIndex;
|
||||
@@ -60,14 +64,45 @@ public class GiftPackAdapter extends BaseAdapter {
|
||||
* 如果够,则直接返回每一页显示的最大条目个数pageSize,
|
||||
* 如果不够,则有几项返回几,(mDatas.size() - curIndex * pageSize);(也就是最后一页的时候就显示剩余item)
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
}
|
||||
// @Override
|
||||
// public int getCount() {
|
||||
// return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public GiftPackBean getItem(int position) {
|
||||
// return mDatas.get(position + curIndex * pageSize);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public GiftPackBean getItem(int position) {
|
||||
return mDatas.get(position + curIndex * pageSize);
|
||||
protected void convert(@NonNull BaseViewHolder helper, GiftPackBean giftModel) {
|
||||
helper.getView(R.id.cl_gift).setOnClickListener(v -> {
|
||||
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
EventBus.getDefault().post(new RoomGiftPackToEvent(this, giftModel, 2));
|
||||
|
||||
});
|
||||
helper.setVisible(R.id.integral, true).setText(R.id.integral, "x" + giftModel.getNum());
|
||||
helper.setText(R.id.tv_gift_name, giftModel.getGift_name());
|
||||
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
helper.setText(R.id.tv_gift_price,stringBuilder);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(),helper.getView(R.id.iv_gift_pic));
|
||||
//设置选中后的样式
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
helper.getView(R.id.cl_iv_down_on).setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
helper.setVisible(R.id.iv_down_on, false);
|
||||
} else {
|
||||
helper.setVisible(R.id.iv_down_on, false);
|
||||
helper.getView(R.id.cl_iv_down_on).setBackgroundResource(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,66 +142,68 @@ public class GiftPackAdapter extends BaseAdapter {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
GiftPackAdapter.ViewHolder viewHolder;
|
||||
GiftPackBean giftModel = getItem(position);
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||
viewHolder = new GiftPackAdapter.ViewHolder();
|
||||
viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
viewHolder.integral = (TextView) convertView.findViewById(R.id.integral);
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (GiftPackAdapter.ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
viewHolder.item_layout.setOnClickListener(v -> {
|
||||
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
EventBus.getDefault().post(new RoomGiftPackToEvent(this, giftModel, 2));
|
||||
|
||||
});
|
||||
viewHolder.integral.setVisibility(View.VISIBLE);
|
||||
viewHolder.integral.setText("x"+giftModel.getNum());
|
||||
//设置礼物名字
|
||||
viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
//设置选中后的样式
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder {
|
||||
public ConstraintLayout item_layout;
|
||||
public TextView tv_gift_name, tv_gift_price, integral;
|
||||
public ImageView iv_gift_pic;
|
||||
public TextView tv_gift_change_love_values;
|
||||
public ImageView ivDownOn;
|
||||
public ConstraintLayout cl_iv_down_on;
|
||||
}
|
||||
// @Override
|
||||
// @SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
// public View getView(int position, View convertView, ViewGroup parent) {
|
||||
// GiftPackAdapter.ViewHolder viewHolder;
|
||||
// GiftPackBean giftModel = getItem(position);
|
||||
// if (convertView == null) {
|
||||
// convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||
// viewHolder = new GiftPackAdapter.ViewHolder();
|
||||
// viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
// viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
// viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
// viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
// viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
// viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
// viewHolder.integral = (TextView) convertView.findViewById(R.id.integral);
|
||||
// viewHolder.im_heart = (ImageView) convertView.findViewById(R.id.im_heartssss);
|
||||
// convertView.setTag(viewHolder);
|
||||
// } else {
|
||||
// viewHolder = (GiftPackAdapter.ViewHolder) convertView.getTag();
|
||||
// }
|
||||
//
|
||||
// viewHolder.item_layout.setOnClickListener(v -> {
|
||||
//// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
// EventBus.getDefault().post(new RoomGiftPackToEvent(this, giftModel, 2));
|
||||
//
|
||||
// });
|
||||
// viewHolder.integral.setVisibility(View.VISIBLE);
|
||||
// viewHolder.integral.setText("x"+giftModel.getNum());
|
||||
// //设置礼物名字
|
||||
// viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
// //设置礼物价格
|
||||
// String surplusTxt = giftModel.getGift_price();
|
||||
// SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
// //ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
// ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
// stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
// viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
//// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
//
|
||||
// //加载礼物图片
|
||||
// ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
// //设置选中后的样式
|
||||
//
|
||||
// if (giftModel.isChecked()) {//被选中
|
||||
// viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
// viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
// viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
// }
|
||||
//
|
||||
// return convertView;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// static class ViewHolder {
|
||||
// public ConstraintLayout item_layout;
|
||||
// public TextView tv_gift_name, tv_gift_price, integral;
|
||||
// public ImageView iv_gift_pic;
|
||||
// public TextView tv_gift_change_love_values;
|
||||
// public ImageView ivDownOn;
|
||||
// public ConstraintLayout cl_iv_down_on;
|
||||
// public ImageView im_heart;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -16,8 +18,12 @@ import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
@@ -29,7 +35,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftRoomAdapter extends BaseAdapter {
|
||||
public class GiftRoomAdapter extends BaseQuickAdapter<RoonGiftModel, BaseViewHolder> {
|
||||
private final List<RoonGiftModel> mDatas;
|
||||
private final LayoutInflater inflater;
|
||||
private final Context mContext;
|
||||
@@ -45,7 +51,7 @@ public class GiftRoomAdapter extends BaseAdapter {
|
||||
private final int pageSize = 100;
|
||||
|
||||
public GiftRoomAdapter(Context context, List<RoonGiftModel> mDatas, int curIndex, String type) {
|
||||
|
||||
super(R.layout.item_gift_room);
|
||||
this.mDatas = mDatas;
|
||||
this.curIndex = curIndex;
|
||||
this.mContext = context;
|
||||
@@ -59,19 +65,93 @@ public class GiftRoomAdapter extends BaseAdapter {
|
||||
* 如果够,则直接返回每一页显示的最大条目个数pageSize,
|
||||
* 如果不够,则有几项返回几,(mDatas.size() - curIndex * pageSize);(也就是最后一页的时候就显示剩余item)
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
}
|
||||
// @Override
|
||||
// public int getCount() {
|
||||
// return mDatas !=null ? mDatas.size() : 0;
|
||||
//// return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public RoonGiftModel getItem(int position) {
|
||||
// return mDatas.get(position);
|
||||
//// return mDatas.get(position + curIndex * pageSize);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public RoonGiftModel getItem(int position) {
|
||||
return mDatas.get(position + curIndex * pageSize);
|
||||
protected void convert(@NonNull BaseViewHolder helper, RoonGiftModel giftModel) {
|
||||
helper.getView(R.id.cl_gift).setOnClickListener(v -> {
|
||||
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
if (giftModel.getIs_lock() == 0) {
|
||||
EventBus.getDefault().post(new RoomGiftClickToEvent(this, giftModel, 1));
|
||||
} else if (giftModel.getIs_lock() == 1) {
|
||||
ToastUtils.show("当前属于爵位礼物,请开通爵位");
|
||||
}
|
||||
});
|
||||
if (giftModel.getIs_lock() == 0) {
|
||||
helper.setVisible(R.id.iv_gift_select,false);
|
||||
} else {
|
||||
helper.setVisible(R.id.iv_gift_select,true);
|
||||
}
|
||||
if (TextUtils.isEmpty(giftModel.getIcon())) {
|
||||
helper.setVisible(R.id.im_heartssss,false);
|
||||
}else {
|
||||
helper.setVisible(R.id.im_heartssss,true);
|
||||
ImageUtils.loadHead(giftModel.getIcon(), helper.getView(R.id.im_heartssss));
|
||||
}
|
||||
|
||||
//设置礼物名字
|
||||
helper.setText(R.id.tv_gift_name,giftModel.getGift_name());
|
||||
if (TextUtils.isEmpty(giftModel.getNum())){
|
||||
helper.setVisible(R.id.integral, false);
|
||||
}else {
|
||||
helper.setVisible(R.id.integral, true).setText(R.id.integral, "x" + giftModel.getNum());
|
||||
}
|
||||
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
helper.setText(R.id.tv_gift_price,stringBuilder);
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(), helper.getView(R.id.iv_gift_pic));
|
||||
//设置选中后的样式
|
||||
|
||||
|
||||
if (giftModel.getGift_bag() == 10) {
|
||||
helper.setText(R.id.tv_gift_name,"");
|
||||
helper.getView(R.id.cl_gift).setBackgroundResource(R.mipmap.gift_tkzj);
|
||||
helper.getView(R.id.tv_gift_name).setBackgroundResource(R.mipmap.gift_name_tkzj);
|
||||
} else if (giftModel.getGift_bag() == 11) {
|
||||
helper.setText(R.id.tv_gift_name,"");
|
||||
helper.getView(R.id.cl_gift).setBackgroundResource(R.mipmap.gift_syzc);
|
||||
helper.getView(R.id.tv_gift_name).setBackgroundResource(R.mipmap.gift_name_syzc);
|
||||
} else if (giftModel.getGift_bag() == 12) {
|
||||
helper.setText(R.id.tv_gift_name,"");
|
||||
helper.getView(R.id.cl_gift).setBackgroundResource(R.mipmap.gift_sjzd);
|
||||
helper.getView(R.id.tv_gift_name).setBackgroundResource(R.mipmap.gift_name_skzd);
|
||||
}else {
|
||||
helper.setText(R.id.tv_gift_name,giftModel.getGift_name());
|
||||
helper.getView(R.id.tv_gift_name).setBackgroundResource(0);
|
||||
helper.getView(R.id.cl_gift).setBackgroundResource(R.mipmap.gift_bj);
|
||||
}
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
helper.getView(R.id.cl_iv_down_on).setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
helper.setVisible(R.id.iv_down_on,false);
|
||||
} else {
|
||||
helper.getView(R.id.cl_iv_down_on).setBackgroundResource(0);
|
||||
helper.setVisible(R.id.iv_down_on,false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position + (long) curIndex * pageSize;
|
||||
return position;
|
||||
// return position + (long) curIndex * pageSize;
|
||||
}
|
||||
|
||||
private static class MyGestureDetector extends GestureDetector {
|
||||
@@ -79,6 +159,7 @@ public class GiftRoomAdapter extends BaseAdapter {
|
||||
private static RoonGiftModel sGiftModel;
|
||||
private GiftRoomAdapter mAdapter;
|
||||
private RoonGiftModel mGiftModel;
|
||||
|
||||
public void setGiftModel(GiftRoomAdapter adapter, RoonGiftModel gift) {
|
||||
sAdapter = new WeakReference<>(adapter);
|
||||
sGiftModel = gift;
|
||||
@@ -114,106 +195,130 @@ public class GiftRoomAdapter extends BaseAdapter {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder viewHolder;
|
||||
RoonGiftModel giftModel = getItem(position);
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||
viewHolder = new ViewHolder();
|
||||
viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
viewHolder.iv_gift_select= (ImageView) convertView.findViewById(R.id.iv_gift_select);
|
||||
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
viewHolder.item_layout.setOnClickListener(v -> {
|
||||
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
if (giftModel.getIs_lock()==0) {
|
||||
EventBus.getDefault().post(new RoomGiftClickToEvent(this, giftModel, 1));
|
||||
}else if (giftModel.getIs_lock()==1){
|
||||
ToastUtils.show("当前属于爵位礼物,请开通爵位");
|
||||
}
|
||||
});
|
||||
if (giftModel.getIs_lock()==0){
|
||||
viewHolder.iv_gift_select.setVisibility(GONE);
|
||||
}else {
|
||||
viewHolder.iv_gift_select.setVisibility(View.VISIBLE);
|
||||
}
|
||||
/*
|
||||
* 在给View绑定显示的数据时,计算正确的position = position + curIndex * pageSize,
|
||||
*/
|
||||
// viewHolder.tv_gift_num.setVisibility(type.equals("1") ? View.VISIBLE : View.INVISIBLE);
|
||||
// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
|
||||
|
||||
//设置礼物名字
|
||||
viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
//设置选中后的样式
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
}
|
||||
//设置
|
||||
// //设置礼物心动值
|
||||
// if (giftModel.getCardiac().equals("0")) {
|
||||
// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_reduce);
|
||||
// viewHolder.tv_gift_change_love_values.setText(String.format("%s", giftModel.getCardiac()));
|
||||
// @Override
|
||||
// @SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
// public View getView(int position, View convertView, ViewGroup parent) {
|
||||
// ViewHolder viewHolder;
|
||||
// RoonGiftModel giftModel = getItem(position);
|
||||
// if (convertView == null) {
|
||||
// convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||
// viewHolder = new ViewHolder();
|
||||
// viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
// viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
// viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
// viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
// viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
// viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
// viewHolder.iv_gift_select = (ImageView) convertView.findViewById(R.id.iv_gift_select);
|
||||
//
|
||||
// // im_heart现在位于顶层布局中
|
||||
// viewHolder.im_heart = (ImageView) convertView.findViewById(R.id.im_heartssss);
|
||||
// convertView.setTag(viewHolder);
|
||||
// } else {
|
||||
// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_add);
|
||||
// viewHolder.tv_gift_change_love_values.setText(String.format("+%s", giftModel.getCardiac()));
|
||||
// viewHolder = (ViewHolder) convertView.getTag();
|
||||
// }
|
||||
// if (giftModel.isManghe()) {
|
||||
// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
//
|
||||
// viewHolder.item_layout.setOnClickListener(v -> {
|
||||
//// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
// if (giftModel.getIs_lock() == 0) {
|
||||
// EventBus.getDefault().post(new RoomGiftClickToEvent(this, giftModel, 1));
|
||||
// } else if (giftModel.getIs_lock() == 1) {
|
||||
// ToastUtils.show("当前属于爵位礼物,请开通爵位");
|
||||
// }
|
||||
// });
|
||||
// if (giftModel.getIs_lock() == 0) {
|
||||
// viewHolder.iv_gift_select.setVisibility(GONE);
|
||||
// } else {
|
||||
// viewHolder.iv_gift_select.setVisibility(VISIBLE);
|
||||
// }
|
||||
if (giftModel.getGift_bag() == 10) {
|
||||
|
||||
viewHolder.item_layout.setBackgroundResource(R.mipmap.gift_tkzj);
|
||||
viewHolder.tv_gift_name.setText("");
|
||||
viewHolder.tv_gift_name.setBackgroundResource(R.mipmap.gift_name_tkzj);
|
||||
} else if (giftModel.getGift_bag() == 11) {
|
||||
viewHolder.tv_gift_name.setText("");
|
||||
viewHolder.item_layout.setBackgroundResource(R.mipmap.gift_syzc);
|
||||
viewHolder.tv_gift_name.setBackgroundResource(R.mipmap.gift_name_syzc);
|
||||
} else if (giftModel.getGift_bag() == 12) {
|
||||
viewHolder.tv_gift_name.setText("");
|
||||
viewHolder.item_layout.setBackgroundResource(R.mipmap.gift_sjzd);
|
||||
viewHolder.tv_gift_name.setBackgroundResource(R.mipmap.gift_name_skzd);
|
||||
}
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder {
|
||||
public ConstraintLayout item_layout;
|
||||
public TextView tv_gift_name, tv_gift_price, tv_gift_num;
|
||||
public ImageView iv_gift_pic;
|
||||
public TextView tv_gift_change_love_values;
|
||||
public ImageView ivDownOn;
|
||||
public ImageView iv_gift_select;
|
||||
public ConstraintLayout cl_iv_down_on;
|
||||
}
|
||||
// if (TextUtils.isEmpty(giftModel.getIcon())) {
|
||||
// viewHolder.im_heart.setVisibility(GONE);
|
||||
// }else {
|
||||
// viewHolder.im_heart.setVisibility(VISIBLE);
|
||||
// ImageUtils.loadHead(giftModel.getIcon(), viewHolder.im_heart);
|
||||
// }
|
||||
//
|
||||
//// if (giftModel.getIs_cp() == 0 && giftModel.getIs_teacher() == 0 ) {//这是cp礼物
|
||||
//// viewHolder.im_heart.setVisibility(GONE);
|
||||
//// } else {
|
||||
//// if (viewHolder.im_heart != null) {
|
||||
//// viewHolder.im_heart.setVisibility(VISIBLE);
|
||||
//// if (giftModel.getIs_cp() == 1) {
|
||||
//// viewHolder.im_heart.setImageResource(R.mipmap.icon_heart);
|
||||
//// }else if (giftModel.getIs_teacher() == 1) {
|
||||
//// viewHolder.im_heart.setImageResource(R.mipmap.icon_teacher);
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//
|
||||
//
|
||||
// /*
|
||||
// * 在给View绑定显示的数据时,计算正确的position = position + curIndex * pageSize,
|
||||
// */
|
||||
//// viewHolder.tv_gift_num.setVisibility(type.equals("1") ? View.VISIBLE : View.INVISIBLE);
|
||||
//// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
//
|
||||
//
|
||||
// //设置礼物名字
|
||||
// viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
// //设置礼物价格
|
||||
// String surplusTxt = giftModel.getGift_price();
|
||||
// SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
// //ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
// ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
// stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
// viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
//// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
//
|
||||
// //加载礼物图片
|
||||
// ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
// //设置选中后的样式
|
||||
//
|
||||
// if (giftModel.isChecked()) {//被选中
|
||||
// viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
// viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
// viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
// }
|
||||
// //设置
|
||||
//// //设置礼物心动值
|
||||
//// if (giftModel.getCardiac().equals("0")) {
|
||||
//// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_reduce);
|
||||
//// viewHolder.tv_gift_change_love_values.setText(String.format("%s", giftModel.getCardiac()));
|
||||
//// } else {
|
||||
//// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_add);
|
||||
//// viewHolder.tv_gift_change_love_values.setText(String.format("+%s", giftModel.getCardiac()));
|
||||
//// }
|
||||
//// if (giftModel.isManghe()) {
|
||||
//// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
//// }
|
||||
// if (giftModel.getGift_bag() == 10) {
|
||||
//
|
||||
// viewHolder.item_layout.setBackgroundResource(R.mipmap.gift_tkzj);
|
||||
// viewHolder.tv_gift_name.setText("");
|
||||
// viewHolder.tv_gift_name.setBackgroundResource(R.mipmap.gift_name_tkzj);
|
||||
// } else if (giftModel.getGift_bag() == 11) {
|
||||
// viewHolder.tv_gift_name.setText("");
|
||||
// viewHolder.item_layout.setBackgroundResource(R.mipmap.gift_syzc);
|
||||
// viewHolder.tv_gift_name.setBackgroundResource(R.mipmap.gift_name_syzc);
|
||||
// } else if (giftModel.getGift_bag() == 12) {
|
||||
// viewHolder.tv_gift_name.setText("");
|
||||
// viewHolder.item_layout.setBackgroundResource(R.mipmap.gift_sjzd);
|
||||
// viewHolder.tv_gift_name.setBackgroundResource(R.mipmap.gift_name_skzd);
|
||||
// }
|
||||
// return convertView;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// static class ViewHolder {
|
||||
// public ConstraintLayout item_layout;
|
||||
// public TextView tv_gift_name, tv_gift_price, tv_gift_num;
|
||||
// public ImageView iv_gift_pic;
|
||||
// public TextView tv_gift_change_love_values;
|
||||
// public ImageView ivDownOn;
|
||||
// public ImageView iv_gift_select;
|
||||
// public ImageView im_heart;
|
||||
// public ConstraintLayout cl_iv_down_on;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
}
|
||||
|
||||
public void loadDataIfNeeded(String id, int type, String roomId) {
|
||||
if (MvpPre==null){
|
||||
if (MvpPre == null) {
|
||||
MvpPre = new RewardGiftPresenter(this, getActivity());
|
||||
}
|
||||
if (id.equals("0")) {
|
||||
@@ -95,11 +95,12 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
}
|
||||
|
||||
}
|
||||
bdgiftId = "";
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onString(GiftPackEvent event) {
|
||||
if (event!=null && event.getBdid()!=null) {
|
||||
if (event != null && event.getBdid() != null) {
|
||||
bdgiftId = event.getBdid();
|
||||
MvpPre.giftPack();
|
||||
}
|
||||
@@ -107,7 +108,7 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (type==0){
|
||||
if (type == 0) {//当type=0的时候,这个是点击排麦插队礼物的,这里传递的id是0
|
||||
MvpPre.getGiftList("0", type, roomId);
|
||||
}
|
||||
}
|
||||
@@ -147,6 +148,8 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
|
||||
@Override
|
||||
public void setGiftList(List<RoonGiftModel> data, int type) {
|
||||
if (data == null)
|
||||
return;
|
||||
giftList = new ArrayList<>();
|
||||
giftList.addAll(data);
|
||||
pageCount = (int) Math.ceil(data.size() * 1.0 / pageSize);
|
||||
@@ -155,6 +158,7 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
if (pageCount > 0) {
|
||||
roomAdapter = new GiftRoomAdapter(CommonAppContext.getInstance(), data, 0, "0");
|
||||
mBinding.rvGift.setAdapter(roomAdapter);
|
||||
roomAdapter.setNewData(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +186,7 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
@Override
|
||||
public void giftPack(List<GiftPackBean> giftPackBean) {
|
||||
giftPackList = new ArrayList<>();
|
||||
if (getActivity()==null){
|
||||
if (getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -209,7 +213,6 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -222,6 +225,11 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomHotCard() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRewardList(List<RewardUserBean> rewardUserBeanList) {
|
||||
|
||||
@@ -296,12 +304,18 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
roonGiftModel.setNum(giftModel.getNum());
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
if (!giftModel.isChecked()) {
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
||||
giftModel.setChecked(true);
|
||||
roonGiftModel.setChecked(giftModel.isChecked());
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
roonGiftModel.setChecked(giftModel.isChecked());
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
roonGiftModel.setChecked(giftModel.isChecked());
|
||||
}
|
||||
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
@@ -320,13 +334,20 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
selGift = giftModel;
|
||||
if (!giftModel.isChecked()) {
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
||||
giftModel.setChecked(true);
|
||||
roonGiftModel.setChecked(giftModel.isChecked());
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
roonGiftModel.setChecked(giftModel.isChecked());
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, null));
|
||||
roonGiftModel.setChecked(giftModel.isChecked());
|
||||
// EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, roonGiftModel));
|
||||
}
|
||||
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnlineBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/10
|
||||
*@description: 显示用户小头像
|
||||
*/
|
||||
public class LikeUser2Adapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
|
||||
public LikeUser2Adapter() {
|
||||
super(R.layout.item_like_user);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper,T item) {
|
||||
if (item instanceof CircleListBean.LikeList) {
|
||||
ImageUtils.loadHeadCC(((CircleListBean.LikeList) item).getAvatar(), helper.getView(R.id.user_icon));
|
||||
} else {
|
||||
// 可扩展:通过接口回调获取头像 URL
|
||||
ImageUtils.loadHeadCC(((RoomOnlineBean) item).getAvatar(), helper.getView(R.id.user_icon));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
||||
*/
|
||||
public class LikeUserAdapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
|
||||
public LikeUserAdapter() {
|
||||
super(R.layout.item_like_user);
|
||||
super(R.layout.item_like_user_2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.voice.lib_base.ext.inflateBindingWithGeneric
|
||||
import com.xscm.moduleutil.R
|
||||
|
||||
|
||||
open class BaseBottomFragmentDialog<B : ViewBinding?>(private val resourceID: Int) :
|
||||
DialogFragment() {
|
||||
var mDatabind: B? = null
|
||||
val mBinding: B get() = mDatabind!!
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = Dialog(requireActivity(), R.style.myChooseDialog)
|
||||
mDatabind = DataBindingUtil.inflate(LayoutInflater.from(requireContext()), resourceID, null, false) as B
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
dialog.setContentView(mBinding!!.root)
|
||||
val window = dialog.window
|
||||
val params = window!!.attributes
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
params.gravity = Gravity.BOTTOM
|
||||
window.attributes = params
|
||||
dialog.setCanceledOnTouchOutside(true)
|
||||
return dialog
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
mDatabind = inflateBindingWithGeneric(inflater, container, false)
|
||||
// return if (mBinding != null) mBinding!!.root else mDatabind?.root
|
||||
return mBinding?.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(requireDialog().window!!, false)
|
||||
requireDialog().setOnShowListener { dialog: DialogInterface? ->
|
||||
(view.parent as ViewGroup).setBackgroundColor(
|
||||
Color.TRANSPARENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
mDatabind = null
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun setBundleArgs(bundleArgs: Bundle?): BaseBottomFragmentDialog<B> {
|
||||
arguments = bundleArgs
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.voice.lib_base.ext.inflateBindingWithGeneric
|
||||
import com.xscm.moduleutil.R
|
||||
|
||||
open class BaseFragmentDialog<B : ViewBinding?>(private val resourceID: Int) : DialogFragment() {
|
||||
var mDatabind: B? = null
|
||||
val mBinding: B get() = mDatabind!!
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = Dialog(requireActivity(), R.style.myChooseDialog)
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
mDatabind = DataBindingUtil.inflate<ViewDataBinding>(LayoutInflater.from(requireContext()), resourceID, null, false) as B
|
||||
dialog.setContentView(mDatabind!!.root)
|
||||
val window = dialog.window
|
||||
val params = window!!.attributes
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
window.attributes = params
|
||||
dialog.setCanceledOnTouchOutside(true)
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
mDatabind = inflateBindingWithGeneric(inflater, container, false)
|
||||
return if (mBinding != null) mBinding!!.root else null
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(requireDialog().window!!, false)
|
||||
requireDialog().setOnShowListener { dialog: DialogInterface? ->
|
||||
(view.parent as ViewGroup).setBackgroundColor(
|
||||
Color.TRANSPARENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
mDatabind = null
|
||||
}
|
||||
|
||||
|
||||
fun setBundleArgs(bundleArgs: Bundle?): BaseFragmentDialog<B> {
|
||||
arguments = bundleArgs
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
@@ -20,6 +21,8 @@ public abstract class BaseMvpFragment<P extends IPresenter, VDB extends ViewData
|
||||
|
||||
protected abstract P bindPresenter();
|
||||
|
||||
protected boolean isShowSuccess = false;
|
||||
|
||||
@Override
|
||||
public FragmentActivity getSelfActivity() {
|
||||
return getActivity();
|
||||
@@ -37,6 +40,23 @@ public abstract class BaseMvpFragment<P extends IPresenter, VDB extends ViewData
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
isShowSuccess = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
LogUtils.e("BaseMvpFragmentAAA","onHiddenChanged==="+hidden+"====="+this.getClass().getSimpleName()+"===="+isShowSuccess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (MvpPre != null) {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
import androidx.lifecycle.*
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.widget.room.PassRoomException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.MultipartBody
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
open class BaseViewModel : ViewModel(), LifecycleObserver {
|
||||
private var clickTime: Long = 0
|
||||
var baseRepository = RetrofitClient.getInstance()
|
||||
|
||||
private val passRoom by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val error by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val finally by lazy { MutableLiveData<Int>() }
|
||||
|
||||
|
||||
|
||||
|
||||
//进入房间
|
||||
|
||||
var imgListData: MutableLiveData<List<String>> = MutableLiveData()
|
||||
var addImgData = MutableLiveData<Any>()
|
||||
|
||||
|
||||
//运行在UI线程的协程
|
||||
fun launchUI(block: suspend CoroutineScope.() -> Unit) = viewModelScope.launch {
|
||||
try {
|
||||
block()
|
||||
} catch (e: Exception) {
|
||||
if (e is PassRoomException) {
|
||||
passRoom.value = e
|
||||
} else {
|
||||
error.value = e
|
||||
// throw e
|
||||
}
|
||||
|
||||
} finally {
|
||||
finally.value = 200
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求失败,出现异常
|
||||
*/
|
||||
fun getError(): LiveData<Exception> {
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求完成,在此处做一些关闭操作
|
||||
*/
|
||||
fun getFinally(): LiveData<Int> {
|
||||
return finally
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.AppUtils;
|
||||
import com.blankj.utilcode.util.FileUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
@@ -43,6 +44,7 @@ import com.tencent.qcloud.tuicore.TUILogin;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.event.AppLifecycleEvent;
|
||||
import com.xscm.moduleutil.event.UnreadCountEvent;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
@@ -75,7 +77,7 @@ import lombok.Setter;
|
||||
* Created by cxf on 2017/8/3.
|
||||
*/
|
||||
|
||||
public class CommonAppContext extends MultiDexApplication implements Application.ActivityLifecycleCallbacks {
|
||||
public class CommonAppContext extends MultiDexApplication implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
private static CommonAppContext sInstance;
|
||||
private static Handler sMainThreadHandler;
|
||||
@@ -95,17 +97,19 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
|
||||
public boolean isShowAg;
|
||||
|
||||
public boolean isRoomJoininj=false;
|
||||
public boolean isRoomJoininj = false;
|
||||
|
||||
public String playCover;
|
||||
public boolean showSelf;//盲盒是否能送自己
|
||||
public String playName;
|
||||
private MqttConnect mqttConnect=null;
|
||||
private MqttConnect mqttConnect = null;
|
||||
|
||||
// 添加后台状态标记
|
||||
private boolean wasInBackground = false;
|
||||
|
||||
public boolean isMai=false;
|
||||
public boolean isMai = false;
|
||||
|
||||
public boolean isLogout = false;
|
||||
|
||||
public void onAppBackground() {
|
||||
wasInBackground = true;
|
||||
@@ -123,16 +127,24 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
|
||||
private AppStateListener appStateListener;
|
||||
private boolean isListeningUnreadCount = false;
|
||||
public boolean onConnectFailed=false;//是否重连
|
||||
public boolean onConnectFailed = false;//是否重连
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public Map<String, Integer> onlineMap=new HashMap<>();
|
||||
public Map<String, Integer> onlineMap = new HashMap<>();
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public UnreadCountEvent unreadCountEvent;
|
||||
|
||||
public static int selectRelease = -1;
|
||||
|
||||
public int is_open = 0;//主题的开关
|
||||
|
||||
public String appId = "com.qxcm.qxlive";
|
||||
public String appVersionCode = "88";
|
||||
public String appVersionName = "1.0.9.8";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@@ -154,16 +166,19 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
|
||||
CrashHandler.init(this);
|
||||
|
||||
if (SpUtil.getShelf()!=0) {
|
||||
if (SpUtil.getShelf() != 0) {
|
||||
SpUtil.setShelf(1);
|
||||
}
|
||||
|
||||
//设置mqtt环境 false 测试环境 true 正式环境
|
||||
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
|
||||
//设置http环境 false 测试环境 true 正式环境
|
||||
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(false);
|
||||
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
|
||||
if (SpUtil.getTaskService() == 1){//当如果是正式服的时候,这里就变成可以设置成辅助服务器,当如果是测试服务的时候,就是变成了测试了,
|
||||
selectRelease = 1;
|
||||
}
|
||||
|
||||
//设置mqtt环境 false 测试环境 true 正式环境
|
||||
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
|
||||
//设置http环境 false 测试环境 true 正式环境
|
||||
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(selectRelease);
|
||||
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
|
||||
|
||||
initialization();
|
||||
}
|
||||
@@ -210,6 +225,58 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
}
|
||||
}
|
||||
|
||||
public void dialogHttp(){
|
||||
new ConfirmDialog(ActivityUtils.getTopActivity(),
|
||||
"提示",
|
||||
"当前网络环境异常,请重试",
|
||||
"确认",
|
||||
"取消",
|
||||
v -> {
|
||||
// 点击“确认”按钮时执行删除操作
|
||||
selectRelease = 3;
|
||||
initHttp();
|
||||
|
||||
},
|
||||
v -> {
|
||||
selectRelease = 3;
|
||||
initHttp();
|
||||
// 点击“取消”按钮时什么都不做
|
||||
}, false, 0).show();
|
||||
}
|
||||
|
||||
public void initHttp(){
|
||||
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(selectRelease);
|
||||
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
|
||||
try {
|
||||
RetrofitClient.INSTANCE=null;
|
||||
RetrofitClient.getInstance();
|
||||
clearLoginInfo();
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearLoginDialog(String msg){
|
||||
new ConfirmDialog(ActivityUtils.getTopActivity(),
|
||||
"提示",
|
||||
msg,
|
||||
"",
|
||||
"确定",
|
||||
v -> {
|
||||
// 点击“确认”按钮时执行删除操作
|
||||
|
||||
},
|
||||
v -> {
|
||||
try {
|
||||
clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
// 点击“取消”按钮时什么都不做
|
||||
}, true, 4).show();
|
||||
}
|
||||
|
||||
// 更新未读消息数的方法
|
||||
private void updateUnreadMessageCount() {
|
||||
V2TIMManager.getConversationManager().getTotalUnreadMessageCount(new V2TIMValueCallback<Long>() {
|
||||
@@ -229,17 +296,19 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
|
||||
// 通知未读数变化的方法(可以发送广播或EventBus事件)
|
||||
private void notifyUnreadCountChanged(long unreadCount) {
|
||||
UnreadCountEvent event =unreadCountEvent;
|
||||
if (event==null){
|
||||
event=new UnreadCountEvent();
|
||||
UnreadCountEvent event = unreadCountEvent;
|
||||
if (event == null) {
|
||||
event = new UnreadCountEvent();
|
||||
}
|
||||
event.setALong(unreadCount);
|
||||
// 使用EventBus通知
|
||||
CommonAppContext.getInstance().setUnreadCountEvent(event);
|
||||
EventBus.getDefault().post(event);
|
||||
EventBus.getDefault().post(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查网络是否可用
|
||||
*
|
||||
* @return true表示网络可用,false表示网络不可用
|
||||
*/
|
||||
public boolean isNetworkAvailable() {
|
||||
@@ -439,24 +508,12 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
if (SpUtil.isAgreePolicy()) {
|
||||
checkInEmulator();
|
||||
// UtilConfig.checkInEmulator();
|
||||
AgoraManager.getInstance();
|
||||
MessageListenerSingleton.getInstance();
|
||||
CrashReport.initCrashReport(this, "b45883f58f", true);/*bugly初始化*/
|
||||
// // 启动 MQTT 服务
|
||||
// Intent mqttServiceIntent = new Intent(this, MyMqttService.class);
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// startForegroundService(mqttServiceIntent);
|
||||
// } else {
|
||||
// startService(mqttServiceIntent);
|
||||
// }
|
||||
|
||||
// mqttConnect=MqttConnect.getInstance(this, currentEnvironment.getMqttUrl(),"android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.101.98","android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect.mqttClient();
|
||||
CrashReport.initCrashReport(this, "b45883f58f", true);/*bugly初始化*/
|
||||
|
||||
// 每次启动应用时重置状态
|
||||
SpUtil.getInstance().setBooleanValue("youth_model_shown", false);
|
||||
startInitSdk();
|
||||
|
||||
// 初始化(通常在Application或Activity的onCreate中)
|
||||
CosUploadManager.getInstance(CommonAppContext.getInstance());
|
||||
}
|
||||
@@ -528,9 +585,12 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
public void upMqtt(){
|
||||
if (mqttConnect == null){
|
||||
mqttConnect=MqttConnect.getInstance(this, currentEnvironment.getMqttUrl(),"android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.101.98","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect.mqttClient();
|
||||
}
|
||||
|
||||
AgoraManager.getInstance();
|
||||
MessageListenerSingleton.getInstance();
|
||||
startInitSdk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -759,15 +819,25 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
SpUtil.putToken("");
|
||||
|
||||
// piaoPingManager.unsubscribe();
|
||||
FileUtils.deleteAllInDir(getCacheDir());
|
||||
FileUtils.deleteAllInDir(getExternalCacheDir());
|
||||
// TODO: 2026/1/22 清楚本地缓存,但是在清楚的时候,会把所有的图片缓存就清除了,这是不对的,今天进行了修改,注释掉
|
||||
// FileUtils.deleteAllInDir(getCacheDir());
|
||||
// FileUtils.deleteAllInDir(getExternalCacheDir());
|
||||
AgoraManager.getInstance().destroy();
|
||||
// 每次启动应用时重置状态
|
||||
SpUtil.setBooleanValue("youth_model_shown", false);
|
||||
|
||||
if (mqttConnect != null){
|
||||
mqttConnect.close();
|
||||
mqttConnect = null;
|
||||
}
|
||||
|
||||
isLogout = true;
|
||||
// 发送广播通知所有Activity刷新状态
|
||||
Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
sendBroadcast(refreshIntent);
|
||||
// Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
// sendBroadcast(refreshIntent);
|
||||
|
||||
ActivityUtils.finishAllActivities();
|
||||
|
||||
Intent intent = new Intent("com.qxcm.qxlive.LAUNCH_PAGE");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(intent);
|
||||
@@ -808,7 +878,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
AppLifecycleUtil.onAppFrontGround();
|
||||
}
|
||||
if (playId!=null && !playId.equals("")){
|
||||
RetrofitClient.getInstance().userRoomBack(playId, "2");
|
||||
// RetrofitClient.getInstance().userRoomBack(playId, "2");
|
||||
}
|
||||
activityCount++;
|
||||
}
|
||||
@@ -823,7 +893,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
}
|
||||
|
||||
if (playId!=null && !playId.equals("")){
|
||||
RetrofitClient.getInstance().userRoomBack(playId, "1");
|
||||
// RetrofitClient.getInstance().userRoomBack(playId, "1");
|
||||
}
|
||||
|
||||
AppLifecycleUtil.onAppBackGround();
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.xscm.moduleutil.utils.config.EnvironmentEnum
|
||||
|
||||
|
||||
object ExternalResConstants {
|
||||
//================================================================================MQTT======================================================================================
|
||||
//================================================================================MQTT======================================================================================
|
||||
// var IS_MQTT_RELEASE = true
|
||||
// val MQTT_PATH_DEBUG = "tcp://1.13.181.248"
|
||||
// val MQTT_PATH_RELEASE = "tcp://1.13.101.98"
|
||||
@@ -17,12 +17,15 @@ object ExternalResConstants {
|
||||
// }
|
||||
// }
|
||||
//================================================================================HTTP======================================================================================
|
||||
var IS_HTTP_RELEASE = true
|
||||
val HTTP_PATH_DEBUG:EnvironmentEnum = EnvironmentEnum.TEST
|
||||
val HTTP_PATH_RELEASE:EnvironmentEnum = EnvironmentEnum.PRODUCTION
|
||||
var IS_HTTP_RELEASE: Int = 1 //0 测试环境 1 正式环境 2 辅助环境
|
||||
val HTTP_PATH_DEBUG: EnvironmentEnum = EnvironmentEnum.TEST
|
||||
val HTTP_PATH_RELEASE: EnvironmentEnum = EnvironmentEnum.PRODUCTION
|
||||
val HTTP_AUXILIARY: EnvironmentEnum = EnvironmentEnum.Auxiliary
|
||||
fun HTTP_PATH(): EnvironmentEnum {
|
||||
return if (IS_HTTP_RELEASE) {
|
||||
return if (IS_HTTP_RELEASE == 1) {
|
||||
HTTP_PATH_RELEASE
|
||||
} else if (IS_HTTP_RELEASE == 3) {
|
||||
HTTP_AUXILIARY
|
||||
} else {
|
||||
HTTP_PATH_DEBUG
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
public class RealTimeMessages<T> {
|
||||
|
||||
public T data;
|
||||
|
||||
public int code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.xscm.moduleutil.base
|
||||
|
||||
|
||||
data class SocketBean(
|
||||
val code: Int, val data: Any
|
||||
)
|
||||
@@ -23,7 +23,7 @@ object WebUrlConstants {
|
||||
val WEB_PROP_MALL_URL = BASE_URL + "/web/index.html#/pages/prop/propMall?id=%s"
|
||||
|
||||
/**公会*/
|
||||
val WEB_GUILD_URL = BASE_URL + "/web/index.html#/pages/union/index?id=%s"
|
||||
val WEB_GUILD_URL = BASE_URL + "/web/index.html#/pages/union/index?id=%s&guild_id=%s"
|
||||
|
||||
/**等级*/
|
||||
val WEB_GRADE_URL = BASE_URL + "/web/index.html#/pages/other/grade?id=%s"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/14 18:47
|
||||
* 用途:app配置的客服用户id和name
|
||||
*/
|
||||
class AppCustomerBean {
|
||||
var user_id: String = ""
|
||||
var user_name: String = ""
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
class BeforeJoinRoomCheckBean :Serializable {
|
||||
var room_id:String? = null
|
||||
var msg:String? = null
|
||||
var code:Int = -1
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/7 19:47
|
||||
* 用途:
|
||||
*/
|
||||
class BlackRoomBean {
|
||||
|
||||
var id: Int = 0
|
||||
var p_room_id: Int = 0
|
||||
var room_id: Int = 0
|
||||
var user_id: Int = 0
|
||||
var meet_user_id: Int = 0
|
||||
var end_time: Int = 0
|
||||
var createtime: Int = 0
|
||||
var status: Int = 0
|
||||
var heart_value: String? = ""
|
||||
/* "id": 1,
|
||||
"p_room_id": 6065,
|
||||
"room_id": 6071,
|
||||
"user_id": 20142,
|
||||
"meet_user_id": 20137,
|
||||
"end_time": 1767957473,
|
||||
"createtime": 1767784373,
|
||||
"status": 1,
|
||||
"heart_value": null*/
|
||||
}
|
||||
@@ -16,6 +16,6 @@ public class BlackUserBean {
|
||||
private int sex;
|
||||
private String user_code;
|
||||
private int is_online;
|
||||
private int is_follow;
|
||||
private int is_follow;// 是否关注 0:未关注 1:已关注 2:别人关注了你,你没有关注别人,这个2只会在粉丝中使用
|
||||
private List<String> icon;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/21 11:37
|
||||
* 用途:盲盒转盘状态
|
||||
*/
|
||||
class BlindBoxStatus {
|
||||
var gift_bag_id: Int = 0
|
||||
var name: String = ""
|
||||
var status: Int = 0 //0关闭 1开启
|
||||
var status_str: String = ""
|
||||
var icon: String = ""
|
||||
|
||||
// "gift_bag_id": 11,
|
||||
// "name": "岁月之城",
|
||||
// "status": 1,
|
||||
// "status_str": "开启中",
|
||||
// "icon": null
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -10,7 +11,7 @@ import lombok.Data;
|
||||
* @Description $
|
||||
*/
|
||||
@Data
|
||||
public class CombinedGiftBean {
|
||||
public class CombinedGiftBean implements Serializable {
|
||||
private int gift_id;
|
||||
private String gift_price;
|
||||
private String gift_name;
|
||||
@@ -21,7 +22,7 @@ public class CombinedGiftBean {
|
||||
private boolean is_liang;
|
||||
|
||||
@Data
|
||||
public static class TopUsers {
|
||||
public static class TopUsers implements Serializable{
|
||||
private int user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/4 10:22
|
||||
* 用途:装扮价格详情
|
||||
*/
|
||||
class DecorateDetailBean {
|
||||
// 用户信息(服务端返回的user_info字段)
|
||||
@SerializedName("user_info")
|
||||
var userInfo: UserInfoDecorate? = UserInfoDecorate()
|
||||
|
||||
// 装饰商品核心信息(服务端返回的decorate字段)
|
||||
@SerializedName("decorate")
|
||||
var decorate: Decorate? = null
|
||||
|
||||
/**
|
||||
* 用户信息内部类(对应服务端user_info)
|
||||
*/
|
||||
class UserInfoDecorate {
|
||||
@SerializedName("user_id")
|
||||
var userId: Int = 0
|
||||
|
||||
@SerializedName("user_coin")
|
||||
var userCoin: String = ""
|
||||
}
|
||||
|
||||
/**
|
||||
* 装饰商品核心信息(对应服务端decorate,直接解析服务端返回数据)
|
||||
* 注意:与之前适配器的Item模型解耦,该类仅负责接收服务端数据,不承担适配器布局类型职责
|
||||
*/
|
||||
class Decorate {
|
||||
@SerializedName("title")
|
||||
var title: String = "" // 商品名称(如“粉色花头”)
|
||||
@SerializedName("price")
|
||||
var price : String =""
|
||||
@SerializedName("base_image")
|
||||
var base_image : String =""
|
||||
@SerializedName("price_list")
|
||||
var priceList: List<PriceListBean> = ArrayList() // 价格/时长列表(服务端返回数组)
|
||||
}
|
||||
|
||||
/**
|
||||
* 价格/时长明细bean(对应服务端price_list中的单个对象)
|
||||
* 可直接解析服务端返回的每个价格项数据,同时适配适配器的PriceItem模型
|
||||
*/
|
||||
class PriceListBean {
|
||||
@SerializedName("price")
|
||||
var price: String = "" // 现价
|
||||
|
||||
@SerializedName("original_price")
|
||||
var originalPrice: String = "" // 原价
|
||||
|
||||
@SerializedName("discount")
|
||||
var discount: String = "" // 折扣(如“5.0”)
|
||||
|
||||
@SerializedName("day")
|
||||
var day: Int = 0 // 有效天数
|
||||
|
||||
@SerializedName("month")
|
||||
var month: String = "" // 有效月数
|
||||
|
||||
@SerializedName("end_time")
|
||||
var endTime: String = "" // 有效期截止时间
|
||||
}
|
||||
|
||||
// ---------------------- 适配器适配相关:转换方法 + 适配器所需模型 ----------------------
|
||||
/**
|
||||
* 适配器的Item数据模型(密封类,区分单行/多选项)
|
||||
* 与服务端数据模型解耦,专门用于RecyclerView适配器布局
|
||||
*/
|
||||
sealed class DecorateAdapterItem {
|
||||
// 单行信息类型(如“商品价格”“有效期至”)
|
||||
data class SingleItem(
|
||||
val label: String, // 左侧标签文字
|
||||
val content: String // 右侧内容文字
|
||||
) : DecorateAdapterItem()
|
||||
|
||||
// 购买时长多选项类型(承载所有时长选项)
|
||||
data class MultiOptionItem(
|
||||
val options: List<PriceListBean> // 直接复用PriceListBean(已适配服务端数据)
|
||||
) : DecorateAdapterItem()
|
||||
|
||||
// type=12专用:购买次数(加减按钮)
|
||||
data class BuyCountItem(
|
||||
val initialCount: Int,
|
||||
val unitPrice: String
|
||||
) : DecorateAdapterItem()
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换方法:将服务端数据(Decorate)转换为适配器所需数据列表(List<DecorateAdapterItem>)
|
||||
* 实现服务端数据与适配器的桥接,方便适配器直接使用
|
||||
* @param defaultSelectedPos 默认选中的时长选项下标(默认0,即第一个选项)
|
||||
*/
|
||||
fun convertToAdapterData(
|
||||
decorate: Decorate?,
|
||||
defaultSelectedPos: Int = 0
|
||||
): List<DecorateAdapterItem> {
|
||||
val adapterDataList = mutableListOf<DecorateAdapterItem>()
|
||||
if (decorate == null ) {
|
||||
return adapterDataList
|
||||
}
|
||||
|
||||
if ( decorate.priceList.isEmpty()){
|
||||
// ---------- type=12:解析单个字段(无price_list),新增购买次数、商品总价 ----------
|
||||
val unitPrice = decorate.price// 直接取Decorate的singlePrice(服务端返回的单价)
|
||||
val unitPriceStr = unitPrice // 格式化单价,避免小数异常
|
||||
|
||||
|
||||
// 2. 商品单价(单行项,取decorate.singlePrice)
|
||||
adapterDataList.add(
|
||||
DecorateAdapterItem.SingleItem(
|
||||
label = "商品单价",
|
||||
content = unitPriceStr
|
||||
)
|
||||
)
|
||||
|
||||
// 3. 购买次数(type=12专用,初始数量1,传入单价用于计算总价)
|
||||
adapterDataList.add(
|
||||
DecorateAdapterItem.BuyCountItem(
|
||||
initialCount = 1,
|
||||
unitPrice = unitPrice
|
||||
)
|
||||
)
|
||||
|
||||
// 4. 商品总价(单行项,初始:单价×1)
|
||||
adapterDataList.add(
|
||||
DecorateAdapterItem.SingleItem(
|
||||
label = "商品总价",
|
||||
content = unitPriceStr // 初始总价=单价×1
|
||||
)
|
||||
)
|
||||
|
||||
}else {
|
||||
|
||||
// 安全获取默认选中项(防止下标越界)
|
||||
val selectedPos = if (defaultSelectedPos in decorate.priceList.indices) {
|
||||
defaultSelectedPos
|
||||
} else {
|
||||
0
|
||||
}
|
||||
val selectedPriceItem = decorate.priceList[selectedPos]
|
||||
|
||||
// 1. 添加“商品价格”单行项(取选中项的现价)
|
||||
adapterDataList.add(
|
||||
DecorateAdapterItem.SingleItem(
|
||||
label = "商品价格",
|
||||
content = "${selectedPriceItem.price}" // 拼接货币符号,优化展示
|
||||
)
|
||||
)
|
||||
|
||||
// 2. 添加“有效期至”单行项(取选中项的截止时间)
|
||||
adapterDataList.add(
|
||||
DecorateAdapterItem.SingleItem(
|
||||
label = "有效期至",
|
||||
content = selectedPriceItem.endTime
|
||||
)
|
||||
)
|
||||
|
||||
// 3. 添加“购买时长”多选项(承载所有价格/时长列表)
|
||||
adapterDataList.add(
|
||||
DecorateAdapterItem.MultiOptionItem(
|
||||
options = decorate.priceList
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
return adapterDataList
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/27 16:47
|
||||
* 用途:
|
||||
*/
|
||||
class FamilyEarnings {
|
||||
|
||||
var id: Int=0
|
||||
var nickname: String=""
|
||||
var avatar: String=""
|
||||
var user_code: String=""
|
||||
var earnings: String=""
|
||||
var createtime: Long=0
|
||||
var gift_name: String=""
|
||||
var gift_price: String=""
|
||||
|
||||
/* id 列表 id
|
||||
|
||||
nickname 用户昵称
|
||||
|
||||
avatar
|
||||
|
||||
user_code
|
||||
|
||||
earnings 收益
|
||||
createtime
|
||||
|
||||
gift_name 礼物名称
|
||||
|
||||
gift_price 礼物价格*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/30 9:44
|
||||
* 用途:节日主题接口
|
||||
*/
|
||||
class FestivalThemeBean {
|
||||
var is_open : Int = 0 //主题开关
|
||||
var theme_name : String = "" //主题名称
|
||||
}
|
||||
@@ -41,7 +41,8 @@ public class GiftBean {
|
||||
public boolean isSameGiftFromSameSender(GiftBean other) {
|
||||
if (other == null) return false;
|
||||
return Objects.equals(gift_id, other.gift_id) &&
|
||||
Objects.equals(senderName, other.senderName);
|
||||
Objects.equals(senderName, other.senderName) &&
|
||||
Objects.equals(nickname,other.nickname);
|
||||
}
|
||||
|
||||
// 生成礼物唯一键
|
||||
|
||||
@@ -3,16 +3,18 @@ package com.xscm.moduleutil.bean;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/27
|
||||
*@description: 礼盒数据
|
||||
* @author qx
|
||||
* @data 2025/5/27
|
||||
* @description: 礼盒数据
|
||||
*/
|
||||
@Data
|
||||
public class GiftBoxBean {
|
||||
private String user_gold;//累计获取的金币
|
||||
private List<GiftBean> gift_box_list;
|
||||
private TaskDataBean tasks;
|
||||
private List<TaskDataBean> tasks;
|
||||
|
||||
@Data
|
||||
public static class GiftBean {
|
||||
// private String giftName; //初级礼盒、高级礼盒
|
||||
@@ -21,10 +23,25 @@ public class GiftBoxBean {
|
||||
// private String giftTypeNumber; //当前的百分比
|
||||
// private String giftTypeStatus; //是否已经可以
|
||||
|
||||
|
||||
/*{
|
||||
"id":2,
|
||||
"name":"高级礼盒",
|
||||
"title":"最高可获得10000金币",
|
||||
"icon":"",
|
||||
"highest_gain":"10000",
|
||||
"meet":"300",
|
||||
"unlock_progress":0,
|
||||
"all_number":"1",
|
||||
"taday_number":0,
|
||||
"taday_number_left":1,
|
||||
"status":0,
|
||||
"status_str":"未解锁"
|
||||
}*/
|
||||
private String id;//礼盒ID
|
||||
private String name;//礼盒名称
|
||||
private String title; //标题
|
||||
private String icon ;//图标
|
||||
private String icon;//图标
|
||||
private String highest_gain;//最高获得金币数
|
||||
private String meet;//满多少金币可抽
|
||||
private String unlock_progress;// //解锁进度
|
||||
@@ -37,23 +54,63 @@ public class GiftBoxBean {
|
||||
|
||||
@Data
|
||||
public static class TaskDataBean {
|
||||
private List<DailyTasksBean> daily_tasks;
|
||||
private List<DailyTasksBean> daily_tasks_special;
|
||||
private List<DailyTasksBean> usual_tasks;
|
||||
private List<DailyTasksBean> task_list;
|
||||
// private List<DailyTasksBean> daily_tasks_special;
|
||||
// private List<DailyTasksBean> usual_tasks;
|
||||
// private List<DailyTasksBean> teacher_tasks;
|
||||
|
||||
private int task_type_id;
|
||||
private String task_type_name;
|
||||
private int is_lock;//锁:0 不开启锁 1 开启锁
|
||||
private int wait_reward_num;//待领取奖励数量
|
||||
@Data
|
||||
public static class DailyTasksBean {
|
||||
private int task_id;////任务Id
|
||||
private String task_name;//任务名称
|
||||
private String icon;//图标
|
||||
private int gold_reward; //奖励金币
|
||||
private int target_quantity;//目标完成数量
|
||||
private int task_type;//任务类型 1每日任务 2每日特殊任务 3平台常规任务
|
||||
private int task_status;//任务状态:1完成 2去领取 3已领取
|
||||
private String task_type_str; //任务状态
|
||||
private int processing_type;//跳转状态:
|
||||
private String processing_type_str;//跳转状态
|
||||
private String from_id;
|
||||
|
||||
/* {
|
||||
"task_id":20,
|
||||
"icon":null,
|
||||
"task_name":"每日在房间时长 15 分钟(0/15)",
|
||||
"target_quantity":900,
|
||||
"task_type":2,
|
||||
"jump_type":4,
|
||||
"tasks_bag_id":0,
|
||||
"task_status":1,
|
||||
"task_type_str":"去完成",
|
||||
"jump_type_str":"跳转房间",
|
||||
"from_id":6040,
|
||||
"is_time":1,
|
||||
"processing_type":2,
|
||||
"processing_type_str":"去观看",
|
||||
"reward_str":"25金币,笨笨狗x1,
|
||||
仙女之星头像框,
|
||||
三八大杠"
|
||||
}*/
|
||||
|
||||
private int task_id;////任务Id
|
||||
private String icon;//图标
|
||||
private String task_name;//任务名称
|
||||
private int target_quantity;//目标完成数量
|
||||
private int task_type;//任务类型 1每日任务 2每日特殊任务 3平台常规任务
|
||||
/**
|
||||
* 0 不跳转
|
||||
* 1 跳转实名
|
||||
* 2 跳转我的相册
|
||||
* 3 跳转绑定管理
|
||||
* 4 跳转房间
|
||||
* 5 跳转申请加入公会
|
||||
* 6 跳转充值
|
||||
*/
|
||||
private int jump_type; //跳转类型
|
||||
private int tasks_bag_id; //任务礼盒ID
|
||||
private int task_status;//任务状态:1完成 2去领取 3已领取
|
||||
private String task_type_str; //任务状态
|
||||
private String jump_type_str; //跳转类型提示
|
||||
private String from_id;
|
||||
private int is_time;
|
||||
private int processing_type;//跳转状态:
|
||||
private String processing_type_str;//跳转状态
|
||||
private String reward_str;//1:奖励
|
||||
private String student_id;//徒弟ID
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -10,11 +11,11 @@ import lombok.Data;
|
||||
* @Description $ 礼物墙展示接口
|
||||
*/
|
||||
@Data
|
||||
public class GiftUserWallBean {
|
||||
public class GiftUserWallBean implements Serializable {
|
||||
private List<GiftWallBean> liang;
|
||||
private List<GiftWallBean> no_liang;
|
||||
@Data
|
||||
public static class GiftWallBean {
|
||||
public static class GiftWallBean implements Serializable {
|
||||
private int gift_id;
|
||||
private String gift_price;
|
||||
private String gift_name;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/23 9:59
|
||||
* 用途:礼物墙用户列表
|
||||
*/
|
||||
class GiftWallUserBean {
|
||||
var count : Int = 0
|
||||
|
||||
var users :List<GiftWallUserItemBean> = ArrayList()
|
||||
|
||||
class GiftWallUserItemBean {
|
||||
var avatar : String = ""
|
||||
var nickname : String = ""
|
||||
var user_id : String = ""
|
||||
var count : Int = 0
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/3 10:13
|
||||
* 用途:群聊实体类
|
||||
*/
|
||||
class GroupBean {
|
||||
var guild_id: String = ""
|
||||
var guild_cover: String = ""
|
||||
var is_deacon: Int = 0 //是否是群主 1:是 ,其他的不是 2:管理员 3:普通成员
|
||||
var user_list: List<GroupUserBean> = ArrayList()
|
||||
|
||||
var name: String = ""
|
||||
var notification: String = ""
|
||||
var mute_all_member : Int = 0 //是否全体禁言 1:是 0:不是
|
||||
class GroupUserBean {
|
||||
var is_online: Int = 0 //是否在线 1:在线 0:不在线
|
||||
var market_value: Int = 0 //身价
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
var user_code: String = ""
|
||||
var user_id: Int = 0
|
||||
var createtime: String = ""
|
||||
var is_self: Int = 0 //是否是本人 1:是 0:不是
|
||||
var role: String = ""
|
||||
var role_str: String = ""
|
||||
var in_room_id: Int = 0 //是否在房间内 1:在 0:不在
|
||||
var is_mute: Int = 0 //是否被禁言 1:是 0:不是
|
||||
var group_role : Int = 0 //群角色 1:群主 2:管理员 3:普通成员
|
||||
}
|
||||
|
||||
|
||||
/*"guild_id": "f627",
|
||||
"guild_cover": "https://yusheng-1369267578.cos.ap-guangzhou.myqcloud.com/images/android_images/325ee1f528343bb09ddc086b2b83b190.jpg",
|
||||
"is_deacon": 1,
|
||||
"user_list": [
|
||||
{
|
||||
"is_online": 1,
|
||||
"market_value": 28,
|
||||
"nickname": "🥭芒的很",
|
||||
"avatar": "https://yusheng-1369267578.cos.ap-guangzhou.myqcloud.com/images/ios_images/1764941796523.jpeg",
|
||||
"user_code": "10001",
|
||||
"user_id": 21211,
|
||||
"createtime": "2025-12-31 13:20:28",
|
||||
"is_self": 0,
|
||||
"role": "Member",
|
||||
"role_str": "普通群成员",
|
||||
"in_room_id": 0
|
||||
}
|
||||
],
|
||||
"name": "美丽的眼神的家族",
|
||||
"notification": ""*/
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/3 14:07
|
||||
* 用途:群成员列表
|
||||
*/
|
||||
class GroupUserListBean {
|
||||
var page : String=""
|
||||
var limit : String=""
|
||||
var count : String=""
|
||||
var list : List<GroupBean.GroupUserBean>?= ArrayList()
|
||||
}
|
||||
102
BaseModule/src/main/java/com/xscm/moduleutil/bean/HeartCpBean.kt
Normal file
102
BaseModule/src/main/java/com/xscm/moduleutil/bean/HeartCpBean.kt
Normal file
@@ -0,0 +1,102 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
class HeartCpBean : Serializable {
|
||||
|
||||
|
||||
/* {
|
||||
"code": 1,
|
||||
"msg": "\u6210\u529f",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"user_id1": 20001,
|
||||
"user_id2": 20003,
|
||||
"status": 1,
|
||||
"level": 1,
|
||||
"exp": 9198,
|
||||
"createtime": 1763720783,
|
||||
"user_info1": {
|
||||
"user_id": 20001,
|
||||
"nickname": "\u9ad8\u5174\u7684\u5c0f\u6d77\u817e",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/ios_images\/1761615690733.jpeg"
|
||||
},
|
||||
"user_info2": {
|
||||
"user_id": 20003,
|
||||
"nickname": "\u79c0\u4e3d\u7684\u978b\u57ab",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/android_images\/33e31b18577856c4f10906b7cabaa698.jpg"
|
||||
},
|
||||
"next_level_exp": 802,
|
||||
"pendant": "https:\/\/cos.xscmmidi.site\/admin\/520liuxingyu_17637096968287.mp4",
|
||||
"gift_log": [
|
||||
{
|
||||
"id": 323,
|
||||
"room_id": 6003,
|
||||
"from_user_id": 20001,
|
||||
"to_user_id": 20003,
|
||||
"gift_id": 313,
|
||||
"num": 1,
|
||||
"cp_zone_id": 1,
|
||||
"exp": "1314",
|
||||
"exp_total": "9198",
|
||||
"remark": "\u9001\u7ed9\u79c0\u4e3d\u7684\u978b\u57ab1\u4e2a\u9e4a\u7f18\u7ec7\u68a6,\u83b7\u5f971314\u7ecf\u9a8c\u503c\uff0c\u603b\u7ecf\u9a8c\u503c\u589e\u52a0\u81f39198",
|
||||
"createtime": 1763796118,
|
||||
"gift_name": "\u9e4a\u7f18\u7ec7\u68a6",
|
||||
"from_user_info": {
|
||||
"user_id": 20001,
|
||||
"nickname": "\u9ad8\u5174\u7684\u5c0f\u6d77\u817e",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/ios_images\/1761615690733.jpeg"
|
||||
},
|
||||
"to_user_info": {
|
||||
"user_id": 20003,
|
||||
"nickname": "\u79c0\u4e3d\u7684\u978b\u57ab",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/android_images\/33e31b18577856c4f10906b7cabaa698.jpg"
|
||||
}
|
||||
}]
|
||||
},
|
||||
"api_version": ""
|
||||
}*/
|
||||
|
||||
var id: Int = 0
|
||||
var user_id1: Int = 0
|
||||
var user_id2: Int = 0
|
||||
var status: Int = 0
|
||||
var level: Int = 0
|
||||
var exp: Long = 0
|
||||
var createtime: Long = 0
|
||||
var user_info1: UserInfo = UserInfo()
|
||||
var user_info2: UserInfo = UserInfo()
|
||||
var next_level_exp: Long = 0
|
||||
var pendant: String = ""
|
||||
var gift_log: List<GiftLog> = ArrayList()
|
||||
var api_version: String = ""
|
||||
|
||||
class GiftLog : Serializable {
|
||||
var id: Int = 0
|
||||
var room_id: Int = 0
|
||||
var from_user_id: Int = 0
|
||||
var to_user_id: Int = 0
|
||||
var gift_id: Int = 0
|
||||
var num: Int = 0
|
||||
var cp_zone_id: Int = 0
|
||||
var exp: String = ""
|
||||
var exp_total: String = ""
|
||||
var remark: String = ""
|
||||
var createtime: Long = 0
|
||||
var gift_name: String = ""
|
||||
var from_user_info: UserInfo = UserInfo()
|
||||
var to_user_info: UserInfo = UserInfo()
|
||||
|
||||
class UserInfo : Serializable {
|
||||
var user_id: Int = 0
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
class UserInfo : Serializable {
|
||||
var user_id: Int = 0
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
}
|
||||
}
|
||||
@@ -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"*/
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public class MusicSongBean implements Serializable {
|
||||
private String duration;//播放时长
|
||||
private int sort;//
|
||||
private String user_id;
|
||||
private String user_code="";
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String dress;
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/26 18:45
|
||||
* 用途:
|
||||
*/
|
||||
class MyFamilyBean {
|
||||
var group_id: String = "" //群组id
|
||||
var name: String = "" //家族名称
|
||||
var user_id: Int = 0 //族长id
|
||||
var group_members_num: Int = 0 //签约次数 群组人数
|
||||
var group_earnings: String = "" //总计收益
|
||||
|
||||
var group_owner_info: GroupOwnerInfoBean? = null //族长信息
|
||||
|
||||
class GroupOwnerInfoBean {
|
||||
|
||||
var nickname: String = "" //昵称
|
||||
var avatar: String = "" //头像
|
||||
var dress: String = "" //头像框
|
||||
var user_code: String = "" //用户id
|
||||
var icon: List<String> = arrayListOf()
|
||||
var mic_cycle: String = "" //麦圈
|
||||
var nobility_image: String = "" //贵族
|
||||
var nickname_color: String = "" //贵族颜色
|
||||
}
|
||||
|
||||
var group_members_lists: List<GroupMembersListsBean> = arrayListOf() //
|
||||
|
||||
class GroupMembersListsBean{
|
||||
var market_value: String = "" //身价
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
var user_code: String = ""
|
||||
var user_id: Int = 0
|
||||
var end_time: Long = 0 //签约到期时间点
|
||||
var dress: String = ""
|
||||
var icon: List<String> = arrayListOf()
|
||||
var mic_cycle: String = "" //麦圈
|
||||
var nobility_image: String = "" //贵族
|
||||
var nickname_color: String = "" //贵族颜色
|
||||
var free_renewal: Int = 0 //免费续签次数
|
||||
var today_earnings: Double = 0.0 //今日收礼收益
|
||||
var yesterday_earnings: Double = 0.0 //昨日收礼收益
|
||||
var is_online: Int = 0 //是否在线 1在线 0离线
|
||||
var is_show_sign: Int = 0 //是否显示续约按钮 1:显示 0:不显示
|
||||
|
||||
var sign_times: Int = 0 //非首签签约时长
|
||||
var sign_user_ratio : Int = 0 //非首签签约比例
|
||||
var end_day: String = "" //签约剩余时长
|
||||
|
||||
val free_re_sign_day : Int=0 //免费续签时长
|
||||
|
||||
}
|
||||
|
||||
/* "group_id": "string",
|
||||
"name": "string",
|
||||
"user_id": "string",
|
||||
"group_members_num": "string",
|
||||
"group_earnings": "string",
|
||||
"group_owner_info": {
|
||||
"nickname": "string",
|
||||
"avatar": "string",
|
||||
"dress": "string",
|
||||
"user_code": "string",
|
||||
"icon": [
|
||||
"string"
|
||||
],
|
||||
"mic_cycle": "string",
|
||||
"nobility_image": "string",
|
||||
"nickname_color": "string"
|
||||
},
|
||||
"group_members_lists": [
|
||||
{
|
||||
"market_value": "string",
|
||||
"nickname": "string",
|
||||
"avatar": "string",
|
||||
"user_code": "string",
|
||||
"user_id": "string",
|
||||
"end_time": "string",
|
||||
"dress": "string",
|
||||
"icon": [
|
||||
"string"
|
||||
],
|
||||
"mic_cycle": "string",
|
||||
"nobility_image": "string",
|
||||
"nickname_color": "string",
|
||||
"free_renewal": "string",
|
||||
"today_earnings": "string",
|
||||
"yesterday_earnings": "string"
|
||||
}
|
||||
]
|
||||
}*/
|
||||
}
|
||||
@@ -54,6 +54,7 @@ public class MyRoomBean {
|
||||
private String come_count; //房间进入数
|
||||
private Double today_income; //今日收益;
|
||||
private int earnings_ratio;//房间收益比例
|
||||
private String lucky_water="";//房间幸运流水
|
||||
|
||||
@Data
|
||||
static class CpRoom {
|
||||
|
||||
@@ -10,7 +10,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class NewsMessageList {
|
||||
private int id;
|
||||
private int type;//类型 1:系统消息 2:官方公告 3:活动中心
|
||||
private int type;//类型 1:系统消息 2:官方公告 3:活动中心 6:邀请加入公会
|
||||
private int admin_id;
|
||||
private String title;//标题
|
||||
private String content;//内容
|
||||
@@ -22,4 +22,5 @@ public class NewsMessageList {
|
||||
private String createtime;
|
||||
private String updatetime;
|
||||
private String delete_time;
|
||||
private int guild_invited_status;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/3 18:44
|
||||
* 用途:装扮列表
|
||||
*/
|
||||
class PersonaltyListBean {
|
||||
var did: Int =0 // 装扮id
|
||||
var title: String = "" // 装扮名称
|
||||
var type: Int = 0 // 1头像框 2坐骑 3资料展示特效 4光圈 5气泡 6个人靓号 7房间靓号 8工会靓号 100热门
|
||||
var base_image: String = "" // 展示图片
|
||||
var play_image: String = "" // 播放图像
|
||||
var price: Int = 0 // 实际价格(金币)
|
||||
var special_num: Int = 0 // 靓号
|
||||
var original_price: Int = 0 // 原价
|
||||
var discount: Double = 0.0 // 折扣
|
||||
var discount_str: String = "" // 折扣字段
|
||||
|
||||
|
||||
/* title
|
||||
装扮名称
|
||||
|
||||
type
|
||||
|
||||
|
||||
类型:1头像框 2坐骑 3资料展示特效 4光圈 5气泡 6个人靓号 7房间靓号 8工会靓号 100热门
|
||||
|
||||
base_image
|
||||
|
||||
展示图片
|
||||
|
||||
play_image
|
||||
|
||||
播放图像
|
||||
|
||||
price
|
||||
|
||||
实际价格(金币)
|
||||
|
||||
special_num
|
||||
|
||||
靓号
|
||||
|
||||
original_price
|
||||
|
||||
原价
|
||||
|
||||
discount
|
||||
|
||||
折扣
|
||||
|
||||
discount_str
|
||||
|
||||
折扣字段*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/6 14:25
|
||||
* 用途:
|
||||
*/
|
||||
class PitTimeRespBean {
|
||||
var time: Int = 0
|
||||
var time_str: String = ""
|
||||
/* "time": 5,
|
||||
"time_str": "5分钟"*/
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class PlaceholderBean {
|
||||
private String nickname1;
|
||||
private String avatar;
|
||||
private String total;
|
||||
private String rank;
|
||||
private String rank="";
|
||||
private List<String> icon;
|
||||
private String room_name;
|
||||
private String room_id;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/30 18:02
|
||||
* 用途:红包配置信息接口
|
||||
*/
|
||||
class RedPacketConfig {
|
||||
var red_packet_min_amount : Int = 0 //发红包最小金额
|
||||
var red_packet_fee : Int = 0 //发红包手续费
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity
|
||||
import lombok.Data
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/20 15:13
|
||||
* 用途:心动空间中的关系实体
|
||||
*/
|
||||
@Data
|
||||
class RelationBean : MultiItemEntity {
|
||||
|
||||
var cp: UserInfo.CpInfo = UserInfo.CpInfo()
|
||||
var no_cp: List<NoCpBean> = ArrayList()
|
||||
override fun getItemType(): Int {
|
||||
|
||||
// 情况3:no_cp集合,relation_name不等于"",并且relation_list的大小是1
|
||||
if (no_cp.isNotEmpty() && no_cp[0].relation_name.isNotEmpty() && no_cp[0].relation_list.size == 1) {
|
||||
return 3
|
||||
}
|
||||
|
||||
// 情况4:no_cp集合,relation_list的大小是1
|
||||
if (no_cp.isNotEmpty() && no_cp[0].relation_list.size == 1) {
|
||||
return 4
|
||||
}
|
||||
|
||||
if (no_cp.isNotEmpty() && no_cp[0].relation_name.isNotEmpty() && no_cp[0].relation_list.size > 1){
|
||||
return 5
|
||||
}
|
||||
|
||||
// 其他情况返回5
|
||||
return 6
|
||||
}
|
||||
|
||||
class NoCpBean : MultiItemEntity{
|
||||
var relation_name: String = ""
|
||||
var relation_list: List<RelationshipBean> = ArrayList()
|
||||
override fun getItemType(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*"cp": [
|
||||
{
|
||||
"relation_name": "string",
|
||||
"relation_list": [
|
||||
{
|
||||
"nickname1": "string",
|
||||
"avatar1": "string",
|
||||
"user_id1": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"no_cp": [
|
||||
{
|
||||
"relation_name": "string",
|
||||
"relation_list": [
|
||||
{
|
||||
"user_info1": {},
|
||||
"user_info2": "string",
|
||||
"level": "string",
|
||||
"exp": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}*/
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -10,7 +12,7 @@ import lombok.Data;
|
||||
* @description: 关系信息
|
||||
*/
|
||||
@Data
|
||||
public class RelationshipBean implements Serializable {
|
||||
public class RelationshipBean implements Serializable, MultiItemEntity {
|
||||
|
||||
|
||||
private int relation_id;//关系id 3,
|
||||
@@ -31,4 +33,14 @@ public class RelationshipBean implements Serializable {
|
||||
private int heart_value;// 0,
|
||||
private int is_top;// 0
|
||||
private int type;// 1,亲密;2:真爱
|
||||
private int sex1;//1:女 2:男
|
||||
private int sex2;//
|
||||
private String dress1;//
|
||||
private String dress2;//
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RevenueBean {
|
||||
private String id;
|
||||
private int id;
|
||||
private String user_id;
|
||||
private String change_type;
|
||||
private String change_type_name;
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 送礼后的成功回调
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class RoomGiftData extends BaseEvent {
|
||||
private int gift_total;
|
||||
|
||||
private List<GiftUserData> gift_user_data;
|
||||
|
||||
private CpType cp_type;
|
||||
|
||||
@Data
|
||||
public static class GiftUserData {
|
||||
private String user_id;//受理人id
|
||||
private String gift_price;//礼物价格
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CpType {
|
||||
private int cp_type;//0:不处理 1:表明心意 2:组成cp
|
||||
private String text;//发送方弹起的信息
|
||||
private String text1;//接收方弹起的信息
|
||||
private int gift_id;//礼物id
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,17 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.room.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class RoomMessageEvent {
|
||||
public class RoomMessageEvent extends BaseEvent {
|
||||
private int MsgType; // 消息类型,如 QXRoomMessageTypeJoin
|
||||
private String RoomId; // 房间 ID
|
||||
private T Text; // 携带的数据对象
|
||||
@@ -27,7 +30,7 @@ public class RoomMessageEvent {
|
||||
public static class T {
|
||||
private String text;
|
||||
private String GiftNum;
|
||||
private String pit_number;//麦位
|
||||
private String pit_number;//麦位 酒吧房的情况下,这个是抱麦的number
|
||||
private String jia_jia;//坐骑
|
||||
private UserInfo FromUserInfo;//从me
|
||||
private UserInfo ToUserInfo;// 到you
|
||||
@@ -44,13 +47,13 @@ public class RoomMessageEvent {
|
||||
private List<RoomAuction.AuctionListBean> auction_list; //拍卖列表
|
||||
private long duration;//时间
|
||||
private RoomAuction.AuctionListBean recipient;//是否成功,有值的是成功的,没有值的时候,是失败的
|
||||
private int type;//拍卖者,1:上麦、2:下麦
|
||||
private int type;//拍卖者,1:上麦、2:下麦 暴币的时候,1是大奖 2:是小奖 在酒吧房的时候, 0:没有选择自定义礼物 1:选择了自定义礼物
|
||||
private String hot_value;
|
||||
private String SendRoomId;//发起者所在的房间ID
|
||||
private String AcceptRoomId;//接收者所在的房间id
|
||||
private String PkId;
|
||||
private String room_id;//当type==1的时候。这个roomId是对方的房间id
|
||||
private String user_id="";
|
||||
private String room_id;//当type==1的时候。这个roomId是对方的房间id 当是酒吧房的时候,就是需要进入的小房间的id
|
||||
private String user_id = ""; //当是酒吧房的时候,这个值就是要进入小黑屋的房主信息
|
||||
private String pk_end_times;//pk结束时间
|
||||
private List<RoomPitBean> userCharmList;
|
||||
|
||||
@@ -64,11 +67,11 @@ public class RoomMessageEvent {
|
||||
private String victory_cover;//胜利的头像
|
||||
private String defeated_name;//输掉的名称
|
||||
private String defeated_cover;//输掉的头像
|
||||
private String end_time;//惩罚时间 /// 在交友房中,是倒计时时间
|
||||
private String end_time;//惩罚时间 /// 在交友房中,是倒计时时间 //签约房倒计时
|
||||
private int is_mute;//1:静音对方 0:不静音对方
|
||||
private int is_mute_pit;
|
||||
private int count;//排麦模式下的人数
|
||||
private int step ; //1:等待邂逅 2:心动连线 3:牵手良缘
|
||||
private int step; //1:等待邂逅 2:心动连线 3:牵手良缘
|
||||
private int friend_id; //场次id
|
||||
// private List<FriendInfo.HeartList> list;//交友心动值发生变化
|
||||
private List<UserInfo> list;//交友房麦位发生变化 //推送的事麦上用户信息,这里使用了userinfo接收的
|
||||
@@ -97,12 +100,31 @@ public class RoomMessageEvent {
|
||||
|
||||
private EmotionDeatils emoji;
|
||||
private String is_pk;//是否是pk
|
||||
|
||||
private SingerInfo.SongInfo song_info;
|
||||
private SingerInfo.SongInfo next_song_info;
|
||||
|
||||
private String rights_icon;//Cp特效
|
||||
|
||||
private String sign_id = "-1";//签约ID
|
||||
private String sign_value;//签约最高价
|
||||
private String sign_day;//被签约天数
|
||||
private String current_body_value;//被签约身价
|
||||
|
||||
private String status = "";
|
||||
private String from_id = "";
|
||||
|
||||
private String play_image;//暴币播放动画地址
|
||||
|
||||
private String meet_user_id="";//当是酒吧房的时候,就是被约的用户id
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class text {
|
||||
private long position;
|
||||
private int is_mute;
|
||||
private RoomGiftData.CpType cp_type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ public class RoomSearchResp {
|
||||
private int label_id;
|
||||
private String today_hot_value;
|
||||
|
||||
private String room_password;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,5 +21,6 @@ public class RoomTypeModel {
|
||||
private String label_name;
|
||||
private String type;
|
||||
private String sort;
|
||||
private int default_index; //1 选中 0 未选中
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class RoonGiftModel {
|
||||
private String gift_name;//礼物名称
|
||||
private String base_image;//礼物图片
|
||||
private String gift_price;//礼物价格
|
||||
private String gift_id;//礼物id
|
||||
private String gift_id="";//礼物id
|
||||
private String gift_bag_name;
|
||||
private String rule;
|
||||
private String rule_url;
|
||||
@@ -34,6 +34,18 @@ public class RoonGiftModel {
|
||||
private int activities_id;//4:盲盒 ;5:天空之境;
|
||||
private int gift_bag;//10:天空之境 11:岁月之城 12:时空之巅
|
||||
private int is_lock;//爵位礼物 0:不锁 1:锁
|
||||
private String icon="";//礼物标签图片
|
||||
|
||||
private int is_cp;//1:是 0:不是 是不是cp心动礼物
|
||||
private int is_teacher;//1:是 0:不是 是不是师徒礼物
|
||||
|
||||
|
||||
//下面是在酒吧房使用的参数
|
||||
private int id;
|
||||
private String gift_remark_name="";//用户设置的礼物内容
|
||||
|
||||
private String user_wallet_coin;//当前的钱包金币数
|
||||
|
||||
public boolean isCan_send_self() {
|
||||
if ( isManghe()) {
|
||||
return true;
|
||||
|
||||
115
BaseModule/src/main/java/com/xscm/moduleutil/bean/SignInData.kt
Normal file
115
BaseModule/src/main/java/com/xscm/moduleutil/bean/SignInData.kt
Normal file
@@ -0,0 +1,115 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/12 10:35
|
||||
* 用途:签到实体类
|
||||
*/
|
||||
class SignInData : MultiItemEntity{
|
||||
val TYPE_NORMAL: Int = 0 // 普通类型,使用day_sgin布局
|
||||
val TYPE_DOUBLE: Int = 1 // 双倍宽度类型,使用day_sgin2布局
|
||||
var viewType: Int = TYPE_NORMAL // 默认为普通类型
|
||||
|
||||
var day: Int = 0 //第几天
|
||||
var sign_in_date: String = "" //日期
|
||||
var sign_in_status: Int = 0 // 签到状态:1已签到 0未签到
|
||||
var sign_in_status_str: String = "" //已签到
|
||||
var is_today: Int = 0 //是否是当天 0否 1是
|
||||
var gift_name: String = "" //礼物名称
|
||||
var num: String = "" //数量
|
||||
var gift_price: Int = 0 //价格
|
||||
var type: Int = 0 //类型: 1金币 2礼物 3装扮 4钻石
|
||||
var base_image: String = "" //礼物图片
|
||||
override fun getItemType(): Int {
|
||||
return viewType
|
||||
}
|
||||
|
||||
/* "gift_bag": [
|
||||
{
|
||||
"day": 1, //第几天
|
||||
"sign_in_date": "2025-12-09", //日期
|
||||
"sign_in_status": 1, //签到状态:1已签到 0未签到
|
||||
"sign_in_status_str": "已签到",
|
||||
"is_today": 0, //是否是当天 0否 1是
|
||||
"gift_name": "金币", //礼物名称
|
||||
"num": 1, //数量
|
||||
"gift_price": 1, //价格
|
||||
"type": 1, //类型: 1金币 2礼物 3装扮 4钻石
|
||||
"base_image": "https://test.vespa.qxyushen.top/static/image/icon/gold.png" //礼物图片
|
||||
},
|
||||
{
|
||||
"day": 2,
|
||||
"sign_in_date": "2025-12-10",
|
||||
"sign_in_status": 1,
|
||||
"sign_in_status_str": "已签到",
|
||||
"is_today": 0,
|
||||
"gift_name": "打工狗",
|
||||
"num": "1 个",
|
||||
"gift_price": "9",
|
||||
"type": 2,
|
||||
"base_image": "https://cos.xscmmidi.site/admin/3143tianxuanbanzhuangou_17615346376493.png"
|
||||
},
|
||||
{
|
||||
"day": 3,
|
||||
"sign_in_date": "2025-12-11",
|
||||
"sign_in_status": 1,
|
||||
"sign_in_status_str": "已签到",
|
||||
"is_today": 0,
|
||||
"gift_name": "神皇",
|
||||
"num": "3 天",
|
||||
"gift_price": 30,
|
||||
"type": 3,
|
||||
"base_image": "https://midi01.oss-cn-beijing.aliyuncs.com/5544shenhuang_17579016149523.png"
|
||||
},
|
||||
{
|
||||
"day": 4,
|
||||
"sign_in_date": "2025-12-12",
|
||||
"sign_in_status": 1,
|
||||
"sign_in_status_str": "已签到",
|
||||
"is_today": 1,
|
||||
"gift_name": "心动喷发",
|
||||
"num": "2 个",
|
||||
"gift_price": "100",
|
||||
"type": 2,
|
||||
"base_image": "https://cos.xscmmidi.site/admin/3300xindongpenfa_17615347008740.png"
|
||||
},
|
||||
{
|
||||
"day": 5,
|
||||
"sign_in_date": "2025-12-13",
|
||||
"sign_in_status": 0,
|
||||
"sign_in_status_str": "未签到",
|
||||
"is_today": 0,
|
||||
"gift_name": "钻石",
|
||||
"num": 20,
|
||||
"gift_price": 1,
|
||||
"type": 4,
|
||||
"base_image": "https://test.vespa.qxyushen.top/static/image/icon/gold.png"
|
||||
},
|
||||
{
|
||||
"day": 6,
|
||||
"sign_in_date": "2025-12-14",
|
||||
"sign_in_status": 0,
|
||||
"sign_in_status_str": "未签到",
|
||||
"is_today": 0,
|
||||
"gift_name": "王者之戒",
|
||||
"num": "1 个",
|
||||
"gift_price": "19",
|
||||
"type": 2,
|
||||
"base_image": "https://cos.xscmmidi.site/admin/5390wangzhezhijie_17615353361010.png"
|
||||
},
|
||||
{
|
||||
"day": 7,
|
||||
"sign_in_date": "2025-12-15",
|
||||
"sign_in_status": 0,
|
||||
"sign_in_status_str": "未签到",
|
||||
"is_today": 0,
|
||||
"gift_name": "财源滚滚",
|
||||
"num": "30 天",
|
||||
"gift_price": 288,
|
||||
"type": 3,
|
||||
"base_image": "https://midi01.oss-cn-beijing.aliyuncs.com/2160caiyuangunguntouxiangkuang_17579008394073.png"
|
||||
}
|
||||
]*/
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
class SignInfo : Serializable {
|
||||
/* sign_id
|
||||
// 0 未开始 1进行中
|
||||
sign_status;
|
||||
// 签约天数
|
||||
sign_day;
|
||||
// 当前身价
|
||||
current_body_value;
|
||||
// 倒计时 时间戳
|
||||
end_time;*/
|
||||
|
||||
var sign_id: String = ""
|
||||
var sign_status: Int = 0
|
||||
var sign_day: Int = 0
|
||||
var current_body_value: Int = 0
|
||||
var end_time: Long = 0
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SingerInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private SongInfo song_info;
|
||||
private SongInfo next_song_info;
|
||||
|
||||
@Data
|
||||
public static class SongInfo implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
/*"id": 29,
|
||||
"room_id": 6001,
|
||||
"user_id": 20001,
|
||||
"singer_song_id": 9,
|
||||
"status": 1,
|
||||
"sort": 0,
|
||||
"createtime": 1763435086,
|
||||
"boss_user_id": 20001,
|
||||
"boss_nickname": "高兴的小海腾",
|
||||
"boss_avatar": "https://yusheng-1369267578.cos.ap-guangzhou.myqcloud.com/images/ios_images/1761615690733.jpeg",
|
||||
"boss_dress": "",
|
||||
"boss_mic_cycle": "https://cos.xscmmidi.site/admin/ripple3695_17627709565119.svga",
|
||||
"singer_user_id": 20000,
|
||||
"singer_nickname": "坚定的故事",
|
||||
"singer_avatar": "https://yusheng-1369267578.cos.ap-guangzhou.myqcloud.com/images/android_images/4ead5077435f1da7b8aae1a878bb5ac9.jpg",
|
||||
"singer_dress": "",
|
||||
"singer_mic_cycle": "https://cos.xscmmidi.site/admin/ripple3695_17627709565119.svga",
|
||||
"song_name": "公敌"*/
|
||||
private int id = 0;
|
||||
private int room_id = 0;
|
||||
private int user_id = 0;
|
||||
private int singer_song_id = 0;
|
||||
private int status = 0;
|
||||
private int sort = 0;
|
||||
private long createtime = 0;
|
||||
private int boss_user_id = 0;
|
||||
private String boss_nickname = "";
|
||||
private String boss_avatar = "";
|
||||
private String boss_dress = "";
|
||||
private String boss_mic_cycle = "";
|
||||
private int singer_user_id = 0;
|
||||
private String singer_nickname = "";
|
||||
private String singer_avatar = "";
|
||||
private String singer_dress = "";
|
||||
private String singer_mic_cycle = "";
|
||||
private String song_name = "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* SingerSongCount 类,用于存储歌手和歌曲数量信息
|
||||
* 这个类可能用于统计或展示每位歌手的歌曲数量
|
||||
*/
|
||||
class SingerSongCount {
|
||||
// 类定义结束,这里可以添加属性和方法来存储和操作歌手及其歌曲数量
|
||||
|
||||
var total: Int = 0
|
||||
var today: Int = 0
|
||||
var yesterday: Int = 0
|
||||
var week: Int = 0
|
||||
var month: Int = 0
|
||||
var already: Int = 0
|
||||
|
||||
/* total
|
||||
string
|
||||
总数
|
||||
必需
|
||||
today
|
||||
string
|
||||
今天
|
||||
必需
|
||||
yesterday
|
||||
string
|
||||
昨天
|
||||
必需
|
||||
week
|
||||
string
|
||||
本周
|
||||
必需
|
||||
month
|
||||
string
|
||||
本月
|
||||
必需
|
||||
already
|
||||
string
|
||||
已点*/
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
class SongPlaylist {
|
||||
|
||||
var count: Int = 0
|
||||
var lists: List<SongPlaylistBean> = ArrayList()
|
||||
|
||||
class SongPlaylistBean {
|
||||
|
||||
var id: Int = 0
|
||||
var room_id :String =""
|
||||
var user_id: String = ""
|
||||
var singer_song_id: String = ""
|
||||
var status:String =""
|
||||
var sort: Int = 0
|
||||
var boss_nickname: String = ""
|
||||
var song_name: String = ""
|
||||
var gift_id: String = ""
|
||||
var gift_num: String = ""
|
||||
var createtime: String = ""
|
||||
var gift_name: String = ""
|
||||
var gift_price: String = ""
|
||||
var base_image: String = ""
|
||||
var singer_nickname: String = ""
|
||||
|
||||
}
|
||||
|
||||
/* id
|
||||
string 列表ID
|
||||
|
||||
user_id
|
||||
string
|
||||
歌手ID
|
||||
|
||||
song_name
|
||||
string
|
||||
歌曲名
|
||||
|
||||
gift_id
|
||||
string
|
||||
礼物ID
|
||||
|
||||
gift_num
|
||||
string
|
||||
礼物数量
|
||||
|
||||
createtime
|
||||
string
|
||||
添加时间
|
||||
|
||||
gift_name
|
||||
string
|
||||
礼物名称
|
||||
|
||||
gift_price
|
||||
string
|
||||
礼物价格
|
||||
|
||||
base_image
|
||||
string
|
||||
礼物图片
|
||||
|
||||
nickname
|
||||
string
|
||||
歌手昵称*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/16 11:35
|
||||
* 用途:任务未领取角标
|
||||
*/
|
||||
class TasksMessage {
|
||||
var num: Int=0
|
||||
var not_received_tasks_num : Int=0 //任务未领取奖励数 这是心跳中返回的参数,用于展示任务未领取角标,是在房间内展示的
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/12 14:54
|
||||
* 用途:签到状态
|
||||
*/
|
||||
class TasksSignStatus {
|
||||
var status : Int=0
|
||||
var status_str: String=""
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -9,17 +12,115 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class ThemeBean {
|
||||
private String theme_color;//主题颜色
|
||||
private int is_open;
|
||||
private String theme_name;
|
||||
private String theme_color="#22BB79";//主题颜色
|
||||
private String file_url;//
|
||||
private String auxiliary_color;//
|
||||
private String btn_text_color;//按钮文字颜色
|
||||
private String app_bg;//app背景图
|
||||
private String home_sel;//首页选中
|
||||
private String home_nor;//首页未选中
|
||||
private String find_sel;//广场选中
|
||||
private String find_nor;//广场未选中
|
||||
private String msg_sel;//消息选中
|
||||
private String msg_nor;//消息未选中
|
||||
private String mine_sel;//我的选中
|
||||
private String mine_nor;//我的未选中
|
||||
private String btn_text_color="#3ABC6D";//按钮文字颜色
|
||||
private int app_bg;//app背景图
|
||||
private int home_sel;//首页选中
|
||||
private int home_nor;//首页未选中
|
||||
private int find_sel;//广场选中
|
||||
private int find_nor;//广场未选中
|
||||
private int msg_sel;//消息选中
|
||||
private int msg_nor;//消息未选中
|
||||
private int mine_sel;//我的选中
|
||||
private int mine_nor;//我的未选中
|
||||
|
||||
public int getIs_open() {
|
||||
CommonAppContext.getInstance().is_open = is_open;
|
||||
return is_open;
|
||||
}
|
||||
|
||||
public void setIs_open(int is_open) {
|
||||
this.is_open = is_open;
|
||||
CommonAppContext.getInstance().is_open = is_open;
|
||||
}
|
||||
|
||||
public String getTheme_color() {
|
||||
|
||||
return "#22BB79";
|
||||
}
|
||||
|
||||
public String getFile_url() {
|
||||
return file_url;
|
||||
}
|
||||
|
||||
public String getAuxiliary_color() {
|
||||
return auxiliary_color;
|
||||
}
|
||||
|
||||
public String getBtn_text_color() {
|
||||
// if (CommonAppContext.getInstance().is_open == 1){
|
||||
// return "#FF663B";
|
||||
// }
|
||||
return "#FFFFFF";
|
||||
}
|
||||
|
||||
public int getApp_bg() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.bg_dark;
|
||||
}else {
|
||||
return R.mipmap.activity_bj;
|
||||
}
|
||||
}
|
||||
|
||||
public int getHome_sel() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_sy_select;
|
||||
}
|
||||
return R.mipmap.tab_main_media_selected;
|
||||
|
||||
}
|
||||
|
||||
public int getHome_nor() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_sy_notselect;
|
||||
}
|
||||
return R.mipmap.tab_main_media_unselected;
|
||||
|
||||
}
|
||||
|
||||
public int getFind_sel() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_dt_select;
|
||||
}
|
||||
return R.mipmap.icon_me_trend_select;
|
||||
}
|
||||
|
||||
public int getFind_nor() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_dt_notselect;
|
||||
}
|
||||
return R.mipmap.icon_me_trend_unselect;
|
||||
}
|
||||
|
||||
public int getMsg_sel() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_xx_select;
|
||||
}
|
||||
return R.mipmap.icon_news_select;
|
||||
}
|
||||
|
||||
public int getMsg_nor() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_xx_notselect;
|
||||
}
|
||||
return R.mipmap.icon_news_un_select;
|
||||
}
|
||||
|
||||
public int getMine_sel() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_wd_select;
|
||||
}
|
||||
return R.mipmap.icon_my_select;
|
||||
}
|
||||
|
||||
public int getMine_nor() {
|
||||
if (CommonAppContext.getInstance().is_open == 1){
|
||||
return R.mipmap.icon_wd_notselect;
|
||||
}
|
||||
return R.mipmap.icon_my_un_select;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||
@@ -11,9 +12,9 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/3
|
||||
*@description: 个人信息,点击我的获取
|
||||
* @author qx
|
||||
* @data 2025/6/3
|
||||
* @description: 个人信息,点击我的获取
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@@ -34,11 +35,12 @@ 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;//是否设置开播提醒
|
||||
private String birthday;//生日
|
||||
private String profile;//简介
|
||||
private String profile = "";//简介
|
||||
private String home_bgimages;//背景图片
|
||||
private int is_follow;//是否关注
|
||||
private List<UserTagBean> tag_list;
|
||||
@@ -49,7 +51,10 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
private String chat_bubble;//聊天气泡
|
||||
private String charm;//魅力值
|
||||
private String room_id;
|
||||
private String guild;//公会名称
|
||||
private String guild_name = "";//公会名称
|
||||
private int guild_id = 0;//公会id
|
||||
private String me_guild_name = "";//公会名称
|
||||
private int me_guild_id = 0;//公会id
|
||||
private String is_mute;//禁言状态 0否 1是
|
||||
private String is_mute_pit;//禁麦状态 0否 1是
|
||||
private String is_manager;//是否是管理员 0否 1是
|
||||
@@ -66,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; //
|
||||
@@ -76,12 +82,97 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
private String nickname_color = "";//昵称颜色
|
||||
private String mic_cycle;//麦圈
|
||||
private String is_hide;//0不能设置,1:可以设置
|
||||
private String hide_status;//0-取消隐身,1-设置隐身
|
||||
private String hide_status;//0-取消隐身,1-设置隐身
|
||||
|
||||
private String enter_image;//爵位飘屏的背景
|
||||
private String enter_text;//爵位飘屏的文字
|
||||
private int singer_status;//歌手认证状态0-待审核,1-通过,2-拒绝 -1:未认证
|
||||
private int singer_level;//歌手等级
|
||||
private CpInfo cp_info;
|
||||
private int market_value;//身价
|
||||
private String market_value_coin="";//身价配置 多少金币数
|
||||
private String market_value_market="";//身价配置 多少身价数
|
||||
|
||||
private String sign_value;
|
||||
private String sign_id;
|
||||
|
||||
private Master master;
|
||||
private int is_online;//是否在线 : 1在线 2离线
|
||||
private int had_custom_gift;//是否显示设置了自定义礼物 0:没有 1:有
|
||||
|
||||
|
||||
@Data
|
||||
public static class Master implements Serializable {
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
}
|
||||
|
||||
/*"cp_info": {
|
||||
"name": "string",
|
||||
"user_id1": "string",
|
||||
"user_id2": "string",
|
||||
"level": "string",
|
||||
"exp": "string",
|
||||
"pendant": "string",
|
||||
"direction": "string",
|
||||
|
||||
}*/
|
||||
|
||||
@Data
|
||||
public static class CpInfo implements Serializable, MultiItemEntity {
|
||||
private int id;
|
||||
private int user_id1;
|
||||
private int user_id2;
|
||||
private int status;
|
||||
|
||||
private long createtime;
|
||||
|
||||
public String name = "-1";
|
||||
public String level = "-1";
|
||||
public String exp = "-1";
|
||||
public String pendant = "-1";
|
||||
public String direction = "-1";
|
||||
public UserInfo1 user_info1;
|
||||
public UserInfo2 user_info2;
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
if (name != null && !name.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class UserInfo1 implements Serializable {
|
||||
public String user_id;
|
||||
public String nickname;
|
||||
public String avatar;
|
||||
public String dress;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class UserInfo2 implements Serializable {
|
||||
public String user_id;
|
||||
public String nickname;
|
||||
public String avatar;
|
||||
public String dress;
|
||||
}
|
||||
/*"user_info1": {
|
||||
"user_id": "string",
|
||||
"nickname": "string",
|
||||
"avatar": "string",
|
||||
"dress": "string"
|
||||
},
|
||||
"user_info2": {
|
||||
"user_id": "string",
|
||||
"nickname": "string",
|
||||
"avatar": "string",
|
||||
"dress": "string"
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
// @Data
|
||||
// public static class TagList{
|
||||
@@ -89,13 +180,14 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
// private String tag_name;
|
||||
// }
|
||||
@Data
|
||||
public static class GiftWall {
|
||||
public static class GiftWall implements Serializable {
|
||||
private String gift_name;
|
||||
private String total;
|
||||
|
||||
private List<SendUserInfo> send_user_info;
|
||||
|
||||
@Data
|
||||
public static class SendUserInfo{
|
||||
public static class SendUserInfo implements Serializable {
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -9,8 +11,9 @@ public class UserResultResp {
|
||||
private String user_id;
|
||||
private String user_code;
|
||||
private String nickname;
|
||||
private String head_picture;
|
||||
private String sex;
|
||||
private String avatar;
|
||||
private int sex;
|
||||
private List<String> icon;
|
||||
private String follow;
|
||||
private String fans_count;
|
||||
private String online_text;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class WalletBean {
|
||||
|
||||
private String id;
|
||||
private String user_id;
|
||||
private String coin;//金币
|
||||
private String coin="0";//金币
|
||||
private String earnings;//钻石
|
||||
private String url;//灵活就业合作伙伴协议
|
||||
private String title;//状态
|
||||
|
||||
@@ -18,6 +18,10 @@ public class BlindReslutBean {
|
||||
public class ReslutList {
|
||||
private int gift_id;//中奖礼物Id
|
||||
private int count;//中奖礼物数量
|
||||
|
||||
private String gift_price = "";
|
||||
private String gift_name = "";
|
||||
private String base_image = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,10 +11,21 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeJoin = 1001;
|
||||
/// 用户退出房间
|
||||
public static final int QXRoomMessageTypeQuit = 1002;
|
||||
|
||||
//================================================================================================麦上变化=================================================================
|
||||
/// 用户上麦
|
||||
public static final int QXRoomMessageTypeUpSeat = 1003;
|
||||
/// 用户下麦
|
||||
public static final int QXRoomMessageTypeDownSeat = 1004;
|
||||
/// 拍卖者被拉上麦
|
||||
public static final int QXRoomMessageTypeAuctionIsUp = 1022;
|
||||
/// 竞拍开始,竞拍麦位发生变化
|
||||
public static final int QXRoomMessageTypeAuctionIsStart = 1024;
|
||||
/// 互娱 麦位发生变化
|
||||
public static final int QXRoomMessageTypeSeatDidChanged = 1053;
|
||||
/// 房间内换麦
|
||||
public static final int QXRoomMessageTypehm = 1039;
|
||||
//==============================================================================================end=================================================================
|
||||
/// 房间收到礼物
|
||||
public static final int QXRoomMessageTypeGift = 1005;
|
||||
/// 设置管理员
|
||||
@@ -48,12 +59,11 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeRoomUpdate = 1020;
|
||||
/// 清除魅力值
|
||||
public static final int QXRoomMessageTypeRoom = 1021;
|
||||
/// 拍卖者被拉上麦
|
||||
public static final int QXRoomMessageTypeAuctionIsUp = 1022;
|
||||
|
||||
|
||||
/// 拍卖者拍卖开始
|
||||
public static final int QXRoomMessageTypeAuctionIsSelected = 1023;
|
||||
/// 竞拍开始,竞拍麦位发生变化
|
||||
public static final int QXRoomMessageTypeAuctionIsStart = 1024;
|
||||
|
||||
/// 竞拍结束
|
||||
public static final int QXRoomMessageTypeAuctionIsEnd = 1025;
|
||||
/// 主持延时
|
||||
@@ -72,23 +82,26 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeRoomPKEnd = 1032;
|
||||
/// pk断开
|
||||
public static final int QXRoomMessageTypeRoomPKDisconnect = 1033;
|
||||
///排麦模式下的人数变化
|
||||
/// 排麦模式下的人数变化
|
||||
public static final int QXRoomMessageTypeRoomMaiwrens = 1034;
|
||||
public static final int QXRoomMessageTypeRoomDress = 1035;//动态修改用户头像信息
|
||||
public static final int QXRoomMessageTypeRoomOnline = 1036;//
|
||||
public static final int QXRoomMessageTypeRoomOPK = 1037;
|
||||
public static final int QXRoomMessageTypeRoomOMh = 1038;
|
||||
|
||||
///清除当前消息列表
|
||||
/// 清除当前消息列表
|
||||
public static final int QXRoomMessageTypeClearMsg = 123;
|
||||
|
||||
///播放音乐
|
||||
/// 播放音乐
|
||||
public static final int QXRoomMessageTypeRoomMusicPlay = 124;
|
||||
|
||||
///关闭对方麦克风
|
||||
/// 关闭对方麦克风
|
||||
public static final int QXRoomMessageTypeMuteRemoteAudio = 125;
|
||||
///小黑屋 关麦
|
||||
/// 小黑屋 关麦
|
||||
public static final int QXRoomMessageTypeMuteLocalAudio = 126;
|
||||
public static final int QXRoomMessageTypeCPDx = 130;//心动礼物,单向发送
|
||||
public static final int QXRoomMessageTypeCPSx = 131;//心动礼物,双向发送
|
||||
|
||||
|
||||
/// 交友房阶段发生变化
|
||||
public static final int QXRoomMessageTypeRoomFriendPartDidChanged = 1049;
|
||||
@@ -98,27 +111,64 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeRoomFriendCreateRelation = 1051;
|
||||
/// 私密小屋结束时间发生延时
|
||||
public static final int QXRoomMessageTypeCabinTimeDelay = 1052;
|
||||
/// 麦位发生变化
|
||||
public static final int QXRoomMessageTypeSeatDidChanged = 1053;
|
||||
|
||||
/// 心动值发生变化
|
||||
public static final int QXRoomMessageTypeHeartDidChanged = 1054;
|
||||
/// 小黑屋有人退出房间
|
||||
public static final int QXRoomMessageTypeHeartDid = 1055;
|
||||
///盲盒抽奖进度条
|
||||
/// 盲盒抽奖进度条
|
||||
public static final int QXRoomMessageTypeMangH = 1056;
|
||||
///巡乐会
|
||||
/// 巡乐会
|
||||
public static final int QXRoomMessageTypeXlh = 1057;
|
||||
///在离线
|
||||
/// 在离线
|
||||
public static final int QXRoomMessageTypezailx = 1058;
|
||||
///清除个人魅力值
|
||||
/// 清除个人魅力值
|
||||
public static final int QXRoomMessageTypeQingGRMl = 1059;
|
||||
///有红包列表
|
||||
/// 有红包列表
|
||||
public static final int QXRoomMessageTypeQXRoomMessageRed = 1060;
|
||||
///移除红包
|
||||
/// 移除红包
|
||||
public static final int QXRoomMessageTypeQXRoomMessageRedRemove = 1061;
|
||||
|
||||
///房间内换麦
|
||||
public static final int QXRoomMessageTypehm = 1039;
|
||||
/// 点歌房当前歌曲发生变化
|
||||
public static final int QXRoomMessageTypeSingerRoomCurrentSongDidChanged = 1070;
|
||||
|
||||
/// 点歌房下一首歌曲发生变化
|
||||
public static final int QXRoomMessageTypeSingerRoomNextSongDidChanged = 1071;
|
||||
|
||||
//已点歌曲数量
|
||||
public static final int QXRoomMessageTypeSongerNum = 1072;
|
||||
|
||||
|
||||
public static final int QXRoomMessageTypeCPText = 1080;//CP特效,进入房间的特效,
|
||||
/// 签约开始
|
||||
public static final int QXRoomMessageTypeSignStartText = 1090;
|
||||
|
||||
/// 签约出价 FromUserInfo :出价最高用户信息,sign_value:出的价,sign_id:场次
|
||||
public static final int QXRoomMessageTypeSignMaxUserText = 1091;
|
||||
|
||||
/**
|
||||
* 签约结束
|
||||
* FromUserInfo:出价用户信息
|
||||
* ToUserInfo:被签用户信息
|
||||
* sign_value:出的最高价
|
||||
*/
|
||||
public static final int QXRoomMessageTypeSignEndText = 1092;
|
||||
/// 延时到这个时间点
|
||||
public static final int QXRoomMessageTypeSignDelayText = 1093;
|
||||
|
||||
/// 被签约者提示弹窗
|
||||
public static final int QXRoomMessageTypeSignTipText = 1094;
|
||||
/// 暴币展示动画列表
|
||||
public static final int QXRoomMessageTypeSignChat = 1100;
|
||||
|
||||
/// 酒吧房撩ta推送
|
||||
public static final int QXRoomMessageTypeFlirtatious = 1200;
|
||||
/// 进入酒吧房的小黑屋
|
||||
public static final int QXRoomMessageTypeFlirtatiousRoom = 1201;
|
||||
/// 酒吧房抱麦推送
|
||||
public static final int QXRoomMessageTypeFlirtatiousRoomPush = 1202;
|
||||
/// 酒吧房设置了自定义礼物推送
|
||||
public static final int QXRoomMessageTypeFlirtatiousRoomCustom = 1203;
|
||||
|
||||
|
||||
|
||||
@@ -176,9 +226,11 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
case QXRoomMessageTypeRoomFriendPartDidChanged:
|
||||
case QXRoomMessageTypeSeatDidChanged:
|
||||
case QXRoomMessageTypehm:
|
||||
case QXRoomMessageTypeSignChat:
|
||||
return 1;
|
||||
case QXRoomMessageTypeRoomOMh:
|
||||
case QXRoomMessageTypeGift:
|
||||
case QXRoomMessageTypeFlirtatious:
|
||||
return 3;
|
||||
case 1:
|
||||
case 2:
|
||||
|
||||
@@ -19,4 +19,6 @@ public class PkRoomInfo implements Serializable {
|
||||
private String pk_part;;//2:等待开始、3:进行中、4:惩罚阶段
|
||||
private String pk_end_times;
|
||||
private int receive_pk_user_id = -2;//接受pk的用户id
|
||||
|
||||
private String close_users="";//关闭pk麦克风的用户id
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class RoomAuction implements Serializable {
|
||||
private String nobility_image;//贵族图标
|
||||
private String nickname_color;//昵称颜色
|
||||
private String mic_cycle;//麦圈
|
||||
private int is_online=1;//是否在线 : 1在线 2离线
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -75,7 +75,7 @@ public class RoomBean implements Serializable {
|
||||
private String room_name;//房间名称
|
||||
private String room_cover;//房间封面
|
||||
private String room_intro;//房间公告
|
||||
private String type_id;//房间类型 1:点唱(pk) 2:拍卖(真爱拍小黑屋) 3/4:交友 6:小黑屋 7:互娱 8:交友
|
||||
private String type_id;//房间类型 1:点唱(pk) 2:拍卖(真爱拍小黑屋) 3/4:交友 6:小黑屋 7:互娱 8:交友 10:签约 11:酒吧房
|
||||
private String type_name;//房间类型名称
|
||||
private String user_id;//房主id
|
||||
private String label_id;//类型id 2:ktv type:1/3/4/8
|
||||
@@ -89,6 +89,7 @@ public class RoomBean implements Serializable {
|
||||
private int queue_number;//排麦队列人数
|
||||
private HeadlineBean head_line;
|
||||
|
||||
private int sexy_coin;//酒吧房撩的金币
|
||||
|
||||
private String room_code;
|
||||
private String popularity;
|
||||
@@ -128,6 +129,11 @@ public class RoomBean implements Serializable {
|
||||
private int is_pk; //1:接收 2:不接受
|
||||
private int last_pk_room_id;//记录上次pk的房间id
|
||||
|
||||
private String start_time="";//营业时间的开始时间
|
||||
private String end_time="";//营业时间的结束时间
|
||||
|
||||
private String room_password = "";//房间密码
|
||||
|
||||
public int getSceneId() {
|
||||
if (sound_effect != null) {
|
||||
return sound_effect.getId();
|
||||
|
||||
@@ -28,6 +28,8 @@ public class RoomHourBean extends BaseEvent {
|
||||
private String label_icon;
|
||||
private int xlh_status;
|
||||
private int redpacket_status;// >0 有红包,=0 没有红包
|
||||
|
||||
private String room_password;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.xscm.moduleutil.bean.NobilitDeatils;
|
||||
import com.xscm.moduleutil.bean.SignInfo;
|
||||
import com.xscm.moduleutil.bean.SingerInfo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -23,7 +26,7 @@ public class RoomInfoResp implements Serializable {
|
||||
private RoomOrderDemand demand;//嘉宾需求
|
||||
private int rejoin;
|
||||
private int is_show_self;//盲盒是否送自己
|
||||
private MusicSongBean song_user_info;
|
||||
private MusicSongBean song_user_info;//ktv
|
||||
private MusicSongBean nextInfo;
|
||||
private RoomAuction room_auction;//拍卖房信息
|
||||
private RoomCpUserBean cp_user;
|
||||
@@ -34,6 +37,11 @@ public class RoomInfoResp implements Serializable {
|
||||
private int hour_ranking_open;//1:开启 0:关闭
|
||||
private NobilitDeatils.NobilityInfo nobility_info;
|
||||
|
||||
private SingerInfo singer_info;
|
||||
private SignInfo sign_info;
|
||||
|
||||
private String room_id="";
|
||||
private String msg="";
|
||||
|
||||
//弹出麦位操作弹出
|
||||
public boolean isWheatManager() {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.xscm.moduleutil.bean.room;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomOnline {
|
||||
public class RoomOnline implements Serializable {
|
||||
|
||||
private List<RoomOnlineBean> on_pit;//麦上用户
|
||||
private List<RoomOnlineBean> off_pit;//麦下用户
|
||||
private int count;//在线人数
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.xscm.moduleutil.bean.room;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -12,7 +13,7 @@ import lombok.Data;
|
||||
* @description: 房间在线列表
|
||||
*/
|
||||
@Data
|
||||
public class RoomOnlineBean implements MultiItemEntity {
|
||||
public class RoomOnlineBean implements MultiItemEntity, Serializable {
|
||||
private int itemViewType;
|
||||
private String typeNames;
|
||||
private int user_id;
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomPitBean implements Serializable {
|
||||
public class RoomPitBean implements Serializable ,Cloneable{
|
||||
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ public class RoomPitBean implements Serializable {
|
||||
}
|
||||
|
||||
private String id;//id
|
||||
private String pit_number = "";//麦位号
|
||||
private String pit_number="";//麦位号
|
||||
private String state;//麦位状态 正常 ,1封麦;3禁麦
|
||||
private int is_lock;//0未锁麦 1锁麦
|
||||
private int is_mute;//0未禁麦 1禁麦
|
||||
@@ -50,7 +50,6 @@ public class RoomPitBean implements Serializable {
|
||||
private String dress;//麦位用户头像装扮
|
||||
private String charm;//麦位上用户在当前房间的魅力值
|
||||
|
||||
|
||||
private String room_id;
|
||||
private String voice;
|
||||
private String shutup;
|
||||
@@ -64,7 +63,7 @@ public class RoomPitBean implements Serializable {
|
||||
private String dress_picture;
|
||||
private RankInfo rank_info;
|
||||
private int ball_state;//1开球0未开球
|
||||
private int is_online;//是否在线 : 1在线 2离线
|
||||
private int is_online=1;//是否在线 : 1在线 2离线
|
||||
private String to_pit_number;
|
||||
private boolean is_pk;//是否是在pk模式中
|
||||
private boolean isMute;//是否打开麦圈
|
||||
@@ -77,4 +76,18 @@ public class RoomPitBean implements Serializable {
|
||||
private String nickname_color;//昵称颜色
|
||||
private String mic_cycle;//麦圈
|
||||
|
||||
private boolean occupied;
|
||||
private boolean imageType;//是否是演唱者
|
||||
private String end_time;//倒计时结束时间 酒吧房
|
||||
private int had_custom_gift;//是否显示设置了自定义礼物 0:没有 1:有
|
||||
|
||||
public RoomPitBean clone(){
|
||||
try {
|
||||
return (RoomPitBean)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.xscm.moduleutil.bean.room;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -16,12 +18,16 @@ public class RoomSettingBean implements MultiItemEntity {
|
||||
public static final int QXRoomSettingTypeRoomTypeBoy = 12;
|
||||
/// 女神房
|
||||
public static final int QXRoomSettingTypeRoomTypeGirl = 13;
|
||||
///交友 房
|
||||
/// 交友 房
|
||||
public static final int QXRoomSettingTypeRoomTypeJiaoy = 27;
|
||||
//互娱
|
||||
public static final int QXRoomSettingTypeRoomTypeHUYU = 28;
|
||||
//练歌房
|
||||
public static final int QXRoomSettingTypeRoomTypeLianG = 31;
|
||||
//签约
|
||||
public static final int QXRoomSettingTypeRoomTypeSIGNCONTRACT = 32;
|
||||
//酒吧房
|
||||
public static final int QXRoomSettingTypeRoomTypePUBROOM = 36;
|
||||
|
||||
/// 常用工具
|
||||
/// 房间补贴
|
||||
@@ -55,6 +61,16 @@ public class RoomSettingBean implements MultiItemEntity {
|
||||
public static final int QXRoomSettingTypeRoomFloatingScreen = 29;//关闭飘屏
|
||||
public static final int QXRoomSettingTypeRoomFloatingRed = 30;//红包
|
||||
|
||||
public static final int QXRoomSettingTypeRoomTheCityYears = 33;//岁月之城
|
||||
public static final int QXRoomSettingTypeRoomTimeSpace = 34;//时空之巅
|
||||
public static final int QXRoomSettingTypeRoomTimeRedSound = 35;//红包声音
|
||||
|
||||
public static final int QXRoomSettingTypeRoomBusinessTime = 37;//营业时间
|
||||
public static final int QXRoomSettingTypeRoomBusinessLegend = 38;//炼仙传说
|
||||
public static final int QXRoomSettingTypeRoomBusinessLOVE = 39;//爱豆计划
|
||||
|
||||
|
||||
|
||||
public static final int ITEM_TYPE_DEFAULT = 0;
|
||||
public static final int ITEM_TYPE_WITH_ICON = 1;
|
||||
|
||||
@@ -68,9 +84,9 @@ public class RoomSettingBean implements MultiItemEntity {
|
||||
private boolean isSelected;//是否在麦位上
|
||||
private boolean status;
|
||||
private boolean select;//是否选中
|
||||
private List<RoomSettingBean> children; // 新增子项列表
|
||||
|
||||
|
||||
public RoomSettingBean(String name, String icon, String selectName, String selectIcon, int type, int read, boolean isSelected, boolean status,boolean select) {
|
||||
public RoomSettingBean(String name, String icon, String selectName, String selectIcon, int type, int read, boolean isSelected, boolean status, boolean select) {
|
||||
this.name = name;
|
||||
this.icon = icon;
|
||||
this.selectName = selectName;
|
||||
@@ -86,6 +102,7 @@ public class RoomSettingBean implements MultiItemEntity {
|
||||
public int getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
|
||||
public void updateItemType() {
|
||||
if (type == -1) { // 特殊值表示标题
|
||||
this.itemType = ITEM_TYPE_DEFAULT;
|
||||
@@ -93,6 +110,7 @@ public class RoomSettingBean implements MultiItemEntity {
|
||||
this.itemType = ITEM_TYPE_WITH_ICON;
|
||||
}
|
||||
}
|
||||
|
||||
// public void updateItemType() {
|
||||
// switch (type) {
|
||||
// case QXRoomSettingTypeRoomSubsidy:
|
||||
|
||||
@@ -28,7 +28,7 @@ public class RoomUserBean implements Serializable {
|
||||
private String avatar;//用户头像
|
||||
private String dress;//头像装扮
|
||||
private int is_room_owner;//是否是房主,1是;0不是
|
||||
private int pit_number;//麦位号,如果在麦位上就返回值
|
||||
private int pit_number = 0;//麦位号,如果在麦位上就返回值
|
||||
private String state;//麦位状态,如果在麦位撒好难过就有返回值,正常;1:封麦;3禁麦
|
||||
private String count_down;//麦位倒计时,在麦位上就有返回值,禁麦倒计时
|
||||
private int is_collect;//是否收藏,1是;0没有
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.xscm.moduleutil.bean.room.refining
|
||||
|
||||
|
||||
data class BoxJiangChiBean(
|
||||
var gid: String = "",
|
||||
var gift_name: String = "",
|
||||
var gift_price: String = "",
|
||||
var base_image: String = "",
|
||||
var play_image: String = ""
|
||||
)
|
||||
|
||||
|
||||
|
||||
data class MonsterLogBean(
|
||||
val add_time: Int,
|
||||
val id: Int,
|
||||
val is_evil_wind: Int,
|
||||
val is_join: Int,
|
||||
val win_type: Int,
|
||||
val win_type_data: List<WinTypeData>,
|
||||
val join_data: List<WinTypeData>,
|
||||
|
||||
val base_image: String,
|
||||
val gift_name: String,
|
||||
val gift_price: Int,
|
||||
val num: Int,
|
||||
val type_name: String,
|
||||
)
|
||||
|
||||
|
||||
data class WinTypeData(
|
||||
val type: Int, val type_name: String,
|
||||
val num: Int
|
||||
)
|
||||
|
||||
|
||||
data class MonsterUserLogBean(
|
||||
val add_time: Int,
|
||||
val base64_nick_name: String,
|
||||
val base_image: String,
|
||||
val gift_name: String,
|
||||
val gift_price: String,
|
||||
val head_pic: String,
|
||||
val id: Int,
|
||||
val mid: Int,
|
||||
val nick_name: String,
|
||||
val num: Int,
|
||||
val type_name: String,
|
||||
val uid: Int,
|
||||
val win_type: Int
|
||||
)
|
||||
|
||||
data class MonsterInfoBean(
|
||||
val integral: String,
|
||||
val is_finsh: Int,
|
||||
val multiple_list: List<Multiple>,
|
||||
val open_monster_price: String,
|
||||
val surplus_time: Int,
|
||||
val win_number: Int
|
||||
)
|
||||
|
||||
data class Multiple(
|
||||
val id: Int,
|
||||
val multiple: Double,
|
||||
val type_name: String,
|
||||
val num: Int,
|
||||
val type: Int
|
||||
)
|
||||
|
||||
data class MonsterResultBean(
|
||||
val head_pic: String,
|
||||
val id: String,
|
||||
val integral: String,
|
||||
val nick_name: String,
|
||||
val num: Int,
|
||||
val price: Int,
|
||||
val type: String,
|
||||
val type_name: String,
|
||||
val uid: Int
|
||||
)
|
||||
|
||||
data class MonsterEndBean(
|
||||
val game_name: String,
|
||||
val gift_name: String,
|
||||
val is_finsh: Int,
|
||||
val is_push_message: Int,
|
||||
val multiple_list: List<Multiple>,
|
||||
val num: Int,
|
||||
val surplus_time: Int,
|
||||
val total_gift_price: Int,
|
||||
val win_count: Int,
|
||||
val win_number: Int,
|
||||
val win_type_name: String,
|
||||
val base_image: String
|
||||
)
|
||||
|
||||
data class OpenMonsterBean(
|
||||
val base_image: String, // 礼物图片
|
||||
val gid: Int, // 礼物id
|
||||
val gift_name: String, // 礼物名称
|
||||
val gift_price: String, // 礼物价格
|
||||
val is_win: Int,// 是否中奖 2未中奖 1中奖
|
||||
val num: Int, // 中奖数量
|
||||
val total_gift_price: Int, // 总价格
|
||||
val type_name: String, // 中奖类型
|
||||
val win_type: Int // 中奖类型
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,11 +15,14 @@ public class ZhuangBanShangChengBean {
|
||||
private String is_perpetual;
|
||||
private String special_num ;//靓号
|
||||
private String title ;//装扮名称
|
||||
private String type ;//类型,顶部的头部选择
|
||||
private String type="" ;//类型,顶部的头部选择
|
||||
private String remaining_day ;//价格
|
||||
private String base_image ;//显示图片
|
||||
private String play_image;//播放图像
|
||||
private boolean is_select = false;
|
||||
private int num ;//数量
|
||||
private String ext_value="" ;//这是使用降身卡的时候,返回的参数,对应的是降身卡的前面,类似10%
|
||||
private String price ="";//价格
|
||||
|
||||
public boolean isIs_select() {
|
||||
return is_select;
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
|
||||
public class BaseCpDialog extends Dialog {
|
||||
|
||||
private String title;
|
||||
private String message;
|
||||
private String positiveButtonText;
|
||||
private String negativeButtonText;
|
||||
private View.OnClickListener positiveButtonClickListener;
|
||||
private View.OnClickListener negativeButtonClickListener;
|
||||
private boolean isCountdownEnabled = false; // 是否启用倒计时
|
||||
private int countdownSeconds = 0; // 倒计时秒数
|
||||
private CountDownTimer countDownTimer; // 倒计时对象
|
||||
|
||||
|
||||
public BaseCpDialog(Context context, String title, String message,
|
||||
String positiveButtonText, String negativeButtonText,
|
||||
View.OnClickListener positiveButtonClickListener,
|
||||
View.OnClickListener negativeButtonClickListener,
|
||||
boolean isCountdownEnabled, int countdownSeconds) {
|
||||
super(context);
|
||||
this.title = title;
|
||||
this.message = message;
|
||||
this.positiveButtonText = positiveButtonText;
|
||||
this.negativeButtonText = negativeButtonText;
|
||||
this.positiveButtonClickListener = positiveButtonClickListener;
|
||||
this.negativeButtonClickListener = negativeButtonClickListener;
|
||||
this.isCountdownEnabled = isCountdownEnabled;
|
||||
this.countdownSeconds = countdownSeconds;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
Window window = getWindow();
|
||||
if (window != null) {
|
||||
window.setGravity(Gravity.CENTER); // 居中显示
|
||||
window.setBackgroundDrawableResource(R.drawable.bg_r16_fff); // 透明背景
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_confirm);
|
||||
init();
|
||||
// 动态设置背景
|
||||
// getWindow().setBackgroundDrawableResource(R.drawable.bg_r16_fff);
|
||||
|
||||
// 初始化视图
|
||||
TextView tvTitle = findViewById(R.id.tv_title);
|
||||
TextView tvMessage = findViewById(R.id.tv_message);
|
||||
Button btnPositive = findViewById(R.id.btn_positive);
|
||||
Button btnNegative = findViewById(R.id.btn_negative);
|
||||
@SuppressLint({"MissingInflatedId", "LocalSuppress"})
|
||||
ConstraintLayout rootView =(ConstraintLayout) findViewById(R.id.root_view);
|
||||
|
||||
// 设置文本
|
||||
tvTitle.setText(title);
|
||||
tvMessage.setText(message);
|
||||
btnPositive.setText(positiveButtonText);
|
||||
btnNegative.setText(negativeButtonText);
|
||||
|
||||
// 设置点击监听器
|
||||
btnPositive.setOnClickListener(v -> {
|
||||
isCountdownCancelled = true; // 标记倒计时被取消
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel(); // 取消倒计时
|
||||
countDownTimer = null;
|
||||
}
|
||||
if (positiveButtonClickListener != null) {
|
||||
positiveButtonClickListener.onClick(v);
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
// 判断是否需要显示取消按钮
|
||||
if (negativeButtonText != null && !negativeButtonText.isEmpty()) {
|
||||
btnNegative.setText(negativeButtonText);
|
||||
btnNegative.setVisibility(View.VISIBLE);
|
||||
|
||||
btnNegative.setOnClickListener(v -> {
|
||||
if (negativeButtonClickListener != null) {
|
||||
negativeButtonClickListener.onClick(v);
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
// 倒计时逻辑
|
||||
if (isCountdownEnabled && countdownSeconds > 0) {
|
||||
startCountdown(btnNegative);
|
||||
}
|
||||
} else {
|
||||
// 隐藏取消按钮
|
||||
btnNegative.setVisibility(View.GONE);
|
||||
}
|
||||
// 倒计时逻辑
|
||||
if (isCountdownEnabled && countdownSeconds > 0) {
|
||||
startCountdown(btnNegative);
|
||||
}
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(btnPositive, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
btnPositive.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
// 找到根布局并应用动画
|
||||
|
||||
// if (rootView != null) {
|
||||
// Animation slideDown = AnimationUtils.loadAnimation(context, R.anim.slide_down);
|
||||
// Animation shake = AnimationUtils.loadAnimation(context, R.anim.shake);
|
||||
//
|
||||
// rootView.startAnimation(slideDown);
|
||||
// rootView.startAnimation(shake);
|
||||
// }
|
||||
}
|
||||
private boolean isCountdownCancelled = false; // 添加标志位
|
||||
private void startCountdown(Button btnNegative) {
|
||||
countDownTimer = new CountDownTimer(countdownSeconds * 1000L, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
int secondsLeft = (int) (millisUntilFinished / 1000);
|
||||
btnNegative.setText(negativeButtonText + " (" + secondsLeft + "s)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
// 检查是否被主动取消
|
||||
if (!isCountdownCancelled) {
|
||||
btnNegative.setText(negativeButtonText);
|
||||
if (negativeButtonClickListener != null) {
|
||||
negativeButtonClickListener.onClick(btnNegative); // 自动触发取消
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel(); // 取消倒计时
|
||||
countDownTimer = null;
|
||||
}
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@@ -9,6 +10,7 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import android.text.SpannableString;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
@@ -26,6 +28,7 @@ public class ConfirmDialog extends Dialog {
|
||||
|
||||
private String title;
|
||||
private String message;
|
||||
private SpannableString spannableMessage;
|
||||
private String positiveButtonText;
|
||||
private String negativeButtonText;
|
||||
private View.OnClickListener positiveButtonClickListener;
|
||||
@@ -34,6 +37,7 @@ public class ConfirmDialog extends Dialog {
|
||||
private int countdownSeconds = 0; // 倒计时秒数
|
||||
private CountDownTimer countDownTimer; // 倒计时对象
|
||||
|
||||
private Context context;
|
||||
|
||||
public ConfirmDialog(Context context, String title, String message,
|
||||
String positiveButtonText, String negativeButtonText,
|
||||
@@ -41,6 +45,7 @@ public class ConfirmDialog extends Dialog {
|
||||
View.OnClickListener negativeButtonClickListener,
|
||||
boolean isCountdownEnabled, int countdownSeconds) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.title = title;
|
||||
this.message = message;
|
||||
this.positiveButtonText = positiveButtonText;
|
||||
@@ -50,6 +55,24 @@ public class ConfirmDialog extends Dialog {
|
||||
this.isCountdownEnabled = isCountdownEnabled;
|
||||
this.countdownSeconds = countdownSeconds;
|
||||
}
|
||||
|
||||
// 新增构造函数,支持SpannableString
|
||||
public ConfirmDialog(Context context, String title, SpannableString spannableMessage,
|
||||
String positiveButtonText, String negativeButtonText,
|
||||
View.OnClickListener positiveButtonClickListener,
|
||||
View.OnClickListener negativeButtonClickListener,
|
||||
boolean isCountdownEnabled, int countdownSeconds) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.title = title;
|
||||
this.spannableMessage = spannableMessage;
|
||||
this.positiveButtonText = positiveButtonText;
|
||||
this.negativeButtonText = negativeButtonText;
|
||||
this.positiveButtonClickListener = positiveButtonClickListener;
|
||||
this.negativeButtonClickListener = negativeButtonClickListener;
|
||||
this.isCountdownEnabled = isCountdownEnabled;
|
||||
this.countdownSeconds = countdownSeconds;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
Window window = getWindow();
|
||||
@@ -57,6 +80,7 @@ public class ConfirmDialog extends Dialog {
|
||||
window.setGravity(Gravity.CENTER); // 居中显示
|
||||
window.setBackgroundDrawableResource(R.drawable.bg_r16_fff); // 透明背景
|
||||
}
|
||||
setCanceledOnTouchOutside(false); // 设置点击外部不取消对话框
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -76,7 +100,12 @@ public class ConfirmDialog extends Dialog {
|
||||
|
||||
// 设置文本
|
||||
tvTitle.setText(title);
|
||||
tvMessage.setText(message);
|
||||
// 根据是否有spannableMessage来设置不同的文本
|
||||
if (spannableMessage != null) {
|
||||
tvMessage.setText(spannableMessage);
|
||||
} else {
|
||||
tvMessage.setText(message);
|
||||
}
|
||||
btnPositive.setText(positiveButtonText);
|
||||
btnNegative.setText(negativeButtonText);
|
||||
|
||||
@@ -104,15 +133,19 @@ public class ConfirmDialog extends Dialog {
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
// 倒计时逻辑
|
||||
if (isCountdownEnabled && countdownSeconds > 0) {
|
||||
startCountdown(btnNegative);
|
||||
}
|
||||
} else {
|
||||
// 隐藏取消按钮
|
||||
btnNegative.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
//判断是否需要显示确认按钮
|
||||
if (positiveButtonText != null && !positiveButtonText.isEmpty()) {
|
||||
btnPositive.setText(positiveButtonText);
|
||||
btnPositive.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
// 隐藏确认按钮
|
||||
btnPositive.setVisibility(View.GONE);
|
||||
}
|
||||
// 倒计时逻辑
|
||||
if (isCountdownEnabled && countdownSeconds > 0) {
|
||||
startCountdown(btnNegative);
|
||||
@@ -121,15 +154,6 @@ public class ConfirmDialog extends Dialog {
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(btnPositive, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
btnPositive.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
// 找到根布局并应用动画
|
||||
|
||||
// if (rootView != null) {
|
||||
// Animation slideDown = AnimationUtils.loadAnimation(context, R.anim.slide_down);
|
||||
// Animation shake = AnimationUtils.loadAnimation(context, R.anim.shake);
|
||||
//
|
||||
// rootView.startAnimation(slideDown);
|
||||
// rootView.startAnimation(shake);
|
||||
// }
|
||||
}
|
||||
private boolean isCountdownCancelled = false; // 添加标志位
|
||||
private void startCountdown(Button btnNegative) {
|
||||
@@ -159,6 +183,12 @@ public class ConfirmDialog extends Dialog {
|
||||
countDownTimer.cancel(); // 取消倒计时
|
||||
countDownTimer = null;
|
||||
}
|
||||
if (context instanceof Activity) {
|
||||
Activity activity = (Activity) context;
|
||||
if (activity.isFinishing() || activity.isDestroyed()) {
|
||||
return; // Don't try to dismiss if activity is gone
|
||||
}
|
||||
}
|
||||
super.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,9 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.BalanceRechargeAdapter;
|
||||
@@ -25,9 +27,12 @@ import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.AppPay;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.FragmentRechargeDialogBinding;
|
||||
import com.xscm.moduleutil.presenter.RechargeDialogContacts;
|
||||
import com.xscm.moduleutil.presenter.RechargeDialogPresenter;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.PaymentUtil;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
@@ -103,7 +108,7 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_payment) {
|
||||
if (money.equals("0")) {
|
||||
money=mBinding.etCustomAmount.getText().toString().trim();
|
||||
money = mBinding.etCustomAmount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(money)) {
|
||||
ToastUtils.showShort("请选择充值金额");
|
||||
return;
|
||||
@@ -114,16 +119,24 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (!mBinding.cbPrivacy.isChecked()) {
|
||||
ToastUtils.showShort("请先勾选服务条款");
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedItem == null) {
|
||||
ToastUtils.showShort("请选择支付方式");
|
||||
return;
|
||||
}
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType(),type_params,gift_bag_id);
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType(), type_params, gift_bag_id);
|
||||
} else if (view.getId() == R.id.tv_czxy) {//充值协议
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=37").withString("title", "充值协议").navigation();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.tvPayment.setOnClickListener(this::onClick);
|
||||
mBinding.tvCzxy.setOnClickListener(this::onClick);
|
||||
mBinding.recycleView1.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
bindTypeAdapter = new PayMethodAdapter(R.layout.item_bind_type);
|
||||
mBinding.recycleView1.setAdapter(bindTypeAdapter);
|
||||
@@ -142,6 +155,9 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
}else{
|
||||
mBinding.r4.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvPayment, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvPayment.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,13 +45,13 @@ public class GiftLotteryAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolde
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBean item) {
|
||||
helper.setText(R.id.tv_gift_time, item.getCreatetime());
|
||||
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.iv_gift_image));
|
||||
ImageUtils.loadHeadCC(item.getBase_image(), helper.getView(R.id.iv_gift_image));
|
||||
// 使用 SpannableString 给 "x4" 设置不同颜色
|
||||
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();
|
||||
String countText = "x"+item.getCount();
|
||||
String countText = "x" + item.getCount();
|
||||
String fullText = baseName + countText;
|
||||
|
||||
SpannableStringBuilder spannable = new SpannableStringBuilder(fullText);
|
||||
@@ -67,7 +67,7 @@ public class GiftLotteryAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolde
|
||||
giftNameTextView.setText(spannable);
|
||||
}
|
||||
|
||||
if (nickNameTextView!=null){
|
||||
if (nickNameTextView != null && item.getNickname() != null) {
|
||||
nickNameTextView.setText(item.getNickname());
|
||||
String nickName = "赠予";
|
||||
String fullText = nickName + " " + item.getNickname();
|
||||
|
||||
@@ -115,6 +115,9 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
}else if (giftBagId.equals("12")){
|
||||
mBinding.clRoot.setBackgroundResource(R.mipmap.skzj);
|
||||
mBinding.imJc.setImageResource(R.mipmap.skzl_jl);
|
||||
}else if (giftBagId.equals("61")){
|
||||
mBinding.clRoot.setBackgroundResource(R.mipmap.icon_love_record_bg);
|
||||
mBinding.imJc.setImageResource(R.mipmap.skzl_jl);
|
||||
}
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
|
||||
@@ -103,15 +103,15 @@ import java.util.List;
|
||||
// 初始化Fragment列表
|
||||
private void initFragments() {
|
||||
fragmentList = new ArrayList<>();
|
||||
fragmentList.add(new LotteryFragment().newInstance(roomId,1)); // 第1页:抽奖榜单
|
||||
fragmentList.add(new LuckyFragment().newInstance(roomId,2)); // 第1页:抽奖榜单
|
||||
// fragmentList.add(new LotteryFragment().newInstance(roomId,1)); // 第1页:抽奖榜单
|
||||
|
||||
}
|
||||
|
||||
// 初始化ViewPager
|
||||
private void initViewPager() {
|
||||
titleList.add("");
|
||||
titleList.add("");
|
||||
// titleList.add("");
|
||||
FragmentManager childFragmentManager = getChildFragmentManager();
|
||||
pagerAdapter = new MyPagerAdapter(childFragmentManager, fragmentList,titleList );
|
||||
mBinding.ivViewPager.setAdapter(pagerAdapter);
|
||||
|
||||
@@ -81,6 +81,9 @@ public class PrizePoolDialog extends BaseDialog<DialogPrizePoolBinding> {
|
||||
}else if (type == 13){
|
||||
mBinding.clPrize.setBackgroundResource(R.mipmap.xlh);
|
||||
mBinding.imJc.setImageResource(R.mipmap.xlh_jc);
|
||||
}else if (type == 38){
|
||||
mBinding.clPrize.setBackgroundResource(R.mipmap.icon_love_record_bg);
|
||||
mBinding.imJc.setImageResource(R.mipmap.xlh_jc);
|
||||
}
|
||||
|
||||
// 根据屏幕密度调整行数和列数
|
||||
|
||||
@@ -72,7 +72,8 @@ public class XlhObtainDialog extends BaseDialog<DialogXlhObtainBinding> {
|
||||
|
||||
mBinding.ivAgain.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onPlayAgainClick();
|
||||
// mListener.onPlayAgainClick();
|
||||
mListener.onCloseClick();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
@@ -17,9 +17,25 @@ public enum QXRoomSeatViewType {
|
||||
* 拍卖麦位
|
||||
*/
|
||||
AUCTION(2, "拍卖麦位"),
|
||||
/**
|
||||
* 点唱
|
||||
*/
|
||||
JUKEBOX(9,"点唱麦位"),
|
||||
|
||||
/**
|
||||
* 签约
|
||||
*/
|
||||
SIGNCONTRACT(10,"签约"),
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 酒吧
|
||||
*/
|
||||
PUB(11,"酒吧"),
|
||||
/**
|
||||
* 酒吧
|
||||
*/
|
||||
PRIVATE(12,"酒吧交友小屋"),
|
||||
/**
|
||||
* 小黑屋麦位
|
||||
*/
|
||||
@@ -30,6 +46,8 @@ public enum QXRoomSeatViewType {
|
||||
*/
|
||||
FRIEND(7, "交友房麦位");
|
||||
|
||||
|
||||
|
||||
private final int value;
|
||||
private final String description;
|
||||
|
||||
|
||||
@@ -14,7 +14,12 @@ enum class RoomType(
|
||||
AUCTION("拍卖(真爱拍小黑屋)", 2),
|
||||
DATING("交友", 1,3, 4, 8), // 1、3、4、8 均对应交友
|
||||
BLACK_ROOM("小黑屋", 6),
|
||||
MUTUAL_ENTERTAINMENT("互娱", 7);
|
||||
JUKEBOX("点唱", 9),
|
||||
PUB_ROOM("酒吧", 11),
|
||||
PRIVATE_ROOM("酒吧交友小屋", 12),
|
||||
MUTUAL_ENTERTAINMENT("互娱", 7),
|
||||
SIGN_CONTRACT("签约", 10);
|
||||
|
||||
|
||||
companion object {
|
||||
/**
|
||||
|
||||
@@ -31,6 +31,4 @@ public class RoomGiftGiveEvent extends BaseEvent {
|
||||
this.heart_id = heart_id;
|
||||
this.auction_id = auction_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@ import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.bean.room.*;
|
||||
import com.xscm.moduleutil.bean.room.refining.BoxJiangChiBean;
|
||||
import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean;
|
||||
import com.xscm.moduleutil.bean.room.refining.MonsterLogBean;
|
||||
import com.xscm.moduleutil.bean.room.refining.MonsterResultBean;
|
||||
import com.xscm.moduleutil.bean.room.refining.MonsterUserLogBean;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.utils.cos.TempKeyBean;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
@@ -26,7 +31,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded //请求验证码
|
||||
@POST(Constants.SEND_CODE)
|
||||
Observable<BaseModel<Object>> sendCode(@Field("mobile") String mobile, @Field("event") String event);
|
||||
Call<BaseModel<String>> sendCode(@Field("mobile") String mobile, @Field("event") String event);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.LOGIN)
|
||||
@@ -34,16 +39,30 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.ROOM_HOUR_BEAN)
|
||||
Call<BaseModel<RoomHourBean>> getRoomHourRanking(@Field("page") String page,@Field("page_limit")String page_limit);
|
||||
Call<BaseModel<RoomHourBean>> getRoomHourRanking(@Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded //手机换绑
|
||||
@POST(Constants.MODIFY_MOBILE)
|
||||
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code);
|
||||
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code,@Field("new_sms_code") String new_sms_code);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_GIFT_WALL_USER_LIST) //礼物墙礼物用户列表
|
||||
Call<BaseModel<GiftWallUserBean>> giftWallUserList( @Field("user_id") String user_id,@Field("gift_id")String gift_id,@Field("page") int page);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.SET_PIT_TIME)
|
||||
Call<BaseModel<String>> setPitTime(@Field("room_id") String roomId, @Field("time") String time);
|
||||
|
||||
@GET(Constants.GET_FESTIVAL_THEME)
|
||||
Call<BaseModel<FestivalThemeBean>> getFestivalThemeBean();
|
||||
|
||||
@GET(Constants.GET_PERSONALTY_LIST_BEAN)
|
||||
Call<BaseModel<List<PersonaltyListBean>>> getPersonaltyListBean(@Query("type") String type);
|
||||
@GET(Constants.GET_EMOTION)
|
||||
Call<BaseModel<List<Emotion>>> upEmotion();
|
||||
|
||||
@GET(Constants.GET_EMOTION_DEATILS)
|
||||
Call<BaseModel<List<EmotionDeatils>>> getEmotionDeatils(@Query("type_id") String type_id,@Query("pid") String pid);
|
||||
Call<BaseModel<List<EmotionDeatils>>> getEmotionDeatils(@Query("type_id") String type_id, @Query("pid") String pid);
|
||||
|
||||
@FormUrlEncoded //手机绑定
|
||||
@POST(Constants.BIND_MOBILE)
|
||||
@@ -51,7 +70,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.USER_ROOM_BACK)
|
||||
Call<ResponseBody> userRoomBack(@Field("room_id")String room_id,@Field("type")String type);
|
||||
Call<ResponseBody> userRoomBack(@Field("room_id") String room_id, @Field("type") String type);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.USER_LOGIN)
|
||||
@@ -79,7 +98,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.dailyTasksReceive)
|
||||
Call<ResponseBody> dailyTasksReceive(@Field("task_id") String task_id);
|
||||
Call<ResponseBody> dailyTasksReceive(@Field("task_id") String task_id,@Field("student_id") String student_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.dailyTasksComplete)
|
||||
@@ -105,7 +124,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_LOG_LIST)
|
||||
Call<BaseModel<List<RevenueBean>>> getRevenueData(@Field("page") String page, @Field("page_limit") String page_limit, @Field("in_out_type") String in_out_type, @Field("start_time") String start_time, @Field("end_time") String end_time, @Field("gift_type") String gift_type);
|
||||
Call<BaseModel<List<RevenueBean>>> getRevenueData(@Field("last_id") int page, @Field("page_limit") String page_limit, @Field("in_out_type") String in_out_type, @Field("start_time") String start_time, @Field("end_time") String end_time, @Field("gift_type") String gift_type);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_WEALTH_RANKING)
|
||||
@@ -125,9 +144,63 @@ public interface ApiServer {
|
||||
@POST(Constants.POST_MESSAGE_LIST)
|
||||
Call<BaseModel<List<NewsMessageList>>> getMessagetitle(@Field("type") String type, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_INVITE)
|
||||
Call<BaseModel<String>> postInvite(@Field("apply_id") String apply_id, @Field("type") String type);
|
||||
@GET(Constants.GET_GROUP_INFO)
|
||||
Call<BaseModel<GroupBean>> getGuildInfo(@Query("guild_id")String guild_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_GROUP_INFO)
|
||||
Call<BaseModel<String>> setGuildInfo(@Field("guild_id") String guild_id, @Field("name") String guild_name, @Field("notice") String guild_notice,@Field("avatar") String guild_avatar);
|
||||
|
||||
@GET(Constants.GET_MEMBER_LIST)
|
||||
Call<BaseModel<GroupUserListBean>> memberList(@Query("page")String page, @Query("page_limit") String page_limit, @Query("guild_id") String guild_id,@Query("search") String search);
|
||||
|
||||
|
||||
@GET(Constants.GET_TEMP_KEY)
|
||||
Call<BaseModel<TempKeyBean>> getTempKey();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_AUTH)
|
||||
Call<BaseModel<String>> singerAuth(@Field("song") String song);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_GET_SONG)
|
||||
Call<BaseModel<SongPlaylist>> getSong(@Field("user_id") String user_id, @Field("room_id") String room_id, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_SONG_CUT)
|
||||
Call<BaseModel<String>> singerSongCut(@Field("id") String id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_SONG_TOP)
|
||||
Call<BaseModel<String>> singerSongTop(@Field("id") String id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_SONG_COUNT)
|
||||
Call<BaseModel<SingerSongCount>> singerSongCount(@Field("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_SONG)
|
||||
Call<BaseModel<String>> singerSong(@Field("song_id") String song_id, @Field("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_SONG_LIST)
|
||||
Call<BaseModel<SongPlaylist>> singerSongList(@Field("room_id") String room_id, @Field("type") String type, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_DELETE_SONG)
|
||||
Call<BaseModel<String>> deleteSong(@Field("id") String song_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_ADD_SONG)
|
||||
Call<BaseModel<String>> singerAddSong(@Field("song_name") String song_name, @Field("gift_id") String gift_id, @Field("gift_num") String gift_num);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SINGER_UPDATE_SONG)
|
||||
Call<BaseModel<String>> singerUpdateSong(@Field("id") String is, @Field("song_name") String song_name, @Field("gift_id") String gift_id, @Field("gift_num") String gift_num);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_RANK)
|
||||
Call<BaseModel<List<CharmRankingResp>>> getRoomRank(@Field("room_id") String room_id, @Field("type") String type, @Field("time_type") String time_type, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
@@ -209,7 +282,8 @@ public interface ApiServer {
|
||||
@POST(Constants.URL_LOGIN)
|
||||
Call<BaseModel<List<UserBean>>> oauthLogin(@Field("login_token") String login_token);
|
||||
|
||||
@GET(Constants.GET_THEME_DATA)
|
||||
// @GET(Constants.GET_THEME_DATA)
|
||||
@GET(Constants.GET_FESTIVAL_THEME)
|
||||
Call<BaseModel<ThemeBean>> getThemeData();
|
||||
|
||||
@FormUrlEncoded
|
||||
@@ -279,20 +353,30 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.CHECK_TXT)
|
||||
Call<ResponseBody> checkTxt(@Field("room_name") String room_name, @Field("room_cover") String room_cover, @Field("room_intro") String room_intro);
|
||||
Call<ResponseBody> checkTxt(@Field("room_name") String room_name, @Field("room_cover") String room_cover, @Field("room_intro") String room_intro,@Field("room_password") String room_password);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.GET_REWARD_LIST)
|
||||
Call<BaseModel<List<RewardUserBean>>> getRewardList(@Field("id") String id, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@GET(Constants.GET_GIFT_LABEL)
|
||||
Call<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("have_hot") String have_hot);
|
||||
Call<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("type") String type);
|
||||
|
||||
//获取礼物列表
|
||||
@GET(Constants.GIFT_LIST)
|
||||
Call<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label,@Query("room_id")String room_id);
|
||||
Call<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label, @Query("room_id") String room_id);
|
||||
|
||||
@GET(Constants.TOPIC_LIST)//获取话题
|
||||
@GET(Constants.GET_CUSTOM_GIFT_LIST)
|
||||
Call<BaseModel<List<RoonGiftModel>>> getCustomGiftList(@Query("user_id") String user_id);
|
||||
|
||||
@GET(Constants.GET_NEW_GIFT_LIST) //拍卖位选择拍卖礼物,type=3 label =99
|
||||
Call<BaseModel<List<RoonGiftModel>>> getNewGiftList(@Query("label") int label, @Query("type") String type );
|
||||
|
||||
@GET(Constants.SET_CUSTOM_GIFT)
|
||||
Call<BaseModel<String>> setCustomGift(@Query("gift_id") String gift_id, @Query("gift_remark_name") String new_gift_name ,@Query("room_id") String room_id );
|
||||
|
||||
@GET(Constants.TOPIC_LIST)
|
||||
//获取话题
|
||||
Call<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded
|
||||
@@ -345,16 +429,23 @@ public interface ApiServer {
|
||||
Call<BaseModel<String>> commentZone(@Field("id") String id, @Field("content") String content, @Field("pid") String pid, @Field("reply_to") String reply_to);
|
||||
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_FRIEND_LIST)
|
||||
Call<BaseModel<RelationBean>> getFriendList(@Field("user_id") String user_id, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@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)
|
||||
@@ -367,6 +458,17 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_MY_INFO)
|
||||
Call<BaseModel<UserInfo>> getMyInfo();
|
||||
|
||||
@GET(Constants.GET_APP_CUSTOMER_SERVICE)
|
||||
Call<BaseModel<AppCustomerBean>> appCustomerService();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_DEL_SONG)
|
||||
Call<BaseModel<String>> delSong(@Field("room_id") String room_id, @Field("did") String did);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SEARCH_USER)
|
||||
Call<BaseModel<List<MusicSongBean>>> searchSong(@Field("room_id") String room_id, @Field("search_user") String search_user);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.ED_USER_INFO)
|
||||
Call<BaseModel<String>> editUserInfo(@Field("nickname") String nickname, @Field("birthday") String birthday, @Field("sex") String sex, @Field("avatar") String avatar, @Field("images") String images, @Field("profile") String profile, @Field("tag_id") String tag_id);
|
||||
@@ -386,8 +488,8 @@ public interface ApiServer {
|
||||
@POST(Constants.GET_ALBUM_DETAIL)
|
||||
Call<BaseModel<AlbumBean>> getAlbumDetail(@Field("album_id") String albumId, @Field("pwd") String pwd, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@GET(Constants.GET_PERSONALTY)
|
||||
Call<BaseModel<List<PersonaltyBean>>> getPersonaltyList();
|
||||
@GET(Constants.GET_PERSONALTY) // from 来源: 1:道具商城 2:个性装扮
|
||||
Call<BaseModel<List<PersonaltyBean>>> getPersonaltyList(@Query("from")String frome);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.GET_SUBSIDY)
|
||||
@@ -396,6 +498,17 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_DECORATE)
|
||||
Call<BaseModel<List<ZhuangBanShangChengBean>>> getDecorateList(@Query("type") String type);
|
||||
|
||||
@GET(Constants.GET_DECORATE_DETAIL)
|
||||
Call<BaseModel<DecorateDetailBean>> getDecorateDetail(@Query("did") String id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_PAY_DECORATE)
|
||||
Call<BaseModel<String>> payDecorate(@Field("did") String id, @Field("day") String day,@Field("num") String num);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_BLACK_ROOM_LIST)
|
||||
Call<BaseModel<List<BlackRoomBean>>>getBlackRoomList(@Field("room_id") String roomId);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_GZ)
|
||||
Call<BaseModel<String>> userGuanz(@Field("user_id") String userId, @Field("type") String type);
|
||||
@@ -424,10 +537,33 @@ public interface ApiServer {
|
||||
@POST(Constants.postRoomSwToken)
|
||||
Call<BaseModel<PkSwTokenBean>> postRoomSwToken(@Field("room_id") String roomId);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_CLOSE_PK_MIC)
|
||||
Call<BaseModel<String>> closePkMic(@Field("pk_id") String pk_id,@Field("type") String type,@Field("user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.SET_USER_DECORATE)
|
||||
Call<BaseModel<String>> setUserDecorate(@Field("udid") String udid);
|
||||
|
||||
@GET(Constants.GET_MONSTER_INFO_BOX)
|
||||
Call<BaseModel<MonsterInfoBean>> get_monster_info_box();
|
||||
|
||||
@GET(Constants.GET_OPEN_BEAT_MONSTER)
|
||||
Call<BaseModel<MonsterResultBean>> open_beat_monster(@Query("rid")String rid,@Query("type") String type,@Query("num") String num);
|
||||
|
||||
@GET(Constants.GET_MONSTER_BOX_LIST)
|
||||
Call<BaseModel<List<BoxJiangChiBean>>> get_monster_box_list();
|
||||
|
||||
@GET(Constants.GET_USER_MONSTER_LOG)
|
||||
Call<BaseModel<List<MonsterUserLogBean>>> get_user_monster_log(@Query("page")String page);
|
||||
|
||||
@GET(Constants.GET_MONSTER_LOG)
|
||||
Call<BaseModel<List<MonsterLogBean>>> get_monster_log(@Query("page")String page,@Query("page_limit")String page_limit);
|
||||
|
||||
@GET(Constants.GET_MONSTER_NOTE)
|
||||
Call<BaseModel<String>> get_monster_note();
|
||||
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_CANCEL_USER_DECORATE)
|
||||
Call<BaseModel<String>> cancelUserDecorate(@Field("type") String type);
|
||||
@@ -443,7 +579,17 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.JOIN_ROOM)
|
||||
Call<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("password") String password);
|
||||
Call<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("room_password") String password);
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.BEFORE_JOIN_ROOM_CHECK)
|
||||
Call<BaseModel<BeforeJoinRoomCheckBean>> beforeJoinRoomCheck(@Field("room_id") String roomId);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.TASK_JUMP_ROOM)
|
||||
Call<BaseModel<String>> taskJumpRoomId(@Field("task_id") String taskId);
|
||||
|
||||
@GET(Constants.GET_PIT_TIME)
|
||||
Call<BaseModel<List<PitTimeRespBean>>> getPitTimeList();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.DELETE_ALBUM_IMAGE)
|
||||
@@ -475,27 +621,41 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.GET_ROOM_GIFT)
|
||||
Call<BaseModel<String>> roomGift(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_num") String num, @Field("to_uid") String to_uid, @Field("type") String gift_type, @Field("pit_number") String pit_number, @Field("heart_id") String heat_id);
|
||||
Call<BaseModel<RoomGiftData>> roomGift(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_num") String num, @Field("to_uid") String to_uid, @Field("type") String gift_type, @Field("pit_number") String pit_number, @Field("heart_id") String heat_id,@Field("gift_bag_id")String gift_bag_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_CP_GIVE_GIFT)
|
||||
Call<BaseModel<RoomGiftData>> cpGiveGift(@Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("room_id") String room_id);
|
||||
|
||||
@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_INDEX_RECOMMEND_ROOM)
|
||||
Call<BaseModel<IndexRecommendRoom>> index_recommend_room();
|
||||
|
||||
@GET(Constants.GET_DAY_DROP_GIFT)
|
||||
Call<BaseModel<HeavenGiftBean>> getDayDropGift();
|
||||
|
||||
@GET(Constants.GET_WALLET)
|
||||
Call<BaseModel<WalletBean>> wallet();
|
||||
|
||||
@GET(Constants.GET_TASKS_MESSAGE)
|
||||
Call<BaseModel<TasksMessage>> getTasksMessage();
|
||||
|
||||
@GET(Constants.GET_REDPACKET_CONFIG)
|
||||
Call<BaseModel<RedPacketConfig>> getRedpacketConfig();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.REDPACKET_CREATE)
|
||||
Call<ResponseBody> redPacketCreate(@Field("type") int type, @Field("password") String password, @Field("coin_type") int coin_type, @Field("total_amount") String total_amount,
|
||||
@Field("total_count")String total_count, @Field("conditions") String conditions, @Field("countdown") String countdown, @Field("room_id") String room_id,
|
||||
@Field("remark") String remark);
|
||||
@Field("total_count") String total_count, @Field("conditions") String conditions, @Field("countdown") String countdown, @Field("room_id") String room_id,
|
||||
@Field("remark") String remark);
|
||||
|
||||
@GET(Constants.ROOM_REDPACKET)
|
||||
Call<BaseModel<List<RedPacketInfo>>> roomRedPackets(@Query("room_id") String roomId);
|
||||
@@ -540,11 +700,15 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SONG_LIST)
|
||||
Call<BaseModel<List<MusicSongBean>>> songList(@Field("room_id") String room_id);
|
||||
Call<BaseModel<List<MusicSongBean>>> songList(@Field("room_id") String room_id,@Field("page")String page);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.APPLY_PIT)
|
||||
Call<BaseModel<String>> applyPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
||||
Call<BaseModel<String>> applyPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number,@Field("gift_id")String gift_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_LIAO_TA)
|
||||
Call<BaseModel<String>> liaoTa(@Field("room_id") String room_id, @Field("to_user_id") String user_id,@Field("type")String type);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.START_FRIEND)
|
||||
@@ -562,8 +726,9 @@ public interface ApiServer {
|
||||
@POST(Constants.DELAY)
|
||||
Call<BaseModel<String>> delay(@Field("friend_id") String friend_id, @Field("room_id") String room_id, @Field("delay_times") String delay_times);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_KEEP_XINTIAO)
|
||||
Call<ResponseBody> keepXintiao();
|
||||
Call<BaseModel<TasksMessage>> keepXintiao(@Field("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.DOWN_PIT)
|
||||
@@ -613,6 +778,13 @@ public interface ApiServer {
|
||||
@POST(Constants.POST_AGREE_SONG)
|
||||
Call<BaseModel<String>> agreeSong(@Field("room_id") String roomId, @Field("type") String type);
|
||||
|
||||
@GET(Constants.GET_BLIND_BOX_STATUS)
|
||||
Call<BaseModel<List<BlindBoxStatus>>> blindBoxStatus();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.SET_ROOM_BUSINESS_TIME)
|
||||
Call<BaseModel<String>> setRoomBusinessTime(@Field("room_id") String roomId,@Field("start_time") String startTime,@Field("end_time") String endTime);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_END_SONG)
|
||||
Call<BaseModel<String>> endSong(@Field("room_id") String roomId);
|
||||
@@ -623,7 +795,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.CHANGE_SONG)
|
||||
Call<BaseModel<String>> changeSong(@Field("room_id") String roomId, @Field("now_did") String now_did);
|
||||
Call<BaseModel<String>> changeSong(@Field("room_id") String roomId, @Field("now_did") String now_did,@Field("is_auto_next") String is_auto_next);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_HOST_LIST)
|
||||
@@ -634,7 +806,7 @@ public interface ApiServer {
|
||||
Call<BaseModel<List<RoomCharmRankBean>>> getCharmRank(@Field("room_id") String roomId);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_RELATION_LIST)
|
||||
@POST(Constants.POST_ROOM_RELATION_LIST) //1:真爱拍 2:亲密拍 3:星球(互娱)
|
||||
Call<BaseModel<List<RoomRelationBean>>> roomRelationList(@Field("type") String type);
|
||||
|
||||
@FormUrlEncoded
|
||||
@@ -700,7 +872,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_EDIT_ROOM)
|
||||
Call<BaseModel<String>> editRoom(@Field("room_id") String room_id, @Field("room_name") String room_name, @Field("room_cover") String room_cover, @Field("room_intro") String room_intro, @Field("room_background") String room_background);
|
||||
Call<BaseModel<String>> editRoom(@Field("room_id") String room_id, @Field("room_name") String room_name, @Field("room_cover") String room_cover, @Field("room_intro") String room_intro, @Field("room_background") String room_background,@Field("room_password")String room_password);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_KICK_OUT_ROOM)
|
||||
@@ -710,6 +882,10 @@ public interface ApiServer {
|
||||
@POST(Constants.POST_QUIT_ROOM)
|
||||
Call<ResponseBody> quitRoom(@Field("room_id") String room_id, @Field("user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_FRIEND_LIST_MORE)
|
||||
Call<BaseModel<List<RelationshipBean>>> getFriendListMore(@Field("user_id") String user_id, @Field("relation_id") String relation_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_RELATION_CARD)
|
||||
Call<BaseModel<RelationCardBean>> relationCard(@Field("user_id") String user_id);
|
||||
@@ -733,7 +909,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_AUCTION_JOIN)
|
||||
Call<BaseModel<RoomAuction.AuctionListBean>> roomAuctionJoin(@Field("auction_id") String auction_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("type") String type);
|
||||
Call<BaseModel<RoomAuction.AuctionListBean>> roomAuctionJoin(@Field("auction_id") String auction_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("type") String type,@Field("gift_bag_id") String gift_bag_id);
|
||||
|
||||
|
||||
@FormUrlEncoded
|
||||
@@ -745,17 +921,17 @@ 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,@Field("auction_id") String auction_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);
|
||||
Call<BaseModel<List<GiftBean>>> getMyRecord(@Query("gift_bag_id") String gift_bag_id, @Query("page") String page, @Query("page_size") String page_size);
|
||||
|
||||
@GET(Constants.GET_ALL_RECORD)
|
||||
Call<BaseModel<List<GiftBean>>> getAllRecord(@Query("gift_bag_id")String gift_bag_id,@Query("page")String page,@Query("page_size")String page_size);
|
||||
Call<BaseModel<List<GiftBean>>> getAllRecord(@Query("gift_bag_id") String gift_bag_id, @Query("page") String page, @Query("page_size") String page_size);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.GIFT_SEND)
|
||||
Call<BaseModel<String>> giftSend(@Field("send_id")String send_id);
|
||||
Call<BaseModel<String>> giftSend(@Field("send_id") String send_id);
|
||||
|
||||
@GET(Constants.GET_NOBILITY_DETAIL)
|
||||
Call<BaseModel<NobilitDeatils>> getNobilityDetail();
|
||||
@@ -767,10 +943,10 @@ public interface ApiServer {
|
||||
Call<BaseModel<NobilityPrice>> getNobilityPrice(@Query("id") String id);
|
||||
|
||||
@POST(Constants.POST_SEND_LOG)
|
||||
Call<BaseModel<String>> postSendAppLog(@Query("log_name") String logName,@Query("log_url") String logUrl);
|
||||
Call<BaseModel<String>> postSendAppLog(@Query("log_name") String logName, @Query("log_url") String logUrl);
|
||||
|
||||
@GET(Constants.GET_BOX_GIFT_LIST_XLH)
|
||||
Call<BaseModel<BlindBoxBean>> getBoxGiftListXLH( @Query("room_id") String room_id);
|
||||
Call<BaseModel<BlindBoxBean>> getBoxGiftListXLH(@Query("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_DRAW_GIFT_LIST_XLH)
|
||||
@@ -779,6 +955,7 @@ public interface ApiServer {
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_XLH_ALL_RECORD)
|
||||
Call<BaseModel<List<GiftBean>>> xlhAllRecord(@Field("room_id") String room_id, @Field("page") String page, @Field("page_size") String page_size);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.Get_XH_RANking)
|
||||
Call<BaseModel<List<GiftBean>>> xlXH_RANking(@Field("room_id") String room_id, @Field("page") String page, @Field("page_size") String page_size);
|
||||
@@ -788,17 +965,85 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_GIFT_ALL_CLEAR)
|
||||
Call<BaseModel<String>> getGiftPack(@Field("room_id") String roomId,@Field("to_uid") String user_id,@Field("heart_id") String heart_id,@Field("auction_id") String auction_id);
|
||||
Call<BaseModel<String>> getGiftPack(@Field("room_id") String roomId, @Field("to_uid") String user_id, @Field("heart_id") String heart_id, @Field("auction_id") String auction_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_USER_CHARM_LIST)
|
||||
Call<BaseModel<List<RoomUserCharmListBean>>> roomUserCharmList(@Field("room_id") String roomId,@Field("user_id") String user_id);
|
||||
Call<BaseModel<List<RoomUserCharmListBean>>> roomUserCharmList(@Field("room_id") String roomId, @Field("user_id") String user_id);
|
||||
|
||||
@GET(Constants.GET_GIFT_PACK_LIST_COUNT)
|
||||
Call<BaseModel<GiftPackListCount>> getGiftPackListCount();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_HOT_CARD)
|
||||
Call<BaseModel<String>> roomHotCard(@Field("udid") String udid, @Field("room_id") String room_id, @Field("num") String num);
|
||||
|
||||
@GET(Constants.GET_GIFT_INFO_TA)
|
||||
Call<BaseModel<RoonGiftModel>> getGiftInfoTa(@Query("room_id") String roomId, @Query("to_user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_MEETING_TA)
|
||||
Call<BaseModel<String>> meetingTa(@Field("room_id") String room_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.ROOM_USER_RECONNECT)
|
||||
Call<BaseModel<String>> roomUserReconnect(@Field("room_id") String room_id);
|
||||
|
||||
@GET(Constants.GET_CP_ZONE)
|
||||
Call<BaseModel<HeartCpBean>> getCpRoom(@Query("user_id") String userId,@Query("page")String page);
|
||||
|
||||
|
||||
@GET(Constants.POST_MY_FAMILY)
|
||||
Call<BaseModel<MyFamilyBean>> myFamily();
|
||||
|
||||
@GET(Constants.POST_MY_JOIN_FAMILY)
|
||||
Call<BaseModel<MyFamilyBean>> myJoinFamily();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_FAMILY_EARNINGS)
|
||||
Call<BaseModel<List<FamilyEarnings>>> familyEarnings(@Field("user_id") String user_id, @Field("page") int page, @Field("start_time") String start_time, @Field("end_time") String end_time);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_START)
|
||||
Call<BaseModel<String>> signStart(@Field("room_id") String room_id, @Field("user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_END)
|
||||
Call<BaseModel<String>> signEnd(@Field("sign_id") String sign_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_DELAY)
|
||||
Call<BaseModel<String>> signDelay(@Field("sign_id") String sign_id, @Field("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_COIN_LIST)
|
||||
Call<BaseModel<List<String>>> signCoinList(@Field("sign_id") String sign_id);
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_COIN)
|
||||
Call<BaseModel<String>> signCoin(@Field("sign_id") String sign_id,@Field("sign_value") String sign_value);
|
||||
|
||||
@GET(Constants.GET_SKILL_LIST)
|
||||
Call<BaseModel<List<String>>> skillList();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_FREE_RE_SIGN)
|
||||
Call<BaseModel<String>> freeReSign(@Field("user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_RE_SIGN)
|
||||
Call<BaseModel<String>> reSign(@Field("user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_REFUSE)
|
||||
Call<BaseModel<String>> signRefuse(@Field("room_id") String room_id);
|
||||
|
||||
|
||||
@GET(Constants.GET_SIGN_IN_LIST)
|
||||
Call<BaseModel<List<SignInData>>> signIn();
|
||||
|
||||
@GET(Constants.POST_DAILY_TASKS_SIGN)
|
||||
Call<BaseModel<String>> postDailyTasksSign();
|
||||
|
||||
@GET(Constants.POST_DAILY_TASKS_SIGN_STATUS)
|
||||
Call<BaseModel<TasksSignStatus>> postDailyTasksSignStatus();
|
||||
}
|
||||
|
||||
@@ -63,8 +63,7 @@ public class BaseModelTypeAdapter<T> extends TypeAdapter<BaseModel<T>> {
|
||||
model.setData(null);
|
||||
} else {
|
||||
// 如果 data 是字符串类型但不是 "null",可根据业务决定是否抛异常或处理
|
||||
reader.skipValue();
|
||||
model.setData(null);
|
||||
model.setData((T)value);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xscm.moduleutil.http;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.http.NetworkException;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/12/23 16:58
|
||||
* 用途:网络状态检查拦截器,会在每次请求前检查网络状态。
|
||||
*/
|
||||
public class NetworkCheckInterceptor implements Interceptor {
|
||||
|
||||
private final Context context;
|
||||
|
||||
public NetworkCheckInterceptor(Context context) {
|
||||
this.context = context.getApplicationContext(); // 使用 Application Context 避免内存泄漏
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
// 检查网络连接状态
|
||||
if (!isNetworkAvailable()) {
|
||||
// 如果没有网络,抛出我们自定义的异常
|
||||
ToastUtils.showLong("网络连接不可用,请检查您的网络设置");
|
||||
}
|
||||
|
||||
// 如果有网络,继续执行请求
|
||||
return chain.proceed(chain.request());
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查网络是否可用
|
||||
* @return true if network is available, false otherwise.
|
||||
*/
|
||||
private boolean isNetworkAvailable() {
|
||||
ConnectivityManager connectivityManager =
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
if (connectivityManager != null) {
|
||||
// 获取所有网络信息
|
||||
NetworkInfo[] networkInfos = connectivityManager.getAllNetworkInfo();
|
||||
if (networkInfos != null) {
|
||||
for (NetworkInfo info : networkInfos) {
|
||||
if (info.getState() == NetworkInfo.State.CONNECTED) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
package com.xscm.moduleutil.listener
|
||||
|
||||
import com.xscm.moduleutil.bean.RoomGiftData
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
|
||||
/**
|
||||
* 这是cp的监听器,方便在各个模块中调用
|
||||
*/
|
||||
interface CPListener {
|
||||
/**
|
||||
* 发送CP消息的处理函数
|
||||
* @param gitData 礼物数据信息,包含房间礼物相关的数据
|
||||
*/
|
||||
fun onSendCpMsg(gitData: RoomGiftData)
|
||||
|
||||
/**
|
||||
* 接收房间消息事件的处理函数
|
||||
* @param roomMessageEvent 房间消息事件对象,包含消息相关的所有信息
|
||||
*/
|
||||
fun onReceiveMsg(roomMessageEvent: RoomMessageEvent)
|
||||
}
|
||||
@@ -91,7 +91,9 @@ public class CustomMessageParser {
|
||||
if (pitObject.has("pit_number") && !pitObject.get("pit_number").isJsonNull()) {
|
||||
pitInfo.setPit_number(String.valueOf(pitObject.get("pit_number").getAsInt()));
|
||||
}
|
||||
|
||||
if (pitObject.has("is_online") && !pitObject.get("is_online").isJsonNull()) {
|
||||
pitInfo.setIs_online(pitObject.get("is_online").getAsInt());
|
||||
}
|
||||
pitList.add(pitInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.xscm.moduleutil.listener
|
||||
|
||||
interface JoinRoomErrorListener {
|
||||
fun onJoinRoomError(errorCode: Int, errorMsg: String)
|
||||
}
|
||||
@@ -0,0 +1,703 @@
|
||||
package com.xscm.moduleutil.listener;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.tencent.imsdk.v2.V2TIMAdvancedMsgListener;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMConversationListener;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupListener;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMMessage;
|
||||
import com.tencent.imsdk.v2.V2TIMSendCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.HeadlineBean;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.event.UnreadCountEvent;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.CustomMsgCode;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/17
|
||||
* @description: 接收消息
|
||||
*/
|
||||
public class MessageExListenerSingleton {
|
||||
private static boolean isInitialized = false;
|
||||
private static MessageExListenerSingleton instance;
|
||||
private List<OnMessageReceivedListener> listeners = new ArrayList<>();
|
||||
private V2TIMSimpleMsgListener simpleMsgListener;
|
||||
private V2TIMAdvancedMsgListener v2TIMAdvancedMsgListener;
|
||||
private static String mRoomId = "";
|
||||
public static String groupId;
|
||||
private V2TIMGroupListener groupListener;
|
||||
private V2TIMConversationListener conversationListener; // 需要保存引用
|
||||
|
||||
// 添加操作状态标记
|
||||
private volatile boolean isGroupOperationInProgress = false;
|
||||
private final Object groupOperationLock = new Object();
|
||||
private Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
// 添加消息缓存机制
|
||||
private static final int MAX_CACHED_MESSAGES = 20;
|
||||
private final Map<String, List<RoomMessageEvent>> cachedMessages = new ConcurrentHashMap<>();
|
||||
private final Set<String> joinedRooms = ConcurrentHashMap.newKeySet();
|
||||
|
||||
private OnMsgTaskListener onMsgTaskListener;
|
||||
|
||||
// private boolean listenersAdded = false; // 标记监听器是否已添加
|
||||
// 1. 添加新的监听器接口
|
||||
public interface PublicScreenMessageListener {
|
||||
void onPublicScreenMessageReceived(RoomMessageEvent message);
|
||||
}
|
||||
|
||||
private List<PublicScreenMessageListener> publicScreenListeners = new ArrayList<>();
|
||||
|
||||
// 添加监听器 // 替换原有的 addPublicScreenMessageListener 方法
|
||||
public void addPublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
if (listener == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (publicScreenListeners) {
|
||||
if (!publicScreenListeners.contains(listener)) {
|
||||
try {
|
||||
publicScreenListeners.add(listener);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "添加 PublicScreenMessageListener 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 同时修改 removePublicScreenMessageListener 方法
|
||||
public void removePublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
if (listener == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (publicScreenListeners) {
|
||||
try {
|
||||
publicScreenListeners.remove(listener);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "移除 PublicScreenMessageListener 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 修改 notify 方法以增加保护
|
||||
private void notifyPublicScreenListeners(RoomMessageEvent message) {
|
||||
synchronized (publicScreenListeners) {
|
||||
// 创建副本以避免并发修改异常
|
||||
List<PublicScreenMessageListener> listenersCopy = new ArrayList<>(publicScreenListeners);
|
||||
for (PublicScreenMessageListener listener : listenersCopy) {
|
||||
try {
|
||||
listener.onPublicScreenMessageReceived(message);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "通知 PublicScreenMessageListener 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MessageExListenerSingleton() {
|
||||
if (!isInitialized) {
|
||||
isInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static MessageExListenerSingleton getInstance() {
|
||||
synchronized (MessageExListenerSingleton.class) {
|
||||
if (instance == null) {
|
||||
instance = new MessageExListenerSingleton();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存消息(用于在Fragment未准备好时存储消息)
|
||||
*/
|
||||
private void cacheMessage(String roomId, RoomMessageEvent message) {
|
||||
if (TextUtils.isEmpty(roomId) || message == null) {
|
||||
return;
|
||||
}
|
||||
// 标记该房间有待处理的消息
|
||||
List<RoomMessageEvent> roomMessages = cachedMessages.computeIfAbsent(roomId, k -> new ArrayList<>());
|
||||
|
||||
// 限制每个房间的缓存消息数量
|
||||
if (roomMessages.size() >= MAX_CACHED_MESSAGES) {
|
||||
roomMessages.remove(0); // 移除最旧的消息
|
||||
}
|
||||
|
||||
roomMessages.add(message);
|
||||
LogUtils.d("MessageListener", "缓存消息: roomId=" + roomId + ", msgType=" + message.getMsgType());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取并清除指定房间的缓存消息
|
||||
*/
|
||||
public List<RoomMessageEvent> getAndClearCachedMessages(String roomId) {
|
||||
if (TextUtils.isEmpty(roomId)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<RoomMessageEvent> messages = cachedMessages.remove(roomId);
|
||||
if (messages == null) {
|
||||
messages = new ArrayList<>();
|
||||
}
|
||||
|
||||
LogUtils.d("MessageListener", "获取并清除缓存消息: roomId=" + roomId + ", count=" + messages.size());
|
||||
return messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记房间已加入
|
||||
*/
|
||||
public void markRoomJoined(String roomId) {
|
||||
if (!TextUtils.isEmpty(roomId)) {
|
||||
joinedRooms.add(roomId);
|
||||
LogUtils.d("MessageListener", "标记房间已加入: " + roomId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查房间是否已加入
|
||||
*/
|
||||
public boolean isRoomJoined(String roomId) {
|
||||
return !TextUtils.isEmpty(roomId) && joinedRooms.contains(roomId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除房间加入标记
|
||||
*/
|
||||
public void clearRoomJoined(String roomId) {
|
||||
if (!TextUtils.isEmpty(roomId)) {
|
||||
joinedRooms.remove(roomId);
|
||||
LogUtils.d("MessageListener", "清除房间加入标记: " + roomId);
|
||||
}
|
||||
}
|
||||
|
||||
// 修改 joinGroup 方法,确保先退出再加入
|
||||
public void joinGroup(String roomId) {
|
||||
if (TextUtils.isEmpty(roomId)) {
|
||||
return;
|
||||
}
|
||||
synchronized (groupOperationLock) {
|
||||
if (isGroupOperationInProgress) {
|
||||
// 如果有操作正在进行,延迟执行
|
||||
mainHandler.removeCallbacksAndMessages(null);
|
||||
mainHandler.postDelayed(() -> joinGroup(roomId), 100);
|
||||
return;
|
||||
}
|
||||
|
||||
isGroupOperationInProgress = true;
|
||||
}
|
||||
mRoomId = roomId;
|
||||
new Thread(() -> {
|
||||
try {
|
||||
// 先退出当前群组(如果需要)
|
||||
if (groupId != null && !groupId.equals(roomId)) {
|
||||
LogUtils.d("MessageListener", "开始退出群组: " + groupId + "____room:" + roomId);
|
||||
CountDownLatch quitLatch = new CountDownLatch(1);
|
||||
boolean[] quitSuccess = {false};
|
||||
|
||||
try {
|
||||
V2TIMManager.getInstance().quitGroup("room" + groupId, new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.d("MessageListener", "退出群组成功: " + groupId + "____room:" + roomId);
|
||||
quitSuccess[0] = true;
|
||||
quitLatch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
LogUtils.e("MessageListener", "退出群组失败: " + groupId + "____room:" + roomId + ", code=" + code + ", desc=" + desc);
|
||||
quitSuccess[0] = false;
|
||||
quitLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
// 等待退出操作完成,最多等待3秒
|
||||
try {
|
||||
quitLatch.await(3, java.util.concurrent.TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "退出群组异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// 加入新群组
|
||||
LogUtils.d("MessageListener", "开始加入群组: " + roomId);
|
||||
CountDownLatch joinLatch = new CountDownLatch(1);
|
||||
boolean[] joinSuccess = {false};
|
||||
|
||||
try {
|
||||
// 确保监听器已添加
|
||||
ensureListenersAdded();
|
||||
|
||||
V2TIMManager.getInstance().joinGroup("room" + roomId, "申请加入", new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.d("MessageListener", "加入im群组成功: " + roomId);
|
||||
joinSuccess[0] = true;
|
||||
groupId = roomId;
|
||||
joinLatch.countDown();
|
||||
// 标记房间已加入
|
||||
markRoomJoined(roomId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
LogUtils.e("MessageListener", "加入群组失败: " + roomId + ", code=" + code + ", desc=" + desc);
|
||||
joinSuccess[0] = false;
|
||||
joinLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
// 等待加入操作完成,最多等待3秒
|
||||
try {
|
||||
joinLatch.await(3, java.util.concurrent.TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "加入群组异常: " + e.getMessage());
|
||||
}
|
||||
|
||||
LogUtils.d("MessageListener", "群组操作完成 - 退出成功: " + (groupId == null || !groupId.equals(roomId)) + ", 加入成功: " + joinSuccess[0]);
|
||||
|
||||
} finally {
|
||||
synchronized (groupOperationLock) {
|
||||
isGroupOperationInProgress = false;
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
private void initListeners() {
|
||||
// 简单消息监听器
|
||||
if (simpleMsgListener == null) {
|
||||
simpleMsgListener = new V2TIMSimpleMsgListener() {
|
||||
@Override
|
||||
public void onRecvC2CTextMessage(String msgID, V2TIMUserInfo sender, String text) {
|
||||
LogUtils.d("C2C 文本消息 " + sender.getNickName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvC2CCustomMessage(String msgID, V2TIMUserInfo sender, byte[] customData) {
|
||||
LogUtils.d("C2C 自定义(信令)消息 " + sender.getNickName());
|
||||
String message = new String(customData, StandardCharsets.UTF_8);
|
||||
RoomMessageEvent event = GsonUtils.fromJson(message, RoomMessageEvent.class);
|
||||
if (event.getMsgType() == 130 || event.getMsgType() == 131) {
|
||||
// EventBus.getDefault().post(event);
|
||||
RetrofitClient.getInstance().getCpListener().onReceiveMsg(event);
|
||||
} else if (event.getMsgType() == CustomMsgCode.INSTANCE.getCODE_TASK_APPRENTICE_JOIN_ROOM()) {
|
||||
if (onMsgTaskListener != null) {
|
||||
onMsgTaskListener.onMsgTask(event);
|
||||
}
|
||||
} else {
|
||||
notifyMessageReceived(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvGroupTextMessage(String msgID, String groupID, V2TIMGroupMemberInfo sender, String text) {
|
||||
LogUtils.d("群文本消息:群组 " + groupID + " 中 " + sender.getNickName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvGroupCustomMessage(String msgID, String groupID, V2TIMGroupMemberInfo sender, byte[] customData) {
|
||||
LogUtils.d("收到群自定义消息:群组 " + groupID + " 中 " + sender.getNickName() +",mRoomId:"+mRoomId);
|
||||
if (!groupID.equals("")) {
|
||||
if (groupID.replace("room","").equals(mRoomId)) {
|
||||
String message = new String(customData, StandardCharsets.UTF_8);
|
||||
RoomMessageEvent event = GsonUtils.fromJson(message, RoomMessageEvent.class);
|
||||
notifyMessageReceived(event);
|
||||
LogUtils.d("收到群自定义消息(信令):", message);
|
||||
}
|
||||
} else {
|
||||
String message = new String(customData, StandardCharsets.UTF_8);
|
||||
LogUtils.d("收到群自定义消息(信令):", message);
|
||||
HeadlineBean event = GsonUtils.fromJson(message, HeadlineBean.class);
|
||||
EventBus.getDefault().post(event);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 高级消息监听器
|
||||
if (v2TIMAdvancedMsgListener == null) {
|
||||
v2TIMAdvancedMsgListener = new V2TIMAdvancedMsgListener() {
|
||||
@Override
|
||||
public void onRecvNewMessage(V2TIMMessage msg) {
|
||||
super.onRecvNewMessage(msg);
|
||||
if (msg.isBroadcastMessage()) {
|
||||
// 收到了广播消息
|
||||
String message = new String(msg.getCustomElem().getData(), StandardCharsets.UTF_8);
|
||||
LogUtils.e("收到广播消息(系统):", message);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 群组监听器
|
||||
if (groupListener == null) {
|
||||
groupListener = new V2TIMGroupListener() {
|
||||
@Override
|
||||
public void onMemberEnter(String groupID, List<V2TIMGroupMemberInfo> memberList) {
|
||||
// 有新成员加入群,该群所有的成员都能收到
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberLeave(String groupID, V2TIMGroupMemberInfo member) {
|
||||
// 有成员离开群,该群所有的成员都能收到
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveRESTCustomData(String groupID, byte[] customData) {
|
||||
String message = "";
|
||||
try {
|
||||
LogUtils.e("收到群自定义消息",groupID);
|
||||
message = new String(customData, StandardCharsets.UTF_8);
|
||||
LogUtils.e("收到群自定义消息(系统):" + message);
|
||||
} catch (Exception e) {
|
||||
// 处理转换过程中可能出现的异常,例如记录日志
|
||||
LogUtils.e("转换 customData 为 String 时出错:" + e.getMessage());
|
||||
return; // 退出方法,避免后续代码执行
|
||||
}
|
||||
|
||||
RoomMessageEvent event = null;
|
||||
try {
|
||||
// 特殊处理某些消息类型
|
||||
event = parseSpecialMessageTypes(message);
|
||||
if (event == null) {
|
||||
// 使用默认解析
|
||||
event = GsonUtils.fromJson(message, RoomMessageEvent.class);
|
||||
}
|
||||
LogUtils.e("收到群自定义消息:" + mRoomId + "===" + event);
|
||||
// event = GsonUtils.fromJson(message, RoomMessageEvent.class);
|
||||
} catch (Exception e) {
|
||||
// 处理 JSON 解析过程中可能出现的异常,例如记录日志
|
||||
LogUtils.e("解析 JSON 数据时出错:" + e.getMessage());
|
||||
return; // 退出方法,避免后续代码执行
|
||||
}
|
||||
if (groupID.contains(mRoomId)) {
|
||||
notifyMessageReceived(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 会话监听器
|
||||
if (conversationListener == null) {
|
||||
conversationListener = new V2TIMConversationListener() {
|
||||
@Override
|
||||
public void onTotalUnreadMessageCountChanged(long totalUnreadCount) {
|
||||
super.onTotalUnreadMessageCountChanged(totalUnreadCount);
|
||||
|
||||
UnreadCountEvent event = CommonAppContext.getInstance().getUnreadCountEvent();
|
||||
if (event == null) {
|
||||
event = new UnreadCountEvent();
|
||||
event.setBLong(0);
|
||||
}
|
||||
event.setALong(totalUnreadCount);
|
||||
CommonAppContext.getInstance().setUnreadCountEvent(event);
|
||||
EventBus.getDefault().post(event);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 添加所有监听器
|
||||
private void addAllListeners() {
|
||||
if (simpleMsgListener != null) {
|
||||
V2TIMManager.getInstance().addSimpleMsgListener(simpleMsgListener);
|
||||
}
|
||||
|
||||
if (v2TIMAdvancedMsgListener != null) {
|
||||
V2TIMManager.getMessageManager().addAdvancedMsgListener(v2TIMAdvancedMsgListener);
|
||||
}
|
||||
|
||||
if (groupListener != null) {
|
||||
V2TIMManager.getInstance().addGroupListener(groupListener);
|
||||
}
|
||||
|
||||
if (conversationListener != null) {
|
||||
V2TIMManager.getConversationManager().addConversationListener(conversationListener);
|
||||
}
|
||||
}
|
||||
|
||||
// 移除所有监听器
|
||||
private static void removeAllListeners() {
|
||||
if (instance != null) {
|
||||
if (instance.simpleMsgListener != null) {
|
||||
V2TIMManager.getInstance().removeSimpleMsgListener(instance.simpleMsgListener);
|
||||
}
|
||||
|
||||
if (instance.v2TIMAdvancedMsgListener != null) {
|
||||
V2TIMManager.getMessageManager().removeAdvancedMsgListener(instance.v2TIMAdvancedMsgListener);
|
||||
}
|
||||
|
||||
if (instance.groupListener != null) {
|
||||
V2TIMManager.getInstance().removeGroupListener(instance.groupListener);
|
||||
}
|
||||
|
||||
if (instance.conversationListener != null) {
|
||||
V2TIMManager.getConversationManager().removeConversationListener(instance.conversationListener);
|
||||
}
|
||||
|
||||
// instance.listenersAdded = false; // 重置标记
|
||||
}
|
||||
}
|
||||
|
||||
// 修改 quitGroup 方法
|
||||
public static void quitGroup(String mRoomId) {
|
||||
|
||||
V2TIMManager.getInstance().quitGroup("room" + mRoomId, new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.d("@@@", "退出群组成功" + mRoomId);
|
||||
// removeAllListeners(); // 移除所有监听器
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
LogUtils.d("@@@", "退出群组失败" + mRoomId, code, desc);
|
||||
// removeAllListeners(); // 即使失败也移除监听器
|
||||
}
|
||||
});
|
||||
|
||||
if (instance != null) {
|
||||
instance.listeners.clear();
|
||||
// removeAllListeners();
|
||||
isInitialized = false;
|
||||
groupId = null;
|
||||
LogUtils.e("@@@", "重置成功");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改 reset 方法
|
||||
public static void reset(String roomId) {
|
||||
if (instance != null) {
|
||||
instance.listeners.clear();
|
||||
// removeAllListeners();
|
||||
isInitialized = false;
|
||||
groupId = null;
|
||||
// instance = null;
|
||||
quitGroup(roomId);
|
||||
LogUtils.e("@@@", "重置成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 确保监听器已添加
|
||||
public void ensureListenersAdded() {
|
||||
initListeners();
|
||||
addAllListeners();
|
||||
}
|
||||
|
||||
|
||||
private RoomMessageEvent parseSpecialMessageTypes(String message) {
|
||||
try {
|
||||
JsonObject jsonObject = new JsonParser().parse(message).getAsJsonObject();
|
||||
int msgType = jsonObject.get("MsgType").getAsInt();
|
||||
|
||||
if (msgType == 1053) {
|
||||
return CustomMessageParser.parseMessageType1053(jsonObject);
|
||||
} else if (msgType == 1054) {
|
||||
return CustomMessageParser.parseMessageType1054(jsonObject);
|
||||
}
|
||||
|
||||
return null; // 不是特殊类型,使用默认解析
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("特殊消息解析失败: " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void addOnMessageReceivedListener(OnMessageReceivedListener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除群组相关的监听器
|
||||
*/
|
||||
private static void removeGroupListeners() {
|
||||
if (instance != null) {
|
||||
// 移除消息监听器
|
||||
if (instance.simpleMsgListener != null) {
|
||||
V2TIMManager.getInstance().removeSimpleMsgListener(instance.simpleMsgListener);
|
||||
}
|
||||
|
||||
if (instance.v2TIMAdvancedMsgListener != null) {
|
||||
V2TIMManager.getMessageManager().removeAdvancedMsgListener(instance.v2TIMAdvancedMsgListener);
|
||||
}
|
||||
|
||||
// 移除群组监听器
|
||||
if (instance.groupListener != null) {
|
||||
V2TIMManager.getInstance().removeGroupListener(instance.groupListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendCustomRoomMessage(String roomId, byte[] binaryData) {
|
||||
|
||||
// 创建自定义群消息
|
||||
V2TIMMessage v2TIMMessage = V2TIMManager.getMessageManager().createCustomMessage(binaryData);
|
||||
// v2TIMMessage.setNeedReadReceipt(true);
|
||||
// 发送消息
|
||||
V2TIMManager.getMessageManager().sendMessage(
|
||||
v2TIMMessage,
|
||||
null,
|
||||
"room" + roomId,
|
||||
V2TIMMessage.V2TIM_PRIORITY_NORMAL,
|
||||
false,
|
||||
null,
|
||||
sendCallback
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: 2025/11/19 添加发送公共方法,messageType:发送的type;message:发送的内容 userId:发送给谁
|
||||
public void sendCustomC2CMessage(int messageType, String message, String userId) {
|
||||
|
||||
RoomMessageEvent.T t = new RoomMessageEvent.T();
|
||||
t.setFromUserInfo(SpUtil.getUserInfo());
|
||||
t.setText(message);
|
||||
RoomMessageEvent roomMessageEvent = new RoomMessageEvent(messageType, mRoomId, t);
|
||||
String json = GsonUtils.toJson(roomMessageEvent);
|
||||
// 转换为 byte[]
|
||||
byte[] binaryData = json.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
// 创建自定义群消息
|
||||
V2TIMMessage v2TIMMessage = V2TIMManager.getMessageManager().createCustomMessage(binaryData);
|
||||
v2TIMMessage.setExcludedFromUnreadCount(true);
|
||||
v2TIMMessage.setExcludedFromContentModeration(true);
|
||||
// v2TIMMessage.setNeedReadReceipt(true);
|
||||
//
|
||||
// // 发送消息
|
||||
V2TIMManager.getMessageManager().sendMessage(v2TIMMessage, "u" + userId, null, V2TIMMessage.V2TIM_PRIORITY_HIGH,
|
||||
true,
|
||||
null,
|
||||
sendCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TODO: 2025/11/19 添加发送公共方法,messageType:发送的type;message:发送的内容 userId:发送给谁
|
||||
public void sendCustomC2CMessage(int messageType, String userId,RoomMessageEvent.T text) {
|
||||
text.setFromUserInfo(SpUtil.getUserInfo());
|
||||
LogUtils.e("发送消息", "messageType:" + messageType + "\nuserId:" + userId + "\ntext:" + text,toString());
|
||||
RoomMessageEvent roomMessageEvent = new RoomMessageEvent(messageType, mRoomId, text);
|
||||
String json = GsonUtils.toJson(roomMessageEvent);
|
||||
// 转换为 byte[]
|
||||
byte[] binaryData = json.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
// 创建自定义群消息
|
||||
V2TIMMessage v2TIMMessage = V2TIMManager.getMessageManager().createCustomMessage(binaryData);
|
||||
v2TIMMessage.setExcludedFromUnreadCount(true);
|
||||
v2TIMMessage.setExcludedFromContentModeration(true);
|
||||
// v2TIMMessage.setNeedReadReceipt(true);
|
||||
//
|
||||
// // 发送消息
|
||||
V2TIMManager.getMessageManager().sendMessage(v2TIMMessage, "u" + userId, null, V2TIMMessage.V2TIM_PRIORITY_HIGH,
|
||||
true,
|
||||
null,
|
||||
sendCallback);
|
||||
|
||||
}
|
||||
|
||||
public void sendCustomC2CMessage125(String userId, byte[] binaryData) {
|
||||
// 创建自定义群消息
|
||||
V2TIMMessage v2TIMMessage = V2TIMManager.getMessageManager().createCustomMessage(binaryData);
|
||||
v2TIMMessage.setExcludedFromUnreadCount(true);
|
||||
v2TIMMessage.setExcludedFromContentModeration(true);
|
||||
// v2TIMMessage.setNeedReadReceipt(true);
|
||||
//
|
||||
// // 发送消息
|
||||
V2TIMManager.getMessageManager().sendMessage(v2TIMMessage, "u" + userId, null, V2TIMMessage.V2TIM_PRIORITY_HIGH,
|
||||
true,
|
||||
null,
|
||||
sendCallback);
|
||||
|
||||
}
|
||||
|
||||
// RoomFragment.java 中添加
|
||||
private final V2TIMSendCallback<V2TIMMessage> sendCallback = new V2TIMSendCallback<V2TIMMessage>() {
|
||||
@Override
|
||||
public void onProgress(int progress) {
|
||||
// 可选实现
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(V2TIMMessage message) {
|
||||
Log.d("MessageSender", "发送成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.e("MessageSender", "发送失败: code=" + code + ", desc=" + desc);
|
||||
}
|
||||
};
|
||||
|
||||
private void notifyMessageReceived(RoomMessageEvent message) {
|
||||
// for (OnMessageReceivedListener listener : listeners) {
|
||||
// listener.onMessageReceived(message);
|
||||
// }
|
||||
|
||||
if ((message.getMsgType() == 1001 || message.getMsgType() == 1080) && publicScreenListeners.isEmpty()) {
|
||||
cacheMessage(message.getRoomId(), message);
|
||||
}
|
||||
|
||||
// 通知原有的监听器
|
||||
for (OnMessageReceivedListener listener : listeners) {
|
||||
listener.onMessageReceived(message);
|
||||
}
|
||||
|
||||
// 通知 PublicScreenEaseChatFragment 监听器
|
||||
for (PublicScreenMessageListener listener : publicScreenListeners) {
|
||||
listener.onPublicScreenMessageReceived(message);
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnMessageReceivedListener {
|
||||
void onMessageReceived(RoomMessageEvent message);
|
||||
}
|
||||
|
||||
|
||||
public void setOnMsgTaskListener(OnMsgTaskListener listener) {
|
||||
this.onMsgTaskListener = listener;
|
||||
}
|
||||
|
||||
public interface OnMsgTaskListener {
|
||||
void onMsgTask(RoomMessageEvent message);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user