修改BUG

This commit is contained in:
2025-08-08 10:31:50 +08:00
parent 38337c63a5
commit 4f09ec38c1
126 changed files with 4166 additions and 711 deletions

View File

@@ -18,7 +18,7 @@ android {
ndk {
//设置支持的so库
abiFilters 'arm64-v8a'
abiFilters 'arm64-v8a' ,'armeabi'
// abiFilters 'armeabi-v7a', 'arm64-v8a'
}

View File

@@ -11,9 +11,9 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 10,
"versionName": "1.0.1.8",
"outputFile": "羽声_1.0.1.8_10.apk"
"versionCode": 20,
"versionName": "1.0.2.8",
"outputFile": "羽声_1.0.2.8_20.apk"
}
],
"elementType": "File",
@@ -22,14 +22,14 @@
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/羽声_1.0.1.8_10.dm"
"baselineProfiles/1/羽声_1.0.2.8_20.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/羽声_1.0.1.8_10.dm"
"baselineProfiles/0/羽声_1.0.2.8_20.dm"
]
}
],

View File

@@ -134,14 +134,14 @@
tools:ignore="SelectedPhotoAccess"
tools:replace="android:theme,android:allowBackup"
android:enableOnBackInvokedCallback="true"
android:requestRawExternalStorageAccess="true"
>
<activity
android:name=".LaunchPageActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:screenOrientation="behind"
android:launchMode="singleTop">
android:launchMode="singleTask">
<intent-filter>
<action android:name="com.example.action.LAUNCH_PAGE" />
<category android:name="android.intent.category.DEFAULT" />
@@ -149,13 +149,28 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- 配置APP ID -->
<meta-data
android:name="BUGLY_APPID"
android:value="865cfe9555" />
<!-- &lt;!&ndash; 配置APP版本号 &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="BUGLY_APP_VERSION"-->
<!-- android:value="<APP_Version>" />-->
<!-- &lt;!&ndash; 配置APP渠道号 &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="BUGLY_APP_CHANNEL"-->
<!-- android:value="<APP_Channel>" />-->
<!-- 配置Bugly调试模式true或者false-->
<meta-data
android:name="BUGLY_ENABLE_DEBUG"
android:value="false" />
<activity
android:name="com.mobile.auth.gatewayauth.LoginAuthActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false"
android:launchMode="singleTop"
android:launchMode="singleTask"
android:screenOrientation="behind"
android:theme="@style/authsdk_activity_dialog" />
@@ -183,6 +198,10 @@
<activity
android:name=".RealNameActivity"
android:exported="false" />
<activity
android:name=".PasswordLoginActivity"
android:exported="true" />
</application>
<!-- <queries>-->
<!-- &lt;!&ndash; 支付宝 scheme &ndash;&gt;-->

View File

@@ -20,7 +20,7 @@ public class AppContext extends CommonAppContext {
super.onCreate();
ToastUtils.init(this);
ARouter.init(this);
ServiceUtils.startService(MyMqttService.class);/**/
// ServiceUtils.startService(MyMqttService.class);/**/
/* mqttClient = MyMQTTClient.getInstance(this);
mqttClient.initialize("tcp://81.70.45.221:1883");

View File

@@ -1,56 +1,21 @@
package com.qxcm.qxlive;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.annotation.Nullable;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ThreadUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.mobile.auth.gatewayauth.AuthUIConfig;
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
import com.mobile.auth.gatewayauth.PreLoginResultListener;
import com.mobile.auth.gatewayauth.ResultCode;
import com.mobile.auth.gatewayauth.TokenResultListener;
import com.mobile.auth.gatewayauth.model.TokenRet;
import com.qxcm.modulelogin.activity.ImproveInfoActivity;
import com.qxcm.modulelogin.activity.LoginActivity;
import com.qxcm.modulelogin.activity.PasswordLoginActivity;
import com.qxcm.modulemain.activity.MainActivity;
import com.qxcm.moduleutil.activity.BaseMvpActivity;
import com.qxcm.moduleutil.base.CommonAppContext;
import com.qxcm.moduleutil.bean.UserBean;
import com.qxcm.moduleutil.dialog.PolicyDialog;
import com.qxcm.moduleutil.utils.SpUtil;
import com.qxcm.moduleutil.utils.location.LocationProvider;
import com.qxcm.moduleutil.utils.location.LocationServiceFactory;
import com.qxcm.moduleutil.utils.logger.Logger;
import com.qxcm.qxlive.databinding.ActivityLaunchPageBinding;
import com.tencent.qcloud.tuicore.TUILogin;
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
import org.greenrobot.eventbus.EventBus;
public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, ActivityLaunchPageBinding> implements LaunchContacter.View {
private Handler handler;
public PhoneNumberAuthHelper phoneNumberAuthHelper;
private TokenResultListener tokenResultListener;
// public PhoneNumberAuthHelper phoneNumberAuthHelper;
// private TokenResultListener tokenResultListener;
private boolean canOnePass;
private boolean isCanOnePass = true;
private String city1="";
@@ -103,229 +68,231 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
private void initLogin() {
// EventBus.getDefault().register(this);
initQuickLogin();
checkOnePass();
// initQuickLogin();
// checkOnePass();
//
}
private void checkOnePass() {
if (!TextUtils.isEmpty(AppContext.getInstance().getToken()) && !TextUtils.isEmpty(AppContext.getInstance().getUser().getTencent_im())) {
isRoot();
return;
}
showLoadings();
if (phoneNumberAuthHelper != null) {
phoneNumberAuthHelper.accelerateLoginPage(3 * 1000, new PreLoginResultListener() {
@Override
public void onTokenSuccess(String s) {
Logger.e("onTokenSuccess", s);
canOnePass = true;
isRoot();
}
@Override
public void onTokenFailed(String s, String s1) {
Logger.e("onTokenFailed", "错误信息" + s, s1);
isRoot();
}
});
} else {
canOnePass = false;
isRoot();
}
}
private void isRoot() {
runOnUiThread(new Runnable() {
@Override
public void run() {
disLoadings();
if (!LaunchPageActivity.this.isTaskRoot()) {
Intent intent = getIntent();
if (intent != null) {
String action = intent.getAction();
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
startActivity(new Intent(this, PasswordLoginActivity.class));
finish();
} else {
goNextActivity();
}
} else {
goNextActivity();
}
} else {
goNextActivity();
}
}
});
}
private void goNextActivity() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (isFinishing() || isDestroyed()) {
return;
}
}
if (TextUtils.isEmpty(AppContext.getInstance().getToken()) || TextUtils.isEmpty(AppContext.getInstance().getUser().getTencent_im())) {
Logger.e("SplashEnd", "ARouters.CODE_LOGIN");
if (canOnePass) {
phoneNumberAuthHelper.setAuthListener(tokenResultListener);
doOnePass();
} else {
go2Login();
}
} else {
Logger.e("SplashEnd", "ARouters.MAIN");
UserBean userBean = CommonAppContext.getInstance().getUser();
// TUILogin.login(getBaseContext(), CommonAppContext.getInstance().getCurrentEnvironment().getSdkAppId(), "u"+userBean.getUser_id(), userBean.getTencent_im(), new TUICallback() {
// @Override
// public void onError(final int code, final String desc) {
// LogUtils.e("@@@",code,"描述:",desc);
// }
// @Override
// public void onSuccess() {
// LogUtils.e("@@@","成功");
//
}
// private void checkOnePass() {
// if (!TextUtils.isEmpty(AppContext.getInstance().getToken()) && !TextUtils.isEmpty(AppContext.getInstance().getUser().getTencent_im())) {
// isRoot();
// return;
// }
// showLoadings();
// if (phoneNumberAuthHelper != null) {
// phoneNumberAuthHelper.accelerateLoginPage(3 * 1000, new PreLoginResultListener() {
// @Override
// public void onTokenSuccess(String s) {
// Logger.e("onTokenSuccess", s);
// canOnePass = true;
// isRoot();
// }
//
// @Override
// public void onTokenFailed(String s, String s1) {
// Logger.e("onTokenFailed", "错误信息" + s, s1);
// isRoot();
// }
// });
if (userBean.getSex() == 0) {
Intent intent = new Intent(this, ImproveInfoActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("userBean", userBean);
intent.putExtras(bundle);
startActivity(intent);
} else {
EventBus.getDefault().post(userBean);
startActivity(new Intent(this, MainActivity.class));
}
finish();
}
}
// } else {
// canOnePass = false;
// isRoot();
// }
// }
private void doOnePass() {
AuthUIConfig authUIConfig = new AuthUIConfig.Builder()
//导航栏
.setNavColor(Color.TRANSPARENT)
.setNavReturnHidden(true)
.setNavHidden(true)
.setNavText("")
.setNavTextColor(Color.BLACK)
.setWebNavColor(Color.TRANSPARENT)
.setWebNavTextColor(Color.BLACK)
.setWebNavReturnImgPath("ic_topbar_back_dark")
//状态栏区
.setStatusBarColor(Color.TRANSPARENT)
.setLightColor(false)
.setWebViewStatusBarColor(Color.TRANSPARENT)
.setStatusBarUIFlag(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
//logo区
.setLogoImgPath("login_log")
.setLogoWidth(142)
.setLogoHeight(142)
.setLogoOffsetY(54)
.setLogoHidden(false)
.setLogoScaleType(ImageView.ScaleType.FIT_XY)
//Slogan
.setSloganText("本机号码")
.setSloganTextColor(Color.parseColor("#A8A8A8"))
.setSloganTextSize(12)
.setSloganOffsetY(236)
//掩码栏
.setNumberColor(Color.BLACK)
.setNumberSize(30)
.setNumFieldOffsetY(263)
.setNumberLayoutGravity(Gravity.CENTER_HORIZONTAL)
//登录按钮
.setLogBtnText("本机号码一键登录")
.setLogBtnWidth(300)
.setLogBtnHeight(42)
.setLogBtnOffsetY(325)
.setLogBtnTextSize(14)
.setLogBtnTextColor(getResources().getColor(R.color.black))
.setLogBtnBackgroundPath("cs")
//切换到其他方式
.setSwitchAccText("其他登录方式")
.setSwitchAccTextColor(Color.parseColor("#333333"))
.setSwitchAccTextSize(12)
.setSwitchOffsetY(390)
//协议栏
.setAppPrivacyOne("《用户协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6")
.setAppPrivacyTwo("《隐私协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4")
.setAppPrivacyColor(Color.parseColor("#A8A8A8"), Color.parseColor("#FFBC00"))
.setPrivacyBefore("登录即代表同意")
.setPrivacyEnd("并授权获得号码")
.setPrivacyTextSize(11)
.setPrivacyAlertContentVerticalMargin(20)
.setPrivacyMargin(39)
.setPrivacyState(true)
.setCheckboxHidden(false)
.setCheckedImgPath("ic_agreement_selected")
.setUncheckedImgPath("ic_agreement_unselect")
.setPrivacyOffsetX(2)
.setVendorPrivacyPrefix("")
.setVendorPrivacySuffix("")
//全页面属性
.setAuthPageActIn("in_activity", "out_activity")
.setAuthPageActOut("in_activity", "out_activity")
.setPageBackgroundPath("log_bj")
.create();
phoneNumberAuthHelper.setAuthUIConfig(authUIConfig);
phoneNumberAuthHelper.getLoginToken(getApplicationContext(), 5000);
}
// private void isRoot() {
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
// disLoadings();
// if (!LaunchPageActivity.this.isTaskRoot()) {
// Intent intent = getIntent();
// if (intent != null) {
// String action = intent.getAction();
// if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
// finish();
// } else {
// goNextActivity();
// }
// } else {
// goNextActivity();
// }
// } else {
// goNextActivity();
// }
// }
// });
// }
private void initQuickLogin() {
tokenResultListener = new TokenResultListener() {
@Override
public void onTokenSuccess(String s) {
Logger.e("onTokenSuccess", s);
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
TokenRet tokenRet = null;
try {
tokenRet = JSON.parseObject(s, TokenRet.class);
if (tokenRet != null && ("600000").equals(tokenRet.getCode())) {
phoneNumberAuthHelper.hideLoginLoading();
//获取成功 dimiss就去登录、登录成功
phoneNumberAuthHelper.quitLoginPage();
LogUtils.e("@@@",tokenRet.getToken());
MvpPre.oauthLogin(tokenRet.getToken());
}
} catch (Exception e) {
go2Login();
e.printStackTrace();
}
}
});
}
// private void goNextActivity() {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
// if (isFinishing() || isDestroyed()) {
// return;
// }
// }
// if (TextUtils.isEmpty(AppContext.getInstance().getToken()) || TextUtils.isEmpty(AppContext.getInstance().getUser().getTencent_im())) {
// Logger.e("SplashEnd", "ARouters.CODE_LOGIN");
// if (canOnePass) {
// phoneNumberAuthHelper.setAuthListener(tokenResultListener);
// doOnePass();
// } else {
// go2Login();
// }
// } else {
// Logger.e("SplashEnd", "ARouters.MAIN");
//
// UserBean userBean = CommonAppContext.getInstance().getUser();
//
//// TUILogin.login(getBaseContext(), CommonAppContext.getInstance().getCurrentEnvironment().getSdkAppId(), "u"+userBean.getUser_id(), userBean.getTencent_im(), new TUICallback() {
//// @Override
//// public void onError(final int code, final String desc) {
//// LogUtils.e("@@@",code,"描述:",desc);
//// }
//// @Override
//// public void onSuccess() {
//// LogUtils.e("@@@","成功");
////
//// }
//// });
// if (userBean.getSex() == 0) {
// Intent intent = new Intent(this, ImproveInfoActivity.class);
// Bundle bundle = new Bundle();
// bundle.putSerializable("userBean", userBean);
// intent.putExtras(bundle);
// startActivity(intent);
// } else {
// EventBus.getDefault().post(userBean);
// startActivity(new Intent(this, MainActivity.class));
// }
// finish();
// }
// }
@Override
public void onTokenFailed(String s) {
Logger.e("onTokenFailed", s);
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
phoneNumberAuthHelper.hideLoginLoading();
phoneNumberAuthHelper.quitLoginPage();
go2Login();
}
});
}
};
// private void doOnePass() {
// AuthUIConfig authUIConfig = new AuthUIConfig.Builder()
// //导航栏
// .setNavColor(Color.TRANSPARENT)
// .setNavReturnHidden(true)
// .setNavHidden(true)
// .setNavText("")
// .setNavTextColor(Color.BLACK)
// .setWebNavColor(Color.TRANSPARENT)
// .setWebNavTextColor(Color.BLACK)
// .setWebNavReturnImgPath("ic_topbar_back_dark")
// //状态栏区
// .setStatusBarColor(Color.TRANSPARENT)
// .setLightColor(false)
// .setWebViewStatusBarColor(Color.TRANSPARENT)
// .setStatusBarUIFlag(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
// //logo区
// .setLogoImgPath("login_log")
// .setLogoWidth(142)
// .setLogoHeight(142)
// .setLogoOffsetY(54)
// .setLogoHidden(false)
// .setLogoScaleType(ImageView.ScaleType.FIT_XY)
// //Slogan
// .setSloganText("本机号码")
// .setSloganTextColor(Color.parseColor("#A8A8A8"))
// .setSloganTextSize(12)
// .setSloganOffsetY(236)
// //掩码栏
// .setNumberColor(Color.BLACK)
// .setNumberSize(30)
// .setNumFieldOffsetY(263)
// .setNumberLayoutGravity(Gravity.CENTER_HORIZONTAL)
// //登录按钮
// .setLogBtnText("本机号码一键登录")
// .setLogBtnWidth(300)
// .setLogBtnHeight(42)
// .setLogBtnOffsetY(325)
// .setLogBtnTextSize(14)
// .setLogBtnTextColor(getResources().getColor(R.color.black))
// .setLogBtnBackgroundPath("cs")
// //切换到其他方式
// .setSwitchAccText("其他登录方式")
// .setSwitchAccTextColor(Color.parseColor("#333333"))
// .setSwitchAccTextSize(12)
// .setSwitchOffsetY(390)
// //协议栏
// .setAppPrivacyOne("《用户协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6")
// .setAppPrivacyTwo("《隐私协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4")
// .setAppPrivacyColor(Color.parseColor("#A8A8A8"), Color.parseColor("#FFBC00"))
// .setPrivacyBefore("登录即代表同意")
// .setPrivacyEnd("并授权获得号码")
// .setPrivacyTextSize(11)
// .setPrivacyAlertContentVerticalMargin(20)
// .setPrivacyMargin(39)
// .setPrivacyState(true)
// .setCheckboxHidden(false)
// .setCheckedImgPath("ic_agreement_selected")
// .setUncheckedImgPath("ic_agreement_unselect")
// .setPrivacyOffsetX(2)
// .setVendorPrivacyPrefix("《")
// .setVendorPrivacySuffix("》")
// //全页面属性
// .setAuthPageActIn("in_activity", "out_activity")
// .setAuthPageActOut("in_activity", "out_activity")
// .setPageBackgroundPath("log_bj")
// .create();
// phoneNumberAuthHelper.setAuthUIConfig(authUIConfig);
// phoneNumberAuthHelper.getLoginToken(getApplicationContext(), 5000);
// }
try {
phoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(getApplicationContext(), null);
phoneNumberAuthHelper.getReporter().setLoggerEnable(true);
// phoneNumberAuthHelper.setAuthSDKInfo("6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=");
phoneNumberAuthHelper.setAuthSDKInfo(((AppContext) getApplication()).getCurrentEnvironment().getALI_AUTH_KEY());
phoneNumberAuthHelper.checkEnvAvailable(2);
} catch (Throwable ignored) {
Logger.e("initAuthSDK", ignored);
}
}
// private void initQuickLogin() {
// tokenResultListener = new TokenResultListener() {
// @Override
// public void onTokenSuccess(String s) {
// Logger.e("onTokenSuccess", s);
// ThreadUtils.runOnUiThread(new Runnable() {
// @Override
// public void run() {
// TokenRet tokenRet = null;
// try {
// tokenRet = JSON.parseObject(s, TokenRet.class);
// if (tokenRet != null && ("600000").equals(tokenRet.getCode())) {
// phoneNumberAuthHelper.hideLoginLoading();
// //获取成功 dimiss就去登录、登录成功
// phoneNumberAuthHelper.quitLoginPage();
// LogUtils.e("@@@",tokenRet.getToken());
// MvpPre.oauthLogin(tokenRet.getToken());
// }
// } catch (Exception e) {
// go2Login();
// e.printStackTrace();
// }
// }
// });
// }
//
// @Override
// public void onTokenFailed(String s) {
// Logger.e("onTokenFailed", s);
// ThreadUtils.runOnUiThread(new Runnable() {
// @Override
// public void run() {
// phoneNumberAuthHelper.hideLoginLoading();
// phoneNumberAuthHelper.quitLoginPage();
// go2Login();
// }
// });
// }
// };
//
// try {
// phoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(getApplicationContext(), null);
// phoneNumberAuthHelper.getReporter().setLoggerEnable(true);
//// phoneNumberAuthHelper.setAuthSDKInfo("6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=");
// phoneNumberAuthHelper.setAuthSDKInfo(((AppContext) getApplication()).getCurrentEnvironment().getALI_AUTH_KEY());
// phoneNumberAuthHelper.checkEnvAvailable(2);
//
// } catch (Throwable ignored) {
// Logger.e("initAuthSDK", ignored);
// }
// }
private void go2Login() {
startActivity(new Intent(this, PasswordLoginActivity.class));
@@ -363,4 +330,20 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
// }
// }
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!this.isTaskRoot()) {
Intent intent = getIntent();
if (intent != null) {
String action = intent.getAction();
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
finish();
return;
}
}
}
}
}

View File

@@ -1,32 +1,44 @@
package com.qxcm.modulelogin.activity;
package com.qxcm.qxlive;
import static android.view.View.VISIBLE;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.alibaba.fastjson.JSON;
import com.alipay.sdk.app.AuthTask;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ThreadUtils;
import com.hjq.toast.ToastUtils;
import com.qxcm.modulelogin.R;
import com.qxcm.modulelogin.databinding.ActivityPasswordLoginBinding;
import com.mobile.auth.gatewayauth.AuthUIConfig;
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
import com.mobile.auth.gatewayauth.PreLoginResultListener;
import com.mobile.auth.gatewayauth.TokenResultListener;
import com.mobile.auth.gatewayauth.model.TokenRet;
import com.qxcm.modulelogin.activity.ImproveInfoActivity;
import com.qxcm.modulelogin.even.LoginFinishEvent;
import com.qxcm.modulelogin.present.LoginContacter;
import com.qxcm.modulelogin.present.LoginPresenter;
import com.qxcm.modulemain.activity.MainActivity;
import com.qxcm.moduleutil.activity.BaseMvpActivity;
import com.qxcm.moduleutil.base.CommonAppContext;
import com.qxcm.moduleutil.bean.UserBean;
import com.qxcm.moduleutil.utils.BarUtils;
import com.qxcm.moduleutil.utils.PreferencesUtils;
import com.qxcm.moduleutil.base.CommonAppContext;
import com.qxcm.moduleutil.utils.logger.DataLogger;
import com.qxcm.moduleutil.utils.logger.Logger;
import com.qxcm.qxlive.databinding.ActivityPasswordLoginBinding;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;
@@ -46,6 +58,9 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
public String mobile;
private int type;//1:验证码登录2密码登录
boolean isPasswordVisible = false;
public PhoneNumberAuthHelper phoneNumberAuthHelper;
private TokenResultListener tokenResultListener;
private boolean canOnePass;
@Override
protected void initData() {
@@ -77,6 +92,10 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
@Override
protected void initView() {
super.initView();
initQuickLogin();
checkOnePass();
BarUtils.setStatusBarAlpha(this, 0);
mBinding.edPhone.addTextChangedListener(new TextWatcher() {
@Override
@@ -130,6 +149,222 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
}
private void initQuickLogin() {
tokenResultListener = new TokenResultListener() {
@Override
public void onTokenSuccess(String s) {
Logger.e("onTokenSuccess", s);
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
TokenRet tokenRet = null;
try {
tokenRet = JSON.parseObject(s, TokenRet.class);
if (tokenRet != null && ("600000").equals(tokenRet.getCode())) {
phoneNumberAuthHelper.hideLoginLoading();
//获取成功 dimiss就去登录登录成功
phoneNumberAuthHelper.quitLoginPage();
LogUtils.e("@@@",tokenRet.getToken());
MvpPre.oauthLoginLogin(tokenRet.getToken());
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
@Override
public void onTokenFailed(String s) {
Logger.e("onTokenFailed", s);
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
phoneNumberAuthHelper.hideLoginLoading();
phoneNumberAuthHelper.quitLoginPage();
}
});
}
};
try {
phoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(getApplicationContext(), null);
phoneNumberAuthHelper.getReporter().setLoggerEnable(true);
// phoneNumberAuthHelper.setAuthSDKInfo("6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=");
phoneNumberAuthHelper.setAuthSDKInfo(((CommonAppContext) getApplication()).getCurrentEnvironment().getALI_AUTH_KEY());
phoneNumberAuthHelper.checkEnvAvailable(2);
} catch (Throwable ignored) {
Logger.e("initAuthSDK", ignored);
}
}
private void checkOnePass() {
if (!TextUtils.isEmpty(CommonAppContext.getInstance().getToken()) && !TextUtils.isEmpty(CommonAppContext.getInstance().getUser().getTencent_im())) {
isRoot();
return;
}
showLoadings();
if (phoneNumberAuthHelper != null) {
phoneNumberAuthHelper.accelerateLoginPage(3 * 1000, new PreLoginResultListener() {
@Override
public void onTokenSuccess(String s) {
Logger.e("onTokenSuccess", s);
canOnePass = true;
isRoot();
}
@Override
public void onTokenFailed(String s, String s1) {
Logger.e("onTokenFailed", "错误信息" + s, s1);
isRoot();
}
});
} else {
canOnePass = false;
isRoot();
}
}
private void isRoot() {
runOnUiThread(new Runnable() {
@Override
public void run() {
disLoadings();
if (!PasswordLoginActivity.this.isTaskRoot()) {
Intent intent = getIntent();
if (intent != null) {
String action = intent.getAction();
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
finish();
} else {
goNextActivity();
}
} else {
goNextActivity();
}
} else {
goNextActivity();
}
}
});
}
private void goNextActivity() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (isFinishing() || isDestroyed()) {
return;
}
}
if (TextUtils.isEmpty(CommonAppContext.getInstance().getToken()) || TextUtils.isEmpty(CommonAppContext.getInstance().getUser().getTencent_im())) {
Logger.e("SplashEnd", "ARouters.CODE_LOGIN");
if (canOnePass) {
phoneNumberAuthHelper.setAuthListener(tokenResultListener);
doOnePass();
} else {
}
} else {
Logger.e("SplashEnd", "ARouters.MAIN");
UserBean userBean = CommonAppContext.getInstance().getUser();
// TUILogin.login(getBaseContext(), CommonAppContext.getInstance().getCurrentEnvironment().getSdkAppId(), "u"+userBean.getUser_id(), userBean.getTencent_im(), new TUICallback() {
// @Override
// public void onError(final int code, final String desc) {
// LogUtils.e("@@@",code,"描述:",desc);
// }
// @Override
// public void onSuccess() {
// LogUtils.e("@@@","成功");
//
// }
// });
if (userBean.getSex() == 0) {
Intent intent = new Intent(this, ImproveInfoActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("userBean", userBean);
intent.putExtras(bundle);
startActivity(intent);
} else {
EventBus.getDefault().post(userBean);
startActivity(new Intent(this, MainActivity.class));
}
finish();
}
}
private void doOnePass() {
AuthUIConfig authUIConfig = new AuthUIConfig.Builder()
//导航栏
.setNavColor(Color.TRANSPARENT)
.setNavReturnHidden(true)
.setNavHidden(true)
.setNavText("")
.setNavTextColor(Color.BLACK)
.setWebNavColor(Color.TRANSPARENT)
.setWebNavTextColor(Color.BLACK)
.setWebNavReturnImgPath("ic_topbar_back_dark")
//状态栏区
.setStatusBarColor(Color.TRANSPARENT)
.setLightColor(false)
.setWebViewStatusBarColor(Color.TRANSPARENT)
.setStatusBarUIFlag(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
//logo区
.setLogoImgPath("login_log")
.setLogoWidth(142)
.setLogoHeight(142)
.setLogoOffsetY(54)
.setLogoHidden(false)
.setLogoScaleType(ImageView.ScaleType.FIT_XY)
//Slogan
.setSloganText("本机号码")
.setSloganTextColor(Color.parseColor("#A8A8A8"))
.setSloganTextSize(12)
.setSloganOffsetY(236)
//掩码栏
.setNumberColor(Color.BLACK)
.setNumberSize(30)
.setNumFieldOffsetY(263)
.setNumberLayoutGravity(Gravity.CENTER_HORIZONTAL)
//登录按钮
.setLogBtnText("本机号码一键登录")
.setLogBtnWidth(300)
.setLogBtnHeight(42)
.setLogBtnOffsetY(325)
.setLogBtnTextSize(14)
.setLogBtnTextColor(getResources().getColor(R.color.black))
.setLogBtnBackgroundPath("cs")
//切换到其他方式
.setSwitchAccText("其他登录方式")
.setSwitchAccTextColor(Color.parseColor("#333333"))
.setSwitchAccTextSize(12)
.setSwitchOffsetY(390)
//协议栏
.setAppPrivacyOne("《用户协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6")
.setAppPrivacyTwo("《隐私协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4")
.setAppPrivacyColor(Color.parseColor("#A8A8A8"), Color.parseColor("#FFBC00"))
.setPrivacyBefore("登录即代表同意")
.setPrivacyEnd("并授权获得号码")
.setPrivacyTextSize(11)
.setPrivacyAlertContentVerticalMargin(20)
.setPrivacyMargin(39)
.setPrivacyState(true)
.setCheckboxHidden(false)
.setCheckedImgPath("ic_agreement_selected")
.setUncheckedImgPath("ic_agreement_unselect")
.setPrivacyOffsetX(2)
.setVendorPrivacyPrefix("")
.setVendorPrivacySuffix("")
//全页面属性
.setAuthPageActIn("in_activity", "out_activity")
.setAuthPageActOut("in_activity", "out_activity")
.setPageBackgroundPath("log_bj")
.create();
phoneNumberAuthHelper.setAuthUIConfig(authUIConfig);
phoneNumberAuthHelper.getLoginToken(getApplicationContext(), 8000);
}
@Override
protected LoginPresenter bindPresenter() {
return new LoginPresenter(this, this);

View File

@@ -214,7 +214,8 @@
android:id="@+id/iv_eye"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/eye_close"/>
android:src="@mipmap/eye_close"
android:visibility="gone"/>
</LinearLayout>
</RelativeLayout>

View File

@@ -29,8 +29,8 @@ isBuildModule=false
#org.gradle.deamon=false
android.injected.testOnly=false
APP_VERSION_NAME=1.0.1.8
APP_VERSION_CODE=10
APP_VERSION_NAME=1.0.2.8
APP_VERSION_CODE=20
org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -3,19 +3,20 @@
<application android:allowBackup="true">
<activity
android:name=".activity.SwitchAccountsActivity"
android:exported="true" />
android:exported="true"
android:launchMode="singleTask"/>
<activity
android:name=".activity.ImproveInfoActivity"
android:exported="true" />
android:exported="true"
android:launchMode="singleTask"/>
<activity
android:name=".activity.ForgetPasswordActivity"
android:exported="true" />
<activity
android:name=".activity.PasswordLoginActivity"
android:exported="true" />
android:exported="true"
android:launchMode="singleTask"/>
<activity
android:name=".activity.LoginActivity"
android:launchMode="singleTop"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
</application>

View File

@@ -12,7 +12,9 @@ import com.blankj.utilcode.util.ToastUtils;
import com.luck.picture.lib.basic.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.engine.CropEngine;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.style.PictureSelectorStyle;
import com.qxcm.modulelogin.R;
import com.qxcm.modulelogin.bean.UserFillResp;
import com.qxcm.modulelogin.databinding.ActivityImproveInfoBinding;
@@ -128,11 +130,13 @@ public class ImproveInfoActivity extends BaseMvpActivity<ImproveInfoPresenter, A
nickname = mBinding.edNickName.getText().toString().trim();
String inviteCode = mBinding.etInviteCode.getText().toString().trim();
if (TextUtils.isEmpty(nickname)) {
ToastUtils.showShort("请输入昵称");
com.hjq.toast.ToastUtils.show("请输入昵称");
// ToastUtils.showShort("请输入昵称");
return;
}
if (TextUtils.isEmpty(sex)) {
ToastUtils.showShort("请选择性别");
if (sex==null||TextUtils.isEmpty(sex)) {
com.hjq.toast.ToastUtils.show("请选择性别");
// ToastUtils.showShort("请选择性别");
return;
}
if (!inviteCode.isEmpty() || inviteCode != null) {
@@ -209,6 +213,7 @@ public class ImproveInfoActivity extends BaseMvpActivity<ImproveInfoPresenter, A
PictureSelector.create(this)
.openGallery(mimeType)
.setSelectorUIStyle(new PictureSelectorStyle())
.isGif(false)
.setImageEngine(GlideEngine.createGlideEngine())
.setMaxSelectNum(1)
@@ -216,8 +221,8 @@ public class ImproveInfoActivity extends BaseMvpActivity<ImproveInfoPresenter, A
.isDisplayCamera(true)
.setOutputCameraDir(Constants.FILE_PATH)
.isOriginalSkipCompress(true)
.forResult(requestCode); //结果回调onActivityResult code
}

View File

@@ -212,10 +212,10 @@ public class LoginActivity extends BaseMvpActivity<LoginPresenter, ActivityLogin
public void onClick(View view) {
int id = view.getId();
if (id == R.id.tv_code_text) {
Intent intent = new Intent(this, PasswordLoginActivity.class);
intent.putExtra("mobile", mBinding.edPhone.getText().toString());
startActivity(intent);
finish();
// Intent intent = new Intent(this, PasswordLoginActivity.class);
// intent.putExtra("mobile", mBinding.edPhone.getText().toString());
// startActivity(intent);
// finish();
} else if (id == R.id.fl_login) {
if (!mBinding.cbPrivacy.isChecked()) {
com.hjq.toast.ToastUtils.show("请先勾选服务条款");

View File

@@ -29,6 +29,8 @@ public final class LoginContacter {
void forgotPassword(String new_password,String mobile, String sms_code );
void oauthLoginLogin(String auth_code);
}
}

View File

@@ -119,9 +119,10 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
loginSuccess(userBeans);
}
});
}
@Override
public void switchAccounts(String loginId) {
api.switchAccounts(loginId, new BaseObserver<List<UserBean>>() {
@@ -153,6 +154,22 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
}
});
}
//一键登陆
@Override
public void oauthLoginLogin(String auth_code) {
api.oauthLogin(auth_code, new BaseObserver<List<UserBean>>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(List<UserBean> userBeans) {
loginSuccess(userBeans);
}
});
}
@Override
public void detachView() {

View File

@@ -54,6 +54,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation libs.appcompat
implementation libs.material
@@ -104,6 +105,8 @@ dependencies {
// api(libs.pictureselector.picture.library)
api('io.github.lucksiege:pictureselector:v3.11.2')
///图片裁剪 (按需引入)
api ('io.github.lucksiege:ucrop:v3.11.2')
api(libs.com.github.bumptech.glide.glide)
// api(libs.glide.compiler)
@@ -186,8 +189,8 @@ dependencies {
// api project(':LocalAar')
api 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号也可以指定明确的版本号例如4.0.3
// api 'com.tencent.rqd:nativecrashreport:latest.release' //其中latest.release指代最新Bugly NDK版本号也可以指定明确的版本号例如3.9.2
// 房间引擎
api "io.trtc.uikit:rtc_room_engine:latest.release"
// rtc room engine 依赖 trtc sdk 和 im sdk

View File

@@ -8,6 +8,11 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application android:allowBackup="true">
<service
android:name=".service.MyRoomService"
android:enabled="true"
android:exported="true"></service>
<activity
android:name=".activity.QxActivity"
android:exported="false" />
@@ -29,9 +34,7 @@
<!-- android:enabled="true" -->
<!-- android:exported="true" -->
<!-- tools:ignore="Instantiatable" /> -->
<service
android:name=".service.EMqttService"
/>
<service android:name=".service.EMqttService" />
<service
android:name=".service.MyMqttService"
android:foregroundServiceType="dataSync" />

View File

@@ -7,6 +7,7 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
@@ -27,6 +28,8 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends AppCompatActivity {
@Override
@@ -34,6 +37,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
super.attachBaseContext(LanguageUtil.attachBaseContext(newBase));
}
protected VDB mBinding;
private static final List<BaseMvpActivity> activityList = new ArrayList<>();
// private LoadingDialog mLoadingDialog;
@@ -70,6 +75,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
EventBus.getDefault().register(this);
}
// // 设置全屏模式,隐藏状态栏和导航栏
// View decorView = getWindow().getDecorView();
// decorView.setSystemUiVisibility(
@@ -81,7 +87,13 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
public static void finishAll() {
for (BaseMvpActivity activity : activityList) {
if (!activity.isFinishing()) {
activity.finish();
}
}
}
@Override
public Resources getResources() {//禁止app字体大小跟随系统字体大小调节
Resources resources = super.getResources();
@@ -189,5 +201,4 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
}
return false;
}
}

View File

@@ -11,6 +11,7 @@ import android.content.pm.PackageManager;
import android.graphics.PixelFormat;
import android.os.Build;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewTreeObserver;
@@ -302,5 +303,4 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
// });
// }
}

View File

@@ -9,6 +9,7 @@ import android.app.Activity;
import android.content.ClipData;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@@ -82,6 +83,10 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示
mBinding.webView.setWebViewClient(new WebViewClient());
mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mBinding.webView.requestFocus();
mBinding.webView.loadUrl(url);
@@ -274,6 +279,11 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
public void enterAuthent() {//实名认证
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
}
@JavascriptInterface
public void Recharge(){
ARouter.getInstance().build(ARouteConstants.RECHARGE_ACTIVITY).navigation();
}
}
@JavascriptInterface

View File

@@ -22,6 +22,7 @@ import com.qxcm.moduleutil.event.GiftDoubleClickEvent;
import com.qxcm.moduleutil.event.GiftUserRefreshEvent;
import com.qxcm.moduleutil.event.RoomGiftClickEvent;
import com.qxcm.moduleutil.event.RoomGiftClickToEvent;
import com.qxcm.moduleutil.event.RoomGiftPackToEvent;
import com.qxcm.moduleutil.presenter.RewardGiftContacts;
import com.qxcm.moduleutil.presenter.RewardGiftPresenter;
@@ -171,7 +172,7 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
// mAdapter = new GiftTwoAdapter(getActivity(), data, j, "0");
// mBinding.rvGift.setAdapter(mAdapter);
packAdapter = new GiftPackAdapter(getActivity(), giftPackBean, j, "0");
mBinding.rvGift.setAdapter(roomAdapter);
mBinding.rvGift.setAdapter(packAdapter);
}
}
@@ -231,6 +232,65 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onGiftClicPackEvent(RoomGiftPackToEvent event) {
if (giftPackList == null) {
giftPackList = new ArrayList<>();
giftPackList.add(event.gift);
}
if (event.type == 1){
String id = event.gift.getGift_id();
for (int i = 0; i < giftPackList.size(); i++) {
GiftPackBean giftModel = giftPackList.get(i);
RoonGiftModel roonGiftModel = new RoonGiftModel();
roonGiftModel.setGift_id(giftModel.getGift_id());
roonGiftModel.setGift_name(giftModel.getGift_name());
roonGiftModel.setGift_price(giftModel.getGift_price());
roonGiftModel.setBase_image(giftModel.getBase_image());
roonGiftModel.setNum(Integer.parseInt(giftModel.getNum()));
if (giftModel.getGift_id().equals(id)) {
if (!giftModel.isChecked()) {
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type,roonGiftModel));
giftModel.setChecked(true);
}
} else {
giftModel.setChecked(false);
}
}
if (event.adapter != null && event.adapter.get() != null) {
event.adapter.get().notifyDataSetChanged();
}
}else {
String id = event.gift.getGift_id();
GiftPackBean selGift = null;
for (int i = 0; i < giftPackList.size(); i++) {
GiftPackBean giftModel = giftPackList.get(i);
RoonGiftModel roonGiftModel = new RoonGiftModel();
roonGiftModel.setGift_id(giftModel.getGift_id());
roonGiftModel.setGift_name(giftModel.getGift_name());
roonGiftModel.setGift_price(giftModel.getGift_price());
roonGiftModel.setBase_image(giftModel.getBase_image());
roonGiftModel.setNum(Integer.parseInt(giftModel.getNum()));
if (giftModel.getGift_id().equals(id)) {
selGift = giftModel;
if (!giftModel.isChecked()) {
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type,roonGiftModel));
giftModel.setChecked(true);
}
} else {
giftModel.setChecked(false);
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type,null));
}
}
if (event.adapter != null && event.adapter.get() != null) {
event.adapter.get().notifyDataSetChanged();
}
if (selGift != null) {
EventBus.getDefault().post(new GiftDoubleClickEvent());
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onGiftClicRoomkTEvent(RoomGiftClickToEvent event) {

View File

@@ -64,6 +64,7 @@ import com.scwang.smartrefresh.layout.api.RefreshHeader;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.qcloud.tuicore.TUILogin;
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
@@ -131,6 +132,8 @@ public class CommonAppContext extends MultiDexApplication {
AgoraManager.getInstance(this).init(currentEnvironment.getSwSdkAppId());
MessageListenerSingleton.getInstance();
CrashReport.initCrashReport(this, "865cfe9555", true);
// CrashReport.testJavaCrash();
// startInitSdk();
}
private PiaoPingManager piaoPingManager;

View File

@@ -4,6 +4,11 @@ import com.stx.xhb.xbanner.entity.SimpleBannerInfo;
import java.util.ArrayList;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
@Data
public class BannerModel extends SimpleBannerInfo {

View File

@@ -0,0 +1,13 @@
package com.qxcm.moduleutil.bean;
import lombok.Data;
/**
* @Author lxj$
* @Time 2025-8-5 01:38:04$ $
* @Description 更新用户声网token$
*/
@Data
public class PkSwTokenBean {
private String agora_token;
}

View File

@@ -11,6 +11,7 @@ public class RevenueBean {
private String change_value;
private String remarks;
private String createtime;
private int type; //1:金币 2钻石
// private String title;
// private String time;
// private String money;

View File

@@ -0,0 +1,13 @@
package com.qxcm.moduleutil.bean;
import lombok.Data;
/**
* @Author lxj$
* @Time 2025-8-6 12:04:05$ $
* @Description 完成任务后返回的参数$
*/
@Data
public class RoomSingleton {
private int is_completed;
}

View File

@@ -68,7 +68,7 @@ public class UserInfo implements Serializable {
// private String tag_name;
// }
@Data
public static class GiftWall{
public static class GiftWall {
private String gift_name;
private String total;

View File

@@ -1,5 +1,7 @@
package com.qxcm.moduleutil.bean;
import java.io.Serializable;
import lombok.Data;
/**
*@author qx
@@ -7,7 +9,7 @@ import lombok.Data;
*@description: 用户标签实体
*/
@Data
public class UserTagBean {
public class UserTagBean implements Serializable {
private String id;
private String tag_name;
private String createtime;

View File

@@ -13,4 +13,6 @@ public class WalletBean {
private String user_id;
private String coin;//金币
private String earnings;//钻石
private String url;//灵活就业合作伙伴协议
private String title;//状态
}

View File

@@ -74,9 +74,10 @@ public class EMMessageInfo implements MultiItemEntity {
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 QXRoomMessageTypeRoomDress = 1035;//动态修改用户头像信息
public static final int QXRoomMessageTypeRoomOnline = 1036;//
public static final int QXRoomMessageTypeRoomOPK = 1037;
public static final int QXRoomMessageTypeRoomOMh = 1038;
///关闭对方麦克风
public static final int QXRoomMessageTypeMuteRemoteAudio = 125;
public static final int QXRoomMessageTypeMuteLocalAudio = 126;
@@ -131,6 +132,7 @@ public class EMMessageInfo implements MultiItemEntity {
case QXRoomMessageTypeRoomDress:
case QXRoomMessageTypeRoomOnline:
case QXRoomMessageTypeRoomOPK:
case QXRoomMessageTypeRoomOMh:
return 1;
case QXRoomMessageTypeGift:
return 3;

View File

@@ -1,5 +1,7 @@
package com.qxcm.moduleutil.bean.room;
import java.io.Serializable;
import lombok.Data;
/**
*@author qx
@@ -7,7 +9,7 @@ import lombok.Data;
*@description: pk实体
*/
@Data
public class PkRoomInfo {
public class PkRoomInfo implements Serializable {
private String pk_room_id;//对方房间的roomId
private String invite_pk_user_id;//pk发起者的用户id
private String pk_id;//pkid

View File

@@ -112,7 +112,7 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
type=2;
} else if (i == R.id.btn_2) {
List<RoonGiftModel> list = new ArrayList<>();
if (firstChargeGiftBean.getGift_bag().size() > 3) {
if (firstChargeGiftBean.getGift_bag().size() == 3) {
if (firstChargeGiftBean.getGift_bag().get(2)!=null) {
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(2).getTitle1());
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(2).getTitle2());

View File

@@ -0,0 +1,193 @@
package com.qxcm.moduleutil.dialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.widget.RadioGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.qxcm.moduleutil.R;
import com.qxcm.moduleutil.activity.WebViewActivity;
import com.qxcm.moduleutil.adapter.HeavenGiftAdapter;
import com.qxcm.moduleutil.base.CommonAppContext;
import com.qxcm.moduleutil.bean.BaseListData;
import com.qxcm.moduleutil.bean.FirstChargeGiftBean;
import com.qxcm.moduleutil.bean.RoonGiftModel;
import com.qxcm.moduleutil.databinding.DialogFirstChargeBinding;
import com.qxcm.moduleutil.databinding.WebViewDialogBinding;
import com.qxcm.moduleutil.http.BaseObserver;
import com.qxcm.moduleutil.http.RetrofitClient;
import com.qxcm.moduleutil.utils.ARouteConstants;
import com.qxcm.moduleutil.widget.dialog.BaseDialog;
import com.tencent.imsdk.v2.V2TIMConversation;
import com.tencent.mm.opensdk.modelbiz.WXOpenCustomerServiceChat;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.tencent.qcloud.tuicore.TUIConstants;
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIC2CChatActivity;
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity;
import com.zhpan.bannerview.indicator.DrawableIndicator;
import com.zhpan.indicator.base.IIndicator;
import com.zhpan.indicator.enums.IndicatorSlideMode;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.disposables.Disposable;
/**
* @Author lxj$
* @Time 2025-8-8 09:20:18$ $
* @Description 弹窗webview$
*/
public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
String mUrl;
public WebViewDialog(@NonNull Context context,String url) {
super(context, R.style.BaseDialogStyleH);
this.mUrl=url;
}
@Override
public int getLayoutId() {
return R.layout.web_view_dialog;
}
@Override
public void initView() {
setCancelable(false);
setCanceledOnTouchOutside(false);
Window window = getWindow();
assert window != null;
window.setGravity(Gravity.BOTTOM);
window.setLayout((int) (ScreenUtils.getScreenWidth() * 320.f / 375), WindowManager.LayoutParams.MATCH_PARENT);
mBinding.ivClose.setOnClickListener(v -> dismiss());
//
}
@Override
public void initData() {
WebSettings webSettings = mBinding.webView.getSettings();
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setJavaScriptEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); //关闭webview中缓存
//增加JSBridge
mBinding.webView.addJavascriptInterface(new WebAppInterface(getContext()), "Android");
// mBinding.webView.addJavascriptInterface(new WebViewBridgeConfig(title), WebViewBridgeConfig.NAME);
webSettings.setBuiltInZoomControls(false);
webSettings.setSupportZoom(false);
webSettings.setDomStorageEnabled(true);
webSettings.setBlockNetworkImage(false);//解决图片不显示
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示
mBinding.webView.setWebViewClient(new WebViewClient());
mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mBinding.webView.requestFocus();
mBinding.webView.loadUrl("https://vespa.qxmier.com/web/index.html#/pages/other/taskDesc");
}
private Resources getResources() {
return getContext().getResources();
}
public class WebAppInterface {
Context mContext;
WebAppInterface(Context c) {
mContext = c;
}
// 被 H5 调用的方法
@JavascriptInterface
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
@JavascriptInterface
public void closeWeb() {
LogUtils.e("value: ");
dismiss();
}
@JavascriptInterface
public void customerService() {
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId(); // 填移动应用(App)的 AppId
IWXAPI api = WXAPIFactory.createWXAPI(mContext, appId);
// 判断当前版本是否支持拉起客服会话
WXOpenCustomerServiceChat.Req req = new WXOpenCustomerServiceChat.Req();
req.corpId = "ww1de4300858c0b461"; // 企业ID
req.url = "https://work.weixin.qq.com/kfid/kfcb3d23a59c188a0e7"; // 客服URL
api.sendReq(req);
}
@JavascriptInterface
public void jumpRoomPage(String room_id) {
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", room_id).navigation();
}
@JavascriptInterface
public void jumpWebPage(String objects) {
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).navigation();
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", objects).navigation();
}
@JavascriptInterface
public void enterGroupChat(String group_id,String cover,String guild_name) {
Intent intent = new Intent(mContext, TUIGroupChatActivity.class);
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, group_id);
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_GROUP);
mContext.startActivity(intent);
}
@JavascriptInterface
public void chatWithUser(String user_id,String nickname) {
Intent intent = new Intent(mContext, TUIC2CChatActivity.class);
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, user_id);
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_C2C);
mContext.startActivity(intent);
}
@JavascriptInterface
public void exchange(){
ARouter.getInstance().build(ARouteConstants.CURRENCY).navigation();
}
@JavascriptInterface
public void Withdrawal() {
ARouter.getInstance().build(ARouteConstants.WITHDRAWAL_ACTIVITY).navigation();
}
@JavascriptInterface
public void enterAuthent() {//实名认证
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
}
@JavascriptInterface
public void Recharge(){
ARouter.getInstance().build(ARouteConstants.RECHARGE_ACTIVITY).navigation();
}
}
}

View File

@@ -0,0 +1,10 @@
package com.qxcm.moduleutil.event;
/**
* @Author lxj$
* @Time 2025-8-6 14:53:35$ $
* @Description 房间任务信息$
*/
public class RoomTaskEvent {
}

View File

@@ -30,6 +30,7 @@ import com.qxcm.moduleutil.bean.MyRoomBean;
import com.qxcm.moduleutil.bean.NewsDataBean;
import com.qxcm.moduleutil.bean.NewsMessageList;
import com.qxcm.moduleutil.bean.PersonaltyBean;
import com.qxcm.moduleutil.bean.PkSwTokenBean;
import com.qxcm.moduleutil.bean.PlaceholderBean;
import com.qxcm.moduleutil.bean.RealNameBean;
import com.qxcm.moduleutil.bean.RechargeBean;
@@ -110,11 +111,14 @@ public interface ApiServer {
@POST(Constants.dailyTasksOpenBox)
Observable<BaseModel<GiftName>> dailyTasksOpenBox(@Field("gift_box_id") String gift_box_id);
@FormUrlEncoded
@POST(Constants.dailyTasksReceive)
Call<ResponseBody> dailyTasksReceive(@Field("task_id") String task_id);
@FormUrlEncoded
@POST(Constants.dailyTasksComplete)
Call<ResponseBody> dailyTasksComplete(@Field("task_id") String task_id);
@FormUrlEncoded
@POST(Constants.SEND_HEADLINE)
Call<BaseModel<String>> sendHeadine(@Field("content") String content, @Field("money") String money, @Field("room_id") String roomId);
@@ -135,7 +139,7 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.POST_LOG_LIST)
Observable<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("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);
@FormUrlEncoded
@POST(Constants.POST_WEALTH_RANKING)
@@ -429,10 +433,19 @@ public interface ApiServer {
@POST(Constants.POST_USER_OLINE_STATUS)
Call<BaseModel<List<UserOnlineStatusBean>>> userOnlineStatus(@Field("user_id") String userId,@Field("room_id")String roomId);
@FormUrlEncoded
@POST(Constants.postRoomSwToken)
Call<BaseModel<PkSwTokenBean>> postRoomSwToken(@Field("room_id") String roomId);
@FormUrlEncoded
@POST(Constants.SET_USER_DECORATE)
Call<BaseModel<String>> setUserDecorate(@Field("udid") String udid);
@FormUrlEncoded
@POST(Constants.POST_CANCEL_USER_DECORATE)
Call<BaseModel<String>> cancelUserDecorate(@Field("type") String type);
@FormUrlEncoded
@POST(Constants.UP_ALBUM)
Call<BaseModel<String>> upAddAlbum(@Field("album_id") String album_id, @Field("images") String images, @Field("content") String content);

View File

@@ -62,12 +62,12 @@ public abstract class BaseObserver<T> implements Observer<T> {
}
}
if (showErrMsg && !TextUtils.isEmpty(apiException.getMessage())) {
ToastUtils.show(extractChinese(apiException.getMessage()));
// ToastUtils.show(extractChinese(apiException.getMessage()));
}
} else if (e instanceof APIException) {
APIException apiException = (APIException) e;
if (showErrMsg && !TextUtils.isEmpty(apiException.getMessage())) {
ToastUtils.show(apiException.getMessage());
// ToastUtils.show(apiException.getMessage());
}
} else if (e instanceof JsonSyntaxException) {
ToastUtils.show("网络请求错误……");

View File

@@ -45,6 +45,7 @@ import com.qxcm.moduleutil.bean.MyRoomBean;
import com.qxcm.moduleutil.bean.NewsDataBean;
import com.qxcm.moduleutil.bean.NewsMessageList;
import com.qxcm.moduleutil.bean.PersonaltyBean;
import com.qxcm.moduleutil.bean.PkSwTokenBean;
import com.qxcm.moduleutil.bean.PlaceholderBean;
import com.qxcm.moduleutil.bean.RealNameBean;
import com.qxcm.moduleutil.bean.RechargeBean;
@@ -56,6 +57,7 @@ import com.qxcm.moduleutil.bean.RoomCharmRankBean;
import com.qxcm.moduleutil.bean.RoomDetails;
import com.qxcm.moduleutil.bean.RoomRelationBean;
import com.qxcm.moduleutil.bean.RoomSearchResp;
import com.qxcm.moduleutil.bean.RoomSingleton;
import com.qxcm.moduleutil.bean.RoomSubsidy;
import com.qxcm.moduleutil.bean.RoomSubsidyDetails;
import com.qxcm.moduleutil.bean.RoomTime;
@@ -445,8 +447,8 @@ public class RetrofitClient {
sApiServer.dailyTasksOpenBox(gift_box_id).compose(new DefaultTransformer<>()).subscribe(observer);
}
public void dailyTasksComplete(String task_id,BaseObserver<String> observer){
sApiServer.dailyTasksComplete(task_id).enqueue(new Callback<ResponseBody>() {
public void dailyTasksReceive(String task_id,BaseObserver<String> observer){
sApiServer.dailyTasksReceive(task_id).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
@@ -462,6 +464,30 @@ public class RetrofitClient {
});
}
public void dailyTasksComplete(String task_id,BaseObserver<RoomSingleton> observer) {
sApiServer.dailyTasksComplete(task_id).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
if (response.code() == 200) {
String json = null;
try {
json = response.body().string();
Type type = new TypeToken<BaseModel<RoomSingleton>>() {
}.getType();
BaseModel<RoomSingleton> baseModel = GsonUtils.fromJson(json, type);
observer.onNext(baseModel.getData());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
t.printStackTrace();
}
});
}
public void sendHeadine(String content, String money, String roomId, BaseObserver<String> observer) {
sApiServer.sendHeadine(content, money, roomId).enqueue(new Callback<BaseModel<String>>() {
@Override
@@ -503,7 +529,26 @@ public class RetrofitClient {
}
public void getRevenueData(String page, String page_limit, String in_out_type, String start_time, String end_time, String gift_type, BaseObserver<List<RevenueBean>> observer) {
sApiServer.getRevenueData(page, page_limit, in_out_type, start_time, end_time, gift_type).compose(new DefaultTransformer<>()).subscribe(observer);
sApiServer.getRevenueData(page, page_limit, in_out_type, start_time, end_time, gift_type).enqueue(new Callback<BaseModel<List<RevenueBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<RevenueBean>>> call, Response<BaseModel<List<RevenueBean>>> response) {
if (response.code() == 200) {
BaseModel<List<RevenueBean>> baseModel = response.body();
if (baseModel != null) {
if (baseModel.getData() != null && baseModel.getData().size() > 0) {
observer.onNext(baseModel.getData());
}else {
observer.onNext(new ArrayList<>());
}
}
}
}
@Override
public void onFailure(Call<BaseModel<List<RevenueBean>>> call, Throwable t) {
t.printStackTrace();
}
});
}
public void realNameInfo(BaseObserver<RealNameBean> observer) {
@@ -1563,6 +1608,22 @@ public class RetrofitClient {
});
}
public void cancelUserDecorate(String type, BaseObserver<String> observer) {
sApiServer.cancelUserDecorate(type).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
if (response.code() == 200){
observer.onNext("取消成功");
}
}
@Override
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
t.printStackTrace();
}
});
}
public void publishZone(String images, String content, String topic_id, String room_id, String ip, BaseObserver<String> observer) {
sApiServer.publishZone(images, content, topic_id, room_id, ip).enqueue(new Callback<BaseModel<String>>() {
@@ -1820,6 +1881,24 @@ public class RetrofitClient {
});
}
public void postRoomSwToken(String roomId, BaseObserver<PkSwTokenBean> observer){
sApiServer.postRoomSwToken(roomId).enqueue(new Callback<BaseModel<PkSwTokenBean>>() {
@Override
public void onResponse(Call<BaseModel<PkSwTokenBean>> call, Response<BaseModel<PkSwTokenBean>> response) {
if (response.code() == 200){
BaseModel<PkSwTokenBean> baseModel = response.body();
observer.onNext(baseModel.getData());
}
}
@Override
public void onFailure(Call<BaseModel<PkSwTokenBean>> call, Throwable t) {
t.printStackTrace();
}
});
}
public void removeBlackList(String user_id, BaseObserver<String> observer) {
sApiServer.removeBlackList(user_id).enqueue(new Callback<BaseModel<String>>() {
@Override

View File

@@ -125,12 +125,35 @@ public class MessageListenerSingleton {
public void onReceiveRESTCustomData(String groupID, byte[] customData) {
// 服务器发送的自定义系统通知
// 将 byte[] 转换为 String
String message = new String(customData, StandardCharsets.UTF_8);
RoomMessageEvent event = GsonUtils.fromJson(message, RoomMessageEvent.class);
// String message = new String(customData, StandardCharsets.UTF_8);
// RoomMessageEvent event = GsonUtils.fromJson(message, RoomMessageEvent.class);
// if (groupID.contains(SpUtil.getMyRoomId())) {
// notifyMessageReceived(event);
// }
// LogUtils.e("收到群自定义消息(系统)" + message);
String message = "";
try {
message = new String(customData, StandardCharsets.UTF_8);
} catch (Exception e) {
// 处理转换过程中可能出现的异常,例如记录日志
LogUtils.e("转换 customData 为 String 时出错:" + e.getMessage());
return; // 退出方法,避免后续代码执行
}
RoomMessageEvent event = null;
try {
event = GsonUtils.fromJson(message, RoomMessageEvent.class);
} catch (Exception e) {
// 处理 JSON 解析过程中可能出现的异常,例如记录日志
LogUtils.e("解析 JSON 数据时出错:" + e.getMessage());
return; // 退出方法,避免后续代码执行
}
if (groupID.contains(SpUtil.getMyRoomId())) {
notifyMessageReceived(event);
}
LogUtils.e("收到群自定义消息(系统)" + message);
}
};

View File

@@ -11,15 +11,17 @@ import com.qxcm.moduleutil.bean.WalletBean;
import com.qxcm.moduleutil.bean.room.RoomAuction;
import com.qxcm.moduleutil.http.BaseObserver;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.disposables.Disposable;
public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View> implements RewardGiftContacts.IIndexPre {
RewardGiftContacts.View mView;
public RewardGiftPresenter(RewardGiftContacts.View view, Context context) {
super(view, context);
mView = view;
}
@Override
@@ -97,6 +99,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().giveGift();
}
});

View File

@@ -1123,7 +1123,7 @@ public class AgoraManager {
}
public static void nextSong() {
if (musicList.size() > 0) {
if (musicList != null && musicList.size() > 0) {
stopMuisc();
new Handler(Looper.getMainLooper()).postDelayed(() -> {
EventBus.getDefault().post(musicList.get(0));

View File

@@ -14,6 +14,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.TextView;
@@ -36,7 +37,7 @@ public class EMqttService extends Service {
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent != null && intent.hasExtra("mqttBean")) {
MqttBean mqttBean = (MqttBean) intent.getSerializableExtra("mqttBean");
showPiaoPingMessage(mqttBean);
showPiaoPingMessage(mqttBean);//全局飘屏
}
return START_NOT_STICKY;
}
@@ -55,28 +56,37 @@ public class EMqttService extends Service {
}
public void showPiaoPingMessage(MqttBean mqttBean) {
int screenWidth = getResources().getDisplayMetrics().widthPixels;
int screenHeight = getResources().getDisplayMetrics().heightPixels;
//
// WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(
// WindowManager.LayoutParams.MATCH_PARENT,
// WindowManager.LayoutParams.WRAP_CONTENT,
// Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
// WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY :
// WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
// WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
// WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
// WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
// PixelFormat.TRANSLUCENT);
//
// // 设置 Gravity 为左上角
// layoutParams.gravity = Gravity.TOP | Gravity.START;
//
// // Y 轴随机位置
// layoutParams.y = (int) ((Math.random() * (screenHeight - 200)));
//
// // 初始 X 设为负值,确保 View 在屏幕左侧外
// layoutParams.x = -screenWidth;
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT,
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY :
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
PixelFormat.TRANSLUCENT);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT);
// 设置 Gravity 为左上角
layoutParams.gravity = Gravity.TOP | Gravity.START;
// 设置随机 Y 轴位置
layoutParams.topMargin = (int) (Math.random() * (screenHeight - 200));
// Y 轴随机位置
layoutParams.y = (int) ((Math.random() * (screenHeight - 200)));
// 初始 X 设为负值,确保 View 在屏幕左侧外
layoutParams.x = -screenWidth;
piaoPingView = LayoutInflater.from(this).inflate(R.layout.item_piaoping, null);
TextView textView = piaoPingView.findViewById(R.id.tv_name);

View File

@@ -0,0 +1,92 @@
package com.qxcm.moduleutil.service;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import com.qxcm.moduleutil.bean.RoomSingleton;
import com.qxcm.moduleutil.http.BaseObserver;
import com.qxcm.moduleutil.http.RetrofitClient;
import io.reactivex.disposables.Disposable;
/**
* @Author lxj$
* @Time 2025-8-6 11:42:49$ $
* @Description 每日任务的定时任务单例模式$
*/
public class MyRoomSingleton {
private int count;
private static MyRoomSingleton instance;
private Handler handler;
private String taskId;
private boolean isTimerActive;
private Context context;
private MyRoomSingleton() {
this.context = context;
handler = new Handler(Looper.getMainLooper());
isTimerActive = false;
}
public static MyRoomSingleton getInstance() {
if (instance == null) {
instance = new MyRoomSingleton();
}
return instance;
}
public void startTimerTask(String taskId) {
this.taskId = taskId;
count = 0; // 重置计数
isTimerActive = true;
handler.postDelayed(timerRunnable, 60 * 1000); // 每分钟请求一次接口
}
private Runnable timerRunnable = new Runnable() {
@Override
public void run() {
if (isTimerActive && count < 5) { // 30分钟任务每分钟请求一次共30/60=0.5次这里假设每分钟请求一次共30次
fetchData();
handler.postDelayed(this, 60 * 1000);
} else {
stopTimerTask(); // 达到最大请求次数后停止定时任务
}
}
};
public void stopTimerTask() {
handler.removeCallbacksAndMessages(null); // 销毁定时器
isTimerActive = false;
}
public void onExitRoom() {
stopTimerTask(); // 退出房间时停止定时任务
}
public void onEnterRoom(String taskId) {
this.taskId = taskId;
if (count!=0 ){
startTimerTask(taskId); // 进入房间时启动定时任务延迟为0表示立即执行
}else {
count = 0; // 重置请求计数
startTimerTask(taskId); // 进入房间时启动定时任务延迟为0表示立即执行
}
}
private void fetchData() {
// 这里编写请求接口的代码例如使用Retrofit或Volley等库
// 示例使用Retrofit:
RetrofitClient.getInstance().dailyTasksComplete(taskId, new BaseObserver<RoomSingleton>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(RoomSingleton roomSingleton) {
count++;
// 这里处理请求结果
if (roomSingleton.getIs_completed()==1){
// 任务完成,可以做一些后续操作
stopTimerTask();
}
}
});
}
}

View File

@@ -23,6 +23,7 @@ public class ARouteConstants {
public static final String REAL_NAME_ACTIVITY2 ="/app/RealNameActivity"; //实名认证
public static final String H5 ="/moduleutil/WebViewActivity"; //实名认证
public static final String GIFT_WALL ="/moduleroom/UserGiftWallFragment"; //实名认证
public static final String RECHARGE_ACTIVITY ="/modulevocal/RechargeActivity"; //实名认证

View File

@@ -42,7 +42,7 @@ public class GlideEngine implements ImageEngine {
@Override
public void loadImage(Context context, ImageView imageView, String url, int maxWidth, int maxHeight) {
Glide.with(context).load(url).into(imageView);
}
@Override
@@ -65,7 +65,6 @@ public class GlideEngine implements ImageEngine {
}
});
}
@Override
public void loadGridImage(Context context, String url, ImageView imageView) {
Glide.with(context)
@@ -239,7 +238,7 @@ public class GlideEngine implements ImageEngine {
// .load(url)
// .override(200, 200)
// .centerCrop()
// .apply(new RequestOptions().placeholder(com.luck.picture.lib.R.drawable.picture_image_placeholder))
// .apply(new RequestOptions().placeholder(com.luck.picture.lib.R.drawable.ps_ic_placeholder))
// .into(imageView);
// }
@@ -252,11 +251,70 @@ public class GlideEngine implements ImageEngine {
public void resumeRequests(Context context) {
}
// /**
// * 加载网络图片适配长图方案
// * # 注意:此方法只有加载网络图片才会回调
// *
// * @param context
// * @param url
// * @param imageView
// * @param longImageView
// * @param callback 网络图片加载回调监听 {link after version 2.5.1 Please use the #OnImageCompleteCallback#}
// */
// @Override
// public void loadImage(@NonNull Context context, @NonNull String url,
// @NonNull ImageView imageView,
// SubsamplingScaleImageView longImageView, OnImageCompleteCallback callback) {
// Glide.with(context)
// .asBitmap()
// .load(url)
// .into(new ImageViewTarget<Bitmap>(imageView) {
// @Override
// public void onLoadStarted(@Nullable Drawable placeholder) {
// super.onLoadStarted(placeholder);
// if (callback != null) {
// callback.onShowLoading();
// }
// }
//
// @Override
// public void onLoadFailed(@Nullable Drawable errorDrawable) {
// super.onLoadFailed(errorDrawable);
// if (callback != null) {
// callback.onHideLoading();
// }
// }
//
// @Override
// protected void setResource(@Nullable Bitmap resource) {
// if (callback != null) {
// callback.onHideLoading();
// }
// if (resource != null) {
// boolean eqLongImage = MediaUtils.isLongImg(resource.getWidth(),
// resource.getHeight());
// longImageView.setVisibility(eqLongImage ? View.VISIBLE : View.GONE);
// imageView.setVisibility(eqLongImage ? View.GONE : View.VISIBLE);
// if (eqLongImage) {
// // 加载长图
// longImageView.setQuickScaleEnabled(true);
// longImageView.setZoomEnabled(true);
// longImageView.setPanEnabled(true);
// longImageView.setDoubleTapZoomDuration(100);
// longImageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
// longImageView.setDoubleTapZoomDpi(SubsamplingScaleImageView.ZOOM_FOCUS_CENTER);
// longImageView.setImage(ImageSource.bitmap(resource),
// new ImageViewState(0, new PointF(0, 0), 0));
// } else {
// // 普通图片
// imageView.setImageBitmap(resource);
// }
// }
// }
// });
// }
private GlideEngine() {
}
private static GlideEngine instance;
public static GlideEngine createGlideEngine() {

View File

@@ -158,7 +158,7 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
private void playNextFromQueue() {
PlayItem item = playQueue.poll();
if (item != null) {
isPlaying = true;
isPlaying = false;
RenderType type = null;
String ext = getFileExtension(item.url);
if ("svga".equalsIgnoreCase(ext)) {
@@ -229,17 +229,23 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
}
private void downloadAndPlayMp4(String url) {
String filePath = PathUtils.getInternalAppCachePath() + Md5Utils.getStringMD5(url) + ".mp4";
File file = new File(filePath);
if (file.exists()) {
playMp4(file);
mFile = file;
} else {
DownloadTask task = new DownloadTask.Builder(url, PathUtils.getInternalAppCachePath()
, Md5Utils.getStringMD5(url) + ".mp4")
.setMinIntervalMillisCallbackProcess(100)
.setPassIfAlreadyCompleted(false)
.setAutoCallbackToUIThread(true)
.build();
if (StatusUtil.isCompleted(task)) {
playMp4(task.getFile());
mFile = task.getFile();
} else {
// if (StatusUtil.isCompleted(task)) {
// playMp4(task.getFile());
// mFile = task.getFile();
// } else {
task.enqueue(new DownloadListener1() {
@Override
public void taskStart(@NonNull DownloadTask task, @NonNull Listener1Assist.Listener1Model model) {
@@ -274,6 +280,7 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
}
}
});
// }
}
}

View File

@@ -282,18 +282,18 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
@Override
public void userJoined(int userId, int elapsd) {
if (pitBean!=null && pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0")) {
if (pitBean != null && pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0")) {
if (pitBean.getUser_id().equals(userId + "")) {
// iv_on_line.setVisibility(GONE);
iv_on_line.setVisibility(GONE);
}
}
}
@Override
public void userOffline(int userId, int reason) {
if (pitBean!=null && pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0")) {
if (pitBean != null && pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0")) {
if (pitBean.getUser_id().equals(userId + "")) {
// iv_on_line.setVisibility(VISIBLE);
iv_on_line.setVisibility(VISIBLE);
}
}
}
@@ -346,17 +346,19 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
}
// @Subscribe(threadMode = ThreadMode.MAIN)
@Subscribe( threadMode = ThreadMode.MAIN, sticky =true)
public void subscribeMessages(UserOnlineStatusBean userOnlineStatusBean) {
if (pitBean.getUser_id()!=null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()){
// for (UserOnlineStatusBean userOnlineStatus : userOnlineStatusBean) {
if (pitBean.getUser_id().equals(userOnlineStatusBean.getUser_id())) {
if (userOnlineStatusBean.getIs_online() == 1) {
// iv_on_line.setVisibility(GONE);
public void setOnlineStatus(UserOnlineStatusBean isOnline) {
// iv_on_line.setVisibility(isOnline ? GONE : VISIBLE);
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
//// for (UserOnlineStatusBean userOnlineStatus : userOnlineStatusBean) {
if (pitBean.getUser_id().equals(isOnline.getUser_id())) {
if (isOnline.getIs_online() == 1) {
iv_on_line.setVisibility(GONE);
} else {
// iv_on_line.setVisibility(VISIBLE);
iv_on_line.setVisibility(VISIBLE);
}
// }
//// }
}
}
}

View File

@@ -364,7 +364,11 @@ public class Constants {
public static final String POST_DELETE_RELATION_CARD = "/api/Room/delete_relation_card";//删除关系
public static final String GET_FIRST_CHARGE = "/api/Activities/first_charge_gift_permission";//首充好礼弹框权限
public static final String GET_FIRST_CHARGE_GIFT = "/api/Activities/first_charge_gift";//首充好礼列表接口
public static final String dailyTasksComplete = "/api/Dailytasks/dailyTasksReceive";//领取每日任务奖励
public static final String dailyTasksReceive = "/api/Dailytasks/dailyTasksReceive";//领取每日任务奖励
public static final String postRoomSwToken = "/api/Room/update_user_sw_token";//获取用户声网token
public static final String dailyTasksComplete = "/api/Dailytasks/dailyTasksComplete";//领取每日任务奖励
public static final String POST_CANCEL_USER_DECORATE = "/api/Decorate/cancel_user_decorate";//取消装扮

View File

@@ -209,4 +209,16 @@ public class RoomMakeWheatView extends BaseWheatView {
public void userOffline(int userId, int reason) {
}
public void setOnlineStatus(UserOnlineStatusBean isOnline) {
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
if (pitBean.getUser_id().equals(isOnline.getUser_id())) {
if (isOnline.getIs_online() == 1) {
iv_on_line.setVisibility(GONE);
} else {
iv_on_line.setVisibility(VISIBLE);
}
}
}
}
}

View File

@@ -1,11 +1,13 @@
package com.qxcm.moduleutil.widget;
import android.content.Context;
import android.graphics.Rect;
import android.os.CountDownTimer;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
@@ -25,7 +27,8 @@ import io.reactivex.disposables.Disposable;
public class RoomMessageInputMenu extends ConstraintLayout {
EditText etContent;
Button tvSend;
private View rootView;
private int screenHeight;
public RoomMessageInputMenu(Context context) {
this(context, null);
}
@@ -42,8 +45,14 @@ public class RoomMessageInputMenu extends ConstraintLayout {
}
});
setVisibility(GONE);
}
}
private void moveInputMenuAboveKeyboard(int keypadHeight) {
// 调整输入框的位置
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) this.getLayoutParams();
params.bottomMargin = keypadHeight;
this.setLayoutParams(params);
}
public void setText(String text) {
etContent.setText(text);
}
@@ -66,7 +75,7 @@ public class RoomMessageInputMenu extends ConstraintLayout {
//
// @Override
// public void onNext(String s) {
EventBus.getDefault().post(new RoomInputEvent(text));
// EventBus.getDefault().post(new RoomInputEvent(text));
// }
//
// @Override
@@ -74,13 +83,15 @@ public class RoomMessageInputMenu extends ConstraintLayout {
//
// }
// });
sendInput(text);
dismiss();
etContent.setText("");
countDownTimer();
dismiss();
}
}
private void sendInput(String text) {
EventBus.getDefault().post(new RoomInputEvent(text));
}
/**
* 下面的内容为发送消息逻辑
*/
@@ -120,12 +131,12 @@ public class RoomMessageInputMenu extends ConstraintLayout {
setVisibility(VISIBLE);
etContent.requestFocus();
KeyboardUtils.showSoftInput(etContent);
// EventBus.getDefault().post(new RoomInputHideEvent(false));
EventBus.getDefault().post(new RoomInputHideEvent(false));
}
public void dismiss() {
setVisibility(GONE);
KeyboardUtils.hideSoftInput(etContent);
// EventBus.getDefault().post(new RoomInputHideEvent(true));
EventBus.getDefault().post(new RoomInputHideEvent(true));
}
}

View File

@@ -0,0 +1,247 @@
package com.qxcm.moduleutil.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.qxcm.moduleutil.R;
import com.qxcm.moduleutil.bean.UserInfo;
import com.qxcm.moduleutil.bean.room.RoomPitBean;
import com.qxcm.moduleutil.utils.ImageUtils;
import com.qxcm.moduleutil.utils.SpUtil;
/**
* @Author lxj$
* @Time 2025-8-6 17:27:29$ $
* @Description 二卡八视图控件$
*/
public class RoomSingSongWheatView extends BaseWheatView {
public ImageView mIvTagBoss;
public TextView mTvTime;
public TextView tv_time_pk;
private boolean showBoss;//显示老板标识
public RoomSingSongWheatView(Context context) {
this(context, null, 0);
}
public RoomSingSongWheatView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RoomSingSongWheatView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void initPit(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoomDefaultWheatView);
pitNumber = typedArray.getString(R.styleable.RoomDefaultWheatView_room_wheat_number);
typedArray.recycle();
mIvTagBoss = findViewById(R.id.iv_tag_boos);
mTvTime = findViewById(R.id.tv_time);
tv_time_pk = findViewById(R.id.tv_time_pk);
}
@Override
protected int getLayoutId() {
return R.layout.room_view_sing_wheat;
}
@Override
protected void setPitData(RoomPitBean bean) {
sex = bean.getSex();
if (isOn()) {
//开启声浪
mIvRipple.stopAnimation();
mIvRipple.setVisibility(VISIBLE);
mTvName.setText(bean.getNickname());
ImageUtils.loadHeadCC(bean.getAvatar(), mRiv);
if (TextUtils.isEmpty(pitBean.getDress())) {
mIvFrame.setVisibility(INVISIBLE);
} else {
mIvFrame.setVisibility(VISIBLE);
mIvFrame.setSource(pitBean.getDress(), 1);
// ImageUtils.loadDecorationAvatar(pitBean.getDress_picture(), mIvFrame);
}
if (showBoss && WHEAT_BOSS.equals(pitNumber)) {
mIvTagBoss.setVisibility(GONE);
}
} else {
mTvName.setText(
"-1".equals(pitNumber) ? "" :
"9".equals(pitNumber) ? "主持位" :
"10".equals(pitNumber) ? "嘉宾位" :
pitNumber + "号麦位"
);
//麦位上锁
if (showBoss && WHEAT_BOSS.equals(pitNumber)) {
mIvTagBoss.setVisibility(VISIBLE);
ImageUtils.loadRes(isLocked() ? R.mipmap.room_ic_wheat_default_suo : R.mipmap.room_ic_wheat_default, mRiv);
} else {
// mIvTagBoss.setVisibility(GONE);
// @DrawableRes int origin = getOriginImage();
// ImageUtils.loadRes(isLocked() ? R.mipmap.room_ic_wheat_default_suo :
// (origin == 0 ? R.mipmap.room_ic_wheat_default : origin), mRiv);
mRiv.setImageResource(bean.getIs_lock() == 1 ? R.mipmap.room_ic_wheat_default_suo : R.mipmap.room_ic_wheat_default);
// ImageUtils.loadRes(isLocked() ? R.mipmap.room_ic_wheat_default_suo : R.mipmap.room_ic_wheat_default, mRiv);
}
if (isMute()) {
ImageUtils.loadRes(R.mipmap.room_microphone_off, mIvSex);
}
mIvFrame.setVisibility(INVISIBLE);
mIvFace.remove();
//停止声浪
mIvRipple.stopAnimation();
mIvRipple.setVisibility(GONE);
}
if (showSexIcon) {
checkSex();
}
if (pitBean.getNickname() == null || pitBean.getNickname().isEmpty()) {
mCharmView.setVisibility(GONE);
} else {
mCharmView.setVisibility(VISIBLE);
}
if (pitBean.is_pk() ){
if (pitBean.getUser_id()!=null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
tv_time_pk.setVisibility(VISIBLE);
setSex(pitBean.getCharm(),false);
mCharmView.setVisibility(GONE);
}else {
tv_time_pk.setVisibility(GONE);
}
// ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mCharmView.getLayoutParams();
// params.width = 35;
// mCharmView.setLayoutParams(params);
}else {
tv_time_pk.setVisibility(GONE);
mCharmView.setVisibility(VISIBLE);
// ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mCharmView.getLayoutParams();
// params.width = 52;
// mCharmView.setLayoutParams(params);
}
// setCardiac(pitBean.getPit_number(), 0.0f);
}
public void setSex( String value, boolean format) {
if (format) {
tv_time_pk.setText(value);
} else {
try {
long xd = Long.parseLong(value);
if (xd > 9999 || xd < -9999) {
tv_time_pk.setText(String.format("%.2fw", xd / 10000.0f));
// mBinding.tvValue.setText(String.valueOf(xd));
} else {
tv_time_pk.setText(value);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
private boolean showSexIcon = false;
private String sex;
public boolean isMale() {
return "1".equals(sex);
}
public boolean isFemale() {
return "2".equals(sex);
}
public void setShowSexIcon(boolean show) {
showSexIcon = show;
}
public void checkSex() {
if (isOn()) {
mIvSex.setVisibility(VISIBLE);
if (!TextUtils.isEmpty(sex)) {
if (UserInfo.MALE.equals(sex)) {
mIvSex.setBackgroundResource(R.drawable.room_xq_wheat_male_mask);
if (mTvNo != null) mTvNo.setBackgroundResource(R.mipmap.ic_room_xq_wno_male);
} else {
mIvSex.setBackgroundResource(R.drawable.room_xq_wheat_female_mask);
if (mTvNo != null) mTvNo.setBackgroundResource(R.mipmap.ic_room_xq_wno_female);
}
} else {
mIvSex.setVisibility(GONE);
if (mTvNo != null) mTvNo.setBackgroundResource(getOriginNoImage());
}
} else {
mIvSex.setVisibility(GONE);
if (mTvNo != null) mTvNo.setBackgroundResource(getOriginNoImage());
}
}
/**
* 是否显示老板标识
*/
public void setIsBossShow(String is_boss_pit) {
showBoss = "1".equals(is_boss_pit);
}
/**
* 开启计时
*/
public void setTime(int time) {
if (time == 0) {
mTvTime.setText("");
mTvTime.setVisibility(INVISIBLE);
} else {
mTvTime.setText(String.format("%s'%s", time / 60, time % 60));
mTvTime.setVisibility(VISIBLE);
}
}
public void hideMaoziIcon() {
View maozi = findViewById(R.id.iv_maozi);
if (maozi != null) maozi.setVisibility(GONE);
}
@Override
public void onRemoteSoundLevelUpdate(String userId, int soundLevel) {
}
@Override
public void onLocalSoundLevelUpdate(int volume) {
if (volume==0){
mIvRipple.stopAnimation();
} else {
if (pitBean.getUser_id().equals(SpUtil.getUserId()) && closePhone) {
mIvRipple.stopAnimation();
}else {
mIvRipple.post(() -> {
if (!mIvRipple.isAnimating()) {
mIvRipple.startAnimation();
}
mIvRipple.setVisibility(VISIBLE);
});
}
}
}
@Override
public void userJoined(int userId, int elapsd) {
}
@Override
public void userOffline(int userId, int reason) {
}
}

View File

@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.flexbox.FlexboxLayout;
import com.qxcm.moduleutil.R;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.RoomPitBean;
import java.util.List;
@@ -424,5 +425,13 @@ public class WheatLayoutManager {
// updateSingleWheat(pitNumber);
}
}
public void updateSingleOnlineWheat(UserOnlineStatusBean bean) {
if (pitList == null || pitList.isEmpty()) return;
for (RoomPitBean pitBean : pitList) {
int pitNumber = Integer.parseInt(pitBean.getPit_number());
RoomDefaultWheatView wheatView = findWheatViewByPitNumber(pitNumber);
wheatView.setOnlineStatus(bean); // 刷新数据
}
}
}

View File

@@ -0,0 +1,439 @@
package com.qxcm.moduleutil.widget;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.qxcm.moduleutil.R;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.RoomPitBean;
import java.util.List;
/**
* @Author lxj$
* @Time 2025-8-6 17:29:04$ $
* @Description 二卡八显示布局$
*/
public class WheatLayoutSingManager {
private final Context context;
private final ViewGroup container;
private List<RoomPitBean> pitList;
private boolean isSingleMode = false;
private int currentSinglePit = -1;
private RoomSingSongWheatView singleWheatView;
private final int[] pitIndexMap = {9, 10, 1, 2, 3, 4, 5, 6, 7, 8};
public interface OnWheatClickListener {
void onWheatClick(RoomSingSongWheatView view, int pitNumber);
void onMakeWheatClick(RoomSingSongWheatView view, int pitNumber);
}
private @Nullable OnWheatClickListener wheatClickListener;
public WheatLayoutSingManager(Context context, ViewGroup container) {
this.context = context;
this.container = container;
}
public void setWheatData(List<RoomPitBean> pitList) {
this.pitList = pitList;
restoreMultiWheat();
}
public void setWheatDataPk(List<RoomPitBean> pitList, int layoutType) {
this.pitList = pitList;
restoreMultiWheatPk(layoutType);
}
public void setOnWheatClickListener(@Nullable OnWheatClickListener listener) {
this.wheatClickListener = listener;
}
public void showSingleWheat(int pitNumber) {
if (isSingleMode && this.currentSinglePit == pitNumber) return;
container.removeAllViews();
if (pitNumber < 1 || pitNumber > 10 || pitList == null || pitList.size() < 10)
return;
RoomPitBean bean = pitList.get(pitNumber - 1);
singleWheatView = new RoomSingSongWheatView(context);
singleWheatView.pitNumber = String.valueOf(pitNumber);
singleWheatView.setData(bean);
// 默认设置为 MATCH_PARENT也可以自定义
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
);
params.setMargins(20, 20, 20, 20);
singleWheatView.setLayoutParams(params);
// 添加点击事件
singleWheatView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onWheatClick(singleWheatView, pitNumber);
}
restoreMultiWheat();
});
container.addView(singleWheatView);
isSingleMode = true;
currentSinglePit = pitNumber;
}
public void restoreMultiWheat() {
container.removeAllViews();
int screenWidth = getScreenWidth();
int itemWidth = screenWidth / 4; // 每个控件宽度为屏幕宽度的 1/4
LinearLayout row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
for (int i = 0; i < 10; i++) {
int pitNumber = pitIndexMap[i];
RoomSingSongWheatView wheatView = new RoomSingSongWheatView(context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
LinearLayout.LayoutParams params;
if (i == 0) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第一个控件:左边距 86dp右边距 100dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
params.rightMargin = dpToPx(50);
} else if (i == 1) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第二个控件:右边距 86dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
} else {
int fixedHeightInDp = 90; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
params = new LinearLayout.LayoutParams(itemWidth - 30, fixedHeightInPx + 30);
// 其他控件保持原有逻辑
// if (i > 1 && (i - 2) % 4 != 0) {
// params.leftMargin = 12;
// params.rightMargin = 12;
// }
params.setMargins(0, 0, 0, 0); // 不设右边距,由 row padding 控制
}
wheatView.setLayoutParams(params);
wheatView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onWheatClick(wheatView, Integer.parseInt(wheatView.pitNumber));
}
// showSingleWheat(Integer.parseInt(wheatView.pitNumber));
});
row.addView(wheatView);
// 第一行添加两个后换行
if (i == 1) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
} else if (i > 1 && (i - 2) % 4 == 3) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
}
}
// 添加最后一行可能存在的剩余 view
if (row.getChildCount() > 0) {
container.addView(row);
}
isSingleMode = false;
currentSinglePit = -1;
}
// public void restoreMultiWheatPk(int layoutType, int width) {
// container.removeAllViews();
//
// int screenWidth = getScreenWidth();
// int itemWidth = screenWidth / 8; // 每个控件宽度为屏幕宽度的 1/4
//
// LinearLayout row = new LinearLayout(context);
// row.setOrientation(LinearLayout.HORIZONTAL);
//
// for (int i = 0; i < 10; i++) {
// int pitNumber = pitIndexMap[i];
// RoomDefaultWheatView wheatView = new RoomDefaultWheatView(context);
// wheatView.pitNumber = String.valueOf(pitNumber);
// wheatView.setData(pitList.get(pitNumber - 1));
//
// LinearLayout.LayoutParams params;
//
// if (i == 0) {
// int fixedHeightInDp = 110; // 固定高度为 100dp
// int fixedHeightInPx =context.getResources().getDimensionPixelSize(R.dimen.dp_80); // 调用已有的 dpToPx 方法
// // 第一个控件:左边距 86dp右边距 100dp
// params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
// params.rightMargin = context.getResources().getDimensionPixelSize(R.dimen.dp_50);
// } else if (i == 1) {
// int fixedHeightInDp = 110; // 固定高度为 100dp
// int fixedHeightInPx = context.getResources().getDimensionPixelSize(R.dimen.dp_80); // 调用已有的 dpToPx 方法
// // 第二个控件:右边距 86dp
// params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
// } else {
// int fixedHeightInDp = 90; // 固定高度为 100dp
// int fixedHeightInPx = context.getResources().getDimensionPixelSize(R.dimen.dp_60); // 调用已有的 dpToPx 方法
// params = new LinearLayout.LayoutParams(itemWidth -10, fixedHeightInPx + 30);
// // 其他控件保持原有逻辑
//
//
//// if (i > 1 && (i - 2) % 4 != 0) {
//// params.leftMargin = 12;
//// params.rightMargin = 12;
//// }
// params.setMargins(0, 0, 0, 0); // 不设右边距,由 row padding 控制
// }
//
// wheatView.setLayoutParams(params);
// wheatView.setOnClickListener(v -> {
// if (wheatClickListener != null) {
// wheatClickListener.onWheatClick(wheatView, Integer.parseInt(wheatView.pitNumber));
// }
//// showSingleWheat(Integer.parseInt(wheatView.pitNumber));
// });
//
// row.addView(wheatView);
//
// // 第一行添加两个后换行
// if (i == 1) {
// container.addView(row);
// row = new LinearLayout(context);
// row.setOrientation(LinearLayout.HORIZONTAL);
// } else if (i > 1 && (i - 2) % 4 == 3) {
// container.addView(row);
// row = new LinearLayout(context);
// row.setOrientation(LinearLayout.HORIZONTAL);
// }
// }
//
//// 添加最后一行可能存在的剩余 view
// if (row.getChildCount() > 0) {
// container.addView(row);
// }
// isSingleMode = false;
// currentSinglePit = -1;
// }
public void restoreMultiWheatPk(int layoutType) {
if (layoutType == 1) {
container.removeAllViews();
}
int screenWidth = getScreenWidth();
int itemWidth = screenWidth / 8;
LinearLayout row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
// 根据 layoutType 调整前两个控件的顺序
int firstPitNumber, secondPitNumber;
if (layoutType == 1) {
firstPitNumber = 10; // 第一个显示 10
secondPitNumber = 9; // 第二个显示 9
} else if (layoutType == 2) {
firstPitNumber = 9; // 第一个显示 9
secondPitNumber = 10; // 第二个显示 10
} else {
firstPitNumber = 9;
secondPitNumber = 10;
}
// 添加第一个控件10 或 9
addWheatViewItem(row, firstPitNumber, itemWidth * 2, layoutType);
// 添加第二个控件9 或 10
addWheatViewItem(row, secondPitNumber, itemWidth * 2, layoutType);
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
// 添加其余 8 个控件1~8
for (int i = 2; i < 10; i++) {
int pitNumber = pitIndexMap[i];
addWheatViewItem(row, pitNumber, itemWidth, layoutType);
if (i > 1 && (i - 2) % 4 == 3) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
}
}
if (row.getChildCount() > 0) {
container.addView(row);
}
isSingleMode = false;
currentSinglePit = -1;
}
// 抽取公共方法:添加单个控件
private void addWheatViewItem(LinearLayout row, int pitNumber, int itemWidth, int layoutType) {
RoomSingSongWheatView wheatView = new RoomSingSongWheatView(context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
LinearLayout.LayoutParams params;
if (pitNumber == 9 || pitNumber == 10) {
int fixedHeightInPx = context.getResources().getDimensionPixelSize(R.dimen.dp_90);
if (pitNumber == 9) {
params = new LinearLayout.LayoutParams(itemWidth - 40, fixedHeightInPx);
if (layoutType == 1) {
// 9号在右边右边距10dp
params.rightMargin = context.getResources().getDimensionPixelSize(R.dimen.dp_1);
params.setMargins(20, -30, -20, 0);
} else if (layoutType == 2) {
// 9号在左边左边距10dp
params.leftMargin = context.getResources().getDimensionPixelSize(R.dimen.dp_1);
params.setMargins(-30, -20, 0, 0);
}
} else {
params = new LinearLayout.LayoutParams(itemWidth - 80, fixedHeightInPx);
if (layoutType == 1) {
// 10号在左边左边距15dp
// params.leftMargin = context.getResources().getDimensionPixelSize(R.dimen.dp_5);
params.setMargins(-30, 10, 0, 0);
} else if (layoutType == 2) {
// 10号在右边右边距15dp
// params.rightMargin = context.getResources().getDimensionPixelSize(R.dimen.dp_5);
params.setMargins(0, 10, -30, 0);
}
}
} else {
int fixedHeightInPx = context.getResources().getDimensionPixelSize(R.dimen.dp_60);
params = new LinearLayout.LayoutParams(itemWidth + 15, fixedHeightInPx + 20);
params.setMargins(-20, -20, -20, 0);
}
wheatView.setLayoutParams(params);
wheatView.setOnClickListener(v -> {
if (wheatClickListener != null) {
if (layoutType == 1) {
wheatClickListener.onWheatClick(wheatView, Integer.parseInt(wheatView.pitNumber));
} else {
wheatClickListener.onMakeWheatClick(wheatView, Integer.parseInt(wheatView.pitNumber));
}
}
});
row.addView(wheatView);
}
private RoomSingSongWheatView createWheatView(int pitNumber) {
RoomSingSongWheatView wheatView = new RoomSingSongWheatView(context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
return wheatView;
}
private RoomMakeWheatView createRoomMakeWheatView(int pitNumber) {
RoomMakeWheatView wheatView = new RoomMakeWheatView(context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
return wheatView;
}
private int dpToPx(int dp) {
return Math.round(dp * context.getResources().getDisplayMetrics().density);
}
private int getScreenWidth() {
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
return metrics.widthPixels;
}
/**
* 更新指定 pitNumber 的麦位信息(用于局部刷新)
*/
public void updateSingleWheat(RoomPitBean pitBean, int pitNumber) {
if (pitList == null || pitList.isEmpty() || pitNumber < 1 || pitNumber > 10) return;
// 如果是单个展示模式且不是当前麦位,不处理
if (isSingleMode && this.currentSinglePit != pitNumber) return;
RoomSingSongWheatView wheatView = findWheatViewByPitNumber(pitNumber);
if (wheatView != null) {
// RoomPitBean bean = pitList.get(pitNumber - 1);
RoomPitBean bean = pitBean;
wheatView.setData(bean); // 刷新数据
}
}
@Nullable
private RoomSingSongWheatView findWheatViewByPitNumber(int pitNumber) {
for (int i = 0; i < container.getChildCount(); i++) {
View row = container.getChildAt(i);
if (row instanceof LinearLayout) {
LinearLayout linearRow = (LinearLayout) row;
for (int j = 0; j < linearRow.getChildCount(); j++) {
View child = linearRow.getChildAt(j);
if (child instanceof RoomSingSongWheatView) {
RoomSingSongWheatView view = (RoomSingSongWheatView) child;
if (Integer.parseInt(view.pitNumber) == pitNumber) {
return view;
}
}
}
} else if (row instanceof RoomSingSongWheatView) {
RoomSingSongWheatView view = (RoomSingSongWheatView) row;
if (Integer.parseInt(view.pitNumber) == pitNumber) {
return view;
}
}
}
return null;
}
/**
* 批量刷新多个麦位状态
*/
public void refreshWheatData(List<RoomPitBean> newPitList, List<Integer> changedPits) {
this.pitList = newPitList;
for (int pitNumber : changedPits) {
// updateSingleWheat(pitNumber);
}
}
public void updateSingleOnlineWheat(UserOnlineStatusBean bean) {
if (pitList == null || pitList.isEmpty()) return;
for (RoomPitBean pitBean : pitList) {
int pitNumber = Integer.parseInt(pitBean.getPit_number());
RoomSingSongWheatView wheatView = findWheatViewByPitNumber(pitNumber);
wheatView.setOnlineStatus(bean); // 刷新数据
}
}
}

View File

@@ -0,0 +1,180 @@
package com.qxcm.moduleutil.widget.picker;
import static com.qxcm.moduleutil.utils.UtilConfig.getContext;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.luck.picture.lib.basic.FragmentInjectManager;
import com.luck.picture.lib.engine.CropFileEngine;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.interfaces.OnPreviewInterceptListener;
import com.luck.picture.lib.style.BottomNavBarStyle;
import com.luck.picture.lib.style.PictureSelectorStyle;
import com.luck.picture.lib.style.SelectMainStyle;
import com.luck.picture.lib.style.TitleBarStyle;
import com.luck.picture.lib.utils.DensityUtil;
import com.luck.picture.lib.utils.StyleUtils;
import com.qxcm.moduleutil.R;
import com.yalantis.ucrop.UCrop;
import com.yalantis.ucrop.UCropImageEngine;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
/**
* @Author lxj$
* @Time 2025-8-5 21:50:02$ $
* @Description 图片选择器$
*/
public class PictureSelectorUtil {
public CropFileEngine ImageFileCropEngine;
private PictureSelectorStyle selectorStyle;
public PictureSelectorStyle syltPictureSelector() {
selectorStyle = new PictureSelectorStyle();
// 主体风格
SelectMainStyle numberSelectMainStyle = new SelectMainStyle();
numberSelectMainStyle.setSelectNumberStyle(true);
numberSelectMainStyle.setPreviewSelectNumberStyle(false);
numberSelectMainStyle.setPreviewDisplaySelectGallery(true);
numberSelectMainStyle.setSelectBackground(com.luck.picture.lib.R.drawable.ps_default_num_selector);
numberSelectMainStyle.setPreviewSelectBackground(com.luck.picture.lib.R.drawable.ps_preview_checkbox_selector);
numberSelectMainStyle.setSelectNormalBackgroundResources(com.luck.picture.lib.R.drawable.ps_select_complete_normal_bg);
numberSelectMainStyle.setSelectNormalTextColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_53575e));
numberSelectMainStyle.setSelectNormalText(com.luck.picture.lib.R.string.ps_send);
numberSelectMainStyle.setAdapterPreviewGalleryBackgroundResource(com.luck.picture.lib.R.drawable.ps_preview_gallery_bg);
numberSelectMainStyle.setAdapterPreviewGalleryItemSize(DensityUtil.dip2px(getContext(), 52));
numberSelectMainStyle.setPreviewSelectText(com.luck.picture.lib.R.string.ps_select);
numberSelectMainStyle.setPreviewSelectTextSize(14);
numberSelectMainStyle.setPreviewSelectTextColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_white));
numberSelectMainStyle.setPreviewSelectMarginRight(DensityUtil.dip2px(getContext(), 6));
numberSelectMainStyle.setSelectBackgroundResources(com.luck.picture.lib.R.drawable.ps_select_complete_bg);
numberSelectMainStyle.setSelectText(com.luck.picture.lib.R.string.ps_send_num);
numberSelectMainStyle.setSelectTextColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_white));
numberSelectMainStyle.setMainListBackgroundColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_black));
numberSelectMainStyle.setCompleteSelectRelativeTop(true);
numberSelectMainStyle.setPreviewSelectRelativeBottom(true);
numberSelectMainStyle.setAdapterItemIncludeEdge(false);
// 头部TitleBar 风格
TitleBarStyle numberTitleBarStyle = new TitleBarStyle();
numberTitleBarStyle.setHideCancelButton(true);
numberTitleBarStyle.setAlbumTitleRelativeLeft(true);
numberTitleBarStyle.setTitleAlbumBackgroundResource(com.luck.picture.lib.R.drawable.ps_album_bg);
numberTitleBarStyle.setTitleDrawableRightResource(com.luck.picture.lib.R.drawable.ps_ic_grey_arrow);
numberTitleBarStyle.setPreviewTitleLeftBackResource(com.luck.picture.lib.R.drawable.ps_ic_normal_back);
// 底部NavBar 风格
BottomNavBarStyle numberBottomNavBarStyle = new BottomNavBarStyle();
numberBottomNavBarStyle.setBottomPreviewNarBarBackgroundColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_half_grey));
numberBottomNavBarStyle.setBottomPreviewNormalText(com.luck.picture.lib.R.string.ps_preview);
numberBottomNavBarStyle.setBottomPreviewNormalTextColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_9b));
numberBottomNavBarStyle.setBottomPreviewNormalTextSize(16);
numberBottomNavBarStyle.setCompleteCountTips(false);
numberBottomNavBarStyle.setBottomPreviewSelectText(com.luck.picture.lib.R.string.ps_preview_num);
numberBottomNavBarStyle.setBottomPreviewSelectTextColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_white));
selectorStyle.setTitleBarStyle(numberTitleBarStyle);
selectorStyle.setBottomBarStyle(numberBottomNavBarStyle);
selectorStyle.setSelectMainStyle(numberSelectMainStyle);
return selectorStyle;
}
public class ImageFileCropEngine implements CropFileEngine {
@Override
public void onStartCrop(Fragment fragment, Uri srcUri, Uri destinationUri, ArrayList<String> dataSource, int requestCode) {
UCrop.Options options = buildOptions();
UCrop uCrop = UCrop.of(srcUri, destinationUri, dataSource);
uCrop.withOptions(options);
uCrop.setImageEngine(new UCropImageEngine() {
@Override
public void loadImage(Context context, String url, ImageView imageView) {
// if (!ImageLoaderUtils.assertValidRequest(context)) {
// return;
// }
Glide.with(context).load(url).override(180, 180).into(imageView);
}
@Override
public void loadImage(Context context, Uri url, int maxWidth, int maxHeight, OnCallbackListener<Bitmap> call) {
Glide.with(context).asBitmap().load(url).override(maxWidth, maxHeight).into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
if (call != null) {
call.onCall(resource);
}
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
if (call != null) {
call.onCall(null);
}
}
});
}
});
uCrop.start(fragment.requireActivity(), fragment, requestCode);
}
}
/**
* 配制UCrop可根据需求自我扩展
*
* @return
*/
public UCrop.Options buildOptions() {
UCrop.Options options = new UCrop.Options();
options.setHideBottomControls(true);//是否显示裁剪
options.setFreeStyleCropEnabled(true);//裁剪是否可以拖动
options.setShowCropFrame(true);//是否显示裁剪边缘
options.setShowCropGrid(true);//是否显示裁剪网格
options.setCircleDimmedLayer(false);//圆形头像裁剪
options.withAspectRatio(1, 1);
options.isCropDragSmoothToCenter(false);
options.isForbidCropGifWebp(false);
options.isForbidSkipMultipleCrop(true);
options.setMaxScaleMultiplier(100);
if (selectorStyle != null && selectorStyle.getSelectMainStyle().getStatusBarColor() != 0) {
SelectMainStyle mainStyle = selectorStyle.getSelectMainStyle();
boolean isDarkStatusBarBlack = mainStyle.isDarkStatusBarBlack();
int statusBarColor = mainStyle.getStatusBarColor();
options.isDarkStatusBarBlack(isDarkStatusBarBlack);
if (StyleUtils.checkStyleValidity(statusBarColor)) {
options.setStatusBarColor(statusBarColor);
options.setToolbarColor(statusBarColor);
} else {
options.setStatusBarColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_grey));
options.setToolbarColor(ContextCompat.getColor(getContext(),com.luck.picture.lib.R.color.ps_color_grey));
}
TitleBarStyle titleBarStyle = selectorStyle.getTitleBarStyle();
if (StyleUtils.checkStyleValidity(titleBarStyle.getTitleTextColor())) {
options.setToolbarWidgetColor(titleBarStyle.getTitleTextColor());
} else {
options.setToolbarWidgetColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_white));
}
} else {
options.setStatusBarColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_grey));
options.setToolbarColor(ContextCompat.getColor(getContext(), com.luck.picture.lib.R.color.ps_color_grey));
options.setToolbarWidgetColor(ContextCompat.getColor(getContext(),com.luck.picture.lib. R.color.ps_color_white));
}
return options;
}
}

View File

@@ -10,12 +10,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
android:background="@android:color/transparent">
<com.qxcm.moduleutil.widget.CustomTopBar
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-30dp"
app:layout_constraintTop_toTopOf="parent" />
<WebView
@@ -23,6 +25,8 @@
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@color/transparent"
android:hardwareAccelerated="true"
app:layout_constraintTop_toBottomOf="@+id/top_bar" />

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?><!-- dialog_custom_input.xml -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white">
<com.qxcm.moduleutil.widget.RoomMessageInputMenu
android:id="@+id/input_menu2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!-- 其他视图组件 -->
<View
android:id="@+id/view_input"
android:layout_width="0dp"
android:layout_height="34dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="84dp"
android:layout_marginBottom="8dp"
android:background="@drawable/room_bg_detail_comment"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<EditText
android:id="@+id/et_content"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@null"
android:hint="说点什么吧(50字以内)"
android:maxLength="50"
android:paddingLeft="8dp"
android:paddingTop="8dp"
android:paddingRight="8dp"
android:paddingBottom="8dp"
android:textColor="@color/color_text"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/view_input"
app:layout_constraintStart_toStartOf="@id/view_input" />
<Button
android:id="@+id/tv_send"
android:layout_width="60dp"
android:layout_height="34dp"
android:layout_marginRight="12dp"
android:background="@drawable/room_input_btn_bg"
android:text="发送"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cl_gift"
android:layout_width="50dp"
android:layout_height="70dp"
android:layout_height="80dp"
android:layout_marginStart="5dp"
android:background="@drawable/bg_r5_e9e9"
>

View File

@@ -125,12 +125,13 @@
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.8"
app:layout_constraintHeight_percent="0.98"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.7" />
app:layout_constraintWidth_percent="0.98" />
<View
android:id="@+id/view_riv_bottom"
@@ -216,8 +217,8 @@
android:background="@mipmap/room_ic_owner_offline"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_percent="0.5"
app:layout_constraintHeight_percent="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -92,8 +92,8 @@
<ImageView
android:id="@+id/iv_online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/room_ic_owner_offline"
android:visibility="gone"
tools:visibility="visible"

View File

@@ -0,0 +1,519 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false">
<!--说话动态图-->
<com.qxcm.moduleutil.widget.GifAvatarOvalView
android:id="@+id/riv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_12"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@mipmap/room_ic_wheat_default"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/iv_ripple"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_8"
app:autoPlay="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_percent="0.99"
app:layout_constraintWidth_percent="0.99"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:loopCount="0"
app:source="ripple3695.svga" />
<ImageView
android:id="@+id/iv_sex"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@mipmap/common_ic_headportriat_base"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toTopOf="@id/riv"
tools:visibility="visible" />
<View
android:id="@+id/view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toTopOf="@id/riv" />
<ImageView
android:id="@+id/iv_tag_boos"
android:layout_width="32dp"
android:layout_height="14dp"
android:src="@mipmap/room_ic_wheat_tag_boss"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/view2"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_tag_type"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/zc"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv" />
<!-- <TextView-->
<!-- android:id="@+id/tv_time"-->
<!-- android:layout_width="@dimen/dp_35"-->
<!-- android:layout_height="17.5dp"-->
<!-- android:background="@drawable/room_bg_wheat_time"-->
<!-- android:gravity="center"-->
<!-- android:text="00:00"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_9"-->
<!-- android:visibility="gone"-->
<!-- android:layout_marginBottom="@dimen/dp_6"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<TextView
android:id="@+id/tv_time"
android:layout_width="@dimen/dp_35"
android:layout_height="17.5dp"
android:background="@mipmap/za_s"
android:gravity="center"
android:text="00:00"
android:textColor="@color/white"
android:textSize="@dimen/sp_9"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
tools:visibility="visible" />
<com.qxcm.moduleutil.widget.AvatarFrameView
android:id="@+id/iv_frame"
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.98"
android:layout_marginTop="@dimen/dp_5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.98" />
<View
android:id="@+id/view_riv_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/cl_guide1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.2" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:singleLine="true"
android:layout_marginTop="@dimen/dp_3"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/riv"
tools:text="麦位1"
tools:textColor="@color/color_FF333333" />
<com.qxcm.moduleutil.widget.WheatCharmView
android:id="@+id/charm_view"
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_5"
android:clipChildren="false"
android:clipToPadding="false"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toBottomOf="@id/tv_name" />
<TextView
android:id="@+id/tv_time_pk"
android:layout_width="@dimen/dp_35"
android:layout_height="17.5dp"
android:background="@mipmap/za_s"
android:layout_marginBottom="@dimen/dp_5"
android:gravity="center"
android:text="00:00"
android:textColor="@color/white"
android:textSize="@dimen/sp_9"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toBottomOf="@id/tv_name"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_shutup"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="4dp"
android:src="@mipmap/room_ic_wheat_shutup"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintHeight_percent="0.05"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintWidth_percent="0.05"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_online"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@mipmap/room_ic_owner_offline"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.82"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_10"
app:loopCount="0"
tools:visibility="visible" />
<com.qxcm.moduleutil.widget.ExpressionImgView
android:id="@+id/iv_face"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toTopOf="@id/riv"
app:layout_constraintVertical_bias="0.0" />
<ImageView
android:id="@+id/iv_gift"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:0.6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.7"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_maozi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_1"
android:scaleType="centerInside"
android:src="@mipmap/ic_room_huangguan"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/iv_frame"
app:layout_constraintTop_toTopOf="@id/iv_frame"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_room_xq_wno_male"
android:gravity="center"
android:text="1"
android:textColor="#fff"
android:textSize="@dimen/sp_10"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/iv_frame"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false">-->
<!-- <com.qxcm.moduleutil.widget.GifAvatarOvalView-->
<!-- android:id="@+id/riv"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:src="@mipmap/room_ic_wheat_default"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- tools:visibility="visible" />-->
<!-- &lt;!&ndash;说话动态图&ndash;&gt;-->
<!-- <com.opensource.svgaplayer.SVGAImageView-->
<!-- android:id="@+id/iv_ripple"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- app:autoPlay="false"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHeight_percent="0.8"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintWidth_percent="0.8"-->
<!-- app:loopCount="0"-->
<!-- app:source="ripple3695.svga"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_sex"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:background="@mipmap/common_ic_headportriat_base"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- <View-->
<!-- android:id="@+id/view2"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="@id/riv" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_tag_boos"-->
<!-- android:layout_width="32dp"-->
<!-- android:layout_height="14dp"-->
<!-- android:src="@mipmap/room_ic_wheat_tag_boss"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toTopOf="@id/view2"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_time"-->
<!-- android:layout_width="@dimen/dp_35"-->
<!-- android:layout_height="17.5dp"-->
<!-- android:background="@mipmap/za_s"-->
<!-- android:gravity="center"-->
<!-- android:text="00:00"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_9"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_online"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@mipmap/room_ic_owner_offline"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:loopCount="0"-->
<!-- tools:visibility="visible" />-->
<!-- <com.qxcm.moduleutil.widget.AvatarFrameView-->
<!-- android:id="@+id/iv_frame"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:contentDescription="@null"-->
<!-- android:scaleType="fitXY"-->
<!-- app:autoPlay="true"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHeight_percent="0.1"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:loopCount="0"-->
<!-- tools:visibility="visible" />-->
<!-- <View-->
<!-- android:id="@+id/view_riv_bottom"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_tag_type"-->
<!-- android:layout_width="@dimen/dp_30"-->
<!-- android:layout_height="@dimen/dp_20"-->
<!-- android:src="@mipmap/zc"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_name"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="@dimen/dp_5"-->
<!-- android:paddingRight="@dimen/dp_5"-->
<!-- android:singleLine="true"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_9"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/riv"-->
<!-- tools:text="麦位1"-->
<!-- tools:textColor="@color/color_FF333333"-->
<!-- tools:visibility="visible" />-->
<!-- &lt;!&ndash; 心动&ndash;&gt;-->
<!-- <com.qxcm.moduleutil.widget.WheatCharmView-->
<!-- android:id="@+id/charm_view"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintEnd_toEndOf="@id/tv_name"-->
<!-- app:layout_constraintStart_toStartOf="@id/tv_name"-->
<!-- app:layout_constraintTop_toBottomOf="@id/tv_name"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_shutup"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_marginRight="5dp"-->
<!-- android:layout_marginBottom="4dp"-->
<!-- android:src="@mipmap/room_ic_wheat_shutup"-->
<!-- android:visibility="invisible"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintHeight_percent="0.018"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintWidth_percent="0.018"-->
<!-- tools:visibility="visible" />-->
<!-- <com.qxcm.moduleutil.widget.ExpressionImgView-->
<!-- android:id="@+id/iv_face"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintHorizontal_bias="1.0"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="@id/riv"-->
<!-- app:layout_constraintVertical_bias="0.0" />-->
<!-- <android.gesture.GestureOverlayView-->
<!-- android:id="@+id/game_imgview"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_gift"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:visibility="visible"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHeight_percent="0.2"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_maozi"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginLeft="@dimen/dp_10"-->
<!-- android:layout_marginTop="@dimen/dp_1"-->
<!-- android:scaleType="centerInside"-->
<!-- android:src="@mipmap/ic_room_huangguan"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintStart_toStartOf="@id/iv_frame"-->
<!-- app:layout_constraintTop_toTopOf="@id/iv_frame"-->
<!-- tools:visibility="visible" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_no"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@mipmap/ic_room_xq_wno_male"-->
<!-- android:gravity="center"-->
<!-- android:text="1"-->
<!-- android:textColor="#fff"-->
<!-- android:textSize="@dimen/sp_10"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/iv_frame"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
</layout>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_transparent">
<WebView
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_600"
android:background="@color/transparent"
android:hardwareAccelerated="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
<ImageView
android:id="@+id/iv_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:src="@mipmap/index_close_youth"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/web_view"
android:visibility="visible"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -71,7 +71,7 @@
<string name="room_rank">房间榜</string>
<string name="wealth_rank">财富榜</string>
<string name="charm_rank">魅力榜</string>
<string name="guild_rank">会榜</string>
<string name="guild_rank">会榜</string>
<string name="true_love_rank">真爱榜</string>
<string name="avatar_change_info">尊敬的用户每月可修改2次剩余<font color="#FF0000">%1$d</font>次;使用头像卡不限更换次数,还剩<font color="#FF0000">%2$d</font></string>

View File

@@ -10,15 +10,18 @@
<activity
android:name=".activity.DynamicDetailActivity"
android:exported="false"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden|adjustResize"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.DynamicListActivity"
android:exported="false"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden|adjustResize"/>
<activity
android:name=".activity.ReleaseActivity"
android:exported="false" />
android:exported="false"
android:launchMode="singleTask"/>
</application>
</manifest>

View File

@@ -105,6 +105,8 @@ public class ExpandColumnAdapter extends BaseQuickAdapter<ExpandColumnBean, Base
recyclerView.setOnItemClickListener((parent, view, position, id) -> {
FullScreenUtil.showFullScreenDialog(mContext, position, oneImageYuanJiaoAdapter.getList_adapter());
});
}else {
helper.getView(R.id.dy_image_recyc).setVisibility(View.GONE);
}
LinearLayout llContainer = helper.getView(R.id.ll_image_container);

View File

@@ -10,7 +10,8 @@
<activity
android:name=".activity.MainActivity"
android:exported="true" />
android:exported="true"
/>
</application>
</manifest>

View File

@@ -11,9 +11,11 @@ import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
@@ -23,6 +25,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.BuildConfig;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.FragmentUtils;
import com.blankj.utilcode.util.ServiceUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.example.modulecircle.fragment.CircleFragment;
import com.example.modulenews.fragment.NewsFragment;
@@ -44,6 +47,7 @@ import com.qxcm.moduleutil.dialog.HeavenGiftDialog;
import com.qxcm.moduleutil.dialog.RechargeDialogFragment;
import com.qxcm.moduleutil.event.RoomOutEvent;
import com.qxcm.moduleutil.event.UnreadCountEvent;
import com.qxcm.moduleutil.service.EMqttService;
import com.qxcm.moduleutil.utils.ARouteConstants;
import com.qxcm.moduleutil.utils.ImageLoader;
import com.qxcm.moduleutil.utils.SpUtil;
@@ -82,7 +86,6 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
// ServiceUtils.startService(EMqttService.class);
checkTab(getIntent().getIntExtra("tab", -1));
}
@Override
protected void initData() {
fragments = new Fragment[]{
@@ -313,9 +316,31 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
@Override
public void onBackPressed() {
super.onBackPressed();
// super.onBackPressed();
ActivityUtils.startHomeActivity();
// moveTaskToBack(true);
super.onBackPressed();
}
private long exitTime = 0;
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
if (System.currentTimeMillis() - exitTime > 2000) {
Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
exitTime = System.currentTimeMillis();
} else {
try {
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onResume() {
@@ -357,6 +382,8 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
});
MvpPre.getMyInfo(SpUtil.getUserId() + "");//获取首充是否需要展示
// mBinding.ivShouchl.setVisibility(View.VISIBLE);
}
@Subscribe(threadMode = ThreadMode.MAIN)
@@ -391,40 +418,6 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
MvpPre.userNews();
}
// @Subscribe(threadMode = ThreadMode.MAIN)
// public void newMessage(NewsMessageEvent newsMessageEvent) {
// refreshUnread();
// }
// @Subscribe(threadMode = ThreadMode.MAIN)
// public void logOut(LogOutEvent logOutEvent) {
// MyApplication.getInstance().reLogin();
// }
// @Subscribe(threadMode = ThreadMode.MAIN)
// public void backHomeEvent(BackHomeEvent event) {
// mBinding.rlMedia.post(new Runnable() {
// @Override
// public void run() {
// mBinding.rlMedia.performClick();
// }
// });
//
// }
// @Override
// public void appUpdate(AppUpdateModel appUpdateModel) {
// if (appUpdateModel.getVersionCode() > BuildConfig.VERSION_CODE) {
// if (appUpdateDialog == null) {
// appUpdateDialog = new AppUpdateDialog(this);
// appUpdateDialog.setAppUpdateModel(appUpdateModel);
// if (appUpdateModel.getForceUpdate() == 1) {
// appUpdateDialog.setCanceledOnTouchOutside(false);
// }
// }
// appUpdateDialog.show();
// }
// }
@Override
public void appUpdate(AppUpdateModel appUpdateModel) {
@@ -491,4 +484,10 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
}
}
}
// @Override
// protected void onPause() {
// super.onPause();
// moveTaskToBack(true);
// }
}

View File

@@ -24,12 +24,17 @@ import com.qxcm.moduleutil.utils.SpUtil;
import org.greenrobot.eventbus.EventBus;
import java.lang.ref.WeakReference;
import io.reactivex.disposables.Disposable;
public class HomePresenter extends BasePresenter<HomeContacts.View> implements HomeContacts.IHomePre {
HomeContacts.View mView;
public HomePresenter(HomeContacts.View view, Context context) {
super(view, context);
mView=view;
}
@@ -43,6 +48,9 @@ public class HomePresenter extends BasePresenter<HomeContacts.View> implements H
@Override
public void onNext(AppUpdateModel appUpdataModel) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().appUpdate(appUpdataModel);
}
});
@@ -340,6 +348,9 @@ public class HomePresenter extends BasePresenter<HomeContacts.View> implements H
@Override
public void onNext(FirstChargeBean myInfoResp) {
if (MvpRef==null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().myInfoSuccess(myInfoResp);
}

View File

@@ -59,6 +59,7 @@ import com.petterp.floatingx.listener.control.IFxControl;
import com.qxcm.moduleutil.base.CommonAppContext;
import com.qxcm.moduleutil.bean.HeadlineBean;
import com.qxcm.moduleutil.bean.HeadlineEvent;
import com.qxcm.moduleutil.bean.RoomSingleton;
import com.qxcm.moduleutil.bean.UserInfo;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.RankInfo;
@@ -72,6 +73,7 @@ import com.qxcm.moduleutil.event.MusicEvent;
import com.qxcm.moduleutil.event.RoomGiftGiveEvent;
import com.qxcm.moduleutil.event.RoomInputHideEvent;
import com.qxcm.moduleutil.event.RoomOutEvent;
import com.qxcm.moduleutil.event.RoomTaskEvent;
import com.qxcm.moduleutil.event.RoomWheatEvent;
import com.qxcm.moduleutil.event.SurfaceEvent;
import com.qxcm.moduleutil.http.BaseObserver;
@@ -98,6 +100,7 @@ import com.qxcm.moduleutil.event.RoomJoinMountModel;
import com.qxcm.moduleutil.rtc.AgoraManager;
import com.qxcm.moduleutil.rtc.MusicPlayBean;
import com.qxcm.moduleutil.rtc.RtcCore;
import com.qxcm.moduleutil.service.MyRoomSingleton;
import com.qxcm.moduleutil.utils.ARouteConstants;
import com.qxcm.moduleutil.utils.DialogUtils;
import com.qxcm.moduleutil.utils.ImageUtils;
@@ -142,6 +145,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
public String password;
@Autowired
public String roomId;
@Autowired
public String taskId;
public static boolean sDestroied = false;
LikeUserAdapter<RoomOnlineBean> likeUserAdapter;
String[] permissions = {Manifest.permission.RECORD_AUDIO};
@@ -200,9 +207,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
@Subscribe(threadMode = ThreadMode.MAIN)
public void roomInfoEvent(SurfaceEvent surfaceView) {
if (mRoomInfoResp.getRoom_info().getType_id().equals("6")) {//判断是否是电影房
floatingMagnetView = findViewById(R.id.flaoat);//电影房
if (mRoomInfoResp.getUser_info().getIs_room_owner() != 1) {//判断是不是房主1是 如何是,不展示 0不是展示布局
if (surfaceView.getType() != 1) {
floatingMagnetView = findViewById(R.id.flaoat);//电影房
FrameLayout container = floatingMagnetView.findViewById(R.id.fl_screenshare);
// mBinding.flaoat.setVisibility(GONE);//展示或不展示
if (surfaceView == null) {
@@ -220,6 +228,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// mBinding.flScreenshare.addView(surfaceView);
});
}
} else {
floatingMagnetView.setVisibility(GONE);
}
}
}
@@ -228,9 +238,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
@Subscribe(threadMode = ThreadMode.MAIN)
public void hideInput(RoomInputHideEvent event) {
if (event.hide) {
// mBinding.vpRoomPager.setScroll(false);
mBinding.vpRoomPager.setScrollContainer(false);
} else {
// mBinding.vpRoomPager.setScroll(true);
mBinding.vpRoomPager.setScrollContainer(true);
}
}
@@ -273,6 +283,33 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
LogUtils.e("lxj", "开始时间:" + TimeUtils.date2String(new Date()));
if (taskId != null) {
if (taskId.equals("9")) {
MyRoomSingleton.getInstance().onEnterRoom(taskId);
}
}
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRoomTaskEvent(RoomTaskEvent event) {
if (taskId != null && !taskId.equals("9")) {//这是每日任务完成发送私聊信息的事件
RetrofitClient.getInstance().dailyTasksComplete(taskId, new BaseObserver<RoomSingleton>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(RoomSingleton roomSingleton) {
number++;
// 这里处理请求结果
if (roomSingleton.getIs_completed() == 1) {
// 任务完成,可以做一些后续操作
taskId = null;
}
}
});
}
}
@Override
@@ -317,7 +354,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
if (!TextUtils.isEmpty(msg) && msg.contains("当前余额不足")) {
com.hjq.toast.ToastUtils.show("当前余额不足,请充值");
ThreadUtils.runOnUiThreadDelayed(() -> {
RechargeDialogFragment.show(roomId,null, getSupportFragmentManager());
RechargeDialogFragment.show(roomId, null, getSupportFragmentManager());
// DialogUtils.showDialogFragment(ARouter.getInstance().build(ARouteConstants.RECHARGE_DIALOG).navigation());
}, 1400);
}
@@ -466,27 +503,6 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
RoomOnlineDialogFragment.show(roomId, "", mRoomUserBean, mRoomInfoResp, getSupportFragmentManager());
}
});
// RoomMessageEvent.T t = new RoomMessageEvent.T();
// t.setText("羽声严禁未成年人进行直播或打赏官方将24小时在线巡查。我们提倡绿色直播直播间严禁出现涉政、涉恐、涉黄、涉赌等违法违规内容严禁宣传封建迷信、宗教极端思想、出现低俗色情、吸烟酗酒等内容严禁违反社会主义核心价值观、践踏社会道德底线、诱导打赏、低俗 PK 、买卖金币等行为,请大家共同遵守、监督并及时举报。请勿相信各类刷钻、购买礼包、游戏币及电商贩卖等非官方广告信息,谨防网络诈骗。");
// onMessageReceived(new RoomMessageEvent(1000, roomId, t));
//// onChatRoomViewCreation();
// V2TIMManager.getInstance().joinGroup("room" + roomId, "申请加入", new V2TIMCallback() {
// @Override
// public void onSuccess() {
//// RoomMessageEvent.T t = new RoomMessageEvent.T();
//// t.setText("羽声严禁未成年人进行直播或打赏官方将24小时在线巡查。我们提倡绿色直播直播间严禁出现涉政、涉恐、涉黄、涉赌等违法违规内容严禁宣传封建迷信、宗教极端思想、出现低俗色情、吸烟酗酒等内容严禁违反社会主义核心价值观、践踏社会道德底线、诱导打赏、低俗 PK 、买卖金币等行为,请大家共同遵守、监督并及时举报。请勿相信各类刷钻、购买礼包、游戏币及电商贩卖等非官方广告信息,谨防网络诈骗。");
//// // 加入群组成功
//// notifyMessageReceived(new RoomMessageEvent(1000, mRoomId, t));
// Log.d("lxj", "加入群组成功:" );
// }
//
// @Override
// public void onError(int code, String desc) {
// // 加入群组失败
// Log.d("lxj", "加入群组失败:" + code + "=" + desc);
// }
// });
// MessageListenerSingleton.getInstance().addOnMessageReceivedListener(this);
MessageListenerSingleton.getInstance().joinGroup(roomId);
SpUtil.saveMyRoomId(roomId);
@@ -586,10 +602,12 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// EventBus.getDefault().post(new RoomClearCardiacRunnable(messageEvent.getRoomId()));
} else if (messageEvent.getMsgType() == 1036) {
if (messageEvent.getText().getRoom_id().equals(roomId)) {
if (!mBinding.roomTop.tvNum.getText().toString().equals(messageEvent.getText().getOnline_number() + "")) {
mBinding.roomTop.tvNum.setText(messageEvent.getText().getOnline_number() + "");
}
}
}
}
private void querenPk(String text, String pk_id) {
@@ -636,6 +654,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// mBinding.flaoat.setVisibility(is? VISIBLE : GONE);
}
public void setOnlineNumber(int number) {
mBinding.roomTop.tvNum.setText(number + "");
}
/**
* 特效设置
*/
@@ -741,7 +763,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
this.mRoomOwnerBean = resp.getRoom_owner();
this.mPitList = mRoomBean.getPit_list();
if (roomBean.getType_id().equals("6")){
if (roomBean.getType_id().equals("6")) {
// mBinding.ivBg.setImageDrawable(getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.cabin_bj));
}
@@ -759,20 +781,18 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
number = roomBean.getOnline_number();
mBinding.roomTop.tvNum.setText(number + "");
// StringBuilder userIds = new StringBuilder();
// for (int i = 0; i < mRoomInfoResp.getRoom_info().getPit_list().size(); i++) {
// String userId = mRoomInfoResp.getRoom_info().getPit_list().get(i).getUser_id();
// if (userId != null && !userId.equals("0") && !userId.isEmpty()) {
// if (userIds.length() > 0) {
// userIds.append(",");
// }
// userIds.append(userId);
// }
// }
StringBuilder userIds = new StringBuilder();
for (int i = 0; i < mRoomInfoResp.getRoom_info().getPit_list().size(); i++) {
String userId = mRoomInfoResp.getRoom_info().getPit_list().get(i).getUser_id();
if (userId != null && !userId.equals("0") && !userId.isEmpty()) {
if (userIds.length() > 0) {
userIds.append(",");
}
userIds.append(userId);
}
}
//
// if (userIds.length() > 0 && roomId != null) {
// MvpPre.userOnlineStatus(userIds.toString(), roomId);
// }
if (!isFinishing() && !isDestroyed()) {
@@ -802,9 +822,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
} else {
mBinding.roomTop.btnFollow.setBackground(getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.collect));
}
if ((roomBean.getType_id().equals("3") || roomBean.getType_id().equals("1") || roomBean.getType_id().equals("4"))&& roomBean.getLabel_id().equals("2")){
if ((roomBean.getType_id().equals("3") || roomBean.getType_id().equals("1") || roomBean.getType_id().equals("4")) && roomBean.getLabel_id().equals("2")) {
AgoraManager.getInstance(this).setBjMusic(false);
}else {
} else {
AgoraManager.getInstance(this).setBjMusic(true);
}
@@ -827,6 +847,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// } else {
// mBinding.roomTop.rl.setVisibility(View.GONE);
// }
if (userIds.length() > 0 && roomId != null) {
// MvpPre.userOnlineStatus(userIds.toString(), roomId);
}
}
private static final long CLICK_DELAY = 500; // 延迟时间,单位毫秒
@@ -834,6 +858,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
private boolean isIntercepted = false;
private long downTime;
///头条
public void toutiao() {
if (mRoomInfoResp.getRoom_info().getHead_line() != null) {
mBinding.flaoatZuoji.setVisibility(VISIBLE);
@@ -1168,9 +1193,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
} else {
mBinding.roomTop.btnFollow.setBackground(getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.collect));
}
if ((roomBean.getType_id().equals("3") || roomBean.getType_id().equals("1") || roomBean.getType_id().equals("4"))&& roomBean.getLabel_id().equals("2")){
if ((roomBean.getType_id().equals("3") || roomBean.getType_id().equals("1") || roomBean.getType_id().equals("4")) && roomBean.getLabel_id().equals("2")) {
AgoraManager.getInstance(this).setBjMusic(false);
}else {
} else {
AgoraManager.getInstance(this).setBjMusic(true);
}
AgoraManager.getInstance(this).stopMuisc();
@@ -1200,7 +1225,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
AgoraManager.getInstance(this).stopScreenCapture();
AgoraManager.getInstance(this).leaveRoom();
AgoraManager.getInstance(this).destroy();
MyRoomSingleton.getInstance().onExitRoom();
V2TIMManager.getInstance().quitGroup("room" + roomId, new V2TIMCallback() {
@Override
public void onSuccess() {
@@ -1238,7 +1263,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
@Override
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
SpUtil.setUserOnline(GsonUtils.toJson(list));
// SpUtil.setUserOnline(GsonUtils.toJson(list));
if(!list.isEmpty()){
for (int i = 0; i < list.size(); i++) {
UserOnlineStatusBean userOnlineStatusBean = list.get(i);
EventBus.getDefault().post(userOnlineStatusBean);
}
}
}

View File

@@ -129,7 +129,11 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
if (sb.length() > 0) {//该步即不会第一位有逗号,也防止最后一位拼接逗号!
sb.append(",");
}
if (data!=null && data.get(i)!=null && data.get(i).getPit_number()!=null) {
sb.append(data.get(i).getPit_number());
}else {
sb.append("");
}
}
}
return sb.toString();

View File

@@ -67,7 +67,7 @@ public class RankingCharmListAdapter extends BaseQuickAdapter<CharmRankingResp,
helper.addOnClickListener(R.id.room_item_head);
LinearLayout ll = helper.getView(R.id.bnv_rank_list_rich);
List<String> images = item.getIcon(); // 获取图片列表
ll.removeAllViews();
for (String url : images) {
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());

View File

@@ -5,8 +5,11 @@ import android.app.Activity;
import com.qxcm.moduleutil.activity.IPresenter;
import com.qxcm.moduleutil.activity.IView;
import com.qxcm.moduleutil.bean.RoomTime;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.AuctionBean;
import java.util.List;
public class RoomAuctionContacts {
public interface View extends IView<Activity> {
void applyPit();
@@ -16,6 +19,8 @@ public class RoomAuctionContacts {
void auctionDelay();
void auctionEnd();
void auctionMode();
void userOnlineStatus(List<UserOnlineStatusBean> list);
}
public interface IRoomDataListPre extends IPresenter {
@@ -27,6 +32,7 @@ public class RoomAuctionContacts {
void auctionEnd(String auctionId,String roomId);
void auctionMode(String roomId,String labelId);
void userOnlineStatus(String userId, String roomid);
}

View File

@@ -35,5 +35,6 @@ public class SingSongContacts {
void endPk(String pk_id,String type,String user_id);
void userOnlineStatus(String userId, String roomid);
}
}

View File

@@ -1,11 +1,14 @@
package com.example.moduleroom.dialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.annotation.NonNull;
@@ -119,6 +122,21 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
EventBus.getDefault().unregister(this);
}
@Override
public void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
// 获取屏幕高度
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
// 设置DialogFragment的高度为屏幕高度的70%
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, (int) (height * 0.6));
}
}
@Override
protected void initData() {
// MvpPre.getRewardList("1", 1, 10);
@@ -367,10 +385,12 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
int currentItem = mBinding.viewPager.getCurrentItem();
if (currentItem < 1) { //比2小是才是礼物
GiftTwoDetailsFragment fragment = (GiftTwoDetailsFragment) fragmentList.get(currentItem);
roonGiftModel = fragment.getGiftList();
// roonGiftModel = fragment.getGiftList();
giftModel = fragment.mGiftList();
} else {
GiftTwoDetailsFragment fragment = (GiftTwoDetailsFragment) fragmentList.get(currentItem);
giftModel = fragment.mGiftList();
// giftModel = fragment.mGiftList();
roonGiftModel = fragment.getGiftList();
}
return currentItem;
}
@@ -425,12 +445,16 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
giftNumber = num;
roomGiftGiveEvent = new RoomGiftGiveEvent(userId, roomId, pit, num, 0, null, roonGiftModel);
if (userInfo != null) {
if (userInfo.getPit_number() != null && userInfo.getPit_number().equals("888") || userInfo.getPit_number().equals("")) {
if (userInfo.getPit_number().isEmpty() || jingp!=1) {
if (userInfo.getPit_number() != null) {
if (userInfo.getPit_number().equals("888") || userInfo.getPit_number().equals("")) {
if (userInfo.getPit_number().isEmpty() || jingp != 1) {
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "1", pit);
} else {
MvpPre.roomAuctionJoin(userInfo.getAuction_id(), userInfo.getUser_id() + "", roonGiftModel.getGift_id(), num, "1");
}
}else {
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "1", pit);
}
} else {
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "1", pit);
}
@@ -484,6 +508,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
giftLabelBean.setName("背包");
giftLabelBeans.add(0, giftLabelBean);
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans, fragmentList));
mBinding.viewPager.setOffscreenPageLimit(0);
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
mBinding.slidingTabLayout.setCurrentTab(1);
}

View File

@@ -17,6 +17,7 @@ import android.view.WindowManager;
import com.blankj.utilcode.util.ToastUtils;
import com.example.moduleroom.R;
import com.example.moduleroom.activity.RoomActivity;
import com.example.moduleroom.adapter.RoomOnlineAdapter;
import com.example.moduleroom.contacts.RoomContacts;
import com.example.moduleroom.databinding.FragmentRoomOnlineDialogBinding;
@@ -257,6 +258,9 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
int total = onlineBean.getOn_pit().size() + onlineBean.getOff_pit().size();
mBinding.tvNum.setText("在线用户(" + total + ")人");
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).setOnlineNumber(total);
}
}
// @Override

View File

@@ -99,9 +99,11 @@ public class RoomPkDialogFragment extends BaseMvpDialogFragment<RoomPkPresenter,
public void run() {
keyWord = editable.toString();
if (!StringUtils.isEmpty(keyWord)) {
if (MvpPre!=null) {
MvpPre.searchPkRoom(keyWord, "1", "15");
}
}
}
}, DELAY);
}
});

View File

@@ -150,12 +150,12 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
dataList.add(new RoomSettingBean("更多操作", null, null, null, -1, read, isSelected, false, false));
dataList.add(new RoomSettingBean("离开房间", "ic_leave", null, null, RoomSettingBean.QXRoomSettingTypeRoomLeave, read, isSelected, false, false));
dataList.add(new RoomSettingBean("分享房间", "ic_share", null, null, RoomSettingBean.QXRoomSettingTypeRoomShare, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("分享房间", "ic_share", null, null, RoomSettingBean.QXRoomSettingTypeRoomShare, read, isSelected, false, false));
dataList.add(new RoomSettingBean("调音台", "ic_my_dress", null, null, RoomSettingBean.QXRoomSettingTypeRoomMyDress, read, isSelected, false, false));
dataList.add(new RoomSettingBean("房间设置", "ic_room_setting", null, null, RoomSettingBean.QXRoomSettingTypeRoomSetting, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("房间欢迎语", "ic_welcome", null, null, RoomSettingBean.QXRoomSettingTypeRoomWelcome,read,isSelected, false));
dataList.add(new RoomSettingBean("关闭特效", "ic_close_effects", null, null, RoomSettingBean.QXRoomSettingTypeRoomCloseEffects, read, isSelected, false,effectOn));
dataList.add(new RoomSettingBean("意见反馈", "ic_report", null, null, RoomSettingBean.QXRoomSettingTypeRoomReport, read, isSelected, false, false));
dataList.add(new RoomSettingBean("举报", "ic_report", null, null, RoomSettingBean.QXRoomSettingTypeRoomReport, read, isSelected, false, false));
List<RoomSettingBean> filteredList = new ArrayList<>();
// 更新 itemType
for (RoomSettingBean bean : dataList) {
@@ -255,6 +255,8 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
MvpPre.changeRoomType(roomId, "4");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
}else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport){
ARouter.getInstance().build(ARouteConstants.H5).withString("url", "https://vespa.qxmier.com/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=" + 2 + "&fromId=" + roomId).navigation();
}
}

View File

@@ -127,7 +127,9 @@ public class WheatFeedingDialogFragment extends BaseMvpDialogFragment<WheatPrese
@Override
public void onStart() {
super.onStart();
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this);
}
Window window = getDialog().getWindow();
if (window != null) {
// 设置固定高度为 500dp
@@ -159,8 +161,10 @@ public class WheatFeedingDialogFragment extends BaseMvpDialogFragment<WheatPrese
@Override
public void onDestroy() {
super.onDestroy();
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this);
}
}
private void onClick(View view) {
int id = view.getId();

View File

@@ -22,6 +22,7 @@ import com.example.moduleroom.databinding.RoomFragementTransEaseChatBinding;
import com.example.moduleroom.dialog.RoomUserInfoFragment;
import com.qxcm.moduleutil.bean.UserInfo;
import com.qxcm.moduleutil.bean.room.RoomUserBean;
import com.qxcm.moduleutil.event.RoomTaskEvent;
import com.qxcm.moduleutil.listener.MessageListenerSingleton;
import com.example.moduleroom.presenter.PublicScreenEaseChatPresenter;
import com.qxcm.moduleutil.base.BaseMvpFragment;
@@ -64,6 +65,7 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
private RoomInfoResp roomInfoResp;
private EaseChatAdapter easeChatAdapter;
private CountDownTimer countDownTimer;
private int number;
// private List<LuckyRankBean> oldList = new ArrayList<>();
private static final int queueMessageNum = 20;//浇水礼物推送队列最大数
// private RoomWinningRecordDialogFragment recordDialogFragment;
@@ -467,6 +469,7 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
@Override
public void onSuccess(V2TIMMessage message) {
// 发送群聊自定义消息成功
EventBus.getDefault().post(new RoomTaskEvent());
}
@Override
@@ -551,7 +554,20 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
} else if (message.getMsgType() == 1036 || message.getMsgType()==1037) {
EventBus.getDefault().post(message);
return;
} else if (message.getMsgType() == 1 || message.getMsgType() == 1005) {
}else if (message.getMsgType() == 1005){
EventBus.getDefault().post(message);
if (message.getText().getText()==null){
return;
}else {
easeChatAdapter.addData(new EMMessageInfo(message));
scrollToBottomIfNeed();
return;
}
}else if (message.getMsgType()==1035){
EventBus.getDefault().post(message);
return;
}
else if (message.getMsgType() == 1 ) {
EventBus.getDefault().post(message);
easeChatAdapter.addData(new EMMessageInfo(message));
scrollToBottomIfNeed();
@@ -561,6 +577,10 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
easeChatAdapter.addData(new EMMessageInfo(message));
scrollToBottomIfNeed();
return;
}else if (message.getMsgType() == 1038){
easeChatAdapter.addData(new EMMessageInfo(message));
scrollToBottomIfNeed();
return;
}
EventBus.getDefault().post(message);
// easeChatAdapter.addData(new EMMessageInfo(message));

View File

@@ -228,8 +228,12 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
@Override
public void setWealthEmpty(List<CharmRankingResp> list) {
if (list != null){
wAdapter.setNewData(list);
}else {
wAdapter.setEmptyView(commonEmptyView);
}
}
/**
* 设置头像男神女神热度背景

View File

@@ -205,11 +205,14 @@ public class RelationshipFragment extends BaseMvpDialogFragment<RoomUserPresente
@Override
public void relationCard(RelationCardBean list) {
if (list !=null) {
if (type == 1) {
if (list != null && list.getQinmi() != null) {
for (int i = 0; i < list.getQinmi().size(); i++) {
list.getQinmi().get(i).setType(1);
}
adapter.setNewData(list.getQinmi());
}
} else if (type == 2) {
if (list != null && list.getZhenai() != null) {
for (int i = 0; i < list.getZhenai().size(); i++) {
@@ -219,6 +222,7 @@ public class RelationshipFragment extends BaseMvpDialogFragment<RoomUserPresente
}
}
}
}
@Override
public void topRelationCard(String s) {

View File

@@ -46,6 +46,7 @@ import com.qxcm.moduleutil.base.BaseMvpFragment;
import com.qxcm.moduleutil.bean.RoomMessageEvent;
import com.qxcm.moduleutil.bean.RoomTime;
import com.qxcm.moduleutil.bean.UserInfo;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.AuctionBean;
import com.qxcm.moduleutil.bean.room.RoomAuction;
import com.qxcm.moduleutil.bean.room.RoomBean;
@@ -115,9 +116,9 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
}
public void initOverlayButtons() {
if (isButtonsInflated) return;
// if (isButtonsInflated) return;
ViewStub stub = requireActivity().findViewById(R.id.stub_buttons);
stub = requireActivity().findViewById(R.id.stub_buttons);
if (stub != null) {
View inflated = stub.inflate();
@@ -129,7 +130,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
imActionJs.setOnClickListener(this::onChock);
imActionYs.setOnClickListener(this::onChock);
isButtonsInflated = true;
// isButtonsInflated = true;
} else {
// 报错提示:说明 top_overlay_buttons.xml 中没有定义这些 id
throw new IllegalStateException("im_action_js or im_action_ys not found in overlay layout");
@@ -139,6 +140,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
@Override
protected void initData() {
initOverlayButtons();
LogUtils.e("lxj", "展示room时间" + TimeUtils.date2String(new Date()));
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).setvisibTop(true);
@@ -147,6 +149,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
if (roomPitBean.getUser_id() != null && !roomPitBean.getUser_id().isEmpty() && !roomPitBean.getUser_id().equals("0")) {
roomPitBean.setIs_pm(1);
wheatView.setData(roomPitBean);
imActionJs.setVisibility(VISIBLE);
}
parentFragment = (RoomFragment) getParentFragment();
@@ -207,7 +210,17 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
auctionId = "";
SpUtil.setAuctionId("");
}
tzblChanged();
RoomPitBean roomPitBean2 = wheatView.pitBean;
if (roomPitBean2 != null && roomPitBean2.getUser_id() != null && !roomPitBean2.getUser_id().equals("0")){
if (roomPitBean2.getUser_id().equals(SpUtil.getUserId() + "")){
imActionJs.setVisibility(VISIBLE);
imActionYs.setVisibility(VISIBLE);
} else {
imActionJs.setVisibility(INVISIBLE);
imActionYs.setVisibility(INVISIBLE);
}
}
}
private void getvjs() {
@@ -218,6 +231,31 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
}
}
protected void tzblChanged() {
StringBuilder userIds = new StringBuilder();
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
String userId = roomInfoResp.getRoom_info().getPit_list().get(i).getUser_id();
if (userId != null && !userId.equals("0") && !userId.isEmpty()) {
if (userIds.length() > 0) {
userIds.append(",");
}
userIds.append(userId);
}
}
if (auctionUserBean!=null && auctionUserBean.getUser_id()!=null && !auctionUserBean.getUser_id().equals("0")){
if (userIds.length() > 0){
userIds.append(",");
}
userIds.append(auctionUserBean.getUser_id());
}
if (userIds.length() > 0 && roomInfoResp.getRoom_info().getRoom_id() != null) {
MvpPre.userOnlineStatus(userIds.toString(), roomInfoResp.getRoom_info().getRoom_id());
}
}
@Override
protected void initView() {
wheatView = mBinding.roomMakeWheat;
@@ -519,9 +557,25 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
}
@Override
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
// RoomMakeWheatView wheatView = mBinding.roomMakeWheat;
RoomPitBean pitBean= wheatView.pitBean;
RoomPitBean pitBean2= wheatView2.pitBean;
for (UserOnlineStatusBean bean : list) {
if (pitBean!=null && pitBean.getUser_id() != null && bean.getUser_id().equals(pitBean.getUser_id())) {
wheatView.setOnlineStatus(bean);
}
if (pitBean2!=null && pitBean2.getUser_id() != null && bean.getUser_id().equals(pitBean2.getUser_id())) {
wheatView2.setOnlineStatus(bean);
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void roomInfoEvent(RoomMessageEvent messageEvent) {
boolean b = false;
if (messageEvent.getMsgType() == 1003) {//上麦
if (messageEvent.getText().getPit_number().equals("9")) {
wheatView.setData(getPitBean(messageEvent));
@@ -546,9 +600,36 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
wheatView.setData(getPitBean2(messageEvent, "9"));
getvjs();
imActionYs.setVisibility(GONE);
// RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(Integer.parseInt(messageEvent.getText().getPit_number()) - 1);
// pitBean.setUser_id("");
// pitBean.setAvatar("");
// pitBean.setNickname("");
// pitBean.setSex("");
// pitBean.setCharm("");
// roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(messageEvent.getText().getPit_number()) - 1, pitBean);
// if (SpUtil.getUserId() == messageEvent.getText().getFromUserInfo().getUser_id()) {
//
// AgoraManager.getInstance(getActivity()).ClientRole(false);
// AgoraManager.getInstance(getActivity()).muteLocalAudioStream(true);
// } else {
// b = false;
// }
//// AgoraManager.getInstance(getActivity()).setEnableAudio(b);
// if (parentFragment != null) {
// parentFragment.updateWheatStatus(pitBean, Integer.parseInt(messageEvent.getText().getPit_number()), false, b);
// }
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
parentFragment.setRoleType(0, 0);
parentFragment.switchMic(2);
RoomPitBean pitBean = wheatView.pitBean;
pitBean.setUser_id("");
pitBean.setAvatar("");
pitBean.setNickname("");
pitBean.setSex("");
pitBean.setCharm("");
parentFragment.updateWheatStatus(pitBean, Integer.parseInt(messageEvent.getText().getPit_number()), false, true);
// parentFragment.setRoleType(0, 0);
// parentFragment.switchMic(2);
}
} else if (messageEvent.getText().getPit_number().equals("888")) {
@@ -590,7 +671,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
} else if (messageEvent.getText().getPit_number().equals("888")) {
wheatView2.setData(getPitBean2(messageEvent, "888"));
if (parentFragment != null) {
if(messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
parentFragment.setRoleType(0, 0);
parentFragment.switchMic(2);
}
@@ -635,6 +716,9 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
auctionList = null;
gexList();
steView(type);
isButtonsInflated = false;
} else if (messageEvent.getMsgType() == 1012) {
stub.setVisibility(GONE);
} else if (messageEvent.getMsgType() == 1026) {//主持延迟
countDownTime(messageEvent.getText().getDuration());
} else if (messageEvent.getMsgType() == 1027) {
@@ -661,6 +745,36 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
}
}
}
} else if (messageEvent.getMsgType() == 1035) {
RoomPitBean pitBean = mBinding.roomMakeWheat.pitBean;
if (pitBean.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
mBinding.roomMakeWheat.setData(pitBean);
}
RoomPitBean pitBean2 = mBinding.roomMakeWheat2.pitBean;
if (pitBean2.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
pitBean2.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
pitBean2.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean2.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean2.setDress(messageEvent.getText().getFromUserInfo().getDress());
mBinding.roomMakeWheat2.setData(pitBean2);
}
if (auctionList != null && auctionList.size() > 0) {
for (int i = 0; i < auctionList.size(); i++) {
if (auctionList.get(i).getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
auctionList.get(i).setDress(messageEvent.getText().getFromUserInfo().getDress());
auctionList.get(i).setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
auctionList.get(i).setNickname(messageEvent.getText().getFromUserInfo().getNickname());
auctionList.get(i).setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
gexList();
}
}
}
}
}
@@ -677,6 +791,14 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
}
}
@Override
public void onDestroy() {
super.onDestroy();
isButtonsInflated = false;
releaseCountDownTimer();
EventBus.getDefault().unregister(this);
}
private void yinc() {
mBinding.ivJp.setVisibility(INVISIBLE);
getvjs();
@@ -709,7 +831,8 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
pitBean.setNickname(auctionListBean.getNickname());
pitBean.setAvatar(auctionListBean.getAvatar());
pitBean.setCharm(auctionListBean.getCharm());
pitBean.setSex(auctionListBean.getSex());
pitBean.setDress(auctionListBean.getDress());
if (j == 1) {
pitBean.setPit_number("111");
RoomMakeWheatView wheatView = mBinding.ivAuction1;
@@ -968,7 +1091,8 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
* @param defaultSize 默认字体大小sp
* @param selectedSize 点击后选中字体大小sp
*/
public void toggleTextStyles(TextView qinmi, TextView zhenai, int defaultColor, int selectedColor, int clickedColor, float defaultSize, float selectedSize, int type) {
public void toggleTextStyles(TextView qinmi, TextView zhenai, int defaultColor,
int selectedColor, int clickedColor, float defaultSize, float selectedSize, int type) {
if (type == 1) {
// 切换到真爱拍样式
qinmi.setTextColor(selectedColor);

View File

@@ -1,6 +1,11 @@
package com.example.moduleroom.fragment;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.annotation.NonNull;
@@ -8,12 +13,24 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import android.os.CountDownTimer;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.TimeUtils;
@@ -32,6 +49,7 @@ import com.example.moduleroom.presenter.RoomPresenter;
import com.hjq.toast.ToastUtils;
import com.qxcm.moduleutil.base.BaseMvpFragment;
import com.qxcm.moduleutil.bean.RoomCharmRankBean;
import com.qxcm.moduleutil.bean.RoomInputEvent;
import com.qxcm.moduleutil.bean.RoomMessageEvent;
import com.qxcm.moduleutil.bean.UserInfo;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
@@ -47,6 +65,7 @@ import com.qxcm.moduleutil.event.UnreadCountEvent;
import com.qxcm.moduleutil.listener.MessageListenerSingleton;
import com.qxcm.moduleutil.rtc.AgoraManager;
import com.qxcm.moduleutil.utils.SpUtil;
import com.qxcm.moduleutil.widget.RoomMessageInputMenu;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMValueCallback;
@@ -404,9 +423,12 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (mRoomInfoResp.getUser_info().getIs_mute().equals("1")) {
ToastUtils.show("您已经被禁言");
} else {
mBinding.llInput.setVisibility(View.VISIBLE);
mBinding.inputMenu1.bringToFront(); // 强制将该 View 置于最上层
mBinding.inputMenu1.show();
// mBinding.llInput.setVisibility(View.VISIBLE);
// mBinding.inputMenu1.bringToFront(); // 强制将该 View 置于最上层
// mBinding.inputMenu1.show();
dialogDismiss();
}
} else if (id == R.id.ll_input) {
mBinding.llInput.setVisibility(View.GONE);
@@ -418,7 +440,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
RequestDialogFragment.show(roomId, mRoomInfoResp, 1, getChildFragmentManager());
}
} else if (id == R.id.rl_gift) {//礼物
RoomGiftDialogFragment.show(mRoomInfoResp, null, roomId, 0,getChildFragmentManager());
RoomGiftDialogFragment.show(mRoomInfoResp, null, roomId, 0, getChildFragmentManager());
} else if (id == R.id.iv_sound_effects) {
SoundEffectsDialogFragment.show(roomId, getChildFragmentManager());
} else if (id == R.id.cl_first_charge) {
@@ -474,6 +496,147 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
}
}
private boolean canSend = true;
private CountDownTimer mCountDownTimer;
@SuppressLint("MissingInflatedId")
public void dialogDismiss() {
// 使用自定义的 Dialog
// final Dialog dialog = new Dialog(getContext(), android.R.style.Theme_Translucent_NoTitleBar);
// dialog.setContentView(com.qxcm.moduleutil.R.layout.dialog_custom_input);
//
// // 设置对话框在底部显示
// Window window = dialog.getWindow();
// if (window != null) {
// window.setGravity(Gravity.BOTTOM);
// window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
// }
//
// EditText etContent = dialog.findViewById(com.qxcm.moduleutil.R.id.et_content);
// Button tvSend = dialog.findViewById(com.qxcm.moduleutil.R.id.tv_send);
//
// // 确保 tvSend 不为空并且正确绑定点击事件
// if (tvSend != null) {
// tvSend.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Log.d("RoomFragment", "tvSend clicked"); // 添加日志进行调试
//
// if (!canSend) {
// ToastUtils.show("消息发送较频繁~");
// return;
// }
// String text = etContent.getText().toString();
// if (TextUtils.isEmpty(text)) {
// ToastUtils.show("请输入评论内容");
// return;
// }
// EventBus.getDefault().post(new RoomInputEvent(text));
//
// etContent.setText("");
// countDownTimer();
//
// // 关闭对话框
// dialog.dismiss();
// }
// });
// } else {
// Log.e("RoomFragment", "tvSend is null"); // 添加日志进行调试
// }
//
// // 显示对话框后自动请求焦点并显示键盘
// dialog.setOnShowListener(new DialogInterface.OnShowListener() {
// @Override
// public void onShow(DialogInterface dialogInterface) {
// etContent.requestFocus();
// InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
// imm.showSoftInput(etContent, InputMethodManager.SHOW_IMPLICIT);
// }
// });
//
// // 显示对话框
// dialog.show();
// // 使用 AlertDialog.Builder
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
LayoutInflater inflater = getLayoutInflater();
View dialogView = inflater.inflate(com.qxcm.moduleutil.R.layout.room_message_input_menu, null);
builder.setView(dialogView);
EditText etContent = dialogView.findViewById(com.qxcm.moduleutil.R.id.et_content);
Button tvSend = dialogView.findViewById(com.qxcm.moduleutil.R.id.tv_send);
// 创建 AlertDialog
final AlertDialog dialog = builder.create();
// 设置对话框在底部显示
Window window = dialog.getWindow();
if (window != null) {
window.setGravity(Gravity.BOTTOM);
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
// dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// 设置对话框在底部显示
// dialog.getWindow().setGravity(Gravity.BOTTOM);
// 自动弹出键盘
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
tvSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!canSend) {
ToastUtils.show("消息发送较频繁~");
return;
}
String text = etContent.getText().toString();
if (TextUtils.isEmpty(text)) {
ToastUtils.show("请输入评论内容");
return;
}
EventBus.getDefault().post(new RoomInputEvent(text));
etContent.setText("");
countDownTimer();
dialog.dismiss();
}
});
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialogInterface) {
etContent.requestFocus();
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(etContent, InputMethodManager.SHOW_IMPLICIT);
}
});
dialog.show();
}
private void countDownTimer() {
releaseCountDownTimer();
mCountDownTimer = new CountDownTimer(3 * 1000L, 1000L) {
@Override
public void onTick(long millisUntilFinished) {
canSend = false;
}
@Override
public void onFinish() {
canSend = true;
}
};
mCountDownTimer.start();
}
private void releaseCountDownTimer() {
if (mCountDownTimer != null) {
mCountDownTimer.cancel();
mCountDownTimer = null;
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void roomInfoEvent(RoomWheatEvent messageEvent) {
if (messageEvent.getRoomId().equals(roomId)) {
@@ -632,10 +795,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private boolean haveMe = false;
public void getVoiceStatus(RoomAuction.AuctionUserBean auctionUserBean,List<RoomAuction.AuctionListBean> auctionListBeans,String user_id) {
if(auctionListBeans!=null){
public void getVoiceStatus(RoomAuction.AuctionUserBean auctionUserBean, List<RoomAuction.AuctionListBean> auctionListBeans, String user_id) {
if (auctionListBeans != null) {
for (int i = 0; i < auctionListBeans.size(); i++) {
if (i<3) {
if (i < 3) {
if (auctionListBeans.get(i).getUser_id().equals(SpUtil.getUserId() + "")) {
haveMe = true;
break;
@@ -643,8 +806,8 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
}
}
}
if(auctionUserBean!=null){
if (auctionUserBean.getUser_id().equals(SpUtil.getUserId() + "")){//判断我是不是被拍卖者
if (auctionUserBean != null) {
if (auctionUserBean.getUser_id().equals(SpUtil.getUserId() + "")) {//判断我是不是被拍卖者
haveMe = true;
}
}
@@ -652,22 +815,22 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
haveMe = true;
}
if (!haveMe){
if (!haveMe) {
AgoraManager.getInstance(getContext()).ClientRole(false);
mBinding.rlMic.setVisibility(View.GONE);
AgoraManager.getInstance(getContext()).setLocalAudioEnabled(false, SpUtil.getUserId() + "");
// switchMic(2);
}else {
} else {
mBinding.rlMic.setVisibility(View.VISIBLE);
if (AgoraManager.getInstance(getContext()).isLocalAudioEnabled()){
if (AgoraManager.getInstance(getContext()).isLocalAudioEnabled()) {
mBinding.ivMic.setImageResource(com.qxcm.moduleutil.R.mipmap.room_microphone);
}else {
} else {
mBinding.ivMic.setImageResource(com.qxcm.moduleutil.R.mipmap.room_microphone_off);
}
}
}else {
} else {
if (!user_id.equals(SpUtil.getUserId() + "")) {
AgoraManager.getInstance(getContext()).ClientRole(false);
mBinding.rlMic.setVisibility(View.GONE);
@@ -675,7 +838,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
}
}
haveMe=false;
haveMe = false;
}
@@ -735,15 +898,23 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
rl_misc.setVisibility(View.GONE);
rl_more.setVisibility(View.GONE);
} else if (roleType != 5 ) {
} else if (roleType != 5) {
rl_misc.setVisibility(View.VISIBLE);
if (mRoomInfoResp.getUser_info().getPit_number()==9) {
if (mRoomInfoResp.getUser_info().getPit_number() == 9) {
rl_more.setVisibility(View.VISIBLE);
}
}
if ((mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("4") || mRoomInfoResp.getRoom_info().getType_id().equals("3")) && mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
rl_more.setVisibility(View.GONE);
}
if (mRoomInfoResp.getUser_info().getPit_number() > 0) {
rl_mic.setVisibility(View.VISIBLE);
switchMic(2);
} else {
switchMic(2);
rl_mic.setVisibility(View.GONE);
}
// if (roleType == 5 ){
// rl_misc.setVisibility(View.GONE);
// rl_more.setVisibility(View.GONE);
@@ -755,7 +926,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
// }
// }
if (mRoomInfoResp.getRoom_info().getType_id().equals("6")){
if (mRoomInfoResp.getRoom_info().getType_id().equals("6")) {
rl_voive.setVisibility(View.GONE);//声音
rl_more.setVisibility(View.GONE);//PK
rl_misc.setVisibility(View.GONE); //音乐
@@ -826,6 +997,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
mBinding.ivWheatFeeding.setImageResource(com.qxcm.moduleutil.R.mipmap.room_wheat_feeding_up);
aBoolean = false;
mRoomInfoResp.getUser_info().setPit_number(messageEvent.getText().getPit_number() != null ? Integer.parseInt(messageEvent.getText().getPit_number()) : 0);
setRoleType(3, Integer.parseInt(messageEvent.getText().getPit_number()));
switchMic(2);
}
@@ -833,7 +1005,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
mBinding.ivWheatFeeding.setImageResource(com.qxcm.moduleutil.R.mipmap.room_wheat_feeding);
aBoolean = true;
mRoomInfoResp.getUser_info().setPit_number(0);
setRoleType(0, 0);
switchMic(2);
}
@@ -870,7 +1042,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
mRoomInfoResp.getUser_info().setIs_host(1);
} else if (messageEvent.getMsgType() == 1018) {
mRoomInfoResp.getUser_info().setIs_host(0);
}else if (messageEvent.getMsgType() == 1024){
} else if (messageEvent.getMsgType() == 1024) {
mRoomInfoResp.getRoom_auction().getAuction_list().clear();
mRoomInfoResp.getRoom_auction().getAuction_list().addAll(messageEvent.getText().getAuction_list());
}

View File

@@ -199,20 +199,47 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
}
if (roomInfoResp.getSong_pit_list() != null && roomInfoResp.getSong_pit_list().size() > 0){
for (RoomPitBean roomPitBean : roomInfoResp.getSong_pit_list()){
if (roomPitBean.getUser_id().equals(SpUtil.getUserId() + "")){
if (roomInfoResp.getSong_pit_list() != null && roomInfoResp.getSong_pit_list().size() > 0) {
for (RoomPitBean roomPitBean : roomInfoResp.getSong_pit_list()) {
if (roomPitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
if (parentFragment != null) {
parentFragment.setRoleType(3, Integer.parseInt(roomPitBean.getPit_number()!=null?roomPitBean.getPit_number():"99"));
parentFragment.setRoleType(3, Integer.parseInt(roomPitBean.getPit_number() != null ? roomPitBean.getPit_number() : "99"));
parentFragment.switchMic(2);
}
}
}
}
sv();
tzblChanged();
}
protected void tzblChanged() {
StringBuilder userIds = new StringBuilder();
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
String userId = roomInfoResp.getRoom_info().getPit_list().get(i).getUser_id();
if (userId != null && !userId.equals("0") && !userId.isEmpty()) {
if (userIds.length() > 0) {
userIds.append(",");
}
userIds.append(userId);
}
}
RoomPitBean roomPitBean =mBinding.muYc.pitBean;
if (roomPitBean != null && roomPitBean.getUser_id() != null && !roomPitBean.getUser_id().equals("0") && !roomPitBean.getUser_id().isEmpty()){
if (userIds.length() > 0){
userIds.append(",");
}
userIds.append(roomPitBean.getUser_id());
}
if (userIds.length() > 0 && roomInfoResp.getRoom_info().getRoom_id() != null) {
MvpPre.userOnlineStatus(userIds.toString(), roomInfoResp.getRoom_info().getRoom_id());
}
}
private void sv() {
RoomDefaultWheatView roomDefaultWheatView = mBinding.muZc;
if (roomInfoResp.getSong_user_info() != null) {
@@ -220,10 +247,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
setVisibilityView(1);
} else if (roomInfoResp.getSong_user_info().getIs_hot() == 1) {
setVisibilityView(1);
}else if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "") && roomDefaultWheatView.getUserId().equals(SpUtil.getUserId() + "")){
} else if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "") && roomDefaultWheatView.getUserId().equals(SpUtil.getUserId() + "")) {
setVisibilityView(4);
}
else if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
} else if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
setVisibilityView(2);
} else {
setVisibilityView(3);
@@ -237,9 +263,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
if (roomDefaultWheatView.getUserId().equals(SpUtil.getUserId() + "")) {
if (mBinding.muYc.getUserId().equals(SpUtil.getUserId() + "")){
if (mBinding.muYc.getUserId().equals(SpUtil.getUserId() + "")) {
setVisibilityView(4);
}else {
} else {
setVisibilityView(1);
}
}
@@ -281,7 +307,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
public void onClick(View v) {
RoomDefaultWheatView roomDefaultWheatView = (RoomDefaultWheatView) v;
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), roomDefaultWheatView.getUserId(), roomDefaultWheatView.pitNumber, getHostUser(), false,2,isNumberWhether(), getChildFragmentManager());
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), roomDefaultWheatView.getUserId(), roomDefaultWheatView.pitNumber, getHostUser(), false, 2, isNumberWhether(), getChildFragmentManager());
}
});
}
@@ -298,7 +324,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
public void onClick(View v) {
if (!muYc.getUserId().equals("")) {
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), muYc.getUserId(), muYc.pitNumber, getHostUser(), false,2,isNumberWhether(), getChildFragmentManager());
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), muYc.getUserId(), muYc.pitNumber, getHostUser(), false, 2, isNumberWhether(), getChildFragmentManager());
}
}
});
@@ -308,7 +334,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
public void onClick(View v) {
if (!muZc.getUserId().equals("")) {
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), muZc.getUserId(), muZc.pitNumber, getHostUser(), false,2,isNumberWhether(), getChildFragmentManager());
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), muZc.getUserId(), muZc.pitNumber, getHostUser(), false, 2, isNumberWhether(), getChildFragmentManager());
} else {
MvpPre.applyPit(roomInfoResp.getRoom_info().getRoom_id(), "9");
}
@@ -319,20 +345,22 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
public void onClick(View v) {
if (!muJb.getUserId().equals("")) {
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), muJb.getUserId(), muJb.pitNumber, getHostUser(), false,2,isNumberWhether(), getChildFragmentManager());
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), muJb.getUserId(), muJb.pitNumber, getHostUser(), false, 2, isNumberWhether(), getChildFragmentManager());
} else {
RoomOnlineDialogFragment.show(roomInfoResp.getRoom_info().getRoom_id(), "10", roomInfoResp.getUser_info(),roomInfoResp, getChildFragmentManager());
RoomOnlineDialogFragment.show(roomInfoResp.getRoom_info().getRoom_id(), "10", roomInfoResp.getUser_info(), roomInfoResp, getChildFragmentManager());
}
}
});
}
private int isNumberWhether() {
if (roomInfoResp.getUser_info().getPit_number()==9){
if (roomInfoResp.getUser_info().getPit_number() == 9) {
return 1;
}
return 0;
}
/**
* 这是判断当前用户是否是麦上房主、管理员、主持,不在主持麦的都是不同用户
*
@@ -344,16 +372,16 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
return 1;
} else if (roomInfoResp.getUser_info().getIs_management() == 1) {
return 2;
} else if (roomInfoResp.getUser_info().getIs_host() == 1){
} else if (roomInfoResp.getUser_info().getIs_host() == 1) {
return 3;
}else {
} else {
return 4;
}
} else {
if (roomInfoResp.getUser_info().getIs_room_owner() == 1) {
return 1;
}
if (roomInfoResp.getUser_info().getIs_management() == 1){
if (roomInfoResp.getUser_info().getIs_management() == 1) {
return 2;
}
if (roomInfoResp.getUser_info().getIs_host() == 1) {
@@ -382,7 +410,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
mBinding.llJs.setVisibility(View.GONE);
mBinding.llQg.setVisibility(View.GONE);
mBinding.llSz.setVisibility(View.GONE);
}else if (type == 4){
} else if (type == 4) {
mBinding.llBz.setVisibility(View.VISIBLE);
mBinding.llDs.setVisibility(View.GONE);
mBinding.llJs.setVisibility(View.VISIBLE);
@@ -410,7 +438,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
userInfo.setNickname(roomInfoResp.getSong_user_info().getNickname());
userInfo.setUser_id(Integer.parseInt(roomInfoResp.getSong_user_info().getUser_id()));
userInfo.setPit_number("0");
RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(),0, getParentFragmentManager());
RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(), 0, getParentFragmentManager());
} else if (id == R.id.ll_bz) {
if (isRotate) {
AgoraManager.getInstance(getActivity()).selectAudioTrack(0);
@@ -549,7 +577,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
if (mBinding.muZc.pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
parentFragment.setRoleType(2, -1);
parentFragment.switchMic(2);
}else {
} else {
parentFragment.setRoleType(0, 0);
parentFragment.switchMic(2);
}
@@ -593,6 +621,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
if (pitBean.getPit_number().equals("9")) {
RoomDefaultWheatView roomDefaultWheatView = mBinding.muZc;
@@ -619,7 +648,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
roomInfoResp.getSong_pit_list().add(pitBean);
}
adapter.setNewData(roomInfoResp.getSong_pit_list());
@@ -708,6 +737,44 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
}
adapter.setNewData(roomInfoResp.getSong_pit_list());
} else if (messageEvent.getMsgType() == 1035) {
RoomPitBean pitBean = mBinding.muZc.pitBean;
if (pitBean.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
mBinding.muZc.setData(pitBean);
}
RoomPitBean pitBean1 = mBinding.muJb.pitBean;
if (pitBean1.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
pitBean1.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
pitBean1.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
pitBean1.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean1.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean1.setDress(messageEvent.getText().getFromUserInfo().getDress());
mBinding.muJb.setData(pitBean1);
}
RoomPitBean pitBean2 = mBinding.muYc.pitBean;
if (pitBean2.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
pitBean2.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
pitBean2.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
pitBean2.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
pitBean2.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
pitBean2.setDress(messageEvent.getText().getFromUserInfo().getDress());
mBinding.muYc.setData(pitBean2);
}
for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
roomInfoResp.getSong_pit_list().get(i).setCharm(messageEvent.getText().getFromUserInfo().getCharm());
roomInfoResp.getSong_pit_list().get(i).setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
roomInfoResp.getSong_pit_list().get(i).setNickname(messageEvent.getText().getFromUserInfo().getNickname());
roomInfoResp.getSong_pit_list().get(i).setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
roomInfoResp.getSong_pit_list().get(i).setDress(messageEvent.getText().getFromUserInfo().getDress());
}
}
adapter.setNewData(roomInfoResp.getSong_pit_list());
}
}
@@ -795,6 +862,26 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
RoomPitBean pitBean= mBinding.muZc.pitBean;
RoomPitBean pitBean2= mBinding.muJb.pitBean;
RoomPitBean pitBean3= mBinding.muYc.pitBean;
for (UserOnlineStatusBean bean : list) {
if (pitBean != null && pitBean.getUser_id() != null && !pitBean.getUser_id().isEmpty()){
if (bean.getUser_id().equals(pitBean.getUser_id())){
mBinding.muZc.setOnlineStatus(bean);
}
}
if (pitBean2 != null && pitBean2.getUser_id() != null && !pitBean2.getUser_id().isEmpty()){
if (bean.getUser_id().equals(pitBean2.getUser_id())){
mBinding.muJb.setOnlineStatus(bean);
}
}
if (pitBean3 != null && pitBean3.getUser_id() != null && !pitBean3.getUser_id().isEmpty()){
if (bean.getUser_id().equals(pitBean3.getUser_id())){
mBinding.muYc.setOnlineStatus(bean);
}
}
}
}
}

View File

@@ -70,7 +70,9 @@ import com.qxcm.moduleutil.utils.logger.Logger;
import com.qxcm.moduleutil.widget.GifAvatarOvalView;
import com.qxcm.moduleutil.widget.RoomDefaultWheatView;
import com.qxcm.moduleutil.widget.RoomMakeWheatView;
import com.qxcm.moduleutil.widget.RoomSingSongWheatView;
import com.qxcm.moduleutil.widget.WheatLayoutManager;
import com.qxcm.moduleutil.widget.WheatLayoutSingManager;
import com.qxcm.moduleutil.widget.dialog.CommonDialog;
import org.greenrobot.eventbus.EventBus;
@@ -95,7 +97,8 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
protected RoomInfoResp roomInfoRespPk;
protected String pitNumber;//当前点击的麦序
protected CommonDialog commonDialog;
private WheatLayoutManager wheatLayoutManager;
// private WheatLayoutManager wheatLayoutManager;
private WheatLayoutSingManager wheatLayoutSingManager;
private WheatLayoutManager wheatLayoutManager1;
private WheatLayoutManager wheatLayoutManager2;
@@ -105,7 +108,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
private PopupWindow popupWindow;
CountDownTimer mCountDownTimer;
CountDownTimer mCountDownTimersta;
List<RoomPitBean> pitList ;
public static SingSongFragment newInstance(RoomInfoResp roomInfo) {
Bundle args = new Bundle();
args.putSerializable("roomInfo", roomInfo);
@@ -128,14 +131,30 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
@Override
protected void initData() {
pitList= new ArrayList<>();
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).setvisibTop(true);
}
// 初始化 PopupWindow
initPopupWindow();
isWhether();
tzblChanged();
}
private void initWheatLayout() {
if ( roomInfoRespPk==null|| roomInfoRespPk.getPk_info() == null){
for (int i=0;i<pitList.size();i++){
wheatLayoutSingManager.updateSingleWheat(roomInfoResp.getRoom_info().getPit_list().get(i),i+1);
}
}
// else {
// for (int i=0;i<pitList.size();i++){
// wheatLayoutManager1.updateSingleWheat(roomInfoResp.getRoom_info().getPit_list().get(i),i+1);
// }
//
// }
}
@@ -306,7 +325,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
}
if (userIds.length() > 0 && roomId != null) {
// MvpPre.userOnlineStatus(userIds.toString(), roomId);
MvpPre.userOnlineStatus(userIds.toString(), roomId);
} else {
updateWheatData();
}
@@ -321,10 +340,10 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
mBinding.flexboxLayout.setVisibility(View.VISIBLE);
mBinding.cl.setVisibility(View.GONE);
FlexboxLayout flexboxLayout = mBinding.flexboxLayout;
wheatLayoutManager = new WheatLayoutManager(requireContext(), flexboxLayout);
wheatLayoutManager.setOnWheatClickListener(new WheatLayoutManager.OnWheatClickListener() {
wheatLayoutSingManager = new WheatLayoutSingManager(requireContext(), flexboxLayout);
wheatLayoutSingManager.setOnWheatClickListener(new WheatLayoutSingManager.OnWheatClickListener() {
@Override
public void onWheatClick(RoomDefaultWheatView view, int pitNumber1) {
public void onWheatClick(RoomSingSongWheatView view, int pitNumber1) {
RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(pitNumber1 - 1);
// 可选:点击事件处理
@@ -350,17 +369,26 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
}
@Override
public void onMakeWheatClick(RoomDefaultWheatView view, int pitNumber) {
public void onMakeWheatClick(RoomSingSongWheatView view, int pitNumber) {
}
});
// List<RoomPitBean> pitList = new ArrayList<>();
// for (int i = 1; i <= 10; i++) {
// RoomPitBean pitBean = new RoomPitBean();
// pitBean.setPit_number("" + i);
// pitBean.setUser_id("0");
// pitBean.setCharm("");
// pitList.add(pitBean);
// }
// wheatLayoutSingManager.setWheatData(pitList);
// initWheatLayout();
if (!ObjectUtils.isEmpty(roomInfoResp.getRoom_info().getPit_list()) && roomInfoResp.getRoom_info().getPit_list().size() == 10) {
wheatLayoutManager.setWheatData(roomInfoResp.getRoom_info().getPit_list());
wheatLayoutSingManager.setWheatData(roomInfoResp.getRoom_info().getPit_list());
}
}
private void isWhether() {
@@ -368,10 +396,10 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
mBinding.flexboxLayout.setVisibility(View.VISIBLE);
mBinding.cl.setVisibility(View.GONE);
FlexboxLayout flexboxLayout = mBinding.flexboxLayout;
wheatLayoutManager = new WheatLayoutManager(requireContext(), flexboxLayout);
wheatLayoutManager.setOnWheatClickListener(new WheatLayoutManager.OnWheatClickListener() {
wheatLayoutSingManager = new WheatLayoutSingManager(requireContext(), flexboxLayout);
wheatLayoutSingManager.setOnWheatClickListener(new WheatLayoutSingManager.OnWheatClickListener() {
@Override
public void onWheatClick(RoomDefaultWheatView view, int pitNumber1) {
public void onWheatClick(RoomSingSongWheatView view, int pitNumber1) {
RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(pitNumber1 - 1);
// 可选:点击事件处理
@@ -399,15 +427,24 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
}
@Override
public void onMakeWheatClick(RoomDefaultWheatView view, int pitNumber) {
public void onMakeWheatClick(RoomSingSongWheatView view, int pitNumber) {
}
});
List<RoomPitBean> pitList = new ArrayList<>();
for (int i = 1; i <= 10; i++) {
RoomPitBean pitBean = new RoomPitBean();
pitBean.setPit_number("" + i);
pitBean.setUser_id("0");
pitBean.setCharm("");
pitList.add(pitBean);
}
wheatLayoutSingManager.setWheatData(pitList);
if (!ObjectUtils.isEmpty(roomInfoResp.getRoom_info().getPit_list()) && roomInfoResp.getRoom_info().getPit_list().size() == 10) {
wheatLayoutManager.setWheatData(roomInfoResp.getRoom_info().getPit_list());
wheatLayoutSingManager.setWheatData(roomInfoResp.getRoom_info().getPit_list());
}
// initWheatLayout();
} else {
mBinding.flexboxLayout.setVisibility(View.GONE);
mBinding.cl.setVisibility(View.VISIBLE);
@@ -585,9 +622,9 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
if (id == R.id.bt_sta) {
PkTimeDialogFragment.show(roomInfoRespPk.getPk_info().getPk_id(), getChildFragmentManager());
} else if (id == R.id.bt_stop) {
if (roomInfoRespPk.getPk_info().getPk_part().equals("3") && pkStatus==0){
if (roomInfoRespPk.getPk_info().getPk_part().equals("3") && pkStatus == 0) {
pkStutas();
}else {
} else {
MvpPre.endPk(roomInfoRespPk.getPk_info().getPk_id(), "3", SpUtil.getUserId() + "");
}
} else if (id == R.id.im_mkf) {
@@ -648,20 +685,20 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
@Override
public void setMutePit(String pitNumber, String is_mute) {
roomPitBean.setIs_mute(Integer.parseInt(is_mute.equals("2") ? "1" : "0"));
wheatLayoutManager.updateSingleWheat(roomPitBean, Integer.parseInt(pitNumber));
wheatLayoutSingManager.updateSingleWheat(roomPitBean, Integer.parseInt(pitNumber));
}
@Override
public void setLockPit(String pitNumber, String is_lock) {
roomPitBean.setIs_lock(Integer.parseInt(is_lock));
wheatLayoutManager.updateSingleWheat(roomPitBean, Integer.parseInt(pitNumber));
wheatLayoutSingManager.updateSingleWheat(roomPitBean, Integer.parseInt(pitNumber));
}
@Override
public void postRoomInfo(RoomInfoResp resp) {
roomInfoResp = resp;
isWhether2();
tzblChanged();
}
@Override
@@ -669,11 +706,13 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
roomInfoRespPk = resp;
// isWhether();
pkView();
tzblChanged();
}
@Override
public void postRoomInfoUp(RoomInfoResp resp) {
roomInfoResp = resp;
tzblChanged();
}
@Override
@@ -687,18 +726,13 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
if (list != null) {
for (int i = 0; i < list.size(); i++) {
EventBus.getDefault().post(list.get(i));
if ( roomInfoRespPk==null|| roomInfoRespPk.getPk_info() == null) {
wheatLayoutSingManager.updateSingleOnlineWheat(list.get(i));
}else{
wheatLayoutManager1.updateSingleOnlineWheat(list.get(i));
}
// EventBus.getDefault().post(list.get(i));
}
// handler.postDelayed(new Runnable() {
// @Override
// public void run() {
// for (int i = 0; i < list.size(); i++) {
// EventBus.getDefault().postSticky(list.get(i));
//// EventBus.getDefault().post(list.get(i));
// }
// }
// }, 10000); // 5秒后执行
}
}
@@ -760,6 +794,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
}
}
FlexboxLayout flexboxLayout2 = mBinding.flexboxLayout2;
flexboxLayout2.removeAllViews();
wheatLayoutManager2 = new WheatLayoutManager(requireContext(), flexboxLayout2);
for (RoomPitBean pitBean : roomInfoRespPk.getRoom_info().getPit_list()) {
pitBean.set_pk(true);
@@ -982,10 +1017,11 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
pitBean.setNickname(message.getText().getFromUserInfo().getNickname());
pitBean.setSex(message.getText().getFromUserInfo().getSex() + "");
pitBean.setCharm(message.getText().getFromUserInfo().getCharm());
pitBean.setDress(message.getText().getFromUserInfo().getDress());
roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(message.getText().getPit_number()) - 1, pitBean);
// if (roomInfoResp.getPk_info()==null) {
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
wheatLayoutManager.updateSingleWheat(pitBean, Integer.parseInt(message.getText().getPit_number()));
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(message.getText().getPit_number()));
} else {
wheatLayoutManager1.updateSingleWheat(pitBean, Integer.parseInt(message.getText().getPit_number()));
}
@@ -1010,9 +1046,10 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
pitBean.setNickname("");
pitBean.setSex("");
pitBean.setCharm("");
pitBean.setDress("");
roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(message.getText().getPit_number()) - 1, pitBean);
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
wheatLayoutManager.updateSingleWheat(pitBean, Integer.parseInt(message.getText().getPit_number()));
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(message.getText().getPit_number()));
} else {
wheatLayoutManager1.updateSingleWheat(pitBean, Integer.parseInt(message.getText().getPit_number()));
}
@@ -1032,7 +1069,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
pitBean.setCharm(message.getText().getToUserInfo().getCharm());
wheatLayoutManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
}
}
} else {
@@ -1059,7 +1096,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
} else {
mBinding.btSta.setVisibility(INVISIBLE);
}
parentFragment.setRoleType(5,-11);
parentFragment.setRoleType(5, -11);
}
} else if (message.getMsgType() == 1031) {
countDownTime(Long.parseLong(message.getText().getPk_end_times()), 1);
@@ -1069,13 +1106,15 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
// pkResultDialogFragment.show();
showCountDownDialog(requireContext(), message);
ivitTop(message);
parentFragment.setRoleType(3,-11);
parentFragment.setRoleType(3, -11);
} else if (message.getMsgType() == 1033) {
AgoraManager.getInstance(getContext()).leaveChannelEx(roomInfoRespPk.getRoom_info().getRoom_id(), SpUtil.getUserId());
MvpPre.postRoomInfo(roomId, "0", 2);
mBinding.imStart2.setVisibility(GONE);
mBinding.imStart.setVisibility(GONE);
parentFragment.setRoleType(3,-11);
parentFragment.setRoleType(3, -11);
roomInfoRespPk = null;
} else if (message.getMsgType() == 1015) {
String roomIdA = message.getText().getRoom_id_a();
String roomIdB = message.getText().getRoom_id_b();
@@ -1114,13 +1153,25 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
} else if (message.getMsgType() == 1021) {
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
pitBean.setCharm("0");
wheatLayoutManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
}
} else if (message.getMsgType() == 1037) {
// 对方想结束本次pk是否同意
if (message.getText().getPit_number().equals("9") && message.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
queren();
}
} else if (message.getMsgType() == 1035) {
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
if (pitBean.getUser_id().equals(message.getText().getFromUserInfo().getUser_id() + "")) {
pitBean.setCharm(message.getText().getFromUserInfo().getCharm());
pitBean.setAvatar(message.getText().getFromUserInfo().getAvatar());
pitBean.setNickname(message.getText().getFromUserInfo().getNickname());
pitBean.setSex(message.getText().getFromUserInfo().getSex() + "");
pitBean.setDress(message.getText().getFromUserInfo().getDress());
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
}
}
}
}
@@ -1162,16 +1213,16 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
mBinding.imStart2.setVisibility(View.VISIBLE);
mBinding.imStart.setVisibility(VISIBLE);
if (message.getText().getType() == 0) {
pkStatus=0;
pkStatus = 0;
mBinding.imStart.setImageResource(com.qxcm.moduleutil.R.mipmap.fail);
mBinding.imStart2.setImageResource(com.qxcm.moduleutil.R.mipmap.victory);
} else if (message.getText().getType() == 1) {
pkStatus=1;
pkStatus = 1;
mBinding.imStart.setImageResource(com.qxcm.moduleutil.R.mipmap.victory);
mBinding.imStart2.setImageResource(com.qxcm.moduleutil.R.mipmap.fail);
} else if (message.getText().getType() == 2) {
pkStatus=2;
pkStatus = 2;
mBinding.imStart.setImageResource(com.qxcm.moduleutil.R.mipmap.ping);
mBinding.imStart2.setImageResource(com.qxcm.moduleutil.R.mipmap.ping);
}

View File

@@ -83,4 +83,9 @@ public class RoomAuctionPresenter extends BasePresenter<RoomAuctionContacts.View
public void auctionMode(String roomId, String labelId) {
}
@Override
public void userOnlineStatus(String userId, String roomid) {
}
}

View File

@@ -4,11 +4,14 @@ import android.content.Context;
import com.example.moduleroom.contacts.RoomAuctionContacts;
import com.qxcm.moduleutil.bean.RoomTime;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.AuctionBean;
import com.qxcm.moduleutil.http.BaseObserver;
import com.qxcm.moduleutil.http.RetrofitClient;
import com.qxcm.moduleutil.presenter.BasePresenter;
import java.util.List;
import io.reactivex.disposables.Disposable;
public class RoomAuctionPresenterTow extends BasePresenter<RoomAuctionContacts.View> implements RoomAuctionContacts.IRoomDataListPre {
@@ -93,6 +96,19 @@ public class RoomAuctionPresenterTow extends BasePresenter<RoomAuctionContacts.V
}
});
}
@Override
public void userOnlineStatus(String userId, String roomid) {
api.userOnlineStatus(userId, roomid, new BaseObserver<List<UserOnlineStatusBean>>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(List<UserOnlineStatusBean> userOnlineStatusBean) {
MvpRef.get().userOnlineStatus(userOnlineStatusBean);
}
});
}
}

View File

@@ -27,6 +27,7 @@ import com.qxcm.moduleutil.rtc.RtcManager;
import com.qxcm.moduleutil.utils.GsonUtils;
import com.qxcm.moduleutil.utils.SpUtil;
import java.lang.ref.WeakReference;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
@@ -34,8 +35,10 @@ import java.util.List;
import io.reactivex.disposables.Disposable;
public class RoomPresenter extends BasePresenter<RoomContacts.View> implements RoomContacts.IRoomPre {
RoomContacts.View mView;
public RoomPresenter(RoomContacts.View view, Context context) {
super(view, context);
mView = view;
}
// TODO: 2025/6/10 加入房间
@@ -77,6 +80,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
// 2. 加入房间
// rtcCore.joinRoom(token, roomId, uid, enableMic);
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().roomInfo(resp);
}
@@ -109,6 +115,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(RoomOnline roomOnlineBeans) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().getRoomOnline(roomOnlineBeans);
}
});
@@ -124,6 +133,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().applyPit();
}
});
@@ -139,6 +151,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().downPit();
}
});
@@ -155,6 +170,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().applySong();
}
});
@@ -170,6 +188,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().agreeSong();
}
});
@@ -186,6 +207,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().agreeSong();
}
});
@@ -208,6 +232,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
SpUtil.setRtmToken(rtm_token);
int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
boolean enableMic = false; // 是否开启麦克风
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().postRoomInfo(roomInfoResp);
}
});
@@ -223,6 +250,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(List<RoomCharmRankBean> roomCharmRankBeans) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().getCharmRank(roomCharmRankBeans);
}
});
@@ -238,6 +268,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().changeSong();
}
});
@@ -253,6 +286,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String string) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().hostUserPit();
}
});
@@ -268,7 +304,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String string) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().quitRoom();
}
});
@@ -284,6 +322,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().userGuanzSuccess(s);
}
});
@@ -300,6 +341,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().acceptPk();
}
});
@@ -315,6 +359,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().clearUserCharm();
}
});
@@ -330,6 +377,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
@Override
public void onNext(List<UserOnlineStatusBean> userOnlineStatusBean) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().userOnlineStatus(userOnlineStatusBean);
}
});

View File

@@ -7,11 +7,15 @@ import com.qxcm.moduleutil.bean.room.RoomSettingBean;
import com.qxcm.moduleutil.http.BaseObserver;
import com.qxcm.moduleutil.presenter.BasePresenter;
import java.lang.ref.WeakReference;
import io.reactivex.disposables.Disposable;
public class RoomSettingPresenter extends BasePresenter<RoomSettingContacts.View> implements RoomSettingContacts.IRoomPre{
RoomSettingContacts.View mView;
public RoomSettingPresenter(RoomSettingContacts.View view, Context context) {
super(view, context);
mView = view;
}
@Override
@@ -24,6 +28,9 @@ public class RoomSettingPresenter extends BasePresenter<RoomSettingContacts.View
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().changeRoomSuccess(s, position,bean);
}
@@ -49,6 +56,9 @@ public class RoomSettingPresenter extends BasePresenter<RoomSettingContacts.View
@Override
public void onNext(String string) {
if (MvpRef==null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().changeRoomType(string);
}
});

View File

@@ -5,6 +5,7 @@ import android.content.Context;
import com.example.moduleroom.contacts.SingSongContacts;
import com.qxcm.moduleutil.base.BaseRoomPresenter;
import com.qxcm.moduleutil.base.CommonAppContext;
import com.qxcm.moduleutil.bean.PkSwTokenBean;
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
import com.qxcm.moduleutil.bean.room.RoomInfoResp;
import com.qxcm.moduleutil.http.BaseObserver;
@@ -86,9 +87,8 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
if (type==1) {
if (roomInfoResp.getPk_info() != null) {
if (number.equals("9")) {
postRoomSwToken(roomId,uid);
///添加多频道
AgoraManager.getInstance(getView().getSelfActivity())
.joinChannelEx(rtm_token, roomId, uid);
}
}
MvpRef.get().postRoomInfoPk(roomInfoResp);
@@ -133,4 +133,23 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
}
});
}
public void postRoomSwToken(String roomId,int uid) {
api.postRoomSwToken(roomId, new BaseObserver<PkSwTokenBean>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(PkSwTokenBean pkSwTokenBean) {
if (pkSwTokenBean!=null){
if (pkSwTokenBean.getAgora_token() != null){
AgoraManager.getInstance(getView().getSelfActivity())
.joinChannelEx(pkSwTokenBean.getAgora_token(), roomId, uid);
}
}
}
});
}
}

View File

@@ -61,6 +61,16 @@
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/room_top" />-->
<!-- <ScrollView-->
<!-- android:id="@+id/scrollView"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- app:layout_constraintTop_toBottomOf="@id/room_top"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent">-->
<FrameLayout
android:id="@+id/vp_room_pager"
android:layout_width="0dp"
@@ -70,8 +80,9 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/room_top" />
app:layout_constraintTop_toBottomOf="@id/room_top"
/>
<!-- </ScrollView>-->
<com.qxcm.moduleutil.widget.AvatarFrameView
android:id="@+id/svga_gift"
android:layout_width="0dp"

View File

@@ -496,13 +496,13 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <ViewStub-->
<!-- android:id="@+id/stub_buttons"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout="@layout/top_overlay_buttons"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<ViewStub
android:id="@+id/stub_buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="@layout/top_overlay_buttons"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -97,7 +97,8 @@
android:text="转币"
android:textColor="@color/white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>
<ImageView
android:id="@+id/kb"

View File

@@ -65,7 +65,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="460dp"
android:layout_height="match_parent"
android:background="@drawable/bg_room_gift"
android:paddingStart="@dimen/dp_16"
android:paddingTop="@dimen/dp_25"
@@ -150,7 +150,7 @@
android:layout_height="@dimen/dp_14"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:src="@mipmap/gift_t" />
android:src="@mipmap/jinb" />
<TextView
android:id="@+id/tv_reward_gift"

View File

@@ -137,8 +137,8 @@
<com.qxcm.moduleutil.widget.GifAvatarOvalView
android:id="@+id/room_rank_top3_headIcon"
android:layout_width="@dimen/dp_58"
android:layout_height="@dimen/dp_58"
android:layout_width="@dimen/dp_55"
android:layout_height="@dimen/dp_55"
app:layout_constraintBottom_toBottomOf="@id/view_top3"
app:layout_constraintEnd_toEndOf="@id/view_top3"
app:layout_constraintHorizontal_bias="0.5"
@@ -148,8 +148,8 @@
app:riv_oval="true" />
<ImageView
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_65"
android:background="@mipmap/rank_im_t3"
app:layout_constraintBottom_toBottomOf="@id/view_top3"
app:layout_constraintEnd_toEndOf="@id/view_top3"

View File

@@ -228,7 +228,7 @@
android:layout_marginTop="@dimen/dp_50"
android:background="@android:color/transparent"
android:layout="@layout/top_overlay_buttons"
android:visibility="gone"/>
/>
</RelativeLayout>
</layout>

View File

@@ -9,106 +9,137 @@
android:theme="@style/BaseAppTheme">
<activity
android:name=".activity.WithdrawalListActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.GiftBoxRecordActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.BindCardDetailsActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.BindCardActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.AlbumDetailActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.SettingActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.CreateAlbumActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.RealName1Activity"
android:exported="false" />
<activity
android:name=".activity.RevenueActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.DailyTasksActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.UserHomepageActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.MyBagActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.BriefIntroductionActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.ChangeNicknameActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.CurrencyExchangeActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.WithdrawalActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.RechargeActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.MyMoneyActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.EditUserInfoActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.EditUserActivity"
android:exported="false" />
<activity
android:name=".activity.ChangPassActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.PersonalityActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.RealDetailActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.RoomAllowanceDetailActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.RoomAllowanceActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.RoomDetailsActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.CreatedRoomActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.MyRoomActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.PhoneReplacementActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.ChangePasswordActivity"
android:exported="false" />
<activity
android:name=".activity.BlacklistActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.MessageReminderActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.NotificationActivity"
android:launchMode="singleTask"
android:exported="false" />
<activity
android:name=".activity.UnderageActivity"
android:launchMode="singleTask"
android:exported="true" />
</application>

View File

@@ -25,6 +25,8 @@ import com.qxcm.moduleutil.bean.GiftBoxBean;
import com.qxcm.moduleutil.bean.GiftName;
import com.qxcm.moduleutil.bean.TaskDataBean;
import com.qxcm.moduleutil.bean.TaskItem;
import com.qxcm.moduleutil.dialog.WebViewDialog;
import com.qxcm.moduleutil.service.MyRoomSingleton;
import com.qxcm.moduleutil.utils.ARouteConstants;
import com.qxcm.moduleutil.utils.SpUtil;
@@ -50,6 +52,12 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
@Override
protected void initData() {
}
@Override
protected void onResume() {
super.onResume();
MvpPre.tasksLihen();
}
@@ -75,6 +83,10 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/other/taskDesc");
intent.putExtra("title", "规则 ");
startActivity(intent);
// WebViewDialog webViewDialog=new WebViewDialog(this,"https://vespa.qxmier.com/web/index.html#/pages/other/taskDesc");
// webViewDialog.show();
});
mTaskBoxAdapter.setOnItemClickListener(position -> {
@@ -129,10 +141,18 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
public void onItemClick(TaskItem taskItem, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
if (taskItem.getTitle().equals("今日任务") || taskItem.getTitle().equals("平台任务")) {
if (item.getTask_status()==2) {
MvpPre.dailyTasksComplete(item.getTask_id() + "");
MvpPre.dailyTasksReceive(item.getTask_id() + "");
}
} else {
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("room_id", item.getFrom_id() + "").navigation();
if (item.getTask_status() == 2){
MvpPre.dailyTasksReceive(item.getTask_id() + "");
}else if (item.getTask_status() == 1) {
if (item.getTask_id() == 9) {
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", item.getFrom_id()).withString("taskId", item.getTask_id() + "").navigation();
} else {
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", item.getFrom_id()).withString("taskId", item.getTask_id() + "").navigation();
}
}
}
}
});

View File

@@ -1,22 +1,34 @@
package com.example.modulevocal.activity;
import static com.qxcm.moduleutil.utils.permission.PermissionUtils.TAG;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.modulevocal.R;
import com.example.modulevocal.adapter.UserPhotoWallAdapter;
@@ -26,7 +38,11 @@ import com.example.modulevocal.presenter.EditUserPresenter;
import com.luck.picture.lib.basic.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.engine.CropFileEngine;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.interfaces.OnExternalPreviewEventListener;
import com.luck.picture.lib.interfaces.OnPreviewInterceptListener;
import com.luck.picture.lib.interfaces.OnResultCallbackListener;
import com.qxcm.moduleutil.activity.BaseMvpActivity;
import com.qxcm.moduleutil.bean.BannerModel;
import com.qxcm.moduleutil.bean.HeatedBean;
@@ -41,11 +57,14 @@ import com.qxcm.moduleutil.utils.MyPictureParameterStyle;
import com.qxcm.moduleutil.utils.SpUtil;
import com.qxcm.moduleutil.widget.Constants;
import com.qxcm.moduleutil.widget.img.FullScreenUtil;
import com.qxcm.moduleutil.widget.picker.PictureSelectorUtil;
import com.stx.xhb.xbanner.XBanner;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.tencent.qcloud.tuicore.util.SPUtils;
import com.yalantis.ucrop.UCrop;
import com.yalantis.ucrop.UCropImageEngine;
import org.greenrobot.eventbus.EventBus;
@@ -72,7 +91,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
@Override
protected void onResume() {
super.onResume();
MvpPre.getUserHome(SpUtil.getUserId()+"");
MvpPre.getUserHome(SpUtil.getUserId() + "");
}
@Override
@@ -94,10 +113,10 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
String item = list.get(position);
int id = view.getId();
if (id == R.id.iv_close){
if (id == R.id.iv_close) {
uploadedUrls.remove(item);
updateAdapterData();
}else {
} else {
if (item.equals(UserPhotoWallAdapter.ADD_PHOTO)) {
// 点击的是“+”号,启动图片选择
startChoosePhoto(1, PictureConfig.REQUEST_CAMERA, false, 9);
@@ -128,7 +147,6 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
mBinding.rvUserHead.setOnClickListener(this::onClick);
}
private void onClick(View view) {
@@ -171,17 +189,53 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
// .forResult(requestCode); //结果回调onActivityResult code
PictureSelectorUtil pictureSelectorUtil = new PictureSelectorUtil();
PictureSelector.create(this)
.openGallery(mimeType)
.isGif(false)
.setImageEngine(GlideEngine.createGlideEngine())
.isGif(isVideo)
.setMaxSelectNum(type)
.isPreviewImage(true)
.isDisplayCamera(true)
.setOutputCameraDir(Constants.FILE_PATH)
.isOriginalSkipCompress(true)
.isPreviewImage(false)
.setImageEngine(GlideEngine.createGlideEngine())
.setImageEngine(GlideEngine.createGlideEngine()) // 选择器展示不出图片则添加
.setCropEngine(new CropFileEngine() {
@Override
public void onStartCrop(Fragment fragment, Uri srcUri, Uri destinationUri, ArrayList<String> dataSource, int requestCode) {
UCrop.Options options = pictureSelectorUtil.buildOptions();
UCrop uCrop = UCrop.of(srcUri, destinationUri, dataSource);
uCrop.withOptions(options);
uCrop.setImageEngine(new UCropImageEngine() {
@Override
public void loadImage(Context context, String url, ImageView imageView) {
// if (!ImageLoaderUtils.assertValidRequest(context)) {
// return;
// }
Glide.with(context).load(url).override(180, 180).into(imageView);
}
.forResult(requestCode); //结果回调onActivityResult code
@Override
public void loadImage(Context context, Uri url, int maxWidth, int maxHeight, OnCallbackListener<Bitmap> call) {
Glide.with(context).asBitmap().load(url).override(maxWidth, maxHeight).into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @org.jetbrains.annotations.Nullable Transition<? super Bitmap> transition) {
if (call != null) {
call.onCall(resource);
}
}
@Override
public void onLoadCleared(@org.jetbrains.annotations.Nullable Drawable placeholder) {
if (call != null) {
call.onCall(null);
}
}
});
}
});
uCrop.start(fragment.requireActivity(), fragment, requestCode);
}
})
.forResult(requestCode);
}
@@ -191,6 +245,8 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
if (resultCode == RESULT_OK && data != null) {
switch (requestCode) {
case PictureConfig.REQUEST_GO_SETTING:
PictureSelector.create(EditUserInfoActivity.this)
.openPreview() ;
List<LocalMedia> localMedia1 = PictureSelector.obtainSelectorList(data);
if (localMedia1 != null && localMedia1.size() != 0) {
LocalMedia imgMedia = localMedia1.get(0);
@@ -205,6 +261,9 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
break;
case PictureConfig.CHOOSE_REQUEST:
PictureSelector.create(EditUserInfoActivity.this)
.openPreview() ;
List<LocalMedia> localMedia = PictureSelector.obtainSelectorList(data);
if (localMedia != null && localMedia.size() != 0) {
LocalMedia imgMedia = localMedia.get(0);
@@ -218,6 +277,8 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
}
break;
case PictureConfig.REQUEST_CAMERA:
PictureSelector.create(EditUserInfoActivity.this)
.openPreview() ;
List<LocalMedia> localMediaList = PictureSelector.obtainSelectorList(data);
if (localMediaList != null && !localMediaList.isEmpty()) {
@@ -244,7 +305,6 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
}
@Override
public void getUserHomeSuccess(UserInfo userInfo) {
SpUtil.saveUserInfo(userInfo);
@@ -253,25 +313,25 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
mBinding.tvSex.setText(userInfo.getSex() == 1 ? "" : "");
mBinding.tvSr.setText(userInfo.getBirthday());
uploadedUrls.clear();
List<String> images =userInfo.getHome_bgimages()!=null && !userInfo.getHome_bgimages().isEmpty() ? Arrays.asList(userInfo.getHome_bgimages().split(",")):new ArrayList<>();
for (int i=0;i<images.size();i++) {
uploadedUrls.add( images.get(i));
List<String> images = userInfo.getHome_bgimages() != null && !userInfo.getHome_bgimages().isEmpty() ? Arrays.asList(userInfo.getHome_bgimages().split(",")) : new ArrayList<>();
for (int i = 0; i < images.size(); i++) {
uploadedUrls.add(images.get(i));
}
list.clear();
list.addAll(uploadedUrls);
list.add(UserPhotoWallAdapter.ADD_PHOTO); // 最后加上 ADD_PHOTO
mUserPhotoWallAdapter.setNewData(list);
userInfo1=userInfo;
List<XBannerData> s=new ArrayList<>();
if (userInfo.getHome_bgimages()==null||userInfo.getHome_bgimages().isEmpty()){
userInfo1 = userInfo;
List<XBannerData> s = new ArrayList<>();
if (userInfo.getHome_bgimages() == null || userInfo.getHome_bgimages().isEmpty()) {
if (userInfo.getAvatar()!=null) {
s.add(new XBannerData(0,userInfo.getAvatar(),""));
if (userInfo.getAvatar() != null) {
s.add(new XBannerData(0, userInfo.getAvatar(), ""));
}
mBinding.xbanner.setBannerData(s);
}else {
for (String s1 : uploadedUrls){
s.add(new XBannerData(0,s1,""));
} else {
for (String s1 : uploadedUrls) {
s.add(new XBannerData(0, s1, ""));
}
mBinding.xbanner.setBannerData(s);
}
@@ -279,7 +339,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
@Override
public void loadBanner(XBanner banner, Object model, View view, int position) {
XBannerData xBannerData= (XBannerData) model;
XBannerData xBannerData = (XBannerData) model;
ImageUtils.loadHeadCC(xBannerData.getUrl(), (ImageView) view);
}
});
@@ -296,7 +356,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
@Override
public void onError(int code, String desc) {
LogUtils.e("@@@", "描述"+desc);
LogUtils.e("@@@", "描述" + desc);
}
});
}
@@ -304,7 +364,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
@Override
public void editUserInfoSuccess(String s) {
ToastUtils.showShort(s);
MvpPre.getUserHome(SpUtil.getUserId()+"");
MvpPre.getUserHome(SpUtil.getUserId() + "");
}
@Override
@@ -318,7 +378,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
ImageUtils.loadHeadCC(url, mBinding.rvUserHead);
userInfo1.setAvatar(url);
EventBus.getDefault().post(userInfo1);
UserBean userBean =SpUtil.getUserBean();
UserBean userBean = SpUtil.getUserBean();
userBean.setAvatar(url);
EventBus.getDefault().post(userBean);
MvpPre.editUserInfo("", "", "", url, "", "", "");
@@ -337,6 +397,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
}
}
}
private void updateAdapterData() {
list.clear();
list.addAll(uploadedUrls); // 添加真实图片
@@ -346,6 +407,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
// MvpPre.editUserInfo("", "", "", "", imageUrlsString, "", "");
MvpPre.editUserBg(imageUrlsString);
}
@Override
public void selectDate(String year, String month, String day) {
mBinding.tvSr.setText(year + "-" + month + "-" + day);

View File

@@ -17,10 +17,14 @@ import com.example.modulevocal.databinding.ActivityMyMoneyBinding;
import com.example.modulevocal.presenter.MyMoneyPresenter;
import com.hjq.toast.ToastUtils;
import com.qxcm.moduleutil.activity.BaseMvpActivity;
import com.qxcm.moduleutil.bean.BindType;
import com.qxcm.moduleutil.bean.WalletBean;
import com.qxcm.moduleutil.utils.ARouteConstants;
import com.qxcm.moduleutil.utils.SpUtil;
import java.util.ArrayList;
import java.util.List;
/**
*@author qx
*@data 2025/5/21
@@ -28,6 +32,7 @@ import com.qxcm.moduleutil.utils.SpUtil;
*/
public class MyMoneyActivity extends BaseMvpActivity<MyMoneyPresenter, ActivityMyMoneyBinding> implements MyMoneyConactos.View {
private boolean isBind=false;
@Override
protected void initData() {
@@ -46,6 +51,7 @@ public class MyMoneyActivity extends BaseMvpActivity<MyMoneyPresenter, ActivityM
protected void onResume() {
super.onResume();
MvpPre.wallet();
MvpPre.bindType(SpUtil.getUserId() + "");
}
private void onClick(View view) {
@@ -63,7 +69,11 @@ public class MyMoneyActivity extends BaseMvpActivity<MyMoneyPresenter, ActivityM
startActivity(new Intent(this, PhoneReplacementActivity.class));
return;
}
if (isBind) {
startActivity(new Intent(this, WithdrawalActivity.class));
}else {
ToastUtils.show("请先绑定银行卡");
}
}else if (view.getId()==R.id.r_3){//钻石换币
startActivity(new Intent(this, CurrencyExchangeActivity.class));
}else if (view.getId()==R.id.r_1){//金币收支
@@ -94,4 +104,32 @@ public class MyMoneyActivity extends BaseMvpActivity<MyMoneyPresenter, ActivityM
mBinding.tv1.setText(walletBean.getCoin());
mBinding.tv2.setText(walletBean.getEarnings());
}
@Override
public void bindType(BindType bindType) {
List<BindType.AllData> allData = new ArrayList<>();
if (bindType.getAli().getIs_with_draw_open().equals("1")) {
allData.add(bindType.getAli());
}
if (bindType.getWx().getIs_with_draw_open().equals("1")) {
allData.add(bindType.getWx());
}
if (bindType.getBank().getIs_with_draw_open().equals("1")) {
allData.add(bindType.getBank());
}
if (bindType.getAli_tl().getIs_with_draw_open().equals("1")) {
allData.add(bindType.getAli_tl());
}
if (bindType.getWx_tl().getIs_with_draw_open().equals("1")) {
allData.add(bindType.getWx_tl());
}
for (BindType.AllData data : allData){
if (data.getIs_bind().equals("1")){
isBind=true;
break;
}
}
}
}

View File

@@ -9,6 +9,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.blankj.utilcode.util.ToastUtils;
import com.example.modulevocal.R;
import com.qxcm.moduleutil.adapter.PayMethodAdapter;
@@ -22,6 +23,7 @@ import com.qxcm.moduleutil.bean.AppPay;
import com.qxcm.moduleutil.bean.BindType;
import com.qxcm.moduleutil.bean.RechargeBean;
import com.qxcm.moduleutil.bean.WalletBean;
import com.qxcm.moduleutil.utils.ARouteConstants;
import com.qxcm.moduleutil.utils.SpUtil;
import com.qxcm.moduleutil.widget.PaymentUtil;
import com.tencent.liteav.base.Log;
@@ -38,6 +40,7 @@ import java.util.List;
* @data 2025/5/21
* @description: 充值
*/
@Route(path = ARouteConstants.RECHARGE_ACTIVITY)
public class RechargeActivity extends BaseMvpActivity<RechargePresenter, ActivityRechargeBinding> implements RechargeConactos.View {
private BalanceRechargeAdapter rechargeAdapter;

View File

@@ -91,6 +91,10 @@ public class RevenueActivity extends BaseMvpActivity<RevenuePresenter, ActivityR
}
@Override
public void finishRefreshLoadMore() {
}
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
private List<MyBagBean> list;

View File

@@ -119,7 +119,7 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
.setNegativeButton("取消", null).create().show();
}else if (view.getId() == R.id.ll_zhxiao){
new AlertDialog.Builder(this).setMessage("确定要注销账号吗?")
.setMessage("注销账号后所有的金币将要清零,是否要注销?")
.setMessage("注销后您当前的账户金币及钻石将无法找回,\n 30天内本账号将无法登陆请谨慎操作")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

View File

@@ -75,7 +75,9 @@ public class UserHomepageActivity extends BaseMvpActivity<UserHomepagePresenter,
@Override
public void setUserDetails(UserInfo data) {
if (data.getUser_id()==SpUtil.getUserId()) {
SpUtil.saveUserInfo(data);
}
List<String> homeBgimages = new ArrayList<>();
if (!TextUtils.isEmpty(data.getHome_bgimages())){
homeBgimages = Arrays.asList(data.getHome_bgimages().split(","));
@@ -102,7 +104,7 @@ public class UserHomepageActivity extends BaseMvpActivity<UserHomepagePresenter,
}
});
List<Fragment> fragments = new ArrayList<>();
fragments.add(UserHomepageFragment.newInstance(userId,type));
fragments.add(UserHomepageFragment.newInstance(data,type));
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(fragments, getSupportFragmentManager()));
}

Some files were not shown because too many files have changed in this diff Show More