封版羽声,作为最后的基础版
117
.idea/codeStyles/Project.xml
generated
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<codeStyleSettings language="XML">
|
||||||
|
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||||
|
<indentOptions>
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
</indentOptions>
|
||||||
|
<arrangement>
|
||||||
|
<rules>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:android</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:id</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>style</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
</rules>
|
||||||
|
</arrangement>
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
2
.idea/deploymentTargetSelector.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
<DropdownSelection timestamp="2025-07-19T03:34:24.516702300Z">
|
<DropdownSelection timestamp="2025-07-28T13:34:22.682062600Z">
|
||||||
<Target type="DEFAULT_BOOT">
|
<Target type="DEFAULT_BOOT">
|
||||||
<handle>
|
<handle>
|
||||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=6705124a" />
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=6705124a" />
|
||||||
|
|||||||
6
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
1
.idea/misc.xml
generated
@@ -1,4 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="NullableNotNullManager">
|
<component name="NullableNotNullManager">
|
||||||
|
|||||||
@@ -10,15 +10,16 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.qxcm.qxlive"
|
applicationId "com.qxcm.qxlive"
|
||||||
minSdk 24
|
minSdk 24
|
||||||
targetSdk 35
|
targetSdk 33
|
||||||
versionCode Integer.parseInt(project.findProperty("APP_VERSION_CODE"))
|
versionCode Integer.parseInt(project.findProperty("APP_VERSION_CODE"))
|
||||||
versionName project.findProperty("APP_VERSION_NAME")
|
versionName project.findProperty("APP_VERSION_NAME")
|
||||||
|
multiDexEnabled true
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
//设置支持的so库
|
//设置支持的so库
|
||||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
abiFilters 'arm64-v8a'
|
||||||
|
// abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||||
}
|
}
|
||||||
|
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
@@ -54,7 +55,7 @@ android {
|
|||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
|
||||||
@@ -117,11 +118,17 @@ android {
|
|||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = '17'
|
jvmTarget = '17'
|
||||||
}
|
}
|
||||||
|
dexOptions {
|
||||||
|
dexInProcess true
|
||||||
|
preDexLibraries true
|
||||||
|
javaMaxHeapSize "6g"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
|
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||||
|
// implementation fileTree(dir: '../LocalAar/aar_libs', include: ['*.jar', '*.aar'] dir: 'libs')
|
||||||
|
|
||||||
implementation libs.appcompat
|
implementation libs.appcompat
|
||||||
implementation libs.material
|
implementation libs.material
|
||||||
@@ -137,6 +144,10 @@ dependencies {
|
|||||||
implementation files('libs/logger-2.2.2-release.aar')
|
implementation files('libs/logger-2.2.2-release.aar')
|
||||||
implementation files('libs/main-2.2.3-release.aar')
|
implementation files('libs/main-2.2.3-release.aar')
|
||||||
|
|
||||||
|
implementation files('libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar')
|
||||||
|
implementation files('libs/WbCloudNormal-v5.1.10-4e3e198.aar')
|
||||||
|
|
||||||
|
|
||||||
implementation (libs.arouter.api.v150)
|
implementation (libs.arouter.api.v150)
|
||||||
//annotationProcessor
|
//annotationProcessor
|
||||||
annotationProcessor libs.arouter.compiler
|
annotationProcessor libs.arouter.compiler
|
||||||
|
|||||||
212091
app/proguard/mapping.txt
515408
app/proguard/seeds.txt
37
app/release/release/output-metadata.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.qxcm.qxlive",
|
||||||
|
"variantName": "release",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 9,
|
||||||
|
"versionName": "1.0.1.7",
|
||||||
|
"outputFile": "羽声_1.0.1.7_9.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File",
|
||||||
|
"baselineProfiles": [
|
||||||
|
{
|
||||||
|
"minApi": 28,
|
||||||
|
"maxApi": 30,
|
||||||
|
"baselineProfiles": [
|
||||||
|
"baselineProfiles/1/羽声_1.0.1.7_9.dm"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"minApi": 31,
|
||||||
|
"maxApi": 2147483647,
|
||||||
|
"baselineProfiles": [
|
||||||
|
"baselineProfiles/0/羽声_1.0.1.7_9.dm"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"minSdkVersionForDexing": 24
|
||||||
|
}
|
||||||
@@ -105,11 +105,16 @@
|
|||||||
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
|
||||||
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
|
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
|
||||||
tools:ignore="ProtectedPermissions" />
|
tools:ignore="ProtectedPermissions" />
|
||||||
|
|
||||||
|
<!-- 声明前台服务权限 -->
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="AppContext"
|
android:name="AppContext"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -122,7 +127,7 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppthemeActivity"
|
android:theme="@style/AppTheme"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:targetApi="tiramisu"
|
tools:targetApi="tiramisu"
|
||||||
@@ -175,6 +180,9 @@
|
|||||||
android:taskAffinity="com.qxcm.qxlive"
|
android:taskAffinity="com.qxcm.qxlive"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask">
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".RealNameActivity"
|
||||||
|
android:exported="false" />
|
||||||
</application>
|
</application>
|
||||||
<!-- <queries>-->
|
<!-- <queries>-->
|
||||||
<!-- <!– 支付宝 scheme –>-->
|
<!-- <!– 支付宝 scheme –>-->
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
|||||||
// BaseApplication.getInstance().checkInEmulator();
|
// BaseApplication.getInstance().checkInEmulator();
|
||||||
// BaseApplication.getInstance().initHeartBeat();
|
// BaseApplication.getInstance().initHeartBeat();
|
||||||
// //延迟1.5秒执行
|
// //延迟1.5秒执行
|
||||||
handler.postDelayed(runnable, 100);
|
handler.postDelayed(runnable, 2500);
|
||||||
// initLogin();
|
// initLogin();
|
||||||
} else {
|
} else {
|
||||||
PolicyDialog policyDialog = new PolicyDialog(this);
|
PolicyDialog policyDialog = new PolicyDialog(this);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.modulevocal.activity;
|
package com.qxcm.qxlive;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -9,22 +9,15 @@ import android.text.style.ForegroundColorSpan;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.core.graphics.Insets;
|
|
||||||
import androidx.core.view.ViewCompat;
|
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.blankj.utilcode.util.RegexUtils;
|
import com.blankj.utilcode.util.RegexUtils;
|
||||||
import com.example.modulevocal.R;
|
|
||||||
import com.example.modulevocal.conacts.RealNameConacts;
|
import com.example.modulevocal.conacts.RealNameConacts;
|
||||||
import com.example.modulevocal.databinding.ActivityRealNameBinding;
|
|
||||||
import com.example.modulevocal.presenter.RealNamePresenter;
|
import com.example.modulevocal.presenter.RealNamePresenter;
|
||||||
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
||||||
import com.qxcm.moduleutil.bean.RealNameBean;
|
import com.qxcm.moduleutil.bean.RealNameBean;
|
||||||
import com.qxcm.moduleutil.utils.ARouteConstants;
|
import com.qxcm.moduleutil.utils.ARouteConstants;
|
||||||
import com.qxcm.moduleutil.utils.SpUtil;
|
import com.qxcm.moduleutil.utils.SpUtil;
|
||||||
|
import com.qxcm.qxlive.databinding.ActivityRealNameBinding;
|
||||||
import com.tencent.cloud.huiyansdkface.facelight.api.WbCloudFaceContant;
|
import com.tencent.cloud.huiyansdkface.facelight.api.WbCloudFaceContant;
|
||||||
import com.tencent.cloud.huiyansdkface.facelight.api.WbCloudFaceVerifySdk;
|
import com.tencent.cloud.huiyansdkface.facelight.api.WbCloudFaceVerifySdk;
|
||||||
import com.tencent.cloud.huiyansdkface.facelight.api.listeners.WbCloudFaceVerifyLoginListener;
|
import com.tencent.cloud.huiyansdkface.facelight.api.listeners.WbCloudFaceVerifyLoginListener;
|
||||||
@@ -32,13 +25,14 @@ import com.tencent.cloud.huiyansdkface.facelight.api.listeners.WbCloudFaceVerify
|
|||||||
import com.tencent.cloud.huiyansdkface.facelight.api.result.WbFaceError;
|
import com.tencent.cloud.huiyansdkface.facelight.api.result.WbFaceError;
|
||||||
import com.tencent.cloud.huiyansdkface.facelight.api.result.WbFaceVerifyResult;
|
import com.tencent.cloud.huiyansdkface.facelight.api.result.WbFaceVerifyResult;
|
||||||
import com.tencent.cloud.huiyansdkface.facelight.process.FaceVerifyStatus;
|
import com.tencent.cloud.huiyansdkface.facelight.process.FaceVerifyStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@author qx
|
*@author qx
|
||||||
*@data 2025/7/15
|
*@data 2025/7/15
|
||||||
*@description: 实名认证
|
*@description: 实名认证
|
||||||
*/
|
*/
|
||||||
@Route(path = ARouteConstants.REAL_NAME_ACTIVITY)
|
@Route(path = ARouteConstants.REAL_NAME_ACTIVITY2)
|
||||||
public class RealName1Activity extends BaseMvpActivity<RealNamePresenter, ActivityRealNameBinding> implements RealNameConacts.View{
|
public class RealNameActivity extends BaseMvpActivity<RealNamePresenter, ActivityRealNameBinding> implements RealNameConacts.View{
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -98,11 +92,11 @@ public class RealName1Activity extends BaseMvpActivity<RealNamePresenter, Activi
|
|||||||
|
|
||||||
//避免用户快速点击导致二次登录,二次拉起刷脸等操作引起问题
|
//避免用户快速点击导致二次登录,二次拉起刷脸等操作引起问题
|
||||||
WbCloudFaceVerifySdk.getInstance().
|
WbCloudFaceVerifySdk.getInstance().
|
||||||
initAdvSdk(RealName1Activity.this, data, new WbCloudFaceVerifyLoginListener() {
|
initAdvSdk(RealNameActivity.this, data, new WbCloudFaceVerifyLoginListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLoginSuccess () {
|
public void onLoginSuccess () {
|
||||||
//登录成功,拉起 sdk 页面,由 FaceVerifyResultListener 返回刷脸结果
|
//登录成功,拉起 sdk 页面,由 FaceVerifyResultListener 返回刷脸结果
|
||||||
WbCloudFaceVerifySdk.getInstance().startWbFaceVerifySdk(RealName1Activity.this, new WbCloudFaceVerifyResultListener() {
|
WbCloudFaceVerifySdk.getInstance().startWbFaceVerifySdk(RealNameActivity.this, new WbCloudFaceVerifyResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish(WbFaceVerifyResult result) {
|
public void onFinish(WbFaceVerifyResult result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
@@ -5,6 +5,12 @@
|
|||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
<item name="android:colorBackground">@color/background</item>
|
<item name="android:colorBackground">@color/background</item>
|
||||||
|
<item name="android:textColor">@color/color_1F1C1F</item>
|
||||||
|
<item name="android:textColorHint">@color/color_FF999999</item>
|
||||||
|
<item name="android:windowBackground">@color/color_F9FAFA</item>
|
||||||
|
<item name="android:windowTranslucentStatus">false</item>
|
||||||
|
<item name="android:windowLightStatusBar">true</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LauncherAppTheme" parent="AppTheme">
|
<style name="LauncherAppTheme" parent="AppTheme">
|
||||||
@@ -18,6 +24,10 @@
|
|||||||
<item name="android:windowAllowReturnTransitionOverlap">false</item>
|
<item name="android:windowAllowReturnTransitionOverlap">false</item>
|
||||||
<item name="android:windowEnterTransition">@null</item>
|
<item name="android:windowEnterTransition">@null</item>
|
||||||
<item name="android:windowExitTransition">@null</item>
|
<item name="android:windowExitTransition">@null</item>
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||||
|
<item name="android:windowTranslucentStatus">false</item>
|
||||||
|
<item name="android:windowLightStatusBar">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="dialog" parent="AppTheme">
|
<style name="dialog" parent="AppTheme">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermsize=512m -Xx:+HeapDumponOutofMemoryError -Dfile.encoding=UTF-8
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. For more details, visit
|
# This option should only be used with decoupled projects. For more details, visit
|
||||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||||
@@ -25,16 +25,20 @@ arouter.register.auto=true
|
|||||||
|
|
||||||
isBuildModule=false
|
isBuildModule=false
|
||||||
|
|
||||||
org.gradle.parallel=false
|
#org.gradle.parallel=false
|
||||||
org.gradle.deamon=false
|
#org.gradle.deamon=false
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
|
|
||||||
APP_VERSION_NAME=1.0.5
|
APP_VERSION_NAME=1.0.1.7
|
||||||
APP_VERSION_CODE=6
|
APP_VERSION_CODE=9
|
||||||
|
|
||||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||||
|
org.gradle.parallel=true
|
||||||
|
org.gradel.daemon=true
|
||||||
|
org.gradel.configureondemand=true
|
||||||
|
aaptOptions.cruncherEnabled false
|
||||||
|
aaptOptions.useNewCruncher false
|
||||||
|
|
||||||
#android.enableR8=true
|
#android.enableR8=true
|
||||||
#isModule
|
#isModule
|
||||||
|
|||||||
@@ -82,19 +82,19 @@ com-github-bumptech-glide-glide = { module = "com.github.bumptech.glide:glide",
|
|||||||
com-github-mmin18-realtimeblurview = { module = "com.github.mmin18:realtimeblurview", version.ref = "githubRealtimeblurviewVersion" }
|
com-github-mmin18-realtimeblurview = { module = "com.github.mmin18:realtimeblurview", version.ref = "githubRealtimeblurviewVersion" }
|
||||||
com-github-zhpanvip-bannerviewpager = { module = "com.github.zhpanvip:bannerviewpager", version.ref = "githubBannerviewpagerVersion" }
|
com-github-zhpanvip-bannerviewpager = { module = "com.github.zhpanvip:bannerviewpager", version.ref = "githubBannerviewpagerVersion" }
|
||||||
com-jacktuotuo-customview-verificationcodeview3 = { module = "com.jacktuotuo.customview:verificationcodeview", version.ref = "comJacktuotuoCustomviewVerificationcodeview2" }
|
com-jacktuotuo-customview-verificationcodeview3 = { module = "com.jacktuotuo.customview:verificationcodeview", version.ref = "comJacktuotuoCustomviewVerificationcodeview2" }
|
||||||
com-liulishuo-okdownload-filedownloader4 = { module = "com.liulishuo.okdownload:filedownloader", version.ref = "comLiulishuoOkdownloadFiledownloader3" }
|
#com-liulishuo-okdownload-filedownloader4 = { module = "com.liulishuo.okdownload:filedownloader", version.ref = "comLiulishuoOkdownloadFiledownloader3" }
|
||||||
com-liulishuo-okdownload-okhttp4 = { module = "com.liulishuo.okdownload:okhttp", version.ref = "comLiulishuoOkdownloadOkhttp3" }
|
#com-liulishuo-okdownload-okhttp4 = { module = "com.liulishuo.okdownload:okhttp", version.ref = "comLiulishuoOkdownloadOkhttp3" }
|
||||||
com-liulishuo-okdownload-sqlite4 = { module = "com.liulishuo.okdownload:sqlite", version.ref = "comLiulishuoOkdownloadSqlite3" }
|
#com-liulishuo-okdownload-sqlite4 = { module = "com.liulishuo.okdownload:sqlite", version.ref = "comLiulishuoOkdownloadSqlite3" }
|
||||||
com-liulishuo-okdownload-okdownload6 = { module = "com.liulishuo.okdownload:okdownload", version.ref = "comLiulishuoOkdownloadOkdownload4" }
|
#com-liulishuo-okdownload-okdownload6 = { module = "com.liulishuo.okdownload:okdownload", version.ref = "comLiulishuoOkdownloadOkdownload4" }
|
||||||
custompopwindow = { module = "com.github.pinguo-zhouwei:CustomPopwindow", version.ref = "custompopwindow" }
|
#custompopwindow = { module = "com.github.pinguo-zhouwei:CustomPopwindow", version.ref = "custompopwindow" }
|
||||||
databinding-runtime-v702 = { module = "androidx.databinding:databinding-runtime", version.ref = "databindingRuntimeVersion" }
|
databinding-runtime-v702 = { module = "androidx.databinding:databinding-runtime", version.ref = "databindingRuntimeVersion" }
|
||||||
dpa-oss-android-sdk = { module = "com.aliyun.dpa:oss-android-sdk", version.ref = "ossAndroidSdkVersion" }
|
dpa-oss-android-sdk = { module = "com.aliyun.dpa:oss-android-sdk", version.ref = "ossAndroidSdkVersion" }
|
||||||
easy-protector-release = { module = "com.lahm.library:easy-protector-release", version.ref = "easyProtectorRelease" }
|
easy-protector-release = { module = "com.lahm.library:easy-protector-release", version.ref = "easyProtectorRelease" }
|
||||||
easypermissions = { module = "pub.devrel:easypermissions", version.ref = "easypermissions" }
|
easypermissions = { module = "pub.devrel:easypermissions", version.ref = "easypermissions" }
|
||||||
egame-animplayer = { module = "com.egame.vap:animplayer", version.ref = "egameAnimplayer" }
|
#egame-animplayer = { module = "com.egame.vap:animplayer", version.ref = "egameAnimplayer" }
|
||||||
github-photoview = { module = "com.github.chrisbanes:PhotoView", version.ref = "githubPhotoview" }
|
github-photoview = { module = "com.github.chrisbanes:PhotoView", version.ref = "githubPhotoview" }
|
||||||
github-shadowlayout = { module = "com.github.lihangleo2:ShadowLayout", version.ref = "githubShadowlayout" }
|
github-shadowlayout = { module = "com.github.lihangleo2:ShadowLayout", version.ref = "githubShadowlayout" }
|
||||||
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "githubGlide" }
|
#glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "githubGlide" }
|
||||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||||
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||||
@@ -105,7 +105,7 @@ marqueeview = { module = "com.sunfusheng:marqueeview", version.ref = "marqueevie
|
|||||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||||
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
||||||
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
||||||
arouter-api = { module = "com.alibaba:arouter-api", version.ref = "arouterApi" }
|
#arouter-api = { module = "com.alibaba:arouter-api", version.ref = "arouterApi" }
|
||||||
arouter-compiler = { module = "com.alibaba:arouter-compiler", version.ref = "arouterCompiler" }
|
arouter-compiler = { module = "com.alibaba:arouter-compiler", version.ref = "arouterCompiler" }
|
||||||
arouter-annotation = { module = "com.alibaba:arouter-annotation", version.ref = "arouterAnnotation" }
|
arouter-annotation = { module = "com.alibaba:arouter-annotation", version.ref = "arouterAnnotation" }
|
||||||
com-scwang-smartrefresh-smartrefreshheader = { module = "com.scwang.smartrefresh:SmartRefreshHeader", version.ref = "scwangSmartrefreshheader" }
|
com-scwang-smartrefresh-smartrefreshheader = { module = "com.scwang.smartrefresh:SmartRefreshHeader", version.ref = "scwangSmartrefreshheader" }
|
||||||
@@ -116,38 +116,38 @@ github-baserecyclerviewadapterhelper = { module = "com.github.CymChad:BaseRecycl
|
|||||||
hjq-toast = { module = "com.hjq:toast", version.ref = "toastVersion" }
|
hjq-toast = { module = "com.hjq:toast", version.ref = "toastVersion" }
|
||||||
jakewharton-retrofit2-kotlin-coroutines-adapter = { module = "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter", version.ref = "retrofit2KotlinCoroutinesAdapterVersion" }
|
jakewharton-retrofit2-kotlin-coroutines-adapter = { module = "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter", version.ref = "retrofit2KotlinCoroutinesAdapterVersion" }
|
||||||
greenrobot-eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbusVersion" }
|
greenrobot-eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbusVersion" }
|
||||||
greenrobot-eventbus-annotation-processor = { module = "org.greenrobot:eventbus-annotation-processor", version.ref = "eventbusAnnotationProcessorVersion" }
|
#greenrobot-eventbus-annotation-processor = { module = "org.greenrobot:eventbus-annotation-processor", version.ref = "eventbusAnnotationProcessorVersion" }
|
||||||
google-gson = { module = "com.google.code.gson:gson", version.ref = "gsonVersion" }
|
google-gson = { module = "com.google.code.gson:gson", version.ref = "gsonVersion" }
|
||||||
logger = { module = "com.orhanobut:logger", version.ref = "logger" }
|
logger = { module = "com.orhanobut:logger", version.ref = "logger" }
|
||||||
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
|
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
|
||||||
numberprogressbar-library = { module = "com.daimajia.numberprogressbar:library", version.ref = "libraryVersion" }
|
#numberprogressbar-library = { module = "com.daimajia.numberprogressbar:library", version.ref = "libraryVersion" }
|
||||||
okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptorVersion" }
|
okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptorVersion" }
|
||||||
persistentcookiejar = { module = "com.github.franmontiel:PersistentCookieJar", version.ref = "persistentcookiejar" }
|
persistentcookiejar = { module = "com.github.franmontiel:PersistentCookieJar", version.ref = "persistentcookiejar" }
|
||||||
pictureselector-picture_library = { module = "com.github.LuckSiege.PictureSelector:picture_library", version.ref = "picture_libraryVersion" }
|
#pictureselector-picture_library = { module = "com.github.LuckSiege.PictureSelector:picture_library", version.ref = "picture_libraryVersion" }
|
||||||
reactivex-rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "reactivexRxjava" }
|
reactivex-rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "reactivexRxjava" }
|
||||||
roundedimageview = { module = "com.makeramen:roundedimageview", version.ref = "roundedimageview" }
|
roundedimageview = { module = "com.makeramen:roundedimageview", version.ref = "roundedimageview" }
|
||||||
rxandroid = { module = "io.reactivex.rxjava2:rxandroid", version.ref = "rxandroid" }
|
rxandroid = { module = "io.reactivex.rxjava2:rxandroid", version.ref = "rxandroid" }
|
||||||
singledateandtimepicker = { module = "com.github.florent37:singledateandtimepicker", version.ref = "singledateandtimepicker" }
|
#singledateandtimepicker = { module = "com.github.florent37:singledateandtimepicker", version.ref = "singledateandtimepicker" }
|
||||||
squareup-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "comSquareupRetrofit2Retrofit3" }
|
squareup-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "comSquareupRetrofit2Retrofit3" }
|
||||||
retrofit2-adapter-rxjava2 = { module = "com.squareup.retrofit2:adapter-rxjava2", version.ref = "comSquareupRetrofit2Retrofit3" }
|
retrofit2-adapter-rxjava2 = { module = "com.squareup.retrofit2:adapter-rxjava2", version.ref = "comSquareupRetrofit2Retrofit3" }
|
||||||
svgaplayer-android = { module = "com.github.yyued:SVGAPlayer-Android", version.ref = "svgaplayerAndroid" }
|
svgaplayer-android = { module = "com.github.yyued:SVGAPlayer-Android", version.ref = "svgaplayerAndroid" }
|
||||||
utilcode = { module = "com.blankj:utilcode", version.ref = "utilcode" }
|
utilcode = { module = "com.blankj:utilcode", version.ref = "utilcode" }
|
||||||
databinding-runtime = { group = "androidx.databinding", name = "databinding-runtime", version.ref = "databindingRuntime" }
|
#databinding-runtime = { group = "androidx.databinding", name = "databinding-runtime", version.ref = "databindingRuntime" }
|
||||||
datastore-core-android = { group = "androidx.datastore", name = "datastore-core-android", version.ref = "datastoreCoreAndroid" }
|
#datastore-core-android = { group = "androidx.datastore", name = "datastore-core-android", version.ref = "datastoreCoreAndroid" }
|
||||||
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
#lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
||||||
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
#activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||||
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
#compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||||
ui = { group = "androidx.compose.ui", name = "ui" }
|
#ui = { group = "androidx.compose.ui", name = "ui" }
|
||||||
ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
#ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
||||||
ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
#ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
||||||
ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
#ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
||||||
ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
#ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
||||||
ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
#ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
||||||
material3 = { group = "androidx.compose.material3", name = "material3" }
|
#material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||||
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||||
lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" }
|
lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" }
|
||||||
lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
|
lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
|
||||||
webpdecoder = { module = "com.zlc.glide:webpdecoder", version.ref = "webpdecoder" }
|
#webpdecoder = { module = "com.zlc.glide:webpdecoder", version.ref = "webpdecoder" }
|
||||||
wechat-sdk-android = { module = "com.tencent.mm.opensdk:wechat-sdk-android", version.ref = "wechatSdkAndroid" }
|
wechat-sdk-android = { module = "com.tencent.mm.opensdk:wechat-sdk-android", version.ref = "wechatSdkAndroid" }
|
||||||
xbanner = { module = "com.github.xiaohaibin:XBanner", version.ref = "xbanner" }
|
xbanner = { module = "com.github.xiaohaibin:XBanner", version.ref = "xbanner" }
|
||||||
zcw-togglebutton-library = { module = "com.zcw:togglebutton-library", version.ref = "togglebuttonLibraryVersion" }
|
zcw-togglebutton-library = { module = "com.zcw:togglebutton-library", version.ref = "togglebuttonLibraryVersion" }
|
||||||
@@ -158,6 +158,6 @@ androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version
|
|||||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||||
android-library = { id = "com.android.library", version.ref = "agp" }
|
android-library = { id = "com.android.library", version.ref = "agp" }
|
||||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" }
|
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" }
|
||||||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
|
#kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
|
||||||
alibaba-arouter = { id = "com.alibaba.arouter", version.ref = "arouter" }
|
#alibaba-arouter = { id = "com.alibaba.arouter", version.ref = "arouter" }
|
||||||
|
|
||||||
|
|||||||
1
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -4,4 +4,5 @@ distributionPath=wrapper/dists
|
|||||||
#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-all.zip
|
#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
#distributionUrl=file:///D:/Greadle/gradle-8.10.2-all.zip
|
||||||
distributionUrl=file:///D:/Greadle/gradle-8.7-bin.zip
|
distributionUrl=file:///D:/Greadle/gradle-8.7-bin.zip
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import android.os.CountDownTimer;
|
|||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
|
import android.text.method.PasswordTransformationMethod;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -44,6 +45,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
|||||||
private CountDownTimer mTimer;
|
private CountDownTimer mTimer;
|
||||||
public String mobile;
|
public String mobile;
|
||||||
private int type;//1:验证码登录2:密码登录
|
private int type;//1:验证码登录2:密码登录
|
||||||
|
boolean isPasswordVisible = false;
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
|
|
||||||
@@ -118,6 +120,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
|||||||
mBinding.ivZfb.setOnClickListener(this::onClick);
|
mBinding.ivZfb.setOnClickListener(this::onClick);
|
||||||
mBinding.ivWeixin.setOnClickListener(this::onClick);
|
mBinding.ivWeixin.setOnClickListener(this::onClick);
|
||||||
mBinding.tvSendCode.setOnClickListener(this::onClick);
|
mBinding.tvSendCode.setOnClickListener(this::onClick);
|
||||||
|
mBinding.ivEye.setOnClickListener(this::onClick);
|
||||||
|
|
||||||
if (mBinding.tvCodeText.getText().equals("切换密码登录")){
|
if (mBinding.tvCodeText.getText().equals("切换密码登录")){
|
||||||
type=1;
|
type=1;
|
||||||
@@ -168,11 +171,13 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
|||||||
mBinding.rlPassCode.setVisibility(VISIBLE);
|
mBinding.rlPassCode.setVisibility(VISIBLE);
|
||||||
mBinding.rlCode.setVisibility(View.GONE);
|
mBinding.rlCode.setVisibility(View.GONE);
|
||||||
mBinding.tvCodeText.setText("切换验证码登录");
|
mBinding.tvCodeText.setText("切换验证码登录");
|
||||||
|
mBinding.tvLoginText.setText("密码登录");
|
||||||
type=2;
|
type=2;
|
||||||
}else {
|
}else {
|
||||||
mBinding.rlPassCode.setVisibility(View.GONE);
|
mBinding.rlPassCode.setVisibility(View.GONE);
|
||||||
mBinding.rlCode.setVisibility(VISIBLE);
|
mBinding.rlCode.setVisibility(VISIBLE);
|
||||||
mBinding.tvCodeText.setText("切换密码登录");
|
mBinding.tvCodeText.setText("切换密码登录");
|
||||||
|
mBinding.tvLoginText.setText("验证码登录");
|
||||||
type=1;
|
type=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,9 +210,9 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (id == R.id.tv_yhxy) {
|
} else if (id == R.id.tv_yhxy) {
|
||||||
MvpPre.yhxy();
|
|
||||||
} else if (id == R.id.tv_ysxy) {
|
|
||||||
MvpPre.ysxl();
|
MvpPre.ysxl();
|
||||||
|
} else if (id == R.id.tv_ysxy) {
|
||||||
|
MvpPre.yhxy();
|
||||||
} else if (id == R.id.iv_zfb) {
|
} else if (id == R.id.iv_zfb) {
|
||||||
if (!mBinding.cbPrivacy.isChecked()) {
|
if (!mBinding.cbPrivacy.isChecked()) {
|
||||||
ToastUtils.show("请先勾选服务条款");
|
ToastUtils.show("请先勾选服务条款");
|
||||||
@@ -230,6 +235,18 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
|||||||
}
|
}
|
||||||
sendCodeSuccess(phone);
|
sendCodeSuccess(phone);
|
||||||
MvpPre.sendCode(phone, 1);
|
MvpPre.sendCode(phone, 1);
|
||||||
|
}else if (id == R.id.iv_eye) {
|
||||||
|
|
||||||
|
if (!isPasswordVisible) {
|
||||||
|
mBinding.edPassword.setInputType(android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
|
||||||
|
mBinding.ivEye.setImageResource(com.qxcm.moduleutil.R.mipmap.eye_visible); // 设置按钮文本为隐藏密码
|
||||||
|
} else {
|
||||||
|
mBinding.edPassword.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||||
|
mBinding.edPassword.setTransformationMethod(PasswordTransformationMethod.getInstance());
|
||||||
|
mBinding.ivEye.setImageResource(com.qxcm.moduleutil.R.mipmap.eye_close); // 设置按钮文本为显示密码
|
||||||
|
}
|
||||||
|
mBinding.edPassword.setSelection(mBinding.edPassword.getText().length()); // 将光标移动到文字末尾
|
||||||
|
isPasswordVisible = !isPasswordVisible; // 切换状态
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void wcLogin() {
|
private void wcLogin() {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import android.os.Bundle;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.alipay.sdk.app.AuthTask;
|
import com.alipay.sdk.app.AuthTask;
|
||||||
import com.blankj.utilcode.util.AppUtils;
|
import com.blankj.utilcode.util.AppUtils;
|
||||||
import com.blankj.utilcode.util.LogUtils;
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
@@ -21,6 +22,7 @@ import com.qxcm.moduleutil.base.CommonAppContext;
|
|||||||
import com.qxcm.moduleutil.bean.UserBean;
|
import com.qxcm.moduleutil.bean.UserBean;
|
||||||
import com.qxcm.moduleutil.http.BaseObserver;
|
import com.qxcm.moduleutil.http.BaseObserver;
|
||||||
import com.qxcm.moduleutil.presenter.BasePresenter;
|
import com.qxcm.moduleutil.presenter.BasePresenter;
|
||||||
|
import com.qxcm.moduleutil.utils.ARouteConstants;
|
||||||
import com.qxcm.moduleutil.utils.PreferencesUtils;
|
import com.qxcm.moduleutil.utils.PreferencesUtils;
|
||||||
import com.qxcm.moduleutil.utils.SpUtil;
|
import com.qxcm.moduleutil.utils.SpUtil;
|
||||||
import com.tencent.mm.opensdk.modelmsg.SendAuth;
|
import com.tencent.mm.opensdk.modelmsg.SendAuth;
|
||||||
@@ -40,16 +42,16 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendCode(String phoneNumber, int type) {
|
public void sendCode(String phoneNumber, int type) {
|
||||||
api.sendCode(phoneNumber,"default", new BaseObserver<Object>() {
|
api.sendCode(phoneNumber, "default", new BaseObserver<Object>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
addDisposable(d);
|
addDisposable(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(Object o) {
|
public void onNext(Object o) {
|
||||||
MvpRef.get().sendCodeSuccess1(o+"");
|
MvpRef.get().sendCodeSuccess1(o + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -58,14 +60,15 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录
|
* 登录
|
||||||
* @param mobile 手机号
|
*
|
||||||
|
* @param mobile 手机号
|
||||||
* @param password 密码
|
* @param password 密码
|
||||||
* @param code 验证码
|
* @param code 验证码
|
||||||
* @param type 1:手机号登录 2:密码登录
|
* @param type 1:手机号登录 2:密码登录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void login(String mobile, String password, String code, int type) {
|
public void login(String mobile, String password, String code, int type) {
|
||||||
if (type==1){
|
if (type == 1) {
|
||||||
api.login(mobile, code, new BaseObserver<List<UserBean>>() {
|
api.login(mobile, code, new BaseObserver<List<UserBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@@ -78,8 +81,8 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}else if (type==2){
|
} else if (type == 2) {
|
||||||
api.userLogin(mobile,password, new BaseObserver<List<UserBean>>(){
|
api.userLogin(mobile, password, new BaseObserver<List<UserBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
addDisposable(d);
|
addDisposable(d);
|
||||||
@@ -97,13 +100,14 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝登录
|
* 支付宝登录
|
||||||
|
*
|
||||||
* @param auth_code
|
* @param auth_code
|
||||||
* @param type type=1:微信登录;type=2:支付宝登录
|
* @param type type=1:微信登录;type=2:支付宝登录
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void oauthLogin(String auth_code, int type) {
|
public void oauthLogin(String auth_code, int type) {
|
||||||
api.authCode(auth_code,type, new BaseObserver<List<UserBean>>() {
|
api.authCode(auth_code, type, new BaseObserver<List<UserBean>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@@ -154,17 +158,18 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
public void detachView() {
|
public void detachView() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loginSuccess(List<UserBean> userBean) {
|
public void loginSuccess(List<UserBean> userBean) {
|
||||||
if (userBean==null) {
|
if (userBean == null) {
|
||||||
ToastUtils.showShort("登录失败请重试");
|
ToastUtils.showShort("登录失败请重试");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (userBean.size()==1) {
|
if (userBean.size() == 1) {
|
||||||
|
|
||||||
CommonAppContext.getInstance().setUser(userBean.get(0));
|
CommonAppContext.getInstance().setUser(userBean.get(0));
|
||||||
if (userBean.get(0).getAuth()==1){
|
if (userBean.get(0).getAuth() == 1) {
|
||||||
SpUtil.setRealName(true);
|
SpUtil.setRealName(true);
|
||||||
}else {
|
} else {
|
||||||
SpUtil.setRealName(false);
|
SpUtil.setRealName(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,9 +193,9 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
EventBus.getDefault().post(userBean.get(0));
|
EventBus.getDefault().post(userBean.get(0));
|
||||||
com.blankj.utilcode.util.ActivityUtils.startActivity(MainActivity.class);
|
com.blankj.utilcode.util.ActivityUtils.startActivity(MainActivity.class);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
Intent intent=new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), SwitchAccountsActivity.class);
|
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), SwitchAccountsActivity.class);
|
||||||
Bundle bundle=new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable("userBean", userBean.get(0));
|
bundle.putSerializable("userBean", userBean.get(0));
|
||||||
intent.putExtras(bundle);
|
intent.putExtras(bundle);
|
||||||
com.blankj.utilcode.util.ActivityUtils.startActivity(intent);
|
com.blankj.utilcode.util.ActivityUtils.startActivity(intent);
|
||||||
@@ -200,6 +205,7 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
// EventBus.getDefault().post(new SplashFinishEvent());
|
// EventBus.getDefault().post(new SplashFinishEvent());
|
||||||
// AppLog.setUserUniqueID(userBean.getUser_id()); // 设置您自己的账号体系ID, 并保证其唯一性 !
|
// AppLog.setUserUniqueID(userBean.getUser_id()); // 设置您自己的账号体系ID, 并保证其唯一性 !
|
||||||
}
|
}
|
||||||
|
|
||||||
public void authorization(String type) {
|
public void authorization(String type) {
|
||||||
|
|
||||||
if (type.equals("wx")) {
|
if (type.equals("wx")) {
|
||||||
@@ -212,7 +218,7 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
// req.scope = "snsapi_userinfo"; // 只能填 snsapi_userinfo
|
// req.scope = "snsapi_userinfo"; // 只能填 snsapi_userinfo
|
||||||
// req.state = "wechat_sdk_demo_test";
|
// req.state = "wechat_sdk_demo_test";
|
||||||
// api.sendReq(req);
|
// api.sendReq(req);
|
||||||
}else if (type.equals("zfb")){
|
} else if (type.equals("zfb")) {
|
||||||
// Map<String, String> result = authTask.authV2(authInfo, true);
|
// Map<String, String> result = authTask.authV2(authInfo, true);
|
||||||
api.authorization(new BaseObserver<String>() {
|
api.authorization(new BaseObserver<String>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -228,14 +234,13 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ysxl() {
|
public void ysxl() {
|
||||||
// ARouter.getInstance().build(ARouters.H5).withString("url", Constant.URL.URL_USER_YSXY).withString("title", "隐私协议").navigation();
|
ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void yhxy() {
|
public void yhxy() {
|
||||||
// ARouter.getInstance().build(ARouters.H5).withString("url", Constant.URL.URL_USER_YHXY).withString("title", "用户协议").navigation();
|
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 982 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
@@ -50,11 +50,11 @@ android {
|
|||||||
packagingOptions {
|
packagingOptions {
|
||||||
// exclude 'lib/arm64-v8a/libagora-fdkaac.so'
|
// exclude 'lib/arm64-v8a/libagora-fdkaac.so'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
|
||||||
|
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation libs.appcompat
|
implementation libs.appcompat
|
||||||
implementation libs.material
|
implementation libs.material
|
||||||
implementation libs.core.ktx
|
implementation libs.core.ktx
|
||||||
@@ -181,8 +181,13 @@ dependencies {
|
|||||||
//腾讯im
|
//腾讯im
|
||||||
api project(':tuichat')
|
api project(':tuichat')
|
||||||
annotationProcessor 'com.google.auto.service:auto-service:1.1.1'
|
annotationProcessor 'com.google.auto.service:auto-service:1.1.1'
|
||||||
api files('libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar')
|
// api files('libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar')
|
||||||
api files('libs/WbCloudNormal-v5.1.10-4e3e198.aar')
|
// api files('libs/WbCloudNormal-v5.1.10-4e3e198.aar')
|
||||||
|
|
||||||
|
// api project(':LocalAar')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 房间引擎
|
// 房间引擎
|
||||||
api "io.trtc.uikit:rtc_room_engine:latest.release"
|
api "io.trtc.uikit:rtc_room_engine:latest.release"
|
||||||
// rtc room engine 依赖 trtc sdk 和 im sdk
|
// rtc room engine 依赖 trtc sdk 和 im sdk
|
||||||
@@ -204,7 +209,7 @@ dependencies {
|
|||||||
|
|
||||||
api 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
|
api 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
|
||||||
api 'io.github.mayzs:paho.mqtt.android:1.2.1'
|
api 'io.github.mayzs:paho.mqtt.android:1.2.1'
|
||||||
|
// api project(':LocalAar')
|
||||||
|
|
||||||
//2. 云normal SDK,
|
//2. 云normal SDK,
|
||||||
//aar的名称,例如:WbCloudNormal-v5.1.10-123456789.aar,填入 'WbCloudNormal-v5.1.10-123456789.aar'
|
//aar的名称,例如:WbCloudNormal-v5.1.10-123456789.aar,填入 'WbCloudNormal-v5.1.10-123456789.aar'
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getWindow().getDecorView().setBackgroundResource(R.mipmap.activity_bj);
|
getWindow().getDecorView().setBackgroundResource(R.mipmap.activity_bj);
|
||||||
setContentView(getLayoutId());
|
setContentView(getLayoutId());
|
||||||
|
// 隐藏标题栏
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
}
|
||||||
mBinding = DataBindingUtil.setContentView(this, getLayoutId());
|
mBinding = DataBindingUtil.setContentView(this, getLayoutId());
|
||||||
mBinding.setLifecycleOwner(this);
|
mBinding.setLifecycleOwner(this);
|
||||||
ARouter.getInstance().inject(this);
|
ARouter.getInstance().inject(this);
|
||||||
@@ -66,35 +70,35 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置全屏模式,隐藏状态栏和导航栏
|
// // 设置全屏模式,隐藏状态栏和导航栏
|
||||||
View decorView = getWindow().getDecorView();
|
// View decorView = getWindow().getDecorView();
|
||||||
decorView.setSystemUiVisibility(
|
// decorView.setSystemUiVisibility(
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
// | View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public Resources getResources() {//禁止app字体大小跟随系统字体大小调节
|
|
||||||
// Resources resources = super.getResources();
|
|
||||||
// if (resources != null && resources.getConfiguration().fontScale != 1.0f) {
|
|
||||||
// android.content.res.Configuration configuration = resources.getConfiguration();
|
|
||||||
// configuration.fontScale = 1.0f;
|
|
||||||
// resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
|
||||||
// }
|
|
||||||
// return resources;
|
|
||||||
// }
|
|
||||||
static float fontScale = 1f;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Resources getResources() {
|
public Resources getResources() {//禁止app字体大小跟随系统字体大小调节
|
||||||
Resources resources = super.getResources();
|
Resources resources = super.getResources();
|
||||||
return DisplayUtil.getResources(this,resources,fontScale);
|
if (resources != null && resources.getConfiguration().fontScale != 1.0f) {
|
||||||
|
android.content.res.Configuration configuration = resources.getConfiguration();
|
||||||
|
configuration.fontScale = 1.0f;
|
||||||
|
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||||
|
}
|
||||||
|
return resources;
|
||||||
}
|
}
|
||||||
|
static float fontScale = 1f;
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public Resources getResources() {
|
||||||
|
// Resources resources = super.getResources();
|
||||||
|
// return DisplayUtil.getResources(this,resources,fontScale);
|
||||||
|
// }
|
||||||
|
|
||||||
public void setFontScale(float fontScale) {
|
public void setFontScale(float fontScale) {
|
||||||
this.fontScale = fontScale;
|
this.fontScale = fontScale;
|
||||||
@@ -117,6 +121,9 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
if (mBinding != null) {
|
if (mBinding != null) {
|
||||||
mBinding.unbind();
|
mBinding.unbind();
|
||||||
}
|
}
|
||||||
|
if (EventBus.getDefault().isRegistered(this)) {
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,22 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
LogUtils.e("@@@", "成功");
|
LogUtils.e("@@@", "成功");
|
||||||
|
// V2TIMManager.getConversationManager().getTotalUnreadMessageCount(new V2TIMValueCallback<Long>() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Long aLong) {
|
||||||
|
// if (aLong == 0) {
|
||||||
|
// EventBus.getDefault().post(new UnreadCountEvent(aLong));
|
||||||
|
// } else {
|
||||||
|
// mBinding.tvMessage.setVisibility(View.VISIBLE);
|
||||||
|
// }
|
||||||
|
// mBinding.tvMessage.setText(String.valueOf(aLong));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void onError(int code, String desc) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import androidx.core.view.ViewCompat;
|
|||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.blankj.utilcode.util.LogUtils;
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.qxcm.moduleutil.R;
|
import com.qxcm.moduleutil.R;
|
||||||
@@ -53,6 +54,7 @@ import java.util.Objects;
|
|||||||
* @data 2025/6/3
|
* @data 2025/6/3
|
||||||
* @description: webview公共方法
|
* @description: webview公共方法
|
||||||
*/
|
*/
|
||||||
|
@Route(path = ARouteConstants.H5)
|
||||||
public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBinding> {
|
public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBinding> {
|
||||||
|
|
||||||
public String title;
|
public String title;
|
||||||
@@ -180,14 +182,19 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
|
getWindow().getDecorView().setBackgroundResource(com.qxcm.moduleutil.R.color.white);
|
||||||
title = getIntent().getStringExtra("title");
|
title = getIntent().getStringExtra("title");
|
||||||
url = getIntent().getStringExtra("url");
|
url = getIntent().getStringExtra("url");
|
||||||
if (title.equals("举报") || title.equals("等级") || title.equals("公会") || title.equals("邀请") || title.equals("反馈")) {
|
if (title!=null) {
|
||||||
mBinding.topBar.setVisibility(GONE);
|
if (title.equals("举报") || title.equals("等级") || title.equals("公会") || title.equals("邀请") || title.equals("反馈")) {
|
||||||
|
mBinding.topBar.setVisibility(GONE);
|
||||||
// mBinding.webView.setPadding(0,20,0,0);
|
// mBinding.webView.setPadding(0,20,0,0);
|
||||||
} else {
|
} else {
|
||||||
mBinding.topBar.setVisibility(VISIBLE);
|
mBinding.topBar.setVisibility(VISIBLE);
|
||||||
mBinding.topBar.setTitle(title);
|
mBinding.topBar.setTitle(title);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
mBinding.topBar.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +272,7 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
|
|||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void enterAuthent() {//实名认证
|
public void enterAuthent() {//实名认证
|
||||||
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY).navigation();
|
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ import android.app.Activity;
|
|||||||
import com.qxcm.moduleutil.activity.IPresenter;
|
import com.qxcm.moduleutil.activity.IPresenter;
|
||||||
import com.qxcm.moduleutil.activity.IView;
|
import com.qxcm.moduleutil.activity.IView;
|
||||||
import com.qxcm.moduleutil.bean.NewsDataBean;
|
import com.qxcm.moduleutil.bean.NewsDataBean;
|
||||||
|
import com.qxcm.moduleutil.bean.NewsMessageList;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class NewsContacts {
|
public class NewsContacts {
|
||||||
public interface View extends IView<Activity> {
|
public interface View extends IView<Activity> {
|
||||||
|
void showNews(List<NewsMessageList> newsList);
|
||||||
void getOfficialNoticeList(List<NewsDataBean> newsDataBeans);
|
void finishRefresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
public interface IHomePre extends IPresenter {
|
public interface IHomePre extends IPresenter {
|
||||||
|
|
||||||
void getOfficialNotice(String page,String page_limit,String type);
|
void getMessagetitle(String type,String page,String pageLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,58 +3,35 @@ package com.qxcm.moduleutil.activity.news;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.qxcm.moduleutil.bean.NewsDataBean;
|
import com.qxcm.moduleutil.bean.NewsDataBean;
|
||||||
|
import com.qxcm.moduleutil.bean.NewsMessageList;
|
||||||
|
import com.qxcm.moduleutil.http.BaseObserver;
|
||||||
import com.qxcm.moduleutil.presenter.BasePresenter;
|
import com.qxcm.moduleutil.presenter.BasePresenter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
|
||||||
public class NewsPresenter extends BasePresenter<NewsContacts.View> implements NewsContacts.IHomePre {
|
public class NewsPresenter extends BasePresenter<NewsContacts.View> implements NewsContacts.IHomePre {
|
||||||
public NewsPresenter(NewsContacts.View view, Context context) {
|
public NewsPresenter(NewsContacts.View view, Context context) {
|
||||||
super(view, context);
|
super(view, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getOfficialNotice(String page, String page_limit, String type) {
|
|
||||||
// api.getOfficialNotice(page, page_limit, type, new BaseObserver<List<NewsDataBean>>() {
|
|
||||||
// @Override
|
|
||||||
// public void onSubscribe(Disposable d) {
|
|
||||||
// addDisposable(d);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onNext(List<NewsDataBean> newsDataBeans) {
|
|
||||||
// MvpRef.get().getOfficialNoticeList(newsDataBeans);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
List<NewsDataBean> newsDataBeans= new ArrayList<>();
|
@Override
|
||||||
if (type.equals("1")){
|
public void getMessagetitle(String type, String page, String pageLimit) {
|
||||||
for (int i = 0; i < 5; i++) {
|
api.getMessagetitle(type, page, pageLimit, new BaseObserver<List<NewsMessageList>>() {
|
||||||
NewsDataBean newsDataBean = new NewsDataBean();
|
@Override
|
||||||
newsDataBean.setId(i+"");
|
public void onSubscribe(Disposable d) {
|
||||||
newsDataBean.setTitle("系统消息"+i);
|
addDisposable(d);
|
||||||
newsDataBean.setContent("系统消息"+i);
|
MvpRef.get().finishRefresh();
|
||||||
newsDataBean.setType("1");
|
|
||||||
newsDataBean.setSource_id("1");
|
|
||||||
newsDataBean.setIs_read("1");
|
|
||||||
newsDataBean.setCreatetime("2019-09-09");
|
|
||||||
newsDataBean.setImage("");
|
|
||||||
newsDataBeans.add(newsDataBean);
|
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
for (int i = 0; i < 5; i++) {
|
@Override
|
||||||
NewsDataBean newsDataBean = new NewsDataBean();
|
public void onNext(List<NewsMessageList> newsMessageLists) {
|
||||||
newsDataBean.setId(i+"");
|
MvpRef.get().showNews(newsMessageLists);
|
||||||
newsDataBean.setTitle("官方公告"+i);
|
|
||||||
newsDataBean.setContent("官方公告"+i);
|
|
||||||
newsDataBean.setType("2");
|
|
||||||
newsDataBean.setSource_id("1");
|
|
||||||
newsDataBean.setIs_read("1");
|
|
||||||
newsDataBean.setCreatetime("2019-09-09");
|
|
||||||
newsDataBean.setImage("");
|
|
||||||
newsDataBeans.add(newsDataBean);
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
MvpRef.get().getOfficialNoticeList(newsDataBeans);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,17 @@ import android.view.View;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
import com.qxcm.moduleutil.R;
|
import com.qxcm.moduleutil.R;
|
||||||
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
||||||
import com.qxcm.moduleutil.bean.NewsDataBean;
|
import com.qxcm.moduleutil.bean.NewsDataBean;
|
||||||
|
import com.qxcm.moduleutil.bean.NewsMessageList;
|
||||||
import com.qxcm.moduleutil.databinding.ActivityOfficialNoticeBinding;
|
import com.qxcm.moduleutil.databinding.ActivityOfficialNoticeBinding;
|
||||||
|
import com.qxcm.moduleutil.utils.ARouteConstants;
|
||||||
import com.qxcm.moduleutil.utils.ImageUtils;
|
import com.qxcm.moduleutil.utils.ImageUtils;
|
||||||
|
import com.qxcm.moduleutil.utils.TimeUtils;
|
||||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||||
|
|
||||||
@@ -24,15 +28,15 @@ import java.util.List;
|
|||||||
public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, ActivityOfficialNoticeBinding> implements NewsContacts.View {
|
public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, ActivityOfficialNoticeBinding> implements NewsContacts.View {
|
||||||
|
|
||||||
private int page = 1;
|
private int page = 1;
|
||||||
private BaseQuickAdapter<NewsDataBean, BaseViewHolder> mAdapter;
|
private BaseQuickAdapter<NewsMessageList, BaseViewHolder> mAdapter;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
type=getIntent().getStringExtra("type");
|
type = getIntent().getStringExtra("type");
|
||||||
if (type.equals("1")){
|
if (type.equals("1")) {
|
||||||
mBinding.topBar.setTitle("系统消息");
|
mBinding.topBar.setTitle("系统消息");
|
||||||
}else {
|
} else {
|
||||||
mBinding.topBar.setTitle("官方公告");
|
mBinding.topBar.setTitle("官方公告");
|
||||||
}
|
}
|
||||||
// mBinding.smartRefreshLayout.autoRefresh();
|
// mBinding.smartRefreshLayout.autoRefresh();
|
||||||
@@ -42,40 +46,63 @@ public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, Activ
|
|||||||
@Override
|
@Override
|
||||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||||
page++;
|
page++;
|
||||||
MvpPre.getOfficialNotice(page+"", "10",type);
|
MvpPre.getMessagetitle(type, page + "", "10");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||||
page = 1;
|
page = 1;
|
||||||
MvpPre.getOfficialNotice(page+"", "10",type);
|
MvpPre.getMessagetitle(type, page + "", "10");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(this));
|
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
mAdapter = new BaseQuickAdapter<NewsDataBean, BaseViewHolder>(R.layout.news_rv_item_system_news) {
|
mAdapter = new BaseQuickAdapter<NewsMessageList, BaseViewHolder>(R.layout.news_rv_item_system_news) {
|
||||||
@Override
|
@Override
|
||||||
protected void convert(BaseViewHolder helper, NewsDataBean item) {
|
protected void convert(BaseViewHolder helper, NewsMessageList item) {
|
||||||
helper.setText(R.id.tv_sys_time, item.getCreatetime() );
|
String time = TimeUtils.getDateToStringNoZ(Long.parseLong(item.getCreatetime()) * 1000L);
|
||||||
helper.setText(R.id.tv_sys_con, Html.fromHtml(item.getTitle()));
|
helper.setText(R.id.tv_sys_time, time);
|
||||||
if (item.getType().equals("1")){
|
if (item.getImage()==null || item.getImage().isEmpty()){
|
||||||
|
helper.getView(R.id.tv_sys_con).setVisibility(VISIBLE);
|
||||||
|
helper.setText(R.id.tv_sys_con, item.getContent());
|
||||||
helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
||||||
}else if (item.getType().equals("2")){
|
}else {
|
||||||
helper.getView(R.id.tv_sys_con).setVisibility(GONE);
|
helper.getView(R.id.tv_sys_con).setVisibility(GONE);
|
||||||
helper.getView(R.id.ll_system_official).setVisibility(VISIBLE);
|
helper.getView(R.id.ll_system_official).setVisibility(VISIBLE);
|
||||||
}else {
|
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.image));
|
||||||
helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
helper.setText(R.id.tv_cont, Html.fromHtml(item.getContent()));
|
||||||
}
|
}
|
||||||
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.image));
|
helper.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
helper.getView(R.id.image).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (item.getRoom_id()>0){
|
||||||
|
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("room_id", item.getRoom_id() + "").navigation();
|
||||||
|
}else if (item.getRoom_id() == 0 && item.getUrl() != null && !item.getUrl().isEmpty()){
|
||||||
|
ARouter.getInstance().build(ARouteConstants.H5).withString("url", item.getUrl()).navigation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// if (item.getType().equals("1")) {
|
||||||
|
// helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
||||||
|
// } else if (item.getType().equals("2")) {
|
||||||
|
// helper.getView(R.id.tv_sys_con).setVisibility(GONE);
|
||||||
|
// helper.getView(R.id.ll_system_official).setVisibility(VISIBLE);
|
||||||
|
// } else {
|
||||||
|
// helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// helper.getView(R.id.image).setOnClickListener(new View.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(View v) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mBinding.recycleView.setAdapter(mAdapter);
|
mBinding.recycleView.setAdapter(mAdapter);
|
||||||
MvpPre.getOfficialNotice("1","10",type);
|
MvpPre.getMessagetitle(type, "1", "10");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,8 +115,15 @@ public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, Activ
|
|||||||
return new NewsPresenter(this, this);
|
return new NewsPresenter(this, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getOfficialNoticeList(List<NewsDataBean> newsDataBeans) {
|
public void showNews(List<NewsMessageList> newsList) {
|
||||||
mAdapter.setNewData(newsDataBeans);
|
mAdapter.setNewData(newsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finishRefresh() {
|
||||||
|
mBinding.smartRefreshLayout.finishRefresh();
|
||||||
|
mBinding.smartRefreshLayout.finishLoadMore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
package com.qxcm.moduleutil.adapter;
|
||||||
|
|
||||||
|
import static com.qxcm.moduleutil.utils.UtilConfig.getContext;
|
||||||
|
|
||||||
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.text.method.ScrollingMovementMethod;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.AppUtils;
|
||||||
|
import com.blankj.utilcode.util.ScreenUtils;
|
||||||
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
|
import com.qxcm.moduleutil.R;
|
||||||
|
import com.qxcm.moduleutil.bean.AppUpdateModel;
|
||||||
|
import com.qxcm.moduleutil.databinding.DialogAppUpdateBinding;
|
||||||
|
import com.qxcm.moduleutil.utils.DownloadListener;
|
||||||
|
import com.qxcm.moduleutil.utils.DownloadUtil;
|
||||||
|
import com.qxcm.moduleutil.utils.logger.Logger;
|
||||||
|
import com.qxcm.moduleutil.widget.dialog.BaseDialog;
|
||||||
|
|
||||||
|
public class AppUpdateDialog extends BaseDialog<DialogAppUpdateBinding> implements DownloadListener, View.OnClickListener {
|
||||||
|
|
||||||
|
private AppUpdateModel appUpdateModel;
|
||||||
|
private ProgressDialog mProgressDialog;
|
||||||
|
|
||||||
|
public AppUpdateDialog(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLayoutId() {
|
||||||
|
return R.layout.dialog_app_update;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView() {
|
||||||
|
Window window = getWindow();
|
||||||
|
window.setBackgroundDrawableResource(android.R.color.transparent);
|
||||||
|
window.setLayout((int) (ScreenUtils.getScreenWidth() * 305 / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||||
|
mBinding.tvContent.setMovementMethod(new ScrollingMovementMethod());
|
||||||
|
mBinding.btUpdate.setOnClickListener(this::onClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (appUpdateModel != null) {
|
||||||
|
mProgressDialog = new ProgressDialog(getContext()) {
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mProgressDialog.setMax(100);//设置最大值
|
||||||
|
mProgressDialog.setTitle("安装包下载");//设置标题
|
||||||
|
mProgressDialog.setIcon(R.mipmap.ic_launcher);//设置标题小图标
|
||||||
|
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);//设置样式为横向显示进度的样式
|
||||||
|
mProgressDialog.incrementProgressBy(0);//设置初始值为0,其实可以不用设置,默认就是0
|
||||||
|
mProgressDialog.setIndeterminate(false);//是否精确显示对话框,flase为是,反之为否
|
||||||
|
mProgressDialog.setCanceledOnTouchOutside(false);
|
||||||
|
mProgressDialog.setMessage("下载中请稍等!!!");
|
||||||
|
mProgressDialog.show();
|
||||||
|
DownloadUtil downloadUtil = new DownloadUtil(getContext());
|
||||||
|
downloadUtil.downloadFile(appUpdateModel.getUrl(), this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppUpdateModel(AppUpdateModel appUpdateModel) {
|
||||||
|
this.appUpdateModel = appUpdateModel;
|
||||||
|
mBinding.tvContent.setText(TextUtils.isEmpty(appUpdateModel.getContent()) ? "修复旧版本已知bug" : Html.fromHtml(appUpdateModel.getContent()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) {
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_SEARCH) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProgress(int currentLength) {
|
||||||
|
if (mProgressDialog != null) {
|
||||||
|
mProgressDialog.setProgress(currentLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish(String localPath) {
|
||||||
|
if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
||||||
|
mProgressDialog.dismiss();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
AppUtils.installApp(localPath);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.e("installAppError", e);
|
||||||
|
onFailure();
|
||||||
|
}
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure() {
|
||||||
|
ToastUtils.showShort("下载失败前往浏览器手动更新");
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
|
Uri url = Uri.parse(appUpdateModel.getUrl());
|
||||||
|
intent.setData(url);
|
||||||
|
getContext().startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package com.qxcm.moduleutil.adapter;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableStringBuilder;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.view.GestureDetector;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
|
import com.qxcm.moduleutil.R;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
|
import com.qxcm.moduleutil.event.RoomGiftClickToEvent;
|
||||||
|
import com.qxcm.moduleutil.event.RoomGiftPackToEvent;
|
||||||
|
import com.qxcm.moduleutil.utils.ImageUtils;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025年7月29日23:36:25$ $
|
||||||
|
* @Description 背包礼物适配器$
|
||||||
|
*/
|
||||||
|
public class GiftPackAdapter extends BaseAdapter {
|
||||||
|
private final List<GiftPackBean> mDatas;
|
||||||
|
private final LayoutInflater inflater;
|
||||||
|
private final Context mContext;
|
||||||
|
private final MyGestureDetector gestureDetector;
|
||||||
|
private final String type;
|
||||||
|
/**
|
||||||
|
* 页数下标,从0开始(当前是第几页)
|
||||||
|
*/
|
||||||
|
private final int curIndex;
|
||||||
|
/**
|
||||||
|
* 每一页显示的个数
|
||||||
|
*/
|
||||||
|
private final int pageSize = 100;
|
||||||
|
|
||||||
|
public GiftPackAdapter(Context context, List<GiftPackBean> mDatas, int curIndex, String type) {
|
||||||
|
inflater = LayoutInflater.from(context);
|
||||||
|
this.mDatas = mDatas;
|
||||||
|
this.curIndex = curIndex;
|
||||||
|
this.mContext = context;
|
||||||
|
this.type = type;
|
||||||
|
this.gestureDetector = new MyGestureDetector(mContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 先判断数据集的大小是否足够显示满本页?mDatas.size() > (curIndex+1)*pageSize,
|
||||||
|
* 如果够,则直接返回每一页显示的最大条目个数pageSize,
|
||||||
|
* 如果不够,则有几项返回几,(mDatas.size() - curIndex * pageSize);(也就是最后一页的时候就显示剩余item)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GiftPackBean getItem(int position) {
|
||||||
|
return mDatas.get(position + curIndex * pageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position + (long) curIndex * pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class MyGestureDetector extends GestureDetector {
|
||||||
|
private static WeakReference<GiftPackAdapter> sAdapter = new WeakReference<>(null);
|
||||||
|
private static GiftPackBean sGiftModel;
|
||||||
|
private GiftPackAdapter mAdapter;
|
||||||
|
private GiftPackBean mGiftModel;
|
||||||
|
public void setGiftModel(GiftPackAdapter adapter, GiftPackBean gift) {
|
||||||
|
sAdapter = new WeakReference<>(adapter);
|
||||||
|
sGiftModel = gift;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final SimpleOnGestureListener sSimpleOnGestureListener = new SimpleOnGestureListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||||
|
EventBus.getDefault().post(new RoomGiftPackToEvent(sAdapter.get(), sGiftModel, 1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onDoubleTap(MotionEvent e) {
|
||||||
|
EventBus.getDefault().post(new RoomGiftPackToEvent(sAdapter.get(), sGiftModel, 2));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public MyGestureDetector(Context context) {
|
||||||
|
super(context, sSimpleOnGestureListener);
|
||||||
|
setOnDoubleTapListener(sSimpleOnGestureListener);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
GiftPackAdapter.ViewHolder viewHolder;
|
||||||
|
GiftPackBean giftModel = getItem(position);
|
||||||
|
if (convertView == null) {
|
||||||
|
convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||||
|
viewHolder = new GiftPackAdapter.ViewHolder();
|
||||||
|
viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||||
|
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||||
|
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||||
|
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||||
|
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||||
|
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||||
|
|
||||||
|
convertView.setTag(viewHolder);
|
||||||
|
} else {
|
||||||
|
viewHolder = (GiftPackAdapter.ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
viewHolder.item_layout.setOnClickListener(v -> {
|
||||||
|
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||||
|
EventBus.getDefault().post(new RoomGiftPackToEvent(this, giftModel, 1));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//设置礼物名字
|
||||||
|
viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||||
|
//设置礼物价格
|
||||||
|
String surplusTxt = giftModel.getGift_price();
|
||||||
|
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||||
|
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||||
|
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||||
|
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||||
|
viewHolder.tv_gift_price.setText(stringBuilder);
|
||||||
|
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||||
|
|
||||||
|
//加载礼物图片
|
||||||
|
ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||||
|
//设置选中后的样式
|
||||||
|
|
||||||
|
if (giftModel.isChecked()) {//被选中
|
||||||
|
viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||||
|
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||||
|
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static class ViewHolder {
|
||||||
|
public ConstraintLayout item_layout;
|
||||||
|
public TextView tv_gift_name, tv_gift_price, tv_gift_num;
|
||||||
|
public ImageView iv_gift_pic;
|
||||||
|
public TextView tv_gift_change_love_values;
|
||||||
|
public ImageView ivDownOn;
|
||||||
|
public ConstraintLayout cl_iv_down_on;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -115,7 +115,7 @@ public class GiftTwoAdapter extends BaseAdapter {
|
|||||||
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||||
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||||
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||||
// viewHolder.tv_gift_num = convertView.findViewById(R.id.tv_gift_num);
|
viewHolder.tv_gift_num = convertView.findViewById(R.id.tv_number);
|
||||||
// viewHolder.tv_gift_change_love_values = convertView.findViewById(R.id.tv_gift_change_love_values);
|
// viewHolder.tv_gift_change_love_values = convertView.findViewById(R.id.tv_gift_change_love_values);
|
||||||
viewHolder.item_layout.setOnTouchListener((v, event) -> {
|
viewHolder.item_layout.setOnTouchListener((v, event) -> {
|
||||||
gestureDetector.setGiftModel(GiftTwoAdapter.this, (RoonGiftModel) v.getTag(R.id.id_gift_tag));
|
gestureDetector.setGiftModel(GiftTwoAdapter.this, (RoonGiftModel) v.getTag(R.id.id_gift_tag));
|
||||||
@@ -156,6 +156,9 @@ public class GiftTwoAdapter extends BaseAdapter {
|
|||||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||||
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||||
}
|
}
|
||||||
|
viewHolder.tv_gift_num.setText(String.format("x%s", giftModel.getNum()));
|
||||||
|
|
||||||
|
|
||||||
//设置
|
//设置
|
||||||
// //设置礼物心动值
|
// //设置礼物心动值
|
||||||
// if (giftModel.getCardiac().equals("0")) {
|
// if (giftModel.getCardiac().equals("0")) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.blankj.utilcode.util.ToastUtils;
|
|||||||
import com.qxcm.moduleutil.R;
|
import com.qxcm.moduleutil.R;
|
||||||
import com.qxcm.moduleutil.base.BaseMvpFragment;
|
import com.qxcm.moduleutil.base.BaseMvpFragment;
|
||||||
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
import com.qxcm.moduleutil.bean.RewardUserBean;
|
import com.qxcm.moduleutil.bean.RewardUserBean;
|
||||||
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
import com.qxcm.moduleutil.bean.WalletBean;
|
import com.qxcm.moduleutil.bean.WalletBean;
|
||||||
@@ -35,11 +36,13 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
private String id;
|
private String id;
|
||||||
private GiftTwoAdapter mAdapter;
|
private GiftTwoAdapter mAdapter;
|
||||||
private GiftRoomAdapter roomAdapter;
|
private GiftRoomAdapter roomAdapter;
|
||||||
|
private GiftPackAdapter packAdapter;
|
||||||
private String tag;
|
private String tag;
|
||||||
private int pageSize = 100;//一页显示的礼物个数
|
private int pageSize = 100;//一页显示的礼物个数
|
||||||
private int pageCount;//页数
|
private int pageCount;//页数
|
||||||
private int type;//1:房间点击进入的;2:打赏进入的
|
private int type;//1:房间点击进入的;2:打赏进入的
|
||||||
private List<RoonGiftModel> giftList=new ArrayList<>();
|
private List<RoonGiftModel> giftList=new ArrayList<>();
|
||||||
|
private List<GiftPackBean> giftPackList=new ArrayList<>();
|
||||||
|
|
||||||
public static GiftTwoDetailsFragment newInstance(String id,int type) {
|
public static GiftTwoDetailsFragment newInstance(String id,int type) {
|
||||||
|
|
||||||
@@ -71,7 +74,16 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
MvpPre.getGiftList(id,type);
|
if (id.equals("0")){
|
||||||
|
MvpPre.giftPack();
|
||||||
|
}else {
|
||||||
|
if (type==0) {
|
||||||
|
MvpPre.getGiftList("0", type);
|
||||||
|
}else {
|
||||||
|
MvpPre.getGiftList(id, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,6 +107,17 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GiftPackBean mGiftList() {
|
||||||
|
if (giftPackList != null) {
|
||||||
|
for (GiftPackBean item : giftPackList) {
|
||||||
|
if (item.isChecked()) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void setGiftList(List<RoonGiftModel> data,int type) {
|
public void setGiftList(List<RoonGiftModel> data,int type) {
|
||||||
if (type == 1){
|
if (type == 1){
|
||||||
@@ -139,6 +162,19 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void giftPack(List<GiftPackBean> giftPackBean) {
|
||||||
|
giftPackList=new ArrayList<>();
|
||||||
|
giftPackList.addAll(giftPackBean);
|
||||||
|
pageCount = (int) Math.ceil(giftPackBean.size() * 1.0 / pageSize);
|
||||||
|
for (int j = 0; j < pageCount; j++) {
|
||||||
|
// mAdapter = new GiftTwoAdapter(getActivity(), data, j, "0");
|
||||||
|
// mBinding.rvGift.setAdapter(mAdapter);
|
||||||
|
packAdapter = new GiftPackAdapter(getActivity(), giftPackBean, j, "0");
|
||||||
|
mBinding.rvGift.setAdapter(roomAdapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getRewardList(List<RewardUserBean> rewardUserBeanList) {
|
public void getRewardList(List<RewardUserBean> rewardUserBeanList) {
|
||||||
|
|
||||||
@@ -207,9 +243,12 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
for (int i = 0; i < giftList.size(); i++) {
|
for (int i = 0; i < giftList.size(); i++) {
|
||||||
RoonGiftModel giftModel = giftList.get(i);
|
RoonGiftModel giftModel = giftList.get(i);
|
||||||
if (giftModel.getGift_id().equals(id)) {
|
if (giftModel.getGift_id().equals(id)) {
|
||||||
if (!giftModel.isChecked()) {
|
if (giftModel.isChecked()) {
|
||||||
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type,event.gift));
|
giftModel.setChecked(false);
|
||||||
|
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type,null));
|
||||||
|
}else {
|
||||||
giftModel.setChecked(true);
|
giftModel.setChecked(true);
|
||||||
|
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type,event.gift));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
giftModel.setChecked(false);
|
giftModel.setChecked(false);
|
||||||
@@ -225,9 +264,12 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
RoonGiftModel giftModel = giftList.get(i);
|
RoonGiftModel giftModel = giftList.get(i);
|
||||||
if (giftModel.getGift_id().equals(id)) {
|
if (giftModel.getGift_id().equals(id)) {
|
||||||
selGift = giftModel;
|
selGift = giftModel;
|
||||||
if (!giftModel.isChecked()) {
|
if (giftModel.isChecked()) {
|
||||||
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type,event.gift));
|
giftModel.setChecked(false);
|
||||||
|
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type,null));
|
||||||
|
}else {
|
||||||
giftModel.setChecked(true);
|
giftModel.setChecked(true);
|
||||||
|
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type,event.gift));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
giftModel.setChecked(false);
|
giftModel.setChecked(false);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.qxcm.moduleutil.adapter;
|
package com.qxcm.moduleutil.adapter;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.GridView;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@@ -9,6 +10,7 @@ import com.qxcm.moduleutil.R;
|
|||||||
import com.qxcm.moduleutil.bean.BaseListData;
|
import com.qxcm.moduleutil.bean.BaseListData;
|
||||||
import com.qxcm.moduleutil.bean.HeatedBean;
|
import com.qxcm.moduleutil.bean.HeatedBean;
|
||||||
import com.qxcm.moduleutil.bean.HeavenGiftBean;
|
import com.qxcm.moduleutil.bean.HeavenGiftBean;
|
||||||
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
import com.zhpan.bannerview.BaseBannerAdapter;
|
import com.zhpan.bannerview.BaseBannerAdapter;
|
||||||
import com.zhpan.bannerview.BaseViewHolder;
|
import com.zhpan.bannerview.BaseViewHolder;
|
||||||
|
|
||||||
@@ -26,11 +28,11 @@ public class HeavenGiftAdapter extends BaseBannerAdapter<BaseListData> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void bindData(BaseViewHolder<BaseListData> holder, BaseListData data, int position, int pageSize) {
|
protected void bindData(BaseViewHolder<BaseListData> holder, BaseListData data, int position, int pageSize) {
|
||||||
GiftAdapter adapter = new GiftAdapter();
|
GiftTwoAdapter adapter = new GiftTwoAdapter(holder.itemView.getContext(), data.getData(), 0,"4");
|
||||||
RecyclerView recyclerView = holder.itemView.findViewById(R.id.recyclerView);
|
GridView recyclerView = holder.itemView.findViewById(R.id.rv_gift);
|
||||||
recyclerView.setLayoutManager(new GridLayoutManager(holder.itemView.getContext(), 4));
|
// recyclerView.setLayoutManager(new GridLayoutManager(holder.itemView.getContext(), 4));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
adapter.setNewData(data.getData());
|
// adapter.setNewData(data.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package com.example.modulevocal.adapter;
|
package com.qxcm.moduleutil.adapter;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
import com.example.modulevocal.R;
|
import com.qxcm.moduleutil.R;
|
||||||
import com.qxcm.moduleutil.bean.BindType;
|
import com.qxcm.moduleutil.bean.BindType;
|
||||||
import com.qxcm.moduleutil.utils.ImageUtils;
|
import com.qxcm.moduleutil.utils.ImageUtils;
|
||||||
|
|
||||||
@@ -2,6 +2,7 @@ package com.qxcm.moduleutil.base;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
@@ -13,6 +14,11 @@ import androidx.fragment.app.Fragment;
|
|||||||
|
|
||||||
import com.qxcm.moduleutil.activity.BaseAppCompatActivity;
|
import com.qxcm.moduleutil.activity.BaseAppCompatActivity;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment {
|
public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment {
|
||||||
protected VDB mBinding;
|
protected VDB mBinding;
|
||||||
|
|
||||||
@@ -44,6 +50,9 @@ public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment
|
|||||||
if (mBinding != null) {
|
if (mBinding != null) {
|
||||||
mBinding.unbind();
|
mBinding.unbind();
|
||||||
}
|
}
|
||||||
|
if (EventBus.getDefault().isRegistered(this)) {
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,4 +82,5 @@ public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment
|
|||||||
((BaseAppCompatActivity) getActivity()).disLoading();
|
((BaseAppCompatActivity) getActivity()).disLoading();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.qxcm.moduleutil.base;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
@@ -59,4 +60,5 @@ public abstract class BaseMvpFragment<P extends IPresenter, VDB extends ViewData
|
|||||||
public void disLoadings() {
|
public void disLoadings() {
|
||||||
// disLoading();
|
// disLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ import com.qxcm.moduleutil.R;
|
|||||||
import com.qxcm.moduleutil.bean.UserBean;
|
import com.qxcm.moduleutil.bean.UserBean;
|
||||||
import com.qxcm.moduleutil.event.AppLifecycleEvent;
|
import com.qxcm.moduleutil.event.AppLifecycleEvent;
|
||||||
import com.qxcm.moduleutil.interfaces.AppLifecycleUtil;
|
import com.qxcm.moduleutil.interfaces.AppLifecycleUtil;
|
||||||
|
import com.qxcm.moduleutil.listener.MessageListenerSingleton;
|
||||||
|
import com.qxcm.moduleutil.rtc.AgoraManager;
|
||||||
import com.qxcm.moduleutil.utils.FloatWindowHelper;
|
import com.qxcm.moduleutil.utils.FloatWindowHelper;
|
||||||
import com.qxcm.moduleutil.utils.ImageUtils;
|
import com.qxcm.moduleutil.utils.ImageUtils;
|
||||||
import com.qxcm.moduleutil.utils.SpUtil;
|
import com.qxcm.moduleutil.utils.SpUtil;
|
||||||
@@ -61,6 +63,7 @@ import com.scwang.smartrefresh.layout.api.RefreshFooter;
|
|||||||
import com.scwang.smartrefresh.layout.api.RefreshHeader;
|
import com.scwang.smartrefresh.layout.api.RefreshHeader;
|
||||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||||
|
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
|
||||||
import com.tencent.qcloud.tuicore.TUILogin;
|
import com.tencent.qcloud.tuicore.TUILogin;
|
||||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
||||||
|
|
||||||
@@ -125,6 +128,9 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
currentEnvironment = prefs.getSelectedEnvironment();
|
currentEnvironment = prefs.getSelectedEnvironment();
|
||||||
piaoPingManager = PiaoPingManager.getInstance(this);
|
piaoPingManager = PiaoPingManager.getInstance(this);
|
||||||
piaoPingManager.subscribe();
|
piaoPingManager.subscribe();
|
||||||
|
AgoraManager.getInstance(this).init(currentEnvironment.getSwSdkAppId());
|
||||||
|
MessageListenerSingleton.getInstance();
|
||||||
|
|
||||||
// startInitSdk();
|
// startInitSdk();
|
||||||
}
|
}
|
||||||
private PiaoPingManager piaoPingManager;
|
private PiaoPingManager piaoPingManager;
|
||||||
@@ -381,7 +387,11 @@ private PiaoPingManager piaoPingManager;
|
|||||||
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
|
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
|
||||||
@Override
|
@Override
|
||||||
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
|
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
|
||||||
return new CustomRefreshHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
ClassicsHeader header = new ClassicsHeader(context);
|
||||||
|
header.setDrawableSize(20);
|
||||||
|
header.setFinishDuration(0);
|
||||||
|
return header;//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||||
|
// return new CustomRefreshHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//设置全局的Footer构建器
|
//设置全局的Footer构建器
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author $
|
||||||
|
* @Time $ $
|
||||||
|
* @Description $ 版本更新信息模型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppUpdateModel {
|
||||||
|
private int id;
|
||||||
|
private String version;//当前版本号
|
||||||
|
private String url;//下载地址
|
||||||
|
private String content;//更新内容
|
||||||
|
private String is_force;//是否强制更新
|
||||||
|
private String apiversion;//API版本号
|
||||||
|
private int code;//状态码
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025-8-1 00:21:22$ $
|
||||||
|
* @Description $
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CombinedGiftBean {
|
||||||
|
private int gift_id;
|
||||||
|
private String gift_price;
|
||||||
|
private String gift_name;
|
||||||
|
private String base_image;
|
||||||
|
private String total_count;
|
||||||
|
private int top_users_count;
|
||||||
|
private List<TopUsers> top_users;
|
||||||
|
private boolean is_liang;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class TopUsers {
|
||||||
|
private int user_id;
|
||||||
|
private String nickname;
|
||||||
|
private String avatar;
|
||||||
|
private String count;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ public class ExpandColumnBean {
|
|||||||
private String loginip;
|
private String loginip;
|
||||||
private String home_bgimages;
|
private String home_bgimages;
|
||||||
private int room_id;//房间id,当有参数的时候,就显示跟随,当没有的时候,就显示私信控件
|
private int room_id;//房间id,当有参数的时候,就显示跟随,当没有的时候,就显示私信控件
|
||||||
|
private String agree;
|
||||||
private List<String> icon;
|
private List<String> icon;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025-8-2 09:13:25$ $
|
||||||
|
* @Description 首页判断参数$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FirstChargeBean {
|
||||||
|
private int permission;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import com.qxcm.moduleutil.bean.room.RoomGiveGiftModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025-8-2 10:46:27$ $
|
||||||
|
* @Description 首充好礼列表$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FirstChargeGiftBean {
|
||||||
|
private String name;
|
||||||
|
private List<GiftBag> gift_bag;
|
||||||
|
@Data
|
||||||
|
public static class GiftBag {
|
||||||
|
private String name;
|
||||||
|
private String title1;
|
||||||
|
private String title2;
|
||||||
|
private String money;
|
||||||
|
private List<RoonGiftModel> gift_list;
|
||||||
|
|
||||||
|
// @Data
|
||||||
|
// public static class GiftList {
|
||||||
|
// private String gift_name;
|
||||||
|
// private int num;
|
||||||
|
// private int gift_price;
|
||||||
|
// private int type;
|
||||||
|
// private String base_image;
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,4 +13,6 @@ public class GiftPackBean {
|
|||||||
private String base_image;
|
private String base_image;
|
||||||
private String gift_price;
|
private String gift_price;
|
||||||
private String num;
|
private String num;
|
||||||
|
|
||||||
|
private boolean isChecked;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time $ $
|
||||||
|
* @Description $ 礼物墙展示接口
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class GiftUserWallBean {
|
||||||
|
private List<GiftWallBean> liang;
|
||||||
|
private List<GiftWallBean> no_liang;
|
||||||
|
@Data
|
||||||
|
public static class GiftWallBean {
|
||||||
|
private int gift_id;
|
||||||
|
private String gift_price;
|
||||||
|
private String gift_name;
|
||||||
|
private String base_image;
|
||||||
|
private String total_count;
|
||||||
|
private int top_users_count;
|
||||||
|
private List<CombinedGiftBean.TopUsers> top_users;
|
||||||
|
private boolean is_liang;
|
||||||
|
|
||||||
|
// @Data
|
||||||
|
// public static class TopUsers {
|
||||||
|
// private int user_id;
|
||||||
|
// private String nickname;
|
||||||
|
// private String avatar;
|
||||||
|
// private String count;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.qxcm.moduleutil.bean;
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
/**
|
/**
|
||||||
*@author qx
|
*@author qx
|
||||||
@@ -7,7 +9,7 @@ import lombok.Data;
|
|||||||
*@description:发布头条需要的参数
|
*@description:发布头条需要的参数
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class HeadlineBean {
|
public class HeadlineBean implements Serializable {
|
||||||
private String countdown;
|
private String countdown;
|
||||||
private String now_money;
|
private String now_money;
|
||||||
private String next_money;
|
private String next_money;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class MyFootResp {
|
|||||||
private String room_name;//房间名称
|
private String room_name;//房间名称
|
||||||
private String room_code;
|
private String room_code;
|
||||||
private String popularity;
|
private String popularity;
|
||||||
|
private String hot_value;
|
||||||
private String label_name;
|
private String label_name;
|
||||||
private String label_icon;//房间标签图标
|
private String label_icon;//房间标签图标
|
||||||
private String owner_picture;
|
private String owner_picture;
|
||||||
|
|||||||
@@ -1,15 +1,29 @@
|
|||||||
package com.qxcm.moduleutil.bean;
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class NewsDataBean {
|
public class NewsDataBean {
|
||||||
private String id; //id
|
private int system_no_read_count; //系统消息未读总数
|
||||||
private String title; //标题
|
private SystemMessage system_last_message;//最后一条未读系统消息
|
||||||
private String content; //内容
|
private int announcement_read_count; //未读官方公告总数
|
||||||
private String type; //类型1系统消息 2官方公告 3活动中心
|
private SystemMessage announcement_last_message;//最后一条未读官方公告
|
||||||
private String source_id; //来源id
|
|
||||||
private String is_read; //是否已读
|
|
||||||
private String createtime;//创建时间
|
@Data
|
||||||
private String image;
|
public static class SystemMessage {
|
||||||
|
private int id; //消息ID
|
||||||
|
private int type; //消息类型
|
||||||
|
private int admin_id; //管理员ID
|
||||||
|
private String content; //内容
|
||||||
|
private String title; //标题
|
||||||
|
private String image;
|
||||||
|
private int room_id; //房间ID
|
||||||
|
private String url;
|
||||||
|
private String updatetime; //更新时间
|
||||||
|
private String delete_time; //删除时间
|
||||||
|
private String createtime; //创建时间
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025年7月23日$ $
|
||||||
|
* @Description 消息列表$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NewsMessageList {
|
||||||
|
private int id;
|
||||||
|
private int type;//类型 1:系统消息 2:官方公告 3:活动中心
|
||||||
|
private int admin_id;
|
||||||
|
private String title;//标题
|
||||||
|
private String content;//内容
|
||||||
|
private String source_id;//来源id
|
||||||
|
private String is_read;//是否已读 0:未读 1:已读
|
||||||
|
private String image;
|
||||||
|
private int room_id; //大于0的时候,点击进入房间 等于0的时候,url不为空,跳转单页
|
||||||
|
private String url;
|
||||||
|
private String createtime;
|
||||||
|
private String updatetime;
|
||||||
|
private String delete_time;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025-8-2 02:11:32$ $
|
||||||
|
* @Description 获取关系的列表$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RelationCardBean {
|
||||||
|
private List<RelationshipBean> qinmi;
|
||||||
|
private List<RelationshipBean> zhenai;
|
||||||
|
}
|
||||||
@@ -1,18 +1,34 @@
|
|||||||
package com.qxcm.moduleutil.bean;
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@author qx
|
* @author qx
|
||||||
*@data 2025/6/16
|
* @data 2025/6/16
|
||||||
*@description: 关系信息
|
* @description: 关系信息
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RelationshipBean {
|
public class RelationshipBean implements Serializable {
|
||||||
|
|
||||||
private String nickname;
|
|
||||||
private String avatar;
|
private int relation_id;//关系id 3,
|
||||||
private String relation;
|
private int id;// 39,
|
||||||
private String nickname2;
|
private int user_id1;// 31,
|
||||||
private String avatar2;
|
private int user_id2;// 12,
|
||||||
private String time;
|
private String updatetime;// " 1754038468,
|
||||||
|
private String time_day;// " 2025-: 54000,
|
||||||
|
private String end_time;// 1754092468,
|
||||||
|
private String nickname1;// "坦率的摩托",
|
||||||
|
private String avatar1;// "https://qx-yusheng.oss-cn-hangzhou.aliyuncs.com/img/53a7320dbf4ed24c204291b1cb3f07f7.jpg",
|
||||||
|
private String cp_room_id;// null,
|
||||||
|
private String nickname2;// "暴躁的金针菇",
|
||||||
|
private String avatar2;//https://qx-yusheng.oss-cn-hangzhou.aliyuncs.com/audio/4354fff51c3ff20c8ffdcfb7fe55d843.jpg",
|
||||||
|
private String relation_name;// ": "闺蜜1",
|
||||||
|
private String image;// "http://111111111",
|
||||||
|
private String delete_me_coin;// " "100",
|
||||||
|
private int heart_value;// 0,
|
||||||
|
private int is_top;// 0
|
||||||
|
private int type;// 1,亲密;2:真爱
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.qxcm.moduleutil.bean;
|
|||||||
import com.qxcm.moduleutil.bean.room.AuctionBean;
|
import com.qxcm.moduleutil.bean.room.AuctionBean;
|
||||||
import com.qxcm.moduleutil.bean.room.RoomAuction;
|
import com.qxcm.moduleutil.bean.room.RoomAuction;
|
||||||
import com.qxcm.moduleutil.bean.room.RoomBean;
|
import com.qxcm.moduleutil.bean.room.RoomBean;
|
||||||
|
import com.qxcm.moduleutil.bean.room.RoomPitBean;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ public class RoomMessageEvent {
|
|||||||
private String room_id;//当type==1的时候。这个roomId是对方的房间id
|
private String room_id;//当type==1的时候。这个roomId是对方的房间id
|
||||||
private String user_id;
|
private String user_id;
|
||||||
private String pk_end_times;//pk结束时间
|
private String pk_end_times;//pk结束时间
|
||||||
|
private List<RoomPitBean> userCharmList;
|
||||||
|
|
||||||
private String room_id_a;//发起者房间id
|
private String room_id_a;//发起者房间id
|
||||||
private String room_id_b;//接收者房间id
|
private String room_id_b;//接收者房间id
|
||||||
@@ -61,6 +63,10 @@ public class RoomMessageEvent {
|
|||||||
private String defeated_cover;//输掉的头像
|
private String defeated_cover;//输掉的头像
|
||||||
private String end_time;//惩罚时间
|
private String end_time;//惩罚时间
|
||||||
private int is_mute;//1:静音对方 0:不静音对方
|
private int is_mute;//1:静音对方 0:不静音对方
|
||||||
|
private int is_mute_pit;
|
||||||
|
private int count;//排麦模式下的人数
|
||||||
|
|
||||||
|
private int online_number;//在线人数
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -3,14 +3,20 @@ package com.qxcm.moduleutil.bean;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
/**
|
||||||
|
* @Author
|
||||||
|
* @Time 2025/7/29 19:26
|
||||||
|
* @Description 搜索类型
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RoomSearchResp {
|
public class RoomSearchResp {
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private String pictrue;
|
private String picture;
|
||||||
private String code;
|
private String code;
|
||||||
private List<String> icon;
|
private List<String> icon;
|
||||||
|
private String label_icon;
|
||||||
|
private String hot_value;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,9 @@ public class RoonGiftModel {
|
|||||||
private String base_image;//礼物图片
|
private String base_image;//礼物图片
|
||||||
private String gift_price;//礼物价格
|
private String gift_price;//礼物价格
|
||||||
private String gift_id;//礼物id
|
private String gift_id;//礼物id
|
||||||
|
private String gift_bag_name;
|
||||||
|
private String rule;
|
||||||
|
private String rule_url;
|
||||||
|
|
||||||
|
|
||||||
private String title;
|
private String title;
|
||||||
@@ -27,15 +30,16 @@ public class RoonGiftModel {
|
|||||||
private boolean isChecked;
|
private boolean isChecked;
|
||||||
private boolean isSelected;
|
private boolean isSelected;
|
||||||
private boolean can_send_self;//是否能送自己
|
private boolean can_send_self;//是否能送自己
|
||||||
|
private int num;//礼物数量
|
||||||
|
|
||||||
// public boolean isCan_send_self() {
|
public boolean isCan_send_self() {
|
||||||
// if ( isManghe()) {
|
if ( isManghe()) {
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
// return can_send_self;
|
return can_send_self;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// public boolean isManghe() {
|
public boolean isManghe() {
|
||||||
// return type.equals("4") || type.equals("5") || type.equals("13");
|
return type.equals("4") || type.equals("5") || type.equals("13");
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,25 +2,41 @@ package com.qxcm.moduleutil.bean;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author
|
||||||
|
* @Time 2025/7/29 19:21
|
||||||
|
* @Description 首頁搜索结果
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
public class SearchResp {
|
public class SearchResp {
|
||||||
|
|
||||||
|
|
||||||
private List<UserResultResp> user_result;
|
// private List<UserResultResp> user_result;
|
||||||
private RoomResultResp room_result;
|
// private RoomResultResp room_result;
|
||||||
|
//
|
||||||
|
// public List<UserResultResp> getUser_result() {
|
||||||
|
// return user_result;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setUser_result(List<UserResultResp> user_result) {
|
||||||
|
// this.user_result = user_result;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public RoomResultResp getRoom_result() {
|
||||||
|
// return room_result;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setRoom_result(RoomResultResp room_result) {
|
||||||
|
// this.room_result = room_result;
|
||||||
|
// }
|
||||||
|
|
||||||
public List<UserResultResp> getUser_result() {
|
private String id;
|
||||||
return user_result;
|
private String name;
|
||||||
}
|
private String picture;
|
||||||
|
private String code;
|
||||||
public void setUser_result(List<UserResultResp> user_result) {
|
private List<String> icon;
|
||||||
this.user_result = user_result;
|
private String label_icon;
|
||||||
}
|
private String hot_value;
|
||||||
|
|
||||||
public RoomResultResp getRoom_result() {
|
|
||||||
return room_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoom_result(RoomResultResp room_result) {
|
|
||||||
this.room_result = room_result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class UserInfo implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
public static final String FEMALE = "2";
|
public static final String FEMALE = "2";
|
||||||
public static final String MALE = "1";
|
public static final String MALE = "1";
|
||||||
@SerializedName(value = "id", alternate = "user_id")
|
// @SerializedName(value = "id", alternate = "user_id")
|
||||||
private int user_id; //用户id
|
private int user_id; //用户id
|
||||||
private String user_code;//用户id码
|
private String user_code;//用户id码
|
||||||
private String avatar;//头像
|
private String avatar;//头像
|
||||||
@@ -53,6 +53,12 @@ public class UserInfo implements Serializable {
|
|||||||
private String pit_number;//在点击麦上用户的时候使用
|
private String pit_number;//在点击麦上用户的时候使用
|
||||||
private String auction_id;//在拍卖中的拍卖序号
|
private String auction_id;//在拍卖中的拍卖序号
|
||||||
private int auth;//是否实名 1:实名 0:未实名
|
private int auth;//是否实名 1:实名 0:未实名
|
||||||
|
private String red_status;
|
||||||
|
private String gift_num;
|
||||||
|
|
||||||
|
private RelationshipBean qinmi;
|
||||||
|
private RelationshipBean zhenai;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.qxcm.moduleutil.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025年7月30日15:30:12$ $
|
||||||
|
* @Description 用户是否在线$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserOnlineStatusBean {
|
||||||
|
private String user_id;
|
||||||
|
private int is_online;
|
||||||
|
}
|
||||||
@@ -7,11 +7,11 @@ public class BaseMultiItemEntity implements MultiItemEntity {
|
|||||||
public static final int TYPE_B = 2;
|
public static final int TYPE_B = 2;
|
||||||
|
|
||||||
private int itemViewType;
|
private int itemViewType;
|
||||||
|
|
||||||
public BaseMultiItemEntity(int itemViewType) {
|
public BaseMultiItemEntity(int itemViewType) {
|
||||||
this.itemViewType = itemViewType;
|
this.itemViewType = itemViewType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemType() {
|
public int getItemType() {
|
||||||
return itemViewType;
|
return itemViewType;
|
||||||
|
|||||||
@@ -4,10 +4,19 @@ public class RoomDeatailList extends BaseMultiItemEntity {
|
|||||||
private double total_price;
|
private double total_price;
|
||||||
private double total_earning;
|
private double total_earning;
|
||||||
private String time;
|
private String time;
|
||||||
|
private boolean isSticky;
|
||||||
public RoomDeatailList() {
|
public RoomDeatailList() {
|
||||||
super(BaseMultiItemEntity.TYPE_A);
|
super(BaseMultiItemEntity.TYPE_A);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSticky() {
|
||||||
|
return isSticky;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSticky(boolean sticky) {
|
||||||
|
isSticky = sticky;
|
||||||
|
}
|
||||||
|
|
||||||
public double getTotal_price() {
|
public double getTotal_price() {
|
||||||
return total_price;
|
return total_price;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class EMMessageInfo implements MultiItemEntity {
|
|||||||
/// cp房送礼物推送礼物火热值
|
/// cp房送礼物推送礼物火热值
|
||||||
public static final int QXRoomMessageTypeRoomIsHostvalue = 1028;
|
public static final int QXRoomMessageTypeRoomIsHostvalue = 1028;
|
||||||
/// 有人向我发起pk
|
/// 有人向我发起pk
|
||||||
public static final int QXRoomMessageTypeRoomRecieveInvitePk = 1029;
|
public static final int QXRoomMessageTypeRoomRecieveInvitePk = 1029;
|
||||||
/// 拒绝或接受pk
|
/// 拒绝或接受pk
|
||||||
public static final int QXRoomMessageTypeRoomPKAgreeOrRefuse = 1030;
|
public static final int QXRoomMessageTypeRoomPKAgreeOrRefuse = 1030;
|
||||||
/// pk开始
|
/// pk开始
|
||||||
@@ -72,9 +72,14 @@ public class EMMessageInfo implements MultiItemEntity {
|
|||||||
public static final int QXRoomMessageTypeRoomPKEnd = 1032;
|
public static final int QXRoomMessageTypeRoomPKEnd = 1032;
|
||||||
/// pk断开
|
/// pk断开
|
||||||
public static final int QXRoomMessageTypeRoomPKDisconnect = 1033;
|
public static final int QXRoomMessageTypeRoomPKDisconnect = 1033;
|
||||||
|
///排麦模式下的人数变化
|
||||||
|
public static final int QXRoomMessageTypeRoomMaiwrens = 1034;
|
||||||
|
public static final int QXRoomMessageTypeRoomDress = 1035;
|
||||||
|
public static final int QXRoomMessageTypeRoomOnline = 1036;
|
||||||
|
public static final int QXRoomMessageTypeRoomOPK = 1037;
|
||||||
///关闭对方麦克风
|
///关闭对方麦克风
|
||||||
public static final int QXRoomMessageTypeMuteRemoteAudio = 125;
|
public static final int QXRoomMessageTypeMuteRemoteAudio = 125;
|
||||||
public static final int QXRoomMessageTypeMuteLocalAudio = 126;
|
public static final int QXRoomMessageTypeMuteLocalAudio = 126;
|
||||||
private RoomMessageEvent emMessage;
|
private RoomMessageEvent emMessage;
|
||||||
|
|
||||||
private int custom = 0;
|
private int custom = 0;
|
||||||
@@ -122,6 +127,10 @@ public class EMMessageInfo implements MultiItemEntity {
|
|||||||
case QXRoomMessageTypeSeatMute:
|
case QXRoomMessageTypeSeatMute:
|
||||||
case QXRoomMessageTypeSeatLock:
|
case QXRoomMessageTypeSeatLock:
|
||||||
case QXRoomMessageTypeRoomTypeDidChanged:
|
case QXRoomMessageTypeRoomTypeDidChanged:
|
||||||
|
case QXRoomMessageTypeRoom:
|
||||||
|
case QXRoomMessageTypeRoomDress:
|
||||||
|
case QXRoomMessageTypeRoomOnline:
|
||||||
|
case QXRoomMessageTypeRoomOPK:
|
||||||
return 1;
|
return 1;
|
||||||
case QXRoomMessageTypeGift:
|
case QXRoomMessageTypeGift:
|
||||||
return 3;
|
return 3;
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ public class RoomBean implements Serializable {
|
|||||||
private String hot_value;//房间火热值
|
private String hot_value;//房间火热值
|
||||||
private String chatrooms;//房间群组id
|
private String chatrooms;//房间群组id
|
||||||
private List<RoomPitBean> pit_list;//麦位信息
|
private List<RoomPitBean> pit_list;//麦位信息
|
||||||
private String room_up_pit_type;
|
private String room_up_pit_type;//排麦模式
|
||||||
private int online_number;
|
private int online_number;
|
||||||
|
private int queue_number;//排麦队列人数
|
||||||
private HeadlineBean head_line;
|
private HeadlineBean head_line;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,14 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class RoomClearCardiacAllModel {
|
public class RoomClearCardiacAllModel {
|
||||||
|
|
||||||
private String room_id;
|
private String room_id;
|
||||||
|
|
||||||
|
public RoomClearCardiacAllModel(String room_id) {
|
||||||
|
this.room_id = room_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.qxcm.moduleutil.bean.room;
|
package com.qxcm.moduleutil.bean.room;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -10,8 +12,9 @@ import lombok.Data;
|
|||||||
* @description: 房间在线列表
|
* @description: 房间在线列表
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RoomOnlineBean {
|
public class RoomOnlineBean implements MultiItemEntity {
|
||||||
|
private int itemViewType;
|
||||||
|
private String typeNames;
|
||||||
private int user_id;
|
private int user_id;
|
||||||
private String nickname;
|
private String nickname;
|
||||||
private String avatar;
|
private String avatar;
|
||||||
@@ -20,4 +23,9 @@ public class RoomOnlineBean {
|
|||||||
private List<String> icon;
|
private List<String> icon;
|
||||||
private int type;//1:麦上用户 2:麦下用户
|
private int type;//1:麦上用户 2:麦下用户
|
||||||
private int type_pit;//判断是从哪里点击进来的,确认显示不显示抱麦按钮 1:点击顶部列表,不显示抱麦按钮 2:点击麦位上的抱麦按钮,显示抱麦按钮 ,
|
private int type_pit;//判断是从哪里点击进来的,确认显示不显示抱麦按钮 1:点击顶部列表,不显示抱麦按钮 2:点击麦位上的抱麦按钮,显示抱麦按钮 ,
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemType() {
|
||||||
|
return itemViewType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,9 +59,10 @@ public class RoomSettingBean implements MultiItemEntity {
|
|||||||
private int read;//角色 1:房主 2:管理员 3:主持、4:观众
|
private int read;//角色 1:房主 2:管理员 3:主持、4:观众
|
||||||
private boolean isSelected;//是否在麦位上
|
private boolean isSelected;//是否在麦位上
|
||||||
private boolean status;
|
private boolean status;
|
||||||
|
private boolean select;//是否选中
|
||||||
|
|
||||||
|
|
||||||
public RoomSettingBean(String name, String icon, String selectName, String selectIcon, int type, int read, boolean isSelected, boolean status) {
|
public RoomSettingBean(String name, String icon, String selectName, String selectIcon, int type, int read, boolean isSelected, boolean status,boolean select) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
this.selectName = selectName;
|
this.selectName = selectName;
|
||||||
@@ -70,6 +71,7 @@ public class RoomSettingBean implements MultiItemEntity {
|
|||||||
this.read = read;
|
this.read = read;
|
||||||
this.isSelected = isSelected;
|
this.isSelected = isSelected;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
|
this.select = select;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -7,19 +7,26 @@ import android.graphics.Paint;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.ApiUtils;
|
||||||
import com.blankj.utilcode.util.ScreenUtils;
|
import com.blankj.utilcode.util.ScreenUtils;
|
||||||
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
import com.qxcm.moduleutil.R;
|
import com.qxcm.moduleutil.R;
|
||||||
import com.qxcm.moduleutil.adapter.GiftAdapter;
|
import com.qxcm.moduleutil.adapter.GiftAdapter;
|
||||||
import com.qxcm.moduleutil.adapter.HeavenGiftAdapter;
|
import com.qxcm.moduleutil.adapter.HeavenGiftAdapter;
|
||||||
import com.qxcm.moduleutil.bean.BaseListData;
|
import com.qxcm.moduleutil.bean.BaseListData;
|
||||||
|
import com.qxcm.moduleutil.bean.FirstChargeGiftBean;
|
||||||
import com.qxcm.moduleutil.bean.HeatedBean;
|
import com.qxcm.moduleutil.bean.HeatedBean;
|
||||||
import com.qxcm.moduleutil.bean.HeavenGiftBean;
|
import com.qxcm.moduleutil.bean.HeavenGiftBean;
|
||||||
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
import com.qxcm.moduleutil.databinding.DialogFirstChargeBinding;
|
import com.qxcm.moduleutil.databinding.DialogFirstChargeBinding;
|
||||||
import com.qxcm.moduleutil.databinding.DialogHeavenGiftBinding;
|
import com.qxcm.moduleutil.databinding.DialogHeavenGiftBinding;
|
||||||
|
import com.qxcm.moduleutil.http.BaseObserver;
|
||||||
|
import com.qxcm.moduleutil.http.RetrofitClient;
|
||||||
import com.qxcm.moduleutil.widget.dialog.BaseDialog;
|
import com.qxcm.moduleutil.widget.dialog.BaseDialog;
|
||||||
import com.zhpan.bannerview.indicator.DrawableIndicator;
|
import com.zhpan.bannerview.indicator.DrawableIndicator;
|
||||||
import com.zhpan.indicator.base.IIndicator;
|
import com.zhpan.indicator.base.IIndicator;
|
||||||
@@ -28,15 +35,20 @@ import com.zhpan.indicator.enums.IndicatorSlideMode;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@author
|
* @author
|
||||||
*@data
|
* @data
|
||||||
*@description: 首充好礼
|
* @description: 首充好礼
|
||||||
*/
|
*/
|
||||||
public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||||
|
|
||||||
GiftAdapter giftAdapter;
|
GiftAdapter giftAdapter;
|
||||||
HeavenGiftAdapter heavenGiftAdapter;
|
HeavenGiftAdapter heavenGiftAdapter;
|
||||||
|
FirstChargeGiftBean firstChargeGiftBean;
|
||||||
|
private int type;
|
||||||
|
|
||||||
public FirstChargeDialog(@NonNull Context context) {
|
public FirstChargeDialog(@NonNull Context context) {
|
||||||
super(context, R.style.BaseDialogStyleH);
|
super(context, R.style.BaseDialogStyleH);
|
||||||
}
|
}
|
||||||
@@ -59,7 +71,7 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
|||||||
// mBinding.rvHead.setLayoutManager(linearLayoutManager);
|
// mBinding.rvHead.setLayoutManager(linearLayoutManager);
|
||||||
// mBinding.rvHead.setAdapter(giftAdapter);
|
// mBinding.rvHead.setAdapter(giftAdapter);
|
||||||
mBinding.tvTitle2.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
|
mBinding.tvTitle2.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
|
||||||
heavenGiftAdapter=new HeavenGiftAdapter();
|
heavenGiftAdapter = new HeavenGiftAdapter();
|
||||||
mBinding.bannerViewPager
|
mBinding.bannerViewPager
|
||||||
.setPageMargin(15)
|
.setPageMargin(15)
|
||||||
.setAutoPlay(false)
|
.setAutoPlay(false)
|
||||||
@@ -69,33 +81,110 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
|||||||
.setIndicatorSlideMode(IndicatorSlideMode.NORMAL)
|
.setIndicatorSlideMode(IndicatorSlideMode.NORMAL)
|
||||||
.setAdapter(heavenGiftAdapter)
|
.setAdapter(heavenGiftAdapter)
|
||||||
.create();
|
.create();
|
||||||
}
|
|
||||||
|
|
||||||
|
mBinding.rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(RadioGroup radioGroup, int i) {
|
||||||
|
if (firstChargeGiftBean== null || firstChargeGiftBean.getGift_bag().size() == 0){
|
||||||
|
ToastUtils.showShort("暂无礼包");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == R.id.btn_0) {
|
||||||
|
List<RoonGiftModel> list = new ArrayList<>();
|
||||||
|
if (firstChargeGiftBean.getGift_bag().size() > 1) {
|
||||||
|
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle1());
|
||||||
|
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||||
|
mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||||
|
list.addAll(firstChargeGiftBean.getGift_bag().get(0).getGift_list());
|
||||||
|
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||||
|
}
|
||||||
|
type=1;
|
||||||
|
} else if (i == R.id.btn_1) {
|
||||||
|
List<RoonGiftModel> list = new ArrayList<>();
|
||||||
|
if (firstChargeGiftBean.getGift_bag().size() > 2) {
|
||||||
|
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(1).getTitle1());
|
||||||
|
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(1).getTitle2());
|
||||||
|
mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||||
|
list.addAll(firstChargeGiftBean.getGift_bag().get(1).getGift_list());
|
||||||
|
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||||
|
}
|
||||||
|
type=2;
|
||||||
|
} else if (i == R.id.btn_2) {
|
||||||
|
List<RoonGiftModel> list = new ArrayList<>();
|
||||||
|
if (firstChargeGiftBean.getGift_bag().size() > 3) {
|
||||||
|
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(2).getTitle1());
|
||||||
|
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(2).getTitle2());
|
||||||
|
mBinding.btn2.setText(firstChargeGiftBean.getGift_bag().get(2).getName());
|
||||||
|
list.addAll(firstChargeGiftBean.getGift_bag().get(2).getGift_list());
|
||||||
|
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||||
|
}
|
||||||
|
type=3;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mBinding.tvInvite.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
// RechargeDialogFragment.show(roomId, getSupportFragmentManager());
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFirstChargeConfirmed(firstChargeGiftBean,type);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public interface OnFirstChargeListener {
|
||||||
|
void onFirstChargeConfirmed(FirstChargeGiftBean giftBean,int type);
|
||||||
|
void onFirstChargeCancelled();
|
||||||
|
}
|
||||||
|
private OnFirstChargeListener listener;
|
||||||
|
// 设置监听器的方法
|
||||||
|
public void setOnFirstChargeListener(OnFirstChargeListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void initData() {
|
public void initData() {
|
||||||
List<HeavenGiftBean> list=new ArrayList<>();
|
RetrofitClient.getInstance().firstChargeGift(new BaseObserver<FirstChargeGiftBean>() {
|
||||||
for (int i = 0; i < 7; i++){
|
@Override
|
||||||
HeavenGiftBean bean=new HeavenGiftBean();
|
public void onSubscribe(Disposable d) {
|
||||||
bean.setTitle("礼物"+i);
|
|
||||||
bean.setPicture("");
|
|
||||||
bean.setType(1);
|
|
||||||
bean.setQuantity("x"+i);
|
|
||||||
bean.setGold(i+"");
|
|
||||||
bean.setDays(i+"天");
|
|
||||||
list.add(bean);
|
|
||||||
}
|
|
||||||
mBinding.bannerViewPager.create(baseListData(list,4));
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(FirstChargeGiftBean firstChargeGiftBean) {
|
||||||
|
if (firstChargeGiftBean != null) {
|
||||||
|
showGift(firstChargeGiftBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// List<HeavenGiftBean> list = new ArrayList<>();
|
||||||
|
// for (int i = 0; i < 7; i++) {
|
||||||
|
// HeavenGiftBean bean = new HeavenGiftBean();
|
||||||
|
// bean.setTitle("礼物" + i);
|
||||||
|
// bean.setPicture("");
|
||||||
|
// bean.setType(1);
|
||||||
|
// bean.setQuantity("x" + i);
|
||||||
|
// bean.setGold(i + "");
|
||||||
|
// bean.setDays(i + "天");
|
||||||
|
// list.add(bean);
|
||||||
|
// }
|
||||||
|
// mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||||
}
|
}
|
||||||
private List<BaseListData<HeavenGiftBean>> baseListData(List<HeavenGiftBean> list, int chunkSize){
|
|
||||||
List<BaseListData<HeavenGiftBean>> baseListData = new ArrayList<>();
|
private List<BaseListData<RoonGiftModel>> baseListData(List<RoonGiftModel> list, int chunkSize) {
|
||||||
|
List<BaseListData<RoonGiftModel>> baseListData = new ArrayList<>();
|
||||||
for (int i = 0; i < list.size(); i += chunkSize) {
|
for (int i = 0; i < list.size(); i += chunkSize) {
|
||||||
BaseListData<HeavenGiftBean> baseListData1 = new BaseListData<>();
|
BaseListData<RoonGiftModel> baseListData1 = new BaseListData<>();
|
||||||
baseListData1.setData(list.subList(i, Math.min(i + chunkSize, list.size())));
|
baseListData1.setData(list.subList(i, Math.min(i + chunkSize, list.size())));
|
||||||
baseListData.add(baseListData1);
|
baseListData.add(baseListData1);
|
||||||
}
|
}
|
||||||
return baseListData;
|
return baseListData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IIndicator getVectorDrawableIndicator() {
|
private IIndicator getVectorDrawableIndicator() {
|
||||||
int dp6 = getResources().getDimensionPixelOffset(com.qxcm.moduleutil.R.dimen.dp_6);
|
int dp6 = getResources().getDimensionPixelOffset(com.qxcm.moduleutil.R.dimen.dp_6);
|
||||||
return new DrawableIndicator(getContext())
|
return new DrawableIndicator(getContext())
|
||||||
@@ -107,4 +196,33 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
|||||||
private Resources getResources() {
|
private Resources getResources() {
|
||||||
return getContext().getResources();
|
return getContext().getResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showGift(FirstChargeGiftBean firstChargeGiftBean) {
|
||||||
|
this.firstChargeGiftBean = firstChargeGiftBean;
|
||||||
|
mBinding.rg.check(R.id.btn_0);
|
||||||
|
if (firstChargeGiftBean.getGift_bag() != null && firstChargeGiftBean.getGift_bag().size() > 0) {
|
||||||
|
if (firstChargeGiftBean.getGift_bag().size() > 0) {
|
||||||
|
type=1;
|
||||||
|
List<RoonGiftModel> list = new ArrayList<>();
|
||||||
|
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle1());
|
||||||
|
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||||
|
mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||||
|
list.addAll(firstChargeGiftBean.getGift_bag().get(0).getGift_list());
|
||||||
|
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||||
|
|
||||||
|
mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||||
|
mBinding.btn2.setText(firstChargeGiftBean.getGift_bag().get(2).getName());
|
||||||
|
} else if (firstChargeGiftBean.getGift_bag().size() == 2) {
|
||||||
|
// mBinding.rg.check(R.id.btn_0);
|
||||||
|
// mBinding.btn1.setVisibility(View.VISIBLE);
|
||||||
|
// mBinding.btn2.setVisibility(View.INVISIBLE);
|
||||||
|
} else if (firstChargeGiftBean.getGift_bag().size() == 3) {
|
||||||
|
// mBinding.rg.check(R.id.btn_0);
|
||||||
|
// mBinding.btn1.setVisibility(View.VISIBLE);
|
||||||
|
// mBinding.btn2.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
// mBinding.rg.check(R.id.btn_0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -13,9 +13,12 @@ import android.view.View;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.blankj.utilcode.util.SpanUtils;
|
import com.blankj.utilcode.util.SpanUtils;
|
||||||
import com.qxcm.moduleutil.R;
|
import com.qxcm.moduleutil.R;
|
||||||
|
import com.qxcm.moduleutil.base.CommonAppContext;
|
||||||
import com.qxcm.moduleutil.databinding.DialogPolicBinding;
|
import com.qxcm.moduleutil.databinding.DialogPolicBinding;
|
||||||
|
import com.qxcm.moduleutil.utils.ARouteConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 隐私协议
|
* 隐私协议
|
||||||
@@ -39,7 +42,7 @@ public class PolicyDialog extends Dialog {
|
|||||||
ClickableSpan clickSpan = new ClickableSpan() {
|
ClickableSpan clickSpan = new ClickableSpan() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(@NonNull View widget) {
|
public void onClick(@NonNull View widget) {
|
||||||
// ARouter.getInstance().build(ARouters.H5).withString("url", Constant.URL.URL_USER_YHXY).navigation();
|
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6" ).withString("title", "用户协议").navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,7 +54,7 @@ public class PolicyDialog extends Dialog {
|
|||||||
ClickableSpan ysClickSpan = new ClickableSpan() {
|
ClickableSpan ysClickSpan = new ClickableSpan() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(@NonNull View widget) {
|
public void onClick(@NonNull View widget) {
|
||||||
// ARouter.getInstance().build(ARouters.H5).withString("url", Constant.URL.URL_USER_YSXY).navigation();
|
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package com.qxcm.moduleutil.dialog;
|
package com.qxcm.moduleutil.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -13,14 +17,23 @@ import android.view.ViewGroup;
|
|||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
import com.qxcm.moduleutil.R;
|
import com.qxcm.moduleutil.R;
|
||||||
import com.qxcm.moduleutil.activity.IPresenter;
|
import com.qxcm.moduleutil.activity.IPresenter;
|
||||||
import com.qxcm.moduleutil.adapter.BalanceRechargeAdapter;
|
import com.qxcm.moduleutil.adapter.BalanceRechargeAdapter;
|
||||||
|
import com.qxcm.moduleutil.adapter.PayMethodAdapter;
|
||||||
import com.qxcm.moduleutil.base.BaseMvpDialogFragment;
|
import com.qxcm.moduleutil.base.BaseMvpDialogFragment;
|
||||||
|
import com.qxcm.moduleutil.base.CommonAppContext;
|
||||||
|
import com.qxcm.moduleutil.bean.AppPay;
|
||||||
|
import com.qxcm.moduleutil.bean.BindType;
|
||||||
import com.qxcm.moduleutil.bean.RechargeBean;
|
import com.qxcm.moduleutil.bean.RechargeBean;
|
||||||
import com.qxcm.moduleutil.databinding.FragmentRechargeDialogBinding;
|
import com.qxcm.moduleutil.databinding.FragmentRechargeDialogBinding;
|
||||||
import com.qxcm.moduleutil.presenter.RechargeDialogContacts;
|
import com.qxcm.moduleutil.presenter.RechargeDialogContacts;
|
||||||
import com.qxcm.moduleutil.presenter.RechargeDialogPresenter;
|
import com.qxcm.moduleutil.presenter.RechargeDialogPresenter;
|
||||||
|
import com.qxcm.moduleutil.utils.SpUtil;
|
||||||
|
import com.qxcm.moduleutil.widget.PaymentUtil;
|
||||||
|
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||||
|
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -33,12 +46,17 @@ import java.util.List;
|
|||||||
public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialogPresenter, FragmentRechargeDialogBinding> implements RechargeDialogContacts.View {
|
public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialogPresenter, FragmentRechargeDialogBinding> implements RechargeDialogContacts.View {
|
||||||
private BalanceRechargeAdapter rechargeAdapter;
|
private BalanceRechargeAdapter rechargeAdapter;
|
||||||
private String money = "0";
|
private String money = "0";
|
||||||
private int type = 1;
|
private String type ;
|
||||||
|
private String coin;
|
||||||
|
private BindType.AllData selectedItem;
|
||||||
|
private PayMethodAdapter bindTypeAdapter;
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
public static void show(String id, FragmentManager fragmentManager) {
|
public static void show(String id, String type,FragmentManager fragmentManager) {
|
||||||
RechargeDialogFragment dialogFragment = new RechargeDialogFragment();
|
RechargeDialogFragment dialogFragment = new RechargeDialogFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString("roomId", id); // 可选:传递参数
|
args.putString("roomId", id); //// 可选:传递参数
|
||||||
|
args.putString("type", type);
|
||||||
dialogFragment.setArguments(args);
|
dialogFragment.setArguments(args);
|
||||||
dialogFragment.show(fragmentManager, "RoomOnlineDialogFragment");
|
dialogFragment.show(fragmentManager, "RoomOnlineDialogFragment");
|
||||||
}
|
}
|
||||||
@@ -48,6 +66,16 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
|||||||
window.setGravity(Gravity.BOTTOM);
|
window.setGravity(Gravity.BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttach(@NonNull Context context) {
|
||||||
|
super.onAttach(context);
|
||||||
|
roomId = getArguments().getString("roomId");
|
||||||
|
type = getArguments().getString("type");
|
||||||
|
if(type!=null){
|
||||||
|
money=type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected RechargeDialogPresenter bindPresenter() {
|
protected RechargeDialogPresenter bindPresenter() {
|
||||||
return new RechargeDialogPresenter(this, getContext());
|
return new RechargeDialogPresenter(this, getContext());
|
||||||
@@ -56,55 +84,54 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
|
if (roomId!=null) {
|
||||||
MvpPre.recharge();
|
MvpPre.recharge();
|
||||||
// List<RechargeBean> rechargeList = new ArrayList<>();
|
}
|
||||||
// RechargeBean bean1 = new RechargeBean();
|
MvpPre.bindType(SpUtil.getUserId() + "");
|
||||||
// bean1.setGoldNum("60");
|
|
||||||
// bean1.setMoney("6");
|
|
||||||
// bean1.setItemViewType(0);
|
|
||||||
// rechargeList.add(bean1);
|
|
||||||
// RechargeBean bean2 = new RechargeBean();
|
|
||||||
// bean2.setGoldNum("100");
|
|
||||||
// bean2.setMoney("10");
|
|
||||||
// bean2.setItemViewType(0);
|
|
||||||
// rechargeList.add(bean2);
|
|
||||||
//
|
|
||||||
// RechargeBean bean3 = new RechargeBean();
|
|
||||||
// bean3.setGoldNum("300");
|
|
||||||
// bean3.setMoney("30");
|
|
||||||
// bean3.setItemViewType(0);
|
|
||||||
// rechargeList.add(bean3);
|
|
||||||
// RechargeBean bean4 = new RechargeBean();
|
|
||||||
// bean4.setGoldNum("500");
|
|
||||||
// bean4.setMoney("50");
|
|
||||||
// bean4.setItemViewType(0);
|
|
||||||
// rechargeList.add(bean4);
|
|
||||||
//
|
|
||||||
// RechargeBean bean5 = new RechargeBean();
|
|
||||||
// bean5.setGoldNum("680");
|
|
||||||
// bean5.setMoney("68");
|
|
||||||
// bean5.setItemViewType(0);
|
|
||||||
// rechargeList.add(bean5);
|
|
||||||
// RechargeBean bean6 = new RechargeBean();
|
|
||||||
// bean6.setGoldNum("1280");
|
|
||||||
// bean6.setMoney("128");
|
|
||||||
// bean6.setItemViewType(0);
|
|
||||||
// rechargeList.add(bean6);
|
|
||||||
//
|
|
||||||
// // 在数据源最后添加一个自定义项
|
|
||||||
// RechargeBean customItem = new RechargeBean();
|
|
||||||
// customItem.setGoldNum("自定义");
|
|
||||||
// customItem.setMoney("");
|
|
||||||
// customItem.setItemViewType(1);
|
|
||||||
// rechargeList.add(customItem);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private void onClick(View view) {
|
||||||
|
if (view.getId() == R.id.tv_payment) {
|
||||||
|
if (money.equals("0")) {
|
||||||
|
money=mBinding.etCustomAmount.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(money)) {
|
||||||
|
ToastUtils.showShort("请选择充值金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if (Double.valueOf(money) < 6) {
|
||||||
|
// ToastUtils.showShort("最低充值6元以上");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (selectedItem == null) {
|
||||||
|
ToastUtils.showShort("请选择支付方式");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType());
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
|
mBinding.tvPayment.setOnClickListener(this::onClick);
|
||||||
|
mBinding.recycleView1.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||||
|
bindTypeAdapter = new PayMethodAdapter(R.layout.item_bind_type);
|
||||||
|
mBinding.recycleView1.setAdapter(bindTypeAdapter);
|
||||||
|
|
||||||
|
bindTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||||
|
// 更新选中项
|
||||||
|
bindTypeAdapter.setSelectedPosition(position);
|
||||||
|
|
||||||
|
// 获取当前选中的数据
|
||||||
|
selectedItem = bindTypeAdapter.getItem(position);
|
||||||
|
// 可以在这里处理选中逻辑,比如保存到变量或触发支付
|
||||||
|
});
|
||||||
|
|
||||||
|
if (type!=null){
|
||||||
|
mBinding.r4.setVisibility(View.GONE);
|
||||||
|
}else{
|
||||||
|
mBinding.r4.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -125,7 +152,7 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(RechargeBean rechargeBean) {
|
public void onClick(RechargeBean rechargeBean) {
|
||||||
money = rechargeBean.getMoney();
|
money = rechargeBean.getMoney();
|
||||||
mBinding.tvPayment.setText(String.format("立即支付(%s元)", money));
|
// mBinding.tvPayment.setText(String.format("立即支付(%s元)", money));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
rechargeAdapter.setInputBoxVisibilityListener(new BalanceRechargeAdapter.InputBoxVisibilityListener() {
|
rechargeAdapter.setInputBoxVisibilityListener(new BalanceRechargeAdapter.InputBoxVisibilityListener() {
|
||||||
@@ -137,6 +164,42 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
|||||||
});
|
});
|
||||||
mBinding.rvComment.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
mBinding.rvComment.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||||
mBinding.rvComment.setAdapter(rechargeAdapter);
|
mBinding.rvComment.setAdapter(rechargeAdapter);
|
||||||
mBinding.tvPayment.setText(String.format("立即支付(%s元)", money));
|
mBinding.tvPayment.setText("立即支付");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindType(BindType bindType) {
|
||||||
|
List<BindType.AllData> allData = new ArrayList<>();
|
||||||
|
if (bindType.getAli().getIs_pay_open().equals("1")) {
|
||||||
|
allData.add(bindType.getAli());
|
||||||
|
}
|
||||||
|
if (bindType.getWx().getIs_pay_open().equals("1")) {
|
||||||
|
allData.add(bindType.getWx());
|
||||||
|
}
|
||||||
|
if (bindType.getBank().getIs_pay_open().equals("1")) {
|
||||||
|
allData.add(bindType.getBank());
|
||||||
|
}
|
||||||
|
if (bindType.getAli_tl().getIs_pay_open().equals("1")) {
|
||||||
|
allData.add(bindType.getAli_tl());
|
||||||
|
}
|
||||||
|
if (bindType.getWx_tl().getIs_pay_open().equals("1")) {
|
||||||
|
allData.add(bindType.getWx_tl());
|
||||||
|
}
|
||||||
|
|
||||||
|
bindTypeAdapter.setNewData(allData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void appPay(AppPay appPay) {
|
||||||
|
if (appPay.getAli()!=null) {
|
||||||
|
PaymentUtil.payAlipay(getContext(), appPay.getAli());
|
||||||
|
}else if (appPay.getWx()!=null){
|
||||||
|
|
||||||
|
IWXAPI wxapi = WXAPIFactory.createWXAPI(getContext(), CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId());
|
||||||
|
PaymentUtil.payWxMiniProgram2(wxapi,appPay);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.qxcm.moduleutil.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025年7月30日01:35:52$ $
|
||||||
|
* @Description 打赏成功$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class GiftRewardEvent {
|
||||||
|
private int points;
|
||||||
|
|
||||||
|
public GiftRewardEvent(int points) {
|
||||||
|
this.points = points;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.qxcm.moduleutil.event;
|
||||||
|
|
||||||
|
import com.qxcm.moduleutil.adapter.GiftPackAdapter;
|
||||||
|
import com.qxcm.moduleutil.adapter.GiftRoomAdapter;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025年7月29日23:42:45$ $
|
||||||
|
* @Description 背包礼物选中$
|
||||||
|
*/
|
||||||
|
public class RoomGiftPackToEvent {
|
||||||
|
public WeakReference<GiftPackAdapter> adapter;
|
||||||
|
public GiftPackBean gift;
|
||||||
|
public int type;
|
||||||
|
public RoomGiftPackToEvent(GiftPackAdapter adapter, GiftPackBean gift, int type) {
|
||||||
|
this.adapter = new WeakReference<>(adapter);
|
||||||
|
this.gift = gift;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.qxcm.moduleutil.event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time $ $
|
||||||
|
* @Description 隐藏软键盘$
|
||||||
|
*/
|
||||||
|
public class RoomInputHideEvent {
|
||||||
|
public boolean hide;
|
||||||
|
|
||||||
|
public RoomInputHideEvent(boolean hide) {
|
||||||
|
this.hide = hide;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.qxcm.moduleutil.event;
|
||||||
|
|
||||||
|
import android.view.SurfaceView;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time $ $
|
||||||
|
* @Description 判断是否是电影房$
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SurfaceEvent {
|
||||||
|
|
||||||
|
private SurfaceView surfaceView;
|
||||||
|
private int type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.qxcm.moduleutil.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time 2025年7月28日16:34:24$ $
|
||||||
|
* @Description $ 这是获取到腾讯的im总得未读数量
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TxEvent {
|
||||||
|
private long unreadCount;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.qxcm.moduleutil.http;
|
|||||||
|
|
||||||
import com.qxcm.moduleutil.bean.AlbumBean;
|
import com.qxcm.moduleutil.bean.AlbumBean;
|
||||||
import com.qxcm.moduleutil.bean.AppPay;
|
import com.qxcm.moduleutil.bean.AppPay;
|
||||||
|
import com.qxcm.moduleutil.bean.AppUpdateModel;
|
||||||
import com.qxcm.moduleutil.bean.BannerModel;
|
import com.qxcm.moduleutil.bean.BannerModel;
|
||||||
import com.qxcm.moduleutil.bean.BindType;
|
import com.qxcm.moduleutil.bean.BindType;
|
||||||
import com.qxcm.moduleutil.bean.BlackUserBean;
|
import com.qxcm.moduleutil.bean.BlackUserBean;
|
||||||
@@ -10,11 +11,14 @@ import com.qxcm.moduleutil.bean.CharmRankingResp;
|
|||||||
import com.qxcm.moduleutil.bean.CircleListBean;
|
import com.qxcm.moduleutil.bean.CircleListBean;
|
||||||
import com.qxcm.moduleutil.bean.CommentBean;
|
import com.qxcm.moduleutil.bean.CommentBean;
|
||||||
import com.qxcm.moduleutil.bean.ExpandColumnBean;
|
import com.qxcm.moduleutil.bean.ExpandColumnBean;
|
||||||
|
import com.qxcm.moduleutil.bean.FirstChargeBean;
|
||||||
|
import com.qxcm.moduleutil.bean.FirstChargeGiftBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftBoxBean;
|
import com.qxcm.moduleutil.bean.GiftBoxBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftBoxRecordBean;
|
import com.qxcm.moduleutil.bean.GiftBoxRecordBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftName;
|
import com.qxcm.moduleutil.bean.GiftName;
|
||||||
import com.qxcm.moduleutil.bean.GiftPackBean;
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftUserWallBean;
|
||||||
import com.qxcm.moduleutil.bean.HeadlineBean;
|
import com.qxcm.moduleutil.bean.HeadlineBean;
|
||||||
import com.qxcm.moduleutil.bean.HeatedBean;
|
import com.qxcm.moduleutil.bean.HeatedBean;
|
||||||
import com.qxcm.moduleutil.bean.HostBean;
|
import com.qxcm.moduleutil.bean.HostBean;
|
||||||
@@ -24,10 +28,12 @@ import com.qxcm.moduleutil.bean.MyCpRoom;
|
|||||||
import com.qxcm.moduleutil.bean.MyFootResp;
|
import com.qxcm.moduleutil.bean.MyFootResp;
|
||||||
import com.qxcm.moduleutil.bean.MyRoomBean;
|
import com.qxcm.moduleutil.bean.MyRoomBean;
|
||||||
import com.qxcm.moduleutil.bean.NewsDataBean;
|
import com.qxcm.moduleutil.bean.NewsDataBean;
|
||||||
|
import com.qxcm.moduleutil.bean.NewsMessageList;
|
||||||
import com.qxcm.moduleutil.bean.PersonaltyBean;
|
import com.qxcm.moduleutil.bean.PersonaltyBean;
|
||||||
import com.qxcm.moduleutil.bean.PlaceholderBean;
|
import com.qxcm.moduleutil.bean.PlaceholderBean;
|
||||||
import com.qxcm.moduleutil.bean.RealNameBean;
|
import com.qxcm.moduleutil.bean.RealNameBean;
|
||||||
import com.qxcm.moduleutil.bean.RechargeBean;
|
import com.qxcm.moduleutil.bean.RechargeBean;
|
||||||
|
import com.qxcm.moduleutil.bean.RelationCardBean;
|
||||||
import com.qxcm.moduleutil.bean.RevenueBean;
|
import com.qxcm.moduleutil.bean.RevenueBean;
|
||||||
import com.qxcm.moduleutil.bean.RewardUserBean;
|
import com.qxcm.moduleutil.bean.RewardUserBean;
|
||||||
import com.qxcm.moduleutil.bean.RoomBgBean;
|
import com.qxcm.moduleutil.bean.RoomBgBean;
|
||||||
@@ -43,6 +49,7 @@ import com.qxcm.moduleutil.bean.SongMusicBean;
|
|||||||
import com.qxcm.moduleutil.bean.TopRoom;
|
import com.qxcm.moduleutil.bean.TopRoom;
|
||||||
import com.qxcm.moduleutil.bean.UserBean;
|
import com.qxcm.moduleutil.bean.UserBean;
|
||||||
import com.qxcm.moduleutil.bean.UserInfo;
|
import com.qxcm.moduleutil.bean.UserInfo;
|
||||||
|
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.qxcm.moduleutil.bean.UserTagBean;
|
import com.qxcm.moduleutil.bean.UserTagBean;
|
||||||
import com.qxcm.moduleutil.bean.WalletBean;
|
import com.qxcm.moduleutil.bean.WalletBean;
|
||||||
import com.qxcm.moduleutil.bean.WalletConfig;
|
import com.qxcm.moduleutil.bean.WalletConfig;
|
||||||
@@ -73,7 +80,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded //请求验证码
|
@FormUrlEncoded //请求验证码
|
||||||
@POST(Constants.SEND_CODE)
|
@POST(Constants.SEND_CODE)
|
||||||
Observable<BaseModel<Object>> sendCode(@Field("mobile") String mobile,@Field("event")String event);
|
Observable<BaseModel<Object>> sendCode(@Field("mobile") String mobile, @Field("event") String event);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.LOGIN)
|
@POST(Constants.LOGIN)
|
||||||
@@ -87,20 +94,33 @@ public interface ApiServer {
|
|||||||
@POST(Constants.EARNINGS_NUM)
|
@POST(Constants.EARNINGS_NUM)
|
||||||
Call<BaseModel<String>> exchangeCoin(@Field("earnings_num") String earnings_num);
|
Call<BaseModel<String>> exchangeCoin(@Field("earnings_num") String earnings_num);
|
||||||
|
|
||||||
|
@GET(Constants.DELETE_ROOM_HISTORY)
|
||||||
|
Call<BaseModel<String>> delfoot();
|
||||||
|
|
||||||
|
@GET(Constants.GET_FIRST_CHARGE)
|
||||||
|
Call<BaseModel<FirstChargeBean>> firstCharge(@Query("uid") String user_id);
|
||||||
|
|
||||||
@POST(Constants.UPLOAD_NICK_NAME)
|
@POST(Constants.UPLOAD_NICK_NAME)
|
||||||
Call<ResponseBody> upUserNickname();
|
Call<ResponseBody> upUserNickname();
|
||||||
|
|
||||||
|
@GET(Constants.GET_APP_UPDATE)
|
||||||
|
Observable<BaseModel<AppUpdateModel>> appUpdate();
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.dailyTasksOpenBox)
|
@POST(Constants.dailyTasksOpenBox)
|
||||||
Observable<BaseModel<GiftName>> dailyTasksOpenBox(@Field("gift_box_id") String gift_box_id);
|
Observable<BaseModel<GiftName>> dailyTasksOpenBox(@Field("gift_box_id") String gift_box_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.SEND_HEADLINE)
|
@POST(Constants.SEND_HEADLINE)
|
||||||
Call<BaseModel<String>> sendHeadine(@Field("content") String content ,@Field("money") String money,@Field("room_id") String roomId);
|
Call<BaseModel<String>> sendHeadine(@Field("content") String content, @Field("money") String money, @Field("room_id") String roomId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_WITHDRAWAL)
|
@POST(Constants.POST_WITHDRAWAL)
|
||||||
Call<ResponseBody> withdrawal(@Field("number") String number,@Field("type") String type,@Field("sms_code") String sms_code);
|
Call<ResponseBody> withdrawal(@Field("number") String number, @Field("type") String type, @Field("sms_code") String sms_code);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_USER_WALL)
|
||||||
|
Observable<BaseModel<GiftUserWallBean>> giftWall(@Field("user_id")String userId);
|
||||||
|
|
||||||
@GET(Constants.CURRENT_HEADLINE)
|
@GET(Constants.CURRENT_HEADLINE)
|
||||||
Observable<BaseModel<HeadlineBean>> currentHeadline();
|
Observable<BaseModel<HeadlineBean>> currentHeadline();
|
||||||
@@ -120,7 +140,11 @@ public interface ApiServer {
|
|||||||
Observable<BaseModel<PlaceholderBean>> guildRanking();
|
Observable<BaseModel<PlaceholderBean>> guildRanking();
|
||||||
|
|
||||||
@GET(Constants.GET_WITHDRAWAL_LIST)
|
@GET(Constants.GET_WITHDRAWAL_LIST)
|
||||||
Observable<BaseModel<List<WithdrawalBean>>> withdrawalList(@Query("page") String page, @Query("page_limit") String page_limit,@Query("search_stime") String search_stime, @Query("search_etime") String search_etime);
|
Observable<BaseModel<List<WithdrawalBean>>> withdrawalList(@Query("page") String page, @Query("page_limit") String page_limit, @Query("search_stime") String search_stime, @Query("search_etime") String search_etime);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_MESSAGE_LIST)
|
||||||
|
Observable<BaseModel<List<NewsMessageList>>> getMessagetitle(@Field("type")String type, @Field("page")String page, @Field("page_limit")String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_RANK)
|
@POST(Constants.POST_ROOM_RANK)
|
||||||
@@ -128,10 +152,11 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_RANKING)
|
@POST(Constants.POST_ROOM_RANKING)
|
||||||
Observable<BaseModel<PlaceholderBean>> roomRanking( @Field("type") String type);
|
Observable<BaseModel<PlaceholderBean>> roomRanking(@Field("type") String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_LOVE_RANKING)
|
@POST(Constants.POST_LOVE_RANKING)
|
||||||
Observable<BaseModel<PlaceholderBean>> loveRanking( @Field("type") String type);
|
Observable<BaseModel<PlaceholderBean>> loveRanking(@Field("type") String type);
|
||||||
|
|
||||||
@GET(Constants.GET_REAL_NAME)
|
@GET(Constants.GET_REAL_NAME)
|
||||||
Observable<BaseModel<RealNameBean>> realNameInfo();
|
Observable<BaseModel<RealNameBean>> realNameInfo();
|
||||||
@@ -141,6 +166,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@GET(Constants.GET_MY_BAG_DATA)
|
@GET(Constants.GET_MY_BAG_DATA)
|
||||||
Observable<BaseModel<List<MyBagDataBean>>> packIncome(@Query("page") String page, @Query("page_limit") String page_size);
|
Observable<BaseModel<List<MyBagDataBean>>> packIncome(@Query("page") String page, @Query("page_limit") String page_size);
|
||||||
|
|
||||||
@GET(Constants.GET_MY_BAG_OUTCOME)
|
@GET(Constants.GET_MY_BAG_OUTCOME)
|
||||||
Observable<BaseModel<List<MyBagDataBean>>> packOutcome(@Query("page") String page, @Query("page_limit") String page_size);
|
Observable<BaseModel<List<MyBagDataBean>>> packOutcome(@Query("page") String page, @Query("page_limit") String page_size);
|
||||||
|
|
||||||
@@ -153,22 +179,22 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SEND_PK)
|
@POST(Constants.POST_SEND_PK)
|
||||||
Call<ResponseBody> sendPk(@Field("room_id_a") String room_id_a,@Field("create_user_id") String create_user_id,@Field("room_id_b") String room_id_b);
|
Call<ResponseBody> sendPk(@Field("room_id_a") String room_id_a, @Field("create_user_id") String create_user_id, @Field("room_id_b") String room_id_b);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_REFUSE_PK)
|
@POST(Constants.POST_REFUSE_PK)
|
||||||
Call<ResponseBody> refusePk(@Field("is_pk") String is_pk,@Field("room_id") String room_id);
|
Call<ResponseBody> refusePk(@Field("is_pk") String is_pk, @Field("room_id") String room_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_END_PK)
|
@POST(Constants.POST_END_PK)
|
||||||
Call<ResponseBody> endPk(@Field("pk_id") String is_pk,@Field("type") String type,@Field("user_id") String user_id);
|
Call<ResponseBody> endPk(@Field("pk_id") String is_pk, @Field("type") String type, @Field("user_id") String user_id);
|
||||||
|
|
||||||
@GET(Constants.GET_RECHARGE)
|
@GET(Constants.GET_RECHARGE)
|
||||||
Observable<BaseModel<List<RechargeBean>>> recharge();
|
Observable<BaseModel<List<RechargeBean>>> recharge();
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_START_PK)
|
@POST(Constants.POST_START_PK)
|
||||||
Call<ResponseBody> startPk(@Field("pk_id") String pk_id,@Field("pk_times") String pk_times);
|
Call<ResponseBody> startPk(@Field("pk_id") String pk_id, @Field("pk_times") String pk_times);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.UPLOAD_USER_PIC)
|
@POST(Constants.UPLOAD_USER_PIC)
|
||||||
@@ -184,18 +210,19 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.USER_UPDATE)
|
@POST(Constants.USER_UPDATE)
|
||||||
Observable<BaseModel<UserBean>> userUpdate(@Field("nickname")String nickname, @Field("birthday")String birthday,@Field("sex")String sex, @Field("avatar")String avatar,@Field("init_code")String init_code,@Field("user_id")String user_id);
|
Observable<BaseModel<UserBean>> userUpdate(@Field("nickname") String nickname, @Field("birthday") String birthday, @Field("sex") String sex, @Field("avatar") String avatar, @Field("init_code") String init_code, @Field("user_id") String user_id);
|
||||||
|
|
||||||
@GET(Constants.AUTHORIZATION)
|
@GET(Constants.AUTHORIZATION)
|
||||||
Call<ResponseBody> authorization();
|
Call<ResponseBody> authorization();
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.CHANGE_PASSWORD)
|
@POST(Constants.CHANGE_PASSWORD)
|
||||||
Call<BaseModel<String>> getPostData(@Field("new_password") String new_password,@Field("mobile") String mobile,@Field("sms_code") String code,@Field("user_id") String userId);
|
Call<BaseModel<String>> getPostData(@Field("new_password") String new_password, @Field("mobile") String mobile, @Field("sms_code") String code, @Field("user_id") String userId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.REAL_NAME_RESULT)
|
@POST(Constants.REAL_NAME_RESULT)
|
||||||
Call<BaseModel<String>> getRealNameResult(@Field("orderNo") String order_no);
|
Call<BaseModel<String>> getRealNameResult(@Field("orderNo") String order_no);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.URL_LOGIN)
|
@POST(Constants.URL_LOGIN)
|
||||||
Call<BaseModel<List<UserBean>>> oauthLogin(@Field("login_token") String login_token);
|
Call<BaseModel<List<UserBean>>> oauthLogin(@Field("login_token") String login_token);
|
||||||
@@ -203,6 +230,7 @@ public interface ApiServer {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.URL_AUTH_CODE)
|
@POST(Constants.URL_AUTH_CODE)
|
||||||
Observable<BaseModel<List<UserBean>>> authCode(@Field("auth_code") String login_token);
|
Observable<BaseModel<List<UserBean>>> authCode(@Field("auth_code") String login_token);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.URL_WX_CODE)
|
@POST(Constants.URL_WX_CODE)
|
||||||
Observable<BaseModel<List<UserBean>>> authCode1(@Field("code") String login_token);
|
Observable<BaseModel<List<UserBean>>> authCode1(@Field("code") String login_token);
|
||||||
@@ -215,19 +243,20 @@ public interface ApiServer {
|
|||||||
@POST(Constants.GET_EXPAND_COLUMN)
|
@POST(Constants.GET_EXPAND_COLUMN)
|
||||||
Observable<BaseModel<List<ExpandColumnBean>>> getExpandColumn(@Field("type") String type);
|
Observable<BaseModel<List<ExpandColumnBean>>> getExpandColumn(@Field("type") String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@GET(Constants.GET_OFFICIAL_NOTICE)
|
||||||
@POST(Constants.GET_OFFICIAL_NOTICE)
|
Observable<BaseModel<NewsDataBean>> getOfficialNotice();
|
||||||
Observable<BaseModel<List<NewsDataBean>>> getOfficialNotice( @Field("page") String page, @Field("page_limit") String page_limit,@Field("type") String type);
|
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_ALBUM_LIST)
|
@POST(Constants.GET_ALBUM_LIST)
|
||||||
Observable<BaseModel<List<AlbumBean>>> getAlbumList(@Field("page") String page, @Field("page_limit") String page_limit, @Field("user_id") String user_id);
|
Observable<BaseModel<List<AlbumBean>>> getAlbumList(@Field("page") String page, @Field("page_limit") String page_limit, @Field("user_id") String user_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.CREATE_ALBUM)
|
@POST(Constants.CREATE_ALBUM)
|
||||||
Call<BaseModel<String> > createAlbum(@Field("name") String name, @Field("pwd")String pwd, @Field("image") String image);
|
Call<BaseModel<String>> createAlbum(@Field("name") String name, @Field("pwd") String pwd, @Field("image") String image);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.EDIT_ALBUM)
|
@POST(Constants.EDIT_ALBUM)
|
||||||
Call<BaseModel<String> > editAlbum(@Field("album_id") String album_id,@Field("name") String name, @Field("pwd")String pwd, @Field("image") String image);
|
Call<BaseModel<String>> editAlbum(@Field("album_id") String album_id, @Field("name") String name, @Field("pwd") String pwd, @Field("image") String image);
|
||||||
|
|
||||||
@GET(Constants.GET_SJ_ROOM_NAME)
|
@GET(Constants.GET_SJ_ROOM_NAME)
|
||||||
Call<ResponseBody> sjRoomName();
|
Call<ResponseBody> sjRoomName();
|
||||||
@@ -235,24 +264,26 @@ public interface ApiServer {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_FOLLOW_LIST)
|
@POST(Constants.POST_FOLLOW_LIST)
|
||||||
Observable<BaseModel<List<BlackUserBean>>> getUserFollowList(@Field("page") String page, @Field("page_limit") String page_limit);
|
Observable<BaseModel<List<BlackUserBean>>> getUserFollowList(@Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_FANS_LIST)
|
@POST(Constants.POST_FANS_LIST)
|
||||||
Observable<BaseModel<List<BlackUserBean>>> getUserFansList(@Field("page") String page, @Field("page_limit") String page_limit);
|
Observable<BaseModel<List<BlackUserBean>>> getUserFansList(@Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_BLACK_LIST)
|
@POST(Constants.POST_BLACK_LIST)
|
||||||
Observable<BaseModel<List<BlackUserBean>>> getBlacklist(@Field("page") String page, @Field("page_limit") String page_limit);
|
Observable<BaseModel<List<BlackUserBean>>> getBlacklist(@Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_MY_ROOM)
|
@POST(Constants.GET_MY_ROOM)
|
||||||
Call<BaseModel<List<MyRoomBean>>> getMyRoom(@Field("type")String type,@Field("page") String page, @Field("page_limit") String page_limit);
|
Call<BaseModel<List<MyRoomBean>>> getMyRoom(@Field("type") String type, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_MY_ROOM_BEAN)
|
@POST(Constants.POST_MY_ROOM_BEAN)
|
||||||
Call<BaseModel<List<BannerModel>>> getBanners(@Field("type")String type);
|
Call<BaseModel<List<BannerModel>>> getBanners(@Field("type") String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_TOP_ROOM)
|
@POST(Constants.GET_TOP_ROOM)
|
||||||
Call<BaseModel<List<TopRoom>>> getTopRooms( @Field("page") String page, @Field("page_limit") String page_limit,@Field("is_top")String is_top,@Field("label_id")String label_id);
|
Call<BaseModel<List<TopRoom>>> getTopRooms(@Field("page") String page, @Field("page_limit") String page_limit, @Field("is_top") String is_top, @Field("label_id") String label_id);
|
||||||
|
|
||||||
@GET(Constants.GET_ROOM_TYPE)
|
@GET(Constants.GET_ROOM_TYPE)
|
||||||
Observable<BaseModel<List<RoomTypeModel>>> getRoomCategories();
|
Observable<BaseModel<List<RoomTypeModel>>> getRoomCategories();
|
||||||
@@ -268,26 +299,31 @@ public interface ApiServer {
|
|||||||
@GET(Constants.GET_GIFT_LABEL)
|
@GET(Constants.GET_GIFT_LABEL)
|
||||||
Observable<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("have_hot") String have_hot);
|
Observable<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("have_hot") String have_hot);
|
||||||
|
|
||||||
@GET(Constants.GIFT_LIST)//获取礼物列表
|
@GET(Constants.GIFT_LIST)
|
||||||
|
//获取礼物列表
|
||||||
Observable<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label);
|
Observable<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label);
|
||||||
|
|
||||||
@GET(Constants.TOPIC_LIST)//获取话题
|
@GET(Constants.TOPIC_LIST)
|
||||||
|
//获取话题
|
||||||
Observable<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
|
Observable<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.PUBLISH_ZONE)
|
@POST(Constants.PUBLISH_ZONE)
|
||||||
Call<BaseModel<String>> publishZone(@Field("images") String images, @Field("content") String content, @Field("topic_id") String topic_id, @Field("room_id") String room_id,@Field("ip") String ip);
|
Call<BaseModel<String>> publishZone(@Field("images") String images, @Field("content") String content, @Field("topic_id") String topic_id, @Field("room_id") String room_id, @Field("ip") String ip);
|
||||||
|
|
||||||
@GET(Constants.GET_CATEGORIES)
|
@GET(Constants.GET_CATEGORIES)
|
||||||
Observable<BaseModel<List<HeatedBean>>> getCategories();
|
Observable<BaseModel<List<HeatedBean>>> getCategories();
|
||||||
|
|
||||||
@GET(Constants.GET_CIRCLE_LIST)
|
@GET(Constants.GET_CIRCLE_LIST)
|
||||||
Observable<BaseModel<List<CircleListBean>>> getCircleList(@Query("page") String page, @Query("page_limit") String page_limit);
|
Observable<BaseModel<List<CircleListBean>>> getCircleList(@Query("page") String page, @Query("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_USER_HOME_ZONE)
|
@POST(Constants.GET_USER_HOME_ZONE)
|
||||||
Observable<BaseModel<List<CircleListBean>>> getCircleUserList(@Field("user_id") String user_id,@Field("page") String page, @Field("page_limit") String page_limit);
|
Observable<BaseModel<List<CircleListBean>>> getCircleUserList(@Field("user_id") String user_id, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@GET(Constants.GET_MY_FOOT)
|
@GET(Constants.GET_MY_FOOT)
|
||||||
Observable<BaseModel<List<MyFootResp>>> getMyFoot(@Query("page")String page, @Query("page_limit") String page_limit);
|
Observable<BaseModel<List<MyFootResp>>> getMyFoot(@Query("page") String page, @Query("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.LIKE_ZONE)
|
@POST(Constants.LIKE_ZONE)
|
||||||
Call<BaseModel<String>> likeZone(@Field("id") String zone_id);
|
Call<BaseModel<String>> likeZone(@Field("id") String zone_id);
|
||||||
@@ -314,7 +350,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SONG)
|
@POST(Constants.POST_SONG)
|
||||||
Observable<BaseModel<List<SongMusicBean>>> song(@Field("room_id")String roomId, @Field("user_id") String userId, @Field("song_code") String songCode, @Field("song_name")String songName, @Field("singer") String singer, @Field("poster") String poster, @Field("duration") String duration);
|
Observable<BaseModel<List<SongMusicBean>>> song(@Field("room_id") String roomId, @Field("user_id") String userId, @Field("song_code") String songCode, @Field("song_name") String songName, @Field("singer") String singer, @Field("poster") String poster, @Field("duration") String duration);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.COMMENT_ZONE)
|
@POST(Constants.COMMENT_ZONE)
|
||||||
@@ -346,6 +382,7 @@ public interface ApiServer {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.ED_USER_BG)
|
@POST(Constants.ED_USER_BG)
|
||||||
Call<BaseModel<String>> editUserBg(@Field("images") String images);
|
Call<BaseModel<String>> editUserBg(@Field("images") String images);
|
||||||
|
|
||||||
@GET(Constants.GET_USER_TAG_LIST)
|
@GET(Constants.GET_USER_TAG_LIST)
|
||||||
Observable<BaseModel<List<UserTagBean>>> getUserTagList();
|
Observable<BaseModel<List<UserTagBean>>> getUserTagList();
|
||||||
|
|
||||||
@@ -355,7 +392,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_ALBUM_DETAIL)
|
@POST(Constants.GET_ALBUM_DETAIL)
|
||||||
Observable<BaseModel<AlbumBean>> getAlbumDetail(@Field("album_id") String albumId, @Field("pwd") String pwd, @Field("page") String page, @Field("page_limit") String page_limit);
|
Observable<BaseModel<AlbumBean>> getAlbumDetail(@Field("album_id") String albumId, @Field("pwd") String pwd, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@GET(Constants.GET_PERSONALTY)
|
@GET(Constants.GET_PERSONALTY)
|
||||||
Observable<BaseModel<List<PersonaltyBean>>> getPersonaltyList();
|
Observable<BaseModel<List<PersonaltyBean>>> getPersonaltyList();
|
||||||
@@ -369,15 +406,24 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_GZ)
|
@POST(Constants.POST_GZ)
|
||||||
Call<BaseModel<String>> userGuanz(@Field("user_id") String userId,@Field("type")String type);
|
Call<BaseModel<String>> userGuanz(@Field("user_id") String userId, @Field("type") String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.ACCEPT_PK)
|
@POST(Constants.ACCEPT_PK)
|
||||||
Call<BaseModel<String>> acceptPk(@Field("pk_id") String pk_id,@Field("type")String type);
|
Call<BaseModel<String>> acceptPk(@Field("pk_id") String pk_id, @Field("type") String type);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_CLEAR_USER_CHARM)
|
||||||
|
Call<BaseModel<String>> clearUserCharm(@Field("room_id") String roomId,@Field("user_id") String userId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.REMOVE_BLACK_LIST)
|
@POST(Constants.REMOVE_BLACK_LIST)
|
||||||
Call<BaseModel<String>> removeBlackList(@Field("uid") String userId);
|
Call<BaseModel<String>> removeBlackList(@Field("uid") String userId);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_USER_OLINE_STATUS)
|
||||||
|
Call<BaseModel<List<UserOnlineStatusBean>>> userOnlineStatus(@Field("user_id") String userId,@Field("room_id")String roomId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.SET_USER_DECORATE)
|
@POST(Constants.SET_USER_DECORATE)
|
||||||
Call<BaseModel<String>> setUserDecorate(@Field("udid") String udid);
|
Call<BaseModel<String>> setUserDecorate(@Field("udid") String udid);
|
||||||
@@ -388,7 +434,8 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.MOVE_ALBUM)
|
@POST(Constants.MOVE_ALBUM)
|
||||||
Call<BaseModel<String>> moveAlbum(@Field("id") String id,@Field("new_album_id")String new_album_id);
|
Call<BaseModel<String>> moveAlbum(@Field("id") String id, @Field("new_album_id") String new_album_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.JOIN_ROOM)
|
@POST(Constants.JOIN_ROOM)
|
||||||
Observable<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("password") String password);
|
Observable<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("password") String password);
|
||||||
@@ -415,14 +462,18 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_ROOM_ONLINE)
|
@POST(Constants.GET_ROOM_ONLINE)
|
||||||
Observable<BaseModel<RoomOnline>> getRoomOnline(@Field("room_id")String roomId, @Field("page")String page, @Field("page_limit")String page_limit);
|
Observable<BaseModel<RoomOnline>> getRoomOnline(@Field("room_id") String roomId, @Field("page") String page, @Field("page_limit") String page_limit);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_GIVE_GIFT)
|
@POST(Constants.GET_GIVE_GIFT)
|
||||||
Call<BaseModel<String>> giveGift(@Field("user_id") String user_id, @Field("gid") String gid, @Field("num") String num, @Field("to_uid") String to_uid, @Field("gift_type") String gift_type);
|
Call<BaseModel<String>> giveGift(@Field("user_id") String user_id, @Field("gid") String gid, @Field("num") String num, @Field("to_uid") String to_uid, @Field("gift_type") String gift_type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_ROOM_GIFT)
|
@POST(Constants.GET_ROOM_GIFT)
|
||||||
Call<BaseModel<String>> roomGift(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_num") String num, @Field("to_uid") String to_uid, @Field("type") String gift_type, @Field("pit_number") String pit_number);
|
Call<BaseModel<String>> roomGift(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_num") String num, @Field("to_uid") String to_uid, @Field("type") String gift_type, @Field("pit_number") String pit_number);
|
||||||
|
|
||||||
|
@GET(Constants.GET_FIRST_CHARGE_GIFT)
|
||||||
|
Observable<BaseModel<FirstChargeGiftBean>> firstChargeGift();
|
||||||
|
|
||||||
@GET(Constants.GET_WALLET)
|
@GET(Constants.GET_WALLET)
|
||||||
Observable<BaseModel<WalletBean>> wallet();
|
Observable<BaseModel<WalletBean>> wallet();
|
||||||
@@ -433,11 +484,11 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_APPLY_LIST)
|
@POST(Constants.POST_APPLY_LIST)
|
||||||
Observable<BaseModel<RoomApplyListBean>> roomApplyListBean(@Field("room_id")String room_id);
|
Observable<BaseModel<RoomApplyListBean>> roomApplyListBean(@Field("room_id") String room_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_ROOM_USER)
|
@POST(Constants.GET_ROOM_USER)
|
||||||
Observable<BaseModel<UserInfo>> getRoomUserInfo(@Field("room_id") String roomId,@Field("user_id") String userId);
|
Observable<BaseModel<UserInfo>> getRoomUserInfo(@Field("room_id") String roomId, @Field("user_id") String userId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_BIND_TYPE)
|
@POST(Constants.POST_BIND_TYPE)
|
||||||
@@ -448,7 +499,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_BIND)
|
@POST(Constants.POST_BIND)
|
||||||
Call<BaseModel<String>> bind(@Field("user_id") String userId, @Field("type") String type, @Field("alipay_account") String alipay_account, @Field("bank_card_number")String bank_card_number, @Field("bank_card") String bank_card, @Field("open_bank") String open_bank);
|
Call<BaseModel<String>> bind(@Field("user_id") String userId, @Field("type") String type, @Field("alipay_account") String alipay_account, @Field("bank_card_number") String bank_card_number, @Field("bank_card") String bank_card, @Field("open_bank") String open_bank);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SONG_LIST)
|
@POST(Constants.POST_SONG_LIST)
|
||||||
@@ -457,17 +508,18 @@ public interface ApiServer {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.APPLY_PIT)
|
@POST(Constants.APPLY_PIT)
|
||||||
Call<BaseModel<String>> applyPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
Call<BaseModel<String>> applyPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.DOWN_PIT)
|
@POST(Constants.DOWN_PIT)
|
||||||
Call<BaseModel<String>> downPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
Call<BaseModel<String>> downPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.REWARD_ZONE)
|
@POST(Constants.REWARD_ZONE)
|
||||||
Call<BaseModel<String>> reward_zone(@Field("id") String id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("is_pack") String is_pack);
|
Call<BaseModel<String>> reward_zone(@Field("id") String id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("is_pack") String is_pack);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_UP_SONG)
|
@POST(Constants.POST_UP_SONG)
|
||||||
Call<BaseModel<String>> upSong(@Field("did") String did,@Field("type") String type);
|
Call<BaseModel<String>> upSong(@Field("did") String did, @Field("type") String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_CHANGE_ROOM)
|
@POST(Constants.POST_CHANGE_ROOM)
|
||||||
@@ -479,7 +531,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.SET_ROOM_APPLY)
|
@POST(Constants.SET_ROOM_APPLY)
|
||||||
Call<BaseModel<String>> setRoomApply(@Field("room_id") String room_id,@Field("gift_id") String gift_id,@Field("gift_price") String gift_price);
|
Call<BaseModel<String>> setRoomApply(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_price") String gift_price);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.CLEAR_APPLY)
|
@POST(Constants.CLEAR_APPLY)
|
||||||
@@ -487,11 +539,11 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.AGREE_PIT)
|
@POST(Constants.AGREE_PIT)
|
||||||
Call<BaseModel<String>> agreePit(@Field("room_id") String roomId,@Field("user_id") String userId);
|
Call<BaseModel<String>> agreePit(@Field("room_id") String roomId, @Field("user_id") String userId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.REFUSE_PIT)
|
@POST(Constants.REFUSE_PIT)
|
||||||
Call<BaseModel<String>> refusePit(@Field("room_id") String roomId,@Field("user_id") String userId);
|
Call<BaseModel<String>> refusePit(@Field("room_id") String roomId, @Field("user_id") String userId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.HELP_APPLY)
|
@POST(Constants.HELP_APPLY)
|
||||||
@@ -503,7 +555,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_AGREE_SONG)
|
@POST(Constants.POST_AGREE_SONG)
|
||||||
Call<BaseModel<String>> agreeSong(@Field("room_id") String roomId,@Field("type") String type);
|
Call<BaseModel<String>> agreeSong(@Field("room_id") String roomId, @Field("type") String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_END_SONG)
|
@POST(Constants.POST_END_SONG)
|
||||||
@@ -515,7 +567,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.CHANGE_SONG)
|
@POST(Constants.CHANGE_SONG)
|
||||||
Call<BaseModel<String>> changeSong(@Field("room_id") String roomId,@Field("now_did") String now_did);
|
Call<BaseModel<String>> changeSong(@Field("room_id") String roomId, @Field("now_did") String now_did);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_HOST_LIST)
|
@POST(Constants.POST_HOST_LIST)
|
||||||
@@ -524,6 +576,7 @@ public interface ApiServer {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_CHARM_RANK)
|
@POST(Constants.GET_CHARM_RANK)
|
||||||
Observable<BaseModel<List<RoomCharmRankBean>>> getCharmRank(@Field("room_id") String roomId);
|
Observable<BaseModel<List<RoomCharmRankBean>>> getCharmRank(@Field("room_id") String roomId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_RELATION_LIST)
|
@POST(Constants.POST_ROOM_RELATION_LIST)
|
||||||
Observable<BaseModel<List<RoomRelationBean>>> roomRelationList(@Field("type") String type);
|
Observable<BaseModel<List<RoomRelationBean>>> roomRelationList(@Field("type") String type);
|
||||||
@@ -538,62 +591,81 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.SET_PRESIDED_RATIO)
|
@POST(Constants.SET_PRESIDED_RATIO)
|
||||||
Call<BaseModel<String>> setPresidedRatio(@Field("room_id") String room_id,@Field("user_id") String userId,@Field("ratio") String ration);
|
Call<BaseModel<String>> setPresidedRatio(@Field("room_id") String room_id, @Field("user_id") String userId, @Field("ratio") String ration);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.GET_PRESIDED_RATIO)
|
@POST(Constants.GET_PRESIDED_RATIO)
|
||||||
Call<BaseModel<String>> getPresidedRatio(@Field("room_id") String room_id,@Field("user_id") String userId,@Field("type") String type,@Field("is_add") String is_add);
|
Call<BaseModel<String>> getPresidedRatio(@Field("room_id") String room_id, @Field("user_id") String userId, @Field("type") String type, @Field("is_add") String is_add);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_HOST_PIT)
|
@POST(Constants.POST_ROOM_HOST_PIT)
|
||||||
Call<BaseModel<String>> hostUserPit(@Field("room_id") String room_id,@Field("pit_number") String pit_number,@Field("user_id") String userId,@Field("type") String type);
|
Call<BaseModel<String>> hostUserPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number, @Field("user_id") String userId, @Field("type") String type);
|
||||||
|
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_GIVE_COIN)
|
||||||
|
Call<BaseModel<String>> giveCoin(@Field("user_id") String user_id,@Field("coin") String coin);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SET_MUTE_PIT)
|
@POST(Constants.POST_SET_MUTE_PIT)
|
||||||
Call<BaseModel<String>> setMutePit(@Field("room_id") String room_id,@Field("user_id") String user_id,@Field("is_mute") String is_mute);
|
Call<BaseModel<String>> setMutePit(@Field("room_id") String room_id, @Field("user_id") String user_id, @Field("is_mute") String is_mute);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SET_LOCK_PIT)
|
@POST(Constants.POST_SET_LOCK_PIT)
|
||||||
Call<BaseModel<String>> setLockPit(@Field("room_id") String room_id,@Field("pit_number") String pit_number,@Field("is_lock") String is_lock);
|
Call<BaseModel<String>> setLockPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number, @Field("is_lock") String is_lock);
|
||||||
|
|
||||||
@GET(Constants.GET_ROOM_BJ)
|
@GET(Constants.GET_ROOM_BJ)
|
||||||
Observable<BaseModel<RoomBgBean>> getBackgroundList();
|
Observable<BaseModel<RoomBgBean>> getBackgroundList();
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_CHARM_LIST)
|
@POST(Constants.POST_CHARM_LIST)
|
||||||
Observable<BaseModel<RoomDetails>> getCharmList(@Field("room_id") String room_id,@Field("start_time") String start_time,@Field("end_time") String end_time);
|
Observable<BaseModel<RoomDetails>> getCharmList(@Field("room_id") String room_id, @Field("start_time") String start_time, @Field("end_time") String end_time);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SET_UPLOAD_BG_IMG)
|
@POST(Constants.POST_SET_UPLOAD_BG_IMG)
|
||||||
Call<BaseModel<String>> setUploadBgImg(@Field("id") String id,@Field("image_url") String image_url);
|
Call<BaseModel<String>> setUploadBgImg(@Field("id") String id, @Field("image_url") String image_url);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_AUCTION_DELAY)
|
@POST(Constants.POST_AUCTION_DELAY)
|
||||||
Call<BaseModel<String>> auctionDelay(@Field("auction_id") String auction_id);
|
Call<BaseModel<String>> auctionDelay(@Field("auction_id") String auction_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_AUCTION_END)
|
@POST(Constants.POST_AUCTION_END)
|
||||||
Call<BaseModel<String>> auctionEnd(@Field("auction_id") String auction_id);
|
Call<BaseModel<String>> auctionEnd(@Field("auction_id") String auction_id,@Field("room_id") String room_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_AUCTION_MODE)
|
@POST(Constants.POST_AUCTION_MODE)
|
||||||
Call<BaseModel<String>> auctionMode(@Field("room_id") String room_id,@Field("label_id") String label_id);
|
Call<BaseModel<String>> auctionMode(@Field("room_id") String room_id, @Field("label_id") String label_id);
|
||||||
|
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_EDIT_ROOM)
|
@POST(Constants.POST_EDIT_ROOM)
|
||||||
Call<BaseModel<String>> editRoom(@Field("room_id") String room_id,@Field("room_name") String room_name,@Field("room_cover") String room_cover,@Field("room_intro") String room_intro,@Field("room_background") String room_background);
|
Call<BaseModel<String>> editRoom(@Field("room_id") String room_id, @Field("room_name") String room_name, @Field("room_cover") String room_cover, @Field("room_intro") String room_intro, @Field("room_background") String room_background);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_KICK_OUT_ROOM)
|
@POST(Constants.POST_KICK_OUT_ROOM)
|
||||||
Call<BaseModel<String>> kickOutRoom(@Field("room_id") String room_id,@Field("user_id") String user_id);
|
Call<BaseModel<String>> kickOutRoom(@Field("room_id") String room_id, @Field("user_id") String user_id);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_QUIT_ROOM)
|
@POST(Constants.POST_QUIT_ROOM)
|
||||||
Call<BaseModel<String>> quitRoom(@Field("room_id") String room_id,@Field("user_id") String user_id);
|
Call<BaseModel<String>> quitRoom(@Field("room_id") String room_id, @Field("user_id") String user_id);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_RELATION_CARD)
|
||||||
|
Observable<BaseModel<RelationCardBean>> relationCard(@Field("user_id") String user_id);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_TOP_RELATION_CARD)
|
||||||
|
Call<BaseModel<String>> topRelationCard(@Field("id") String id);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.POST_DELETE_RELATION_CARD)
|
||||||
|
Call<BaseModel<String>> deleteRelationCard(@Field("id") String id);
|
||||||
|
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_AUCTION)
|
@POST(Constants.POST_ROOM_AUCTION)
|
||||||
Observable<BaseModel<AuctionBean>> roomAuction(@Field("room_id") String room_id,@Field("user_id")String user_id,@Field("gift_id")String gift_id,@Field("relation_id")String relation_id,@Field("auction_type")String auction_type,@Field("time_day")String time_day);
|
Observable<BaseModel<AuctionBean>> roomAuction(@Field("room_id") String room_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("relation_id") String relation_id, @Field("auction_type") String auction_type, @Field("time_day") String time_day);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_AUCTION_TIME)
|
@POST(Constants.POST_ROOM_AUCTION_TIME)
|
||||||
@@ -601,10 +673,10 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_ROOM_AUCTION_JOIN)
|
@POST(Constants.POST_ROOM_AUCTION_JOIN)
|
||||||
Observable<BaseModel<RoomAuction.AuctionListBean>> roomAuctionJoin(@Field("auction_id")String auction_id,@Field("user_id")String user_id,@Field("gift_id")String gift_id,@Field("num")String num,@Field("type")String type);
|
Observable<BaseModel<RoomAuction.AuctionListBean>> roomAuctionJoin(@Field("auction_id") String auction_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("type") String type);
|
||||||
|
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.POST_SEARCH_PK_ROOM)
|
@POST(Constants.POST_SEARCH_PK_ROOM)
|
||||||
Observable<BaseModel<List<RoomBean>>> searchPkRoom(@Field("room_id")String room_id,@Field("page")String page,@Field("limit")String limit);
|
Observable<BaseModel<List<RoomBean>>> searchPkRoom(@Field("room_id") String room_id, @Field("page") String page, @Field("limit") String limit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import org.greenrobot.eventbus.EventBus;
|
|||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
@@ -60,7 +62,7 @@ public abstract class BaseObserver<T> implements Observer<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (showErrMsg && !TextUtils.isEmpty(apiException.getMessage())) {
|
if (showErrMsg && !TextUtils.isEmpty(apiException.getMessage())) {
|
||||||
ToastUtils.show(apiException.getMessage());
|
ToastUtils.show(extractChinese(apiException.getMessage()));
|
||||||
}
|
}
|
||||||
} else if (e instanceof APIException) {
|
} else if (e instanceof APIException) {
|
||||||
APIException apiException = (APIException) e;
|
APIException apiException = (APIException) e;
|
||||||
@@ -78,6 +80,17 @@ public abstract class BaseObserver<T> implements Observer<T> {
|
|||||||
onComplete();
|
onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String extractChinese(String message) {
|
||||||
|
// 使用正则表达式提取中文字符
|
||||||
|
StringBuilder chinesePart = new StringBuilder();
|
||||||
|
Pattern pattern = Pattern.compile("[\\u4e00-\\u9fa5]+");
|
||||||
|
Matcher matcher = pattern.matcher(message);
|
||||||
|
while (matcher.find()) {
|
||||||
|
chinesePart.append(matcher.group());
|
||||||
|
}
|
||||||
|
return chinesePart.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public void onErrorCode(int code) {
|
public void onErrorCode(int code) {
|
||||||
Logger.e("onErrorCode", code);
|
Logger.e("onErrorCode", code);
|
||||||
if (code == 2) {
|
if (code == 2) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.qxcm.moduleutil.http;
|
package com.qxcm.moduleutil.http;
|
||||||
|
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.TypeAdapter;
|
import com.google.gson.TypeAdapter;
|
||||||
import com.qxcm.moduleutil.utils.GsonUtils;
|
import com.qxcm.moduleutil.utils.GsonUtils;
|
||||||
@@ -31,7 +32,10 @@ public class ResponseBodyConverter<T> implements Converter<ResponseBody, T> {
|
|||||||
value.close();
|
value.close();
|
||||||
return adapter.fromJson(json);
|
return adapter.fromJson(json);
|
||||||
} else {
|
} else {
|
||||||
throw new APIException(obj.getCode(), info);
|
if(!info.contains("更新失败")) {
|
||||||
|
ToastUtils.showShort(info);
|
||||||
|
}
|
||||||
|
// throw new APIException(obj.getCode(), info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value.close();
|
value.close();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
import com.qxcm.moduleutil.base.CommonAppContext;
|
import com.qxcm.moduleutil.base.CommonAppContext;
|
||||||
import com.qxcm.moduleutil.bean.AlbumBean;
|
import com.qxcm.moduleutil.bean.AlbumBean;
|
||||||
import com.qxcm.moduleutil.bean.AppPay;
|
import com.qxcm.moduleutil.bean.AppPay;
|
||||||
|
import com.qxcm.moduleutil.bean.AppUpdateModel;
|
||||||
import com.qxcm.moduleutil.bean.BannerModel;
|
import com.qxcm.moduleutil.bean.BannerModel;
|
||||||
import com.qxcm.moduleutil.bean.BindType;
|
import com.qxcm.moduleutil.bean.BindType;
|
||||||
import com.qxcm.moduleutil.bean.BlackUserBean;
|
import com.qxcm.moduleutil.bean.BlackUserBean;
|
||||||
@@ -25,11 +26,14 @@ import com.qxcm.moduleutil.bean.CharmRankingResp;
|
|||||||
import com.qxcm.moduleutil.bean.CircleListBean;
|
import com.qxcm.moduleutil.bean.CircleListBean;
|
||||||
import com.qxcm.moduleutil.bean.CommentBean;
|
import com.qxcm.moduleutil.bean.CommentBean;
|
||||||
import com.qxcm.moduleutil.bean.ExpandColumnBean;
|
import com.qxcm.moduleutil.bean.ExpandColumnBean;
|
||||||
|
import com.qxcm.moduleutil.bean.FirstChargeBean;
|
||||||
|
import com.qxcm.moduleutil.bean.FirstChargeGiftBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftBoxBean;
|
import com.qxcm.moduleutil.bean.GiftBoxBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftBoxRecordBean;
|
import com.qxcm.moduleutil.bean.GiftBoxRecordBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
||||||
import com.qxcm.moduleutil.bean.GiftName;
|
import com.qxcm.moduleutil.bean.GiftName;
|
||||||
import com.qxcm.moduleutil.bean.GiftPackBean;
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftUserWallBean;
|
||||||
import com.qxcm.moduleutil.bean.HeadlineBean;
|
import com.qxcm.moduleutil.bean.HeadlineBean;
|
||||||
import com.qxcm.moduleutil.bean.HeatedBean;
|
import com.qxcm.moduleutil.bean.HeatedBean;
|
||||||
import com.qxcm.moduleutil.bean.HostBean;
|
import com.qxcm.moduleutil.bean.HostBean;
|
||||||
@@ -39,10 +43,12 @@ import com.qxcm.moduleutil.bean.MyCpRoom;
|
|||||||
import com.qxcm.moduleutil.bean.MyFootResp;
|
import com.qxcm.moduleutil.bean.MyFootResp;
|
||||||
import com.qxcm.moduleutil.bean.MyRoomBean;
|
import com.qxcm.moduleutil.bean.MyRoomBean;
|
||||||
import com.qxcm.moduleutil.bean.NewsDataBean;
|
import com.qxcm.moduleutil.bean.NewsDataBean;
|
||||||
|
import com.qxcm.moduleutil.bean.NewsMessageList;
|
||||||
import com.qxcm.moduleutil.bean.PersonaltyBean;
|
import com.qxcm.moduleutil.bean.PersonaltyBean;
|
||||||
import com.qxcm.moduleutil.bean.PlaceholderBean;
|
import com.qxcm.moduleutil.bean.PlaceholderBean;
|
||||||
import com.qxcm.moduleutil.bean.RealNameBean;
|
import com.qxcm.moduleutil.bean.RealNameBean;
|
||||||
import com.qxcm.moduleutil.bean.RechargeBean;
|
import com.qxcm.moduleutil.bean.RechargeBean;
|
||||||
|
import com.qxcm.moduleutil.bean.RelationCardBean;
|
||||||
import com.qxcm.moduleutil.bean.RevenueBean;
|
import com.qxcm.moduleutil.bean.RevenueBean;
|
||||||
import com.qxcm.moduleutil.bean.RewardUserBean;
|
import com.qxcm.moduleutil.bean.RewardUserBean;
|
||||||
import com.qxcm.moduleutil.bean.RoomBgBean;
|
import com.qxcm.moduleutil.bean.RoomBgBean;
|
||||||
@@ -60,6 +66,7 @@ import com.qxcm.moduleutil.bean.TopRoom;
|
|||||||
import com.qxcm.moduleutil.bean.UserBean;
|
import com.qxcm.moduleutil.bean.UserBean;
|
||||||
import com.qxcm.moduleutil.bean.UserFollowBean;
|
import com.qxcm.moduleutil.bean.UserFollowBean;
|
||||||
import com.qxcm.moduleutil.bean.UserInfo;
|
import com.qxcm.moduleutil.bean.UserInfo;
|
||||||
|
import com.qxcm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.qxcm.moduleutil.bean.UserTagBean;
|
import com.qxcm.moduleutil.bean.UserTagBean;
|
||||||
import com.qxcm.moduleutil.bean.WalletBean;
|
import com.qxcm.moduleutil.bean.WalletBean;
|
||||||
import com.qxcm.moduleutil.bean.WalletConfig;
|
import com.qxcm.moduleutil.bean.WalletConfig;
|
||||||
@@ -223,6 +230,9 @@ public class RetrofitClient {
|
|||||||
// login("18229732986", "123456");
|
// login("18229732986", "123456");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void appUpdate(BaseObserver<AppUpdateModel> observer) {
|
||||||
|
sApiServer.appUpdate().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
|
}
|
||||||
|
|
||||||
public void sendCode(String mobile, String event, BaseObserver<Object> observer) {
|
public void sendCode(String mobile, String event, BaseObserver<Object> observer) {
|
||||||
sApiServer.sendCode(mobile, event).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.sendCode(mobile, event).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
@@ -290,18 +300,60 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void withdrawal(String number, String type, String sms_code, BaseObserver<String> observer){
|
public void delfoot(BaseObserver<String> observer) {
|
||||||
|
sApiServer.delfoot().enqueue(new Callback<BaseModel<String>>() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
onNextRetu(response, observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void firstCharge(String uid, BaseObserver<FirstChargeBean> observer) {
|
||||||
|
sApiServer.firstCharge(uid).enqueue(new Callback<BaseModel<FirstChargeBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<FirstChargeBean>> call, Response<BaseModel<FirstChargeBean>> response) {
|
||||||
|
if (response.code() == 200) {
|
||||||
|
BaseModel<FirstChargeBean> baseModel = response.body();
|
||||||
|
if (baseModel != null) {
|
||||||
|
observer.onNext(baseModel.getData());
|
||||||
|
} else {
|
||||||
|
ToastUtils.showShort("获取数据失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<FirstChargeBean>> call, Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void giftWall(String userId, BaseObserver<GiftUserWallBean> observer) {
|
||||||
|
sApiServer.giftWall(userId).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void withdrawal(String number, String type, String sms_code, BaseObserver<String> observer) {
|
||||||
sApiServer.withdrawal(number, type, sms_code).enqueue(new Callback<ResponseBody>() {
|
sApiServer.withdrawal(number, type, sms_code).enqueue(new Callback<ResponseBody>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||||
if (response.code()==200){
|
if (response.code() == 200) {
|
||||||
try {
|
try {
|
||||||
String json = response.body().string();
|
String json = response.body().string();
|
||||||
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
||||||
if (baseModel.getCode()==1) {
|
if (baseModel.getCode() == 1) {
|
||||||
baseModel.setData(baseModel.getMsg());
|
baseModel.setData(baseModel.getMsg());
|
||||||
observer.onNext(baseModel.getData());
|
observer.onNext(baseModel.getData());
|
||||||
}else {
|
} else {
|
||||||
baseModel.setData(baseModel.getMsg());
|
baseModel.setData(baseModel.getMsg());
|
||||||
observer.onNext(baseModel.getData());
|
observer.onNext(baseModel.getData());
|
||||||
}
|
}
|
||||||
@@ -321,50 +373,56 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void withdrawalList(String page,String page_limit,String search_stime,String search_etime,BaseObserver<List<WithdrawalBean>> observer){
|
public void getMessagetitle(String type, String page, String page_limit, BaseObserver<List<NewsMessageList>> observer) {
|
||||||
sApiServer.withdrawalList(page,page_limit,search_stime,search_etime).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.getMessagetitle(type, page, page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getRoomRank(String roomId, String type, String time_type, String page, String page_limit, BaseObserver<List<CharmRankingResp>> observer){
|
public void withdrawalList(String page, String page_limit, String search_stime, String search_etime, BaseObserver<List<WithdrawalBean>> observer) {
|
||||||
|
sApiServer.withdrawalList(page, page_limit, search_stime, search_etime).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getRoomRank(String roomId, String type, String time_type, String page, String page_limit, BaseObserver<List<CharmRankingResp>> observer) {
|
||||||
sApiServer.getRoomRank(roomId, type, time_type, page, page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.getRoomRank(roomId, type, time_type, page, page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void wealthRanking(String ranking_type, String type, BaseObserver<PlaceholderBean> observer){
|
public void wealthRanking(String ranking_type, String type, BaseObserver<PlaceholderBean> observer) {
|
||||||
if (ranking_type.equals("0")){
|
if (ranking_type.equals("0")) {
|
||||||
sApiServer.roomRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.roomRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}else if (ranking_type.equals("1") || ranking_type.equals("2")) {
|
} else if (ranking_type.equals("1") || ranking_type.equals("2")) {
|
||||||
sApiServer.wealthRanking(ranking_type, type).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.wealthRanking(ranking_type, type).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}else if (ranking_type.equals("3")) {
|
} else if (ranking_type.equals("3")) {
|
||||||
sApiServer.guildRanking().compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.guildRanking().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}else if (ranking_type.equals("4")){
|
} else if (ranking_type.equals("4")) {
|
||||||
sApiServer.loveRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.loveRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dailyTasksBoxRecord(BaseObserver<List<GiftBoxRecordBean>> observer){
|
public void dailyTasksBoxRecord(BaseObserver<List<GiftBoxRecordBean>> observer) {
|
||||||
sApiServer.dailyTasksBoxRecord().compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.dailyTasksBoxRecord().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void packIncome(String page,String page_limit,BaseObserver<List<MyBagDataBean>> observer){
|
public void packIncome(String page, String page_limit, BaseObserver<List<MyBagDataBean>> observer) {
|
||||||
sApiServer.packIncome(page,page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.packIncome(page, page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
|
||||||
public void packOutcome(String page,String page_limit,BaseObserver<List<MyBagDataBean>> observer){
|
|
||||||
sApiServer.packOutcome(page,page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giftPack(BaseObserver<List<GiftPackBean>> observer){
|
public void packOutcome(String page, String page_limit, BaseObserver<List<MyBagDataBean>> observer) {
|
||||||
|
sApiServer.packOutcome(page, page_limit).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void giftPack(BaseObserver<List<GiftPackBean>> observer) {
|
||||||
sApiServer.giftPack().compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.giftPack().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tasksLihen(BaseObserver<GiftBoxBean> observer){
|
public void tasksLihen(BaseObserver<GiftBoxBean> observer) {
|
||||||
sApiServer.tasksLihen().enqueue(new Callback<ResponseBody>() {
|
sApiServer.tasksLihen().enqueue(new Callback<ResponseBody>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||||
if (response.code()==200){
|
if (response.code() == 200) {
|
||||||
String json = null;
|
String json = null;
|
||||||
try {
|
try {
|
||||||
json = response.body().string();
|
json = response.body().string();
|
||||||
Type type = new TypeToken<BaseModel<GiftBoxBean>>(){}.getType();
|
Type type = new TypeToken<BaseModel<GiftBoxBean>>() {
|
||||||
|
}.getType();
|
||||||
BaseModel<GiftBoxBean> baseModel = GsonUtils.fromJson(json, type);
|
BaseModel<GiftBoxBean> baseModel = GsonUtils.fromJson(json, type);
|
||||||
observer.onNext(baseModel.getData());
|
observer.onNext(baseModel.getData());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -381,12 +439,12 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dailyTasksOpenBox(String gift_box_id, BaseObserver<GiftName> observer){
|
public void dailyTasksOpenBox(String gift_box_id, BaseObserver<GiftName> observer) {
|
||||||
sApiServer.dailyTasksOpenBox(gift_box_id).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.dailyTasksOpenBox(gift_box_id).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendHeadine(String content, String money,String roomId, BaseObserver<String> observer) {
|
public void sendHeadine(String content, String money, String roomId, BaseObserver<String> observer) {
|
||||||
sApiServer.sendHeadine(content, money,roomId).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.sendHeadine(content, money, roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
onNextRetu(response, observer);
|
onNextRetu(response, observer);
|
||||||
@@ -475,6 +533,7 @@ public class RetrofitClient {
|
|||||||
try {
|
try {
|
||||||
String json = response.body().string();
|
String json = response.body().string();
|
||||||
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
||||||
|
ToastUtils.showShort(baseModel.getMsg());
|
||||||
observer.onNext(baseModel.getData());
|
observer.onNext(baseModel.getData());
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -553,7 +612,7 @@ public class RetrofitClient {
|
|||||||
sApiServer.authorization().enqueue(new Callback<ResponseBody>() {
|
sApiServer.authorization().enqueue(new Callback<ResponseBody>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||||
if (response.code()==200){
|
if (response.code() == 200) {
|
||||||
try {
|
try {
|
||||||
String json = response.body().string();
|
String json = response.body().string();
|
||||||
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
||||||
@@ -618,9 +677,9 @@ public class RetrofitClient {
|
|||||||
sApiServer.getExpandColumn(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.getExpandColumn(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取官方公告数据或者系统消息,根据type区分 type=1是系统消息,type=2是官方公告
|
//获取官方公告数据或者系统消息,
|
||||||
public void getOfficialNotice(String page, String page_limit, String type, BaseObserver<List<NewsDataBean>> observer) {
|
public void getOfficialNotice(BaseObserver<NewsDataBean> observer) {
|
||||||
sApiServer.getOfficialNotice(page, page_limit, type).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.getOfficialNotice().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getAlbumList(String page, String page_limit, String userId, BaseObserver<List<AlbumBean>> observer) {
|
public void getAlbumList(String page, String page_limit, String userId, BaseObserver<List<AlbumBean>> observer) {
|
||||||
@@ -650,8 +709,8 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getMyRoom(String type, BaseObserver<List<MyRoomBean>> observer) {
|
public void getMyRoom(String type, String page, String page_limit, BaseObserver<List<MyRoomBean>> observer) {
|
||||||
sApiServer.getMyRoom(type, "1", "20").enqueue(new Callback<BaseModel<List<MyRoomBean>>>() {
|
sApiServer.getMyRoom(type, page, page_limit).enqueue(new Callback<BaseModel<List<MyRoomBean>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<BaseModel<List<MyRoomBean>>> call, Response<BaseModel<List<MyRoomBean>>> response) {
|
public void onResponse(Call<BaseModel<List<MyRoomBean>>> call, Response<BaseModel<List<MyRoomBean>>> response) {
|
||||||
if (response.code() == 200) {
|
if (response.code() == 200) {
|
||||||
@@ -949,11 +1008,15 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void auctionEnd(String auctionId, BaseObserver<String> observer) {
|
public void auctionEnd(String auctionId, String roomId, BaseObserver<String> observer) {
|
||||||
sApiServer.auctionEnd(auctionId).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.auctionEnd(auctionId, roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
onNextRetu(response, observer);
|
if (response.code() == 200) {
|
||||||
|
|
||||||
|
observer.onNext(null);
|
||||||
|
}
|
||||||
|
// onNextRetu(response, observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1160,6 +1223,10 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void firstChargeGift(BaseObserver<FirstChargeGiftBean> observer) {
|
||||||
|
sApiServer.firstChargeGift().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
|
}
|
||||||
|
|
||||||
public void applyPit(String roomId, String pitNumber, BaseObserver<String> observer) {
|
public void applyPit(String roomId, String pitNumber, BaseObserver<String> observer) {
|
||||||
sApiServer.applyPit(roomId, pitNumber).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.applyPit(roomId, pitNumber).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -1316,6 +1383,59 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void giveCoin(String user_id, String coin, BaseObserver<String> observer) {
|
||||||
|
sApiServer.giveCoin(user_id, coin).enqueue(new Callback<BaseModel<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
if (response.code() == 200) {
|
||||||
|
BaseModel<String> baseModel = response.body();
|
||||||
|
if (baseModel.getCode() == 1) {
|
||||||
|
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
|
||||||
|
observer.onNext(baseModel.getData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void relationCard(String user_id, BaseObserver<RelationCardBean> observer) {
|
||||||
|
sApiServer.relationCard(user_id).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void topRelationCard(String id, BaseObserver<String> observer) {
|
||||||
|
sApiServer.topRelationCard(id).enqueue(new Callback<BaseModel<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
onNextRetu(response, observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||||
|
com.blankj.utilcode.util.ToastUtils.showShort(t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteRelationCard(String id, BaseObserver<String> observer) {
|
||||||
|
sApiServer.deleteRelationCard(id).enqueue(new Callback<BaseModel<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
onNextRetu(response, observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||||
|
com.blankj.utilcode.util.ToastUtils.showShort(t.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void quitRoom(String room_id, String user_id, BaseObserver<String> observer) {
|
public void quitRoom(String room_id, String user_id, BaseObserver<String> observer) {
|
||||||
sApiServer.quitRoom(room_id, user_id).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.quitRoom(room_id, user_id).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -1338,9 +1458,9 @@ public class RetrofitClient {
|
|||||||
try {
|
try {
|
||||||
String json = response.body().string();
|
String json = response.body().string();
|
||||||
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
BaseModel<String> baseModel = GsonUtils.fromJson(json, BaseModel.class);
|
||||||
if (baseModel.getCode()==1) {
|
if (baseModel.getCode() == 1) {
|
||||||
observer.onNext(baseModel.getData());
|
observer.onNext(baseModel.getData());
|
||||||
}else {
|
} else {
|
||||||
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
|
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -1594,6 +1714,39 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearUserCharm(String roomId, String userId, BaseObserver<String> observer) {
|
||||||
|
sApiServer.clearUserCharm(roomId, userId).enqueue(new Callback<BaseModel<String>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
onNextRetu(response, observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||||
|
com.blankj.utilcode.util.ToastUtils.showShort(t.toString());
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void userOnlineStatus(String user_id, String roomId, BaseObserver<List<UserOnlineStatusBean>> observer) {
|
||||||
|
sApiServer.userOnlineStatus(user_id, roomId).enqueue(new Callback<BaseModel<List<UserOnlineStatusBean>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<BaseModel<List<UserOnlineStatusBean>>> call, Response<BaseModel<List<UserOnlineStatusBean>>> response) {
|
||||||
|
if (response.code() == 200) {
|
||||||
|
BaseModel<List<UserOnlineStatusBean>> baseModel = response.body();
|
||||||
|
observer.onNext(baseModel.getData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<BaseModel<List<UserOnlineStatusBean>>> call, Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void removeBlackList(String user_id, BaseObserver<String> observer) {
|
public void removeBlackList(String user_id, BaseObserver<String> observer) {
|
||||||
sApiServer.removeBlackList(user_id).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.removeBlackList(user_id).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -1742,6 +1895,7 @@ public class RetrofitClient {
|
|||||||
int code = string.getCode();
|
int code = string.getCode();
|
||||||
if (code == 1) {
|
if (code == 1) {
|
||||||
observer.onNext(string.getMsg());
|
observer.onNext(string.getMsg());
|
||||||
|
|
||||||
} else if (code == 301) {
|
} else if (code == 301) {
|
||||||
try {
|
try {
|
||||||
CommonAppContext.getInstance().clearLoginInfo();
|
CommonAppContext.getInstance().clearLoginInfo();
|
||||||
|
|||||||
@@ -6,4 +6,8 @@ public interface SoundLevelUpdateListener {
|
|||||||
*/
|
*/
|
||||||
void onRemoteSoundLevelUpdate(String userId, int soundLevel);
|
void onRemoteSoundLevelUpdate(String userId, int soundLevel);
|
||||||
void onLocalSoundLevelUpdate(int volume);
|
void onLocalSoundLevelUpdate(int volume);
|
||||||
|
|
||||||
|
void userJoined(int userId,int elapsd);
|
||||||
|
|
||||||
|
void userOffline(int userId,int reason);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ import com.qxcm.moduleutil.bean.HeadlineBean;
|
|||||||
import com.qxcm.moduleutil.bean.HeadlineEvent;
|
import com.qxcm.moduleutil.bean.HeadlineEvent;
|
||||||
import com.qxcm.moduleutil.bean.RoomMessageEvent;
|
import com.qxcm.moduleutil.bean.RoomMessageEvent;
|
||||||
import com.qxcm.moduleutil.bean.room.RoomInfoResp;
|
import com.qxcm.moduleutil.bean.room.RoomInfoResp;
|
||||||
|
import com.qxcm.moduleutil.event.UnreadCountEvent;
|
||||||
import com.qxcm.moduleutil.utils.SpUtil;
|
import com.qxcm.moduleutil.utils.SpUtil;
|
||||||
import com.tencent.imsdk.v2.V2TIMAdvancedMsgListener;
|
import com.tencent.imsdk.v2.V2TIMAdvancedMsgListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMConversationListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMGroupListener;
|
import com.tencent.imsdk.v2.V2TIMGroupListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||||
import com.tencent.imsdk.v2.V2TIMManager;
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
@@ -48,6 +50,7 @@ public class MessageListenerSingleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initListeners() {
|
private void initListeners() {
|
||||||
|
// 简单消息监听器
|
||||||
simpleMsgListener = new V2TIMSimpleMsgListener() {
|
simpleMsgListener = new V2TIMSimpleMsgListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRecvC2CTextMessage(String msgID, V2TIMUserInfo sender, String text) {
|
public void onRecvC2CTextMessage(String msgID, V2TIMUserInfo sender, String text) {
|
||||||
@@ -132,74 +135,16 @@ public class MessageListenerSingleton {
|
|||||||
};
|
};
|
||||||
|
|
||||||
V2TIMManager.getInstance().addGroupListener(groupListener);
|
V2TIMManager.getInstance().addGroupListener(groupListener);
|
||||||
|
|
||||||
|
V2TIMConversationListener conversationListener = new V2TIMConversationListener() {
|
||||||
|
@Override
|
||||||
|
public void onTotalUnreadMessageCountChanged(long totalUnreadCount) {
|
||||||
|
super.onTotalUnreadMessageCountChanged(totalUnreadCount);
|
||||||
|
EventBus.getDefault().post(new UnreadCountEvent(totalUnreadCount));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
V2TIMManager.getConversationManager().addConversationListener(conversationListener);
|
||||||
}
|
}
|
||||||
// private MessageListenerSingleton() {
|
|
||||||
//
|
|
||||||
// // 消息监听
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // 集成 V2TIMSimpleMsgListener
|
|
||||||
// simpleMsgListener = new V2TIMSimpleMsgListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onRecvC2CTextMessage(String msgID, V2TIMUserInfo sender, String text) {
|
|
||||||
//// notifyMessageReceived("C2C 文本消息:" + sender.getNickName() + " - " + text);
|
|
||||||
// LogUtils.d("C2C 文本消息 " + sender.getNickName());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onRecvC2CCustomMessage(String msgID, V2TIMUserInfo sender, byte[] customData) {
|
|
||||||
//// notifyMessageReceived("C2C 自定义(信令)消息:" + sender.getNickName());
|
|
||||||
// LogUtils.d("C2C 自定义(信令)消息 " + sender.getNickName());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onRecvGroupTextMessage(String msgID, String groupID, V2TIMGroupMemberInfo sender, String text) {
|
|
||||||
//// notifyMessageReceived("群文本消息:群组 " + groupID + " 中 " + sender.getNickName() + " - " + text);
|
|
||||||
// LogUtils.d("群文本消息:群组 " + groupID + " 中 " + sender.getNickName());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onRecvGroupCustomMessage(String msgID, String groupID, V2TIMGroupMemberInfo sender, byte[] customData) {
|
|
||||||
//// notifyMessageReceived("群自定义(信令)消息:群组 " + groupID + " 中 " + sender.getNickName());
|
|
||||||
// LogUtils.d("收到群自定义消息:群组 " + groupID + " 中 " + sender.getNickName());
|
|
||||||
// String message = new String(customData, StandardCharsets.UTF_8);
|
|
||||||
// RoomMessageEvent event = GsonUtils.fromJson(message, RoomMessageEvent.class);
|
|
||||||
// notifyMessageReceived(event);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// V2TIMManager.getInstance().addSimpleMsgListener(simpleMsgListener);
|
|
||||||
//
|
|
||||||
// V2TIMGroupListener groupListener = new V2TIMGroupListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onMemberEnter(String groupID, List<V2TIMGroupMemberInfo> memberList) {
|
|
||||||
// // 有新成员加入群,该群所有的成员都能收到
|
|
||||||
//// for (V2TIMGroupMemberInfo member : memberList) {
|
|
||||||
//// notifyMessageReceived("系统消息:" + member.getNickName() + " 加入了群组");
|
|
||||||
//// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onMemberLeave(String groupID, V2TIMGroupMemberInfo member) {
|
|
||||||
// // 有成员离开群,该群所有的成员都能收到
|
|
||||||
//// notifyMessageReceived("系统消息:" + member.getNickName() + " 离开了群组");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onReceiveRESTCustomData(String groupID, byte[] customData) {
|
|
||||||
// // 服务器发送的自定义系统通知
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // 将 byte[] 转换为 String
|
|
||||||
// String message = new String(customData, StandardCharsets.UTF_8);
|
|
||||||
// RoomMessageEvent event = GsonUtils.fromJson(message, RoomMessageEvent.class);
|
|
||||||
// notifyMessageReceived(event);
|
|
||||||
// LogUtils.e("收到群自定义消息:" + message);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// V2TIMManager.getInstance().addGroupListener(groupListener);
|
|
||||||
// }
|
|
||||||
|
|
||||||
public static MessageListenerSingleton getInstance() {
|
public static MessageListenerSingleton getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
@@ -210,38 +155,38 @@ public class MessageListenerSingleton {
|
|||||||
private OnMessageReceivedListener tempGroupJoinListener;
|
private OnMessageReceivedListener tempGroupJoinListener;
|
||||||
public void joinGroup(String roomId) {
|
public void joinGroup(String roomId) {
|
||||||
|
|
||||||
if (!mRoomId.isEmpty()){
|
// if (!mRoomId.isEmpty()){
|
||||||
V2TIMManager.getInstance().quitGroup("room"+roomId, new V2TIMCallback() {
|
// V2TIMManager.getInstance().quitGroup("room"+roomId, new V2TIMCallback() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSuccess() {
|
// public void onSuccess() {
|
||||||
LogUtils.d("退出群组成功");
|
// LogUtils.d("退出群组成功");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(int code, String desc) {
|
// public void onError(int code, String desc) {
|
||||||
LogUtils.d("退出群组失败");
|
// LogUtils.d("退出群组失败");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
mRoomId=roomId;
|
mRoomId=roomId;
|
||||||
|
|
||||||
// V2TIMManager.getInstance().joinGroup("room" + mRoomId, "申请加入", new V2TIMCallback() {
|
V2TIMManager.getInstance().joinGroup("room" + mRoomId, "申请加入", new V2TIMCallback() {
|
||||||
// @Override
|
@Override
|
||||||
// public void onSuccess() {
|
public void onSuccess() {
|
||||||
// RoomMessageEvent.T t = new RoomMessageEvent.T();
|
RoomMessageEvent.T t = new RoomMessageEvent.T();
|
||||||
// t.setText("羽声严禁未成年人进行直播或打赏,官方将24小时在线巡查。我们提倡绿色直播,直播间严禁出现涉政、涉恐、涉黄、涉赌等违法违规内容,严禁宣传封建迷信、宗教极端思想、出现低俗色情、吸烟酗酒等内容,严禁违反社会主义核心价值观、践踏社会道德底线、诱导打赏、低俗 PK 、买卖金币等行为,请大家共同遵守、监督并及时举报。请勿相信各类刷钻、购买礼包、游戏币及电商贩卖等非官方广告信息,谨防网络诈骗。");
|
t.setText("羽声严禁未成年人进行直播或打赏,官方将24小时在线巡查。我们提倡绿色直播,直播间严禁出现涉政、涉恐、涉黄、涉赌等违法违规内容,严禁宣传封建迷信、宗教极端思想、出现低俗色情、吸烟酗酒等内容,严禁违反社会主义核心价值观、践踏社会道德底线、诱导打赏、低俗 PK 、买卖金币等行为,请大家共同遵守、监督并及时举报。请勿相信各类刷钻、购买礼包、游戏币及电商贩卖等非官方广告信息,谨防网络诈骗。");
|
||||||
// // 加入群组成功
|
// 加入群组成功
|
||||||
//// onMessageReceived(new RoomMessageEvent(1000, roomId, t));
|
// onMessageReceived(new RoomMessageEvent(1000, roomId, t));
|
||||||
//// EventBus.getDefault().post(new RoomMessageEvent(1000, mRoomId, t));
|
// EventBus.getDefault().post(new RoomMessageEvent(1000, mRoomId, t));
|
||||||
// notifyMessageReceived(new RoomMessageEvent(1000, mRoomId, t));
|
notifyMessageReceived(new RoomMessageEvent(1000, mRoomId, t));
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void onError(int code, String desc) {
|
public void onError(int code, String desc) {
|
||||||
// // 加入群组失败
|
// 加入群组失败
|
||||||
// Log.d("@@@", "加入群组失败:" + code + "=" + desc);
|
Log.d("@@@", "加入群组失败:" + code + "=" + desc);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
|
|
||||||
if (tempGroupJoinListener == null) {
|
if (tempGroupJoinListener == null) {
|
||||||
tempGroupJoinListener = new OnMessageReceivedListener() {
|
tempGroupJoinListener = new OnMessageReceivedListener() {
|
||||||
@@ -305,20 +250,6 @@ public class MessageListenerSingleton {
|
|||||||
null,
|
null,
|
||||||
sendCallback);
|
sendCallback);
|
||||||
|
|
||||||
// API 返回 msgID,按需使用
|
|
||||||
// V2TIMManager.getInstance().sendC2CTextMessage( binaryData,"u"+userId, new V2TIMValueCallback<V2TIMMessage>() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(V2TIMMessage message) {
|
|
||||||
// // 发送单聊文本消息成功
|
|
||||||
// LogUtils.e("发送成功");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onError(int code, String desc) {
|
|
||||||
// // 发送单聊文本消息失败
|
|
||||||
// LogUtils.e("发送失败");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reset(String roomId) {
|
public static void reset(String roomId) {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import android.app.Activity;
|
|||||||
|
|
||||||
import com.qxcm.moduleutil.activity.IPresenter;
|
import com.qxcm.moduleutil.activity.IPresenter;
|
||||||
import com.qxcm.moduleutil.activity.IView;
|
import com.qxcm.moduleutil.activity.IView;
|
||||||
|
import com.qxcm.moduleutil.bean.AppPay;
|
||||||
|
import com.qxcm.moduleutil.bean.BindType;
|
||||||
import com.qxcm.moduleutil.bean.RechargeBean;
|
import com.qxcm.moduleutil.bean.RechargeBean;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,9 +14,14 @@ public class RechargeDialogContacts {
|
|||||||
|
|
||||||
public interface View extends IView<Activity> {
|
public interface View extends IView<Activity> {
|
||||||
void setRechargeData(List<RechargeBean> rechargeData);
|
void setRechargeData(List<RechargeBean> rechargeData);
|
||||||
|
void bindType(BindType bindType);
|
||||||
|
void appPay(AppPay appPay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IRechargePre extends IPresenter {
|
public interface IRechargePre extends IPresenter {
|
||||||
void recharge();//可选充值金额列表
|
void recharge();//可选充值金额列表
|
||||||
|
void bindType(String userId);
|
||||||
|
void appPay(String user_id,String money,String coin,String type);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.qxcm.moduleutil.presenter;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.qxcm.moduleutil.bean.AppPay;
|
||||||
|
import com.qxcm.moduleutil.bean.BindType;
|
||||||
import com.qxcm.moduleutil.bean.RechargeBean;
|
import com.qxcm.moduleutil.bean.RechargeBean;
|
||||||
import com.qxcm.moduleutil.http.BaseObserver;
|
import com.qxcm.moduleutil.http.BaseObserver;
|
||||||
|
|
||||||
@@ -28,4 +30,35 @@ public class RechargeDialogPresenter extends BasePresenter<RechargeDialogContact
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindType(String userId) {
|
||||||
|
api.bindType(userId, new BaseObserver<BindType>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
addDisposable(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BindType bindType) {
|
||||||
|
MvpRef.get().bindType(bindType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void appPay(String user_id, String money, String coin, String type) {
|
||||||
|
api.appPay(user_id, money, coin, type, new BaseObserver<AppPay>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
addDisposable(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(AppPay appPay) {
|
||||||
|
MvpRef.get().appPay(appPay);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.app.Activity;
|
|||||||
import com.qxcm.moduleutil.activity.IPresenter;
|
import com.qxcm.moduleutil.activity.IPresenter;
|
||||||
import com.qxcm.moduleutil.activity.IView;
|
import com.qxcm.moduleutil.activity.IView;
|
||||||
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
import com.qxcm.moduleutil.bean.RewardUserBean;
|
import com.qxcm.moduleutil.bean.RewardUserBean;
|
||||||
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
import com.qxcm.moduleutil.bean.WalletBean;
|
import com.qxcm.moduleutil.bean.WalletBean;
|
||||||
@@ -25,7 +26,7 @@ public class RewardGiftContacts {
|
|||||||
|
|
||||||
void reward_zone();
|
void reward_zone();
|
||||||
void roomAuctionJoin(RoomAuction.AuctionListBean auctionListBean);
|
void roomAuctionJoin(RoomAuction.AuctionListBean auctionListBean);
|
||||||
|
void giftPack(List<GiftPackBean> giftPackBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IIndexPre extends IPresenter {
|
public interface IIndexPre extends IPresenter {
|
||||||
@@ -46,6 +47,6 @@ public class RewardGiftContacts {
|
|||||||
void setRoomApply(String room_id, String gift_id,String gift_price);
|
void setRoomApply(String room_id, String gift_id,String gift_price);
|
||||||
|
|
||||||
void roomAuctionJoin(String auction_id,String user_id, String gift_id, String num,String type);
|
void roomAuctionJoin(String auction_id,String user_id, String gift_id, String num,String type);
|
||||||
|
void giftPack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.qxcm.moduleutil.activity.IView;
|
import com.qxcm.moduleutil.activity.IView;
|
||||||
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
import com.qxcm.moduleutil.bean.GiftLabelBean;
|
||||||
|
import com.qxcm.moduleutil.bean.GiftPackBean;
|
||||||
import com.qxcm.moduleutil.bean.RewardUserBean;
|
import com.qxcm.moduleutil.bean.RewardUserBean;
|
||||||
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
import com.qxcm.moduleutil.bean.RoonGiftModel;
|
||||||
import com.qxcm.moduleutil.bean.WalletBean;
|
import com.qxcm.moduleutil.bean.WalletBean;
|
||||||
@@ -162,5 +163,19 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void giftPack() {
|
||||||
|
api.giftPack(new BaseObserver<List<GiftPackBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
addDisposable(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(List<GiftPackBean> giftPackBeans) {
|
||||||
|
MvpRef.get().giftPack(giftPackBeans);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,11 @@ import static io.agora.rtc2.video.VideoEncoderConfiguration.VD_640x360;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.Service;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.IBinder;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -37,12 +40,13 @@ import com.qxcm.moduleutil.base.CommonAppContext;
|
|||||||
import com.qxcm.moduleutil.bean.RoomMessageEvent;
|
import com.qxcm.moduleutil.bean.RoomMessageEvent;
|
||||||
import com.qxcm.moduleutil.event.CabinEvent;
|
import com.qxcm.moduleutil.event.CabinEvent;
|
||||||
import com.qxcm.moduleutil.event.ColoseCardEvent;
|
import com.qxcm.moduleutil.event.ColoseCardEvent;
|
||||||
|
import com.qxcm.moduleutil.event.SurfaceEvent;
|
||||||
import com.qxcm.moduleutil.interfaces.SoundLevelUpdateListener;
|
import com.qxcm.moduleutil.interfaces.SoundLevelUpdateListener;
|
||||||
import com.qxcm.moduleutil.listener.MessageListenerSingleton;
|
import com.qxcm.moduleutil.listener.MessageListenerSingleton;
|
||||||
import com.qxcm.moduleutil.utils.Md5Utils;
|
import com.qxcm.moduleutil.utils.Md5Utils;
|
||||||
import com.qxcm.moduleutil.utils.SpUtil;
|
import com.qxcm.moduleutil.utils.SpUtil;
|
||||||
import com.qxcm.moduleutil.utils.logger.Logger;
|
import com.qxcm.moduleutil.utils.logger.Logger;
|
||||||
import com.tencent.bugly.idasc.crashreport.CrashReport;
|
//import com.tencent.bugly.idasc.crashreport.CrashReport;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@@ -85,34 +89,42 @@ import io.agora.rtc2.video.VideoEncoderConfiguration;
|
|||||||
public class AgoraManager {
|
public class AgoraManager {
|
||||||
|
|
||||||
private static volatile AgoraManager instance;
|
private static volatile AgoraManager instance;
|
||||||
private RtcEngineEx rtcEngine;
|
private static RtcEngineEx rtcEngine;
|
||||||
// private RtcEngineEx rtcEngineEx;
|
// private RtcEngineEx rtcEngineEx;
|
||||||
private Context context;
|
private static Context context;
|
||||||
private boolean isLocalAudioEnabled = true; // 默认开启麦克风
|
private boolean isLocalAudioEnabled = true; // 默认开启麦克风
|
||||||
private final List<IRtcEngineEventHandler> eventHandlers = new ArrayList<>();
|
private final List<IRtcEngineEventHandler> eventHandlers = new ArrayList<>();
|
||||||
IAgoraMusicContentCenter musicContentCenter;
|
private static IAgoraMusicContentCenter musicContentCenter;
|
||||||
IAgoraMusicPlayer musicPlayer;
|
private static IAgoraMusicPlayer musicPlayer;
|
||||||
MusicContentCenterConfiguration contentCenterConfiguration;
|
private static MusicContentCenterConfiguration contentCenterConfiguration;
|
||||||
private String mRoomId = "";
|
private static String mRoomId = "";
|
||||||
private long mSongCode;
|
private static long mSongCode;
|
||||||
|
|
||||||
private List<Music> musicList;
|
private static List<Music> musicList;
|
||||||
private boolean isBjMusic = false;
|
private static boolean isBjMusic = false;
|
||||||
private List<SoundLevelUpdateListener> soundLevelUpdateListeners = new CopyOnWriteArrayList<>();
|
private static List<SoundLevelUpdateListener> soundLevelUpdateListeners = new CopyOnWriteArrayList<>();
|
||||||
ChannelMediaOptions options;
|
private static ChannelMediaOptions options;
|
||||||
|
private static RtcConnection connection;
|
||||||
|
private String pkRoomId = "";
|
||||||
|
|
||||||
|
private AgoraManager() {
|
||||||
|
// this.context = context.getApplicationContext();
|
||||||
|
// init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||||
|
|
||||||
private AgoraManager(Context context) {
|
|
||||||
this.context = context.getApplicationContext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AgoraManager getInstance(Context context) {
|
public static AgoraManager getInstance(Context con) {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
synchronized (AgoraManager.class) {
|
synchronized (AgoraManager.class) {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new AgoraManager(context);
|
instance = new AgoraManager();
|
||||||
|
context = con;
|
||||||
|
// init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||||
|
// init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +147,8 @@ public class AgoraManager {
|
|||||||
/**
|
/**
|
||||||
* 初始化 Agora 引擎
|
* 初始化 Agora 引擎
|
||||||
*/
|
*/
|
||||||
public AgoraManager init(String appId) {
|
public static void init(String appId) {
|
||||||
if (rtcEngine != null) return this;
|
if (rtcEngine != null) throw new IllegalStateException("RtcEngine已经初始化过");;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RtcEngineConfig config = new RtcEngineConfig();
|
RtcEngineConfig config = new RtcEngineConfig();
|
||||||
@@ -191,13 +203,13 @@ public class AgoraManager {
|
|||||||
rtcEngine.setDefaultAudioRoutetoSpeakerphone(true);
|
rtcEngine.setDefaultAudioRoutetoSpeakerphone(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
// return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加入语音聊天房间
|
* 加入语音聊天房间
|
||||||
*/
|
*/
|
||||||
public void joinRoom(String token, String roomId, int uid, boolean isMicrophoneEnabled) {
|
public void joinRoom(String token, String roomId, int uid, boolean isMicrophoneEnabled, boolean isCamerJs) {
|
||||||
if (rtcEngine == null) {
|
if (rtcEngine == null) {
|
||||||
Log.e("AgoraManager", "RtcEngine not initialized");
|
Log.e("AgoraManager", "RtcEngine not initialized");
|
||||||
return;
|
return;
|
||||||
@@ -221,8 +233,7 @@ public class AgoraManager {
|
|||||||
options.publishScreenCaptureVideo = true;
|
options.publishScreenCaptureVideo = true;
|
||||||
// 在频道中发布屏幕采集的音频
|
// 在频道中发布屏幕采集的音频
|
||||||
options.publishScreenCaptureAudio = true;
|
options.publishScreenCaptureAudio = true;
|
||||||
|
ClientRole(isCamerJs);
|
||||||
|
|
||||||
// options.publishMediaPlayerId = 0;
|
// options.publishMediaPlayerId = 0;
|
||||||
rtcEngine.joinChannel(token, mRoomId, uid, options);
|
rtcEngine.joinChannel(token, mRoomId, uid, options);
|
||||||
|
|
||||||
@@ -251,9 +262,10 @@ public class AgoraManager {
|
|||||||
options.publishMicrophoneTrack = true; // 是否发布麦克风音频
|
options.publishMicrophoneTrack = true; // 是否发布麦克风音频
|
||||||
options.enableAudioRecordingOrPlayout = true;
|
options.enableAudioRecordingOrPlayout = true;
|
||||||
options.autoSubscribeAudio = true;
|
options.autoSubscribeAudio = true;
|
||||||
RtcConnection connection = new RtcConnection();
|
connection = new RtcConnection();
|
||||||
connection.channelId = channelId;
|
connection.channelId = channelId;
|
||||||
connection.localUid = uid;
|
connection.localUid = uid;
|
||||||
|
pkRoomId = channelId;
|
||||||
rtcEngine.joinChannelEx(token, connection, options, getDefaultEventHandler());
|
rtcEngine.joinChannelEx(token, connection, options, getDefaultEventHandler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -345,8 +357,8 @@ public class AgoraManager {
|
|||||||
if (musicContentCenter != null) {
|
if (musicContentCenter != null) {
|
||||||
musicContentCenter.destroy();
|
musicContentCenter.destroy();
|
||||||
}
|
}
|
||||||
rtcEngine.destroy();
|
// rtcEngine.destroy();
|
||||||
rtcEngine = null;
|
// rtcEngine = null;
|
||||||
}
|
}
|
||||||
eventHandlers.clear();
|
eventHandlers.clear();
|
||||||
}
|
}
|
||||||
@@ -361,7 +373,7 @@ public class AgoraManager {
|
|||||||
* 设置是否开启本地麦克风
|
* 设置是否开启本地麦克风
|
||||||
*/
|
*/
|
||||||
@SuppressLint("SuspiciousIndentation")
|
@SuppressLint("SuspiciousIndentation")
|
||||||
public void setLocalAudioEnabled(boolean enabled,String userId) {
|
public void setLocalAudioEnabled(boolean enabled, String userId) {
|
||||||
if (rtcEngine != null) {
|
if (rtcEngine != null) {
|
||||||
rtcEngine.enableLocalAudio(enabled); // 启用/禁用音频采集
|
rtcEngine.enableLocalAudio(enabled); // 启用/禁用音频采集
|
||||||
this.isLocalAudioEnabled = enabled;
|
this.isLocalAudioEnabled = enabled;
|
||||||
@@ -378,19 +390,28 @@ public class AgoraManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void muteAllRemoteAudioStreamsEx(boolean enabled){
|
public void muteAllRemoteAudioStreamsEx(boolean enabled) {
|
||||||
if (rtcEngine != null){
|
if (rtcEngine == null) {
|
||||||
RtcConnection connection = new RtcConnection();
|
init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||||
connection.channelId = mRoomId;
|
}
|
||||||
|
if (rtcEngine != null) {
|
||||||
|
// RtcConnection connection = new RtcConnection();
|
||||||
|
// connection.channelId = mRoomId;
|
||||||
|
if (connection == null) {
|
||||||
|
connection = new RtcConnection();
|
||||||
|
connection.channelId = pkRoomId;
|
||||||
|
}
|
||||||
rtcEngine.muteAllRemoteAudioStreamsEx(enabled, connection);
|
rtcEngine.muteAllRemoteAudioStreamsEx(enabled, connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设置是否是主播角色
|
||||||
public void ClientRole(boolean enabled) {
|
public void ClientRole(boolean enabled) {
|
||||||
if (rtcEngine != null) {
|
if (rtcEngine != null) {
|
||||||
|
|
||||||
rtcEngine.setClientRole(enabled ? Constants.CLIENT_ROLE_BROADCASTER : Constants.CLIENT_ROLE_AUDIENCE);
|
rtcEngine.setClientRole(enabled ? Constants.CLIENT_ROLE_BROADCASTER : Constants.CLIENT_ROLE_AUDIENCE);
|
||||||
|
} else {
|
||||||
|
init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||||
|
rtcEngine.setClientRole(enabled ? Constants.CLIENT_ROLE_BROADCASTER : Constants.CLIENT_ROLE_AUDIENCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,9 +422,9 @@ public class AgoraManager {
|
|||||||
* @param uid
|
* @param uid
|
||||||
*/
|
*/
|
||||||
public void muteLocalAudioStreamEx(boolean enabled, int uid) {
|
public void muteLocalAudioStreamEx(boolean enabled, int uid) {
|
||||||
RtcConnection connection = new RtcConnection();
|
// RtcConnection connection = new RtcConnection();
|
||||||
connection.channelId = mRoomId;
|
// connection.channelId = mRoomId;
|
||||||
connection.localUid = uid;
|
// connection.localUid = uid;
|
||||||
rtcEngine.muteLocalAudioStreamEx(enabled, connection);
|
rtcEngine.muteLocalAudioStreamEx(enabled, connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,6 +436,9 @@ public class AgoraManager {
|
|||||||
public void muteLocalAudioStream(boolean enabled) {
|
public void muteLocalAudioStream(boolean enabled) {
|
||||||
if (rtcEngine != null) {
|
if (rtcEngine != null) {
|
||||||
rtcEngine.muteLocalAudioStream(enabled); // 静音/取消静音
|
rtcEngine.muteLocalAudioStream(enabled); // 静音/取消静音
|
||||||
|
} else {
|
||||||
|
init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||||
|
rtcEngine.muteLocalAudioStream(enabled); // 静音/取消静音
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,7 +481,7 @@ public class AgoraManager {
|
|||||||
/**
|
/**
|
||||||
* 默认事件处理器,转发给所有监听器
|
* 默认事件处理器,转发给所有监听器
|
||||||
*/
|
*/
|
||||||
private IRtcEngineEventHandler getDefaultEventHandler() {
|
private static IRtcEngineEventHandler getDefaultEventHandler() {
|
||||||
return new IRtcEngineEventHandler() {
|
return new IRtcEngineEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
|
public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
|
||||||
@@ -621,24 +645,47 @@ public class AgoraManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUserJoined(int uid, int elapsed) {
|
public void onUserJoined(int uid, int elapsed) {//远端用户加入频道
|
||||||
for (IRtcEngineEventHandler handler : eventHandlers) {
|
// for (IRtcEngineEventHandler handler : eventHandlers) {
|
||||||
if (handler != null) {
|
// if (handler != null) {
|
||||||
handler.onUserJoined(uid, elapsed);
|
// handler.onUserJoined(uid, elapsed);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||||
|
if (listener != null) {
|
||||||
|
ThreadUtils.runOnUiThread(() -> {
|
||||||
|
// 远程用户音量变化
|
||||||
|
listener.userJoined(uid, elapsed);
|
||||||
|
// }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceView renderView = new SurfaceView(context);
|
SurfaceView renderView = new SurfaceView(context);
|
||||||
rtcEngine.setupRemoteVideo(new VideoCanvas(renderView, Constants.RENDER_MODE_FIT, uid));
|
rtcEngine.setupRemoteVideo(new VideoCanvas(renderView, Constants.RENDER_MODE_FIT, uid));
|
||||||
EventBus.getDefault().post(renderView);
|
SurfaceEvent surfaceEvent = new SurfaceEvent();
|
||||||
|
surfaceEvent.setSurfaceView(renderView);
|
||||||
|
surfaceEvent.setType(1);
|
||||||
|
EventBus.getDefault().post(surfaceEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUserOffline(int uid, int reason) {
|
public void onUserOffline(int uid, int reason) {//远端用户离开频道
|
||||||
for (IRtcEngineEventHandler handler : eventHandlers) {
|
// for (IRtcEngineEventHandler handler : eventHandlers) {
|
||||||
if (handler != null) {
|
// if (handler != null) {
|
||||||
handler.onUserOffline(uid, reason);
|
// handler.onUserOffline(uid, reason);
|
||||||
|
// }
|
||||||
|
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||||
|
if (listener != null) {
|
||||||
|
ThreadUtils.runOnUiThread(() -> {
|
||||||
|
// 远程用户音量变化
|
||||||
|
listener.userOffline(uid, reason);
|
||||||
|
// }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
SurfaceView renderView = null;
|
SurfaceView renderView = null;
|
||||||
rtcEngine.setupRemoteVideo(new VideoCanvas(null, Constants.RENDER_MODE_FIT, uid));
|
rtcEngine.setupRemoteVideo(new VideoCanvas(null, Constants.RENDER_MODE_FIT, uid));
|
||||||
@@ -659,8 +706,8 @@ public class AgoraManager {
|
|||||||
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
ThreadUtils.runOnUiThread(() -> {
|
ThreadUtils.runOnUiThread(() -> {
|
||||||
// 远程用户音量变化
|
// 远程用户音量变化
|
||||||
listener.onRemoteSoundLevelUpdate(uid > 0 ? String.valueOf(uid) : SpUtil.getUserId() + "", volume);
|
listener.onRemoteSoundLevelUpdate(uid > 0 ? String.valueOf(uid) : SpUtil.getUserId() + "", volume);
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -683,9 +730,13 @@ public class AgoraManager {
|
|||||||
public void onFirstRemoteAudioFrame(int uid, int elapsed) {
|
public void onFirstRemoteAudioFrame(int uid, int elapsed) {
|
||||||
super.onFirstRemoteAudioFrame(uid, elapsed);
|
super.onFirstRemoteAudioFrame(uid, elapsed);
|
||||||
Log.i("RoomCabinFragment", "onFirstRemoteAudioFrame: uid->" + uid);
|
Log.i("RoomCabinFragment", "onFirstRemoteAudioFrame: uid->" + uid);
|
||||||
|
|
||||||
SurfaceView renderView = new SurfaceView(context);
|
SurfaceView renderView = new SurfaceView(context);
|
||||||
|
SurfaceEvent surfaceEvent = new SurfaceEvent();
|
||||||
|
surfaceEvent.setSurfaceView(renderView);
|
||||||
|
surfaceEvent.setType(2);
|
||||||
rtcEngine.setupRemoteVideo(new VideoCanvas(renderView, Constants.RENDER_MODE_FIT, uid));
|
rtcEngine.setupRemoteVideo(new VideoCanvas(renderView, Constants.RENDER_MODE_FIT, uid));
|
||||||
EventBus.getDefault().post(renderView);
|
EventBus.getDefault().post(surfaceEvent);
|
||||||
}
|
}
|
||||||
// 可继续扩展其他回调...
|
// 可继续扩展其他回调...
|
||||||
|
|
||||||
@@ -693,13 +744,17 @@ public class AgoraManager {
|
|||||||
public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) {
|
public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) {
|
||||||
super.onRemoteVideoStateChanged(uid, state, reason, elapsed);
|
super.onRemoteVideoStateChanged(uid, state, reason, elapsed);
|
||||||
Log.i("RoomCabinFragment", "onRemoteVideoStateChanged:uid->" + uid + ", state->" + state);
|
Log.i("RoomCabinFragment", "onRemoteVideoStateChanged:uid->" + uid + ", state->" + state);
|
||||||
if (state == Constants.LOCAL_VIDEO_STREAM_STATE_STOPPED) {
|
if (state == Constants.REMOTE_AUDIO_STATE_STOPPED) {
|
||||||
ColoseCardEvent renderView = new ColoseCardEvent();
|
ColoseCardEvent renderView = new ColoseCardEvent();
|
||||||
EventBus.getDefault().post(renderView);
|
EventBus.getDefault().post(renderView);
|
||||||
} else {
|
} else if (state == Constants.REMOTE_AUDIO_STATE_STARTING) {
|
||||||
|
|
||||||
SurfaceView renderView = new SurfaceView(context);
|
SurfaceView renderView = new SurfaceView(context);
|
||||||
rtcEngine.setupRemoteVideo(new VideoCanvas(renderView, Constants.RENDER_MODE_FIT, uid));
|
rtcEngine.setupRemoteVideo(new VideoCanvas(renderView, Constants.RENDER_MODE_FIT, uid));
|
||||||
EventBus.getDefault().post(renderView);
|
SurfaceEvent surfaceEvent = new SurfaceEvent();
|
||||||
|
surfaceEvent.setSurfaceView(renderView);
|
||||||
|
surfaceEvent.setType(2);
|
||||||
|
EventBus.getDefault().post(surfaceEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -760,7 +815,10 @@ public class AgoraManager {
|
|||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_IDLE) {//空闲
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_IDLE) {//空闲
|
||||||
LogUtils.e("lxj", "空闲");
|
LogUtils.e("lxj", "空闲");
|
||||||
musicPlayer.open(mSongCode, 0);
|
musicPlayer.open(mSongCode, 0);
|
||||||
isPreload(mSongCode, type);
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
isPreload(mSongCode, type);
|
||||||
|
}, 2000); // 2秒延迟
|
||||||
|
// isPreload(mSongCode, type);
|
||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_OPEN_COMPLETED) {//打开成功
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_OPEN_COMPLETED) {//打开成功
|
||||||
LogUtils.e("lxj", "播放");
|
LogUtils.e("lxj", "播放");
|
||||||
musicPlayer.play();
|
musicPlayer.play();
|
||||||
@@ -781,7 +839,7 @@ public class AgoraManager {
|
|||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_OPENING) {
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_OPENING) {
|
||||||
LogUtils.e("lxj", musicPlayer.getState());
|
LogUtils.e("lxj", musicPlayer.getState());
|
||||||
isPreload(mSongCode, type);
|
isPreload(mSongCode, type);
|
||||||
}else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_PLAYING){
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_PLAYING) {
|
||||||
LogUtils.e("lxj", musicPlayer.getState());
|
LogUtils.e("lxj", musicPlayer.getState());
|
||||||
isPreload(mSongCode, type);
|
isPreload(mSongCode, type);
|
||||||
}
|
}
|
||||||
@@ -834,7 +892,7 @@ public class AgoraManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void isPreload2(long songCode, int type) {
|
public static void isPreload2(long songCode, int type) {
|
||||||
|
|
||||||
|
|
||||||
mSongCode = songCode;
|
mSongCode = songCode;
|
||||||
@@ -863,7 +921,10 @@ public class AgoraManager {
|
|||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_IDLE) {//空闲
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_IDLE) {//空闲
|
||||||
LogUtils.e("lxj", "空闲");
|
LogUtils.e("lxj", "空闲");
|
||||||
musicPlayer.open(mSongCode, 0);
|
musicPlayer.open(mSongCode, 0);
|
||||||
isPreload2(mSongCode, type);
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
isPreload2(mSongCode, type);
|
||||||
|
}, 3000); // 3秒延迟
|
||||||
|
// isPreload2(mSongCode, type);
|
||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_OPEN_COMPLETED) {//打开成功
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_OPEN_COMPLETED) {//打开成功
|
||||||
LogUtils.e("lxj", "播放");
|
LogUtils.e("lxj", "播放");
|
||||||
musicPlayer.play();
|
musicPlayer.play();
|
||||||
@@ -871,7 +932,10 @@ public class AgoraManager {
|
|||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_IDLE) {
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_IDLE) {
|
||||||
LogUtils.e("lxj", "空闲");
|
LogUtils.e("lxj", "空闲");
|
||||||
musicPlayer.open(mSongCode, 0);
|
musicPlayer.open(mSongCode, 0);
|
||||||
isPreload2(mSongCode, type);
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
isPreload2(mSongCode, type);
|
||||||
|
}, 3000); // 3秒延迟
|
||||||
|
// isPreload2(mSongCode, type);
|
||||||
// LogUtils.e("@@@", musicPlayer.getState());
|
// LogUtils.e("@@@", musicPlayer.getState());
|
||||||
// musicPlayer.pause() ;
|
// musicPlayer.pause() ;
|
||||||
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_PAUSING_INTERNAL) {
|
} else if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_PAUSING_INTERNAL) {
|
||||||
@@ -943,7 +1007,7 @@ public class AgoraManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopMuisc() {
|
public static void stopMuisc() {
|
||||||
if (musicPlayer != null) {
|
if (musicPlayer != null) {
|
||||||
// if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_PLAYING) {
|
// if (musicPlayer.getState() == io.agora.mediaplayer.Constants.MediaPlayerState.PLAYER_STATE_PLAYING) {
|
||||||
musicPlayer.stop();
|
musicPlayer.stop();
|
||||||
@@ -1058,7 +1122,7 @@ public class AgoraManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void nextSong() {
|
public static void nextSong() {
|
||||||
if (musicList.size() > 0) {
|
if (musicList.size() > 0) {
|
||||||
stopMuisc();
|
stopMuisc();
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
@@ -1077,12 +1141,10 @@ public class AgoraManager {
|
|||||||
*
|
*
|
||||||
* @param lrcUri
|
* @param lrcUri
|
||||||
*/
|
*/
|
||||||
public void getLyricsInstance(String lrcUri) {
|
public static void getLyricsInstance(String lrcUri) {
|
||||||
downloadAndPlayMp4(lrcUri);
|
downloadAndPlayMp4(lrcUri);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// final File[] file = new File[1];
|
// final File[] file = new File[1];
|
||||||
//// 设置可缓存的歌词文件的最大数量,默认为 50
|
//// 设置可缓存的歌词文件的最大数量,默认为 50
|
||||||
// LyricsFileDownloader.getInstance(context).setMaxFileNum(50);
|
// LyricsFileDownloader.getInstance(context).setMaxFileNum(50);
|
||||||
@@ -1114,7 +1176,7 @@ public class AgoraManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void downloadAndPlayMp4(String url) {
|
private static void downloadAndPlayMp4(String url) {
|
||||||
DownloadTask task = new DownloadTask.Builder(url, PathUtils.getInternalAppCachePath()
|
DownloadTask task = new DownloadTask.Builder(url, PathUtils.getInternalAppCachePath()
|
||||||
, Md5Utils.getStringMD5(url))
|
, Md5Utils.getStringMD5(url))
|
||||||
// the minimal interval millisecond for callback progress
|
// the minimal interval millisecond for callback progress
|
||||||
@@ -1137,7 +1199,7 @@ public class AgoraManager {
|
|||||||
@Override
|
@Override
|
||||||
public void retry(@NonNull DownloadTask task, @NonNull ResumeFailedCause cause) {
|
public void retry(@NonNull DownloadTask task, @NonNull ResumeFailedCause cause) {
|
||||||
com.qxcm.moduleutil.utils.logger.Logger.e("retry", cause);
|
com.qxcm.moduleutil.utils.logger.Logger.e("retry", cause);
|
||||||
CrashReport.postCatchedException(new RuntimeException("下载文件重试:" + cause == null ? "" : cause.name()));
|
// CrashReport.postCatchedException(new RuntimeException("下载文件重试:" + cause == null ? "" : cause.name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.qxcm.moduleutil.rtc;
|
||||||
|
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.IBinder;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lxj$
|
||||||
|
* @Time $ $
|
||||||
|
* @Description $
|
||||||
|
*/
|
||||||
|
public class MeForegroundService extends Service {
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.qxcm.moduleutil.service;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.qxcm.moduleutil.bean.room.RoomClearCardiacAllModel;
|
||||||
|
import com.qxcm.moduleutil.bean.room.RoomClearCardiacModel;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
public class RoomClearCardiacRunnable implements Runnable {
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
public RoomClearCardiacRunnable(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// RoomClearCardiacModel roomClearCardiacModel = JSON.parseObject(data, RoomClearCardiacModel.class);
|
||||||
|
// if (TextUtils.isEmpty(data)) {
|
||||||
|
EventBus.getDefault().post(new RoomClearCardiacAllModel(data));
|
||||||
|
// } else {
|
||||||
|
// EventBus.getDefault().post(new RoomClearCardiacAllModel());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,7 +19,10 @@ public class ARouteConstants {
|
|||||||
public static final String CURRENCY = "/modulevocal/CurrencyExchangeActivity"; //补贴历史
|
public static final String CURRENCY = "/modulevocal/CurrencyExchangeActivity"; //补贴历史
|
||||||
public static final String CREATED_ROOM = "/modulevocal/CreatedRoomActivity"; //创建房间
|
public static final String CREATED_ROOM = "/modulevocal/CreatedRoomActivity"; //创建房间
|
||||||
public static final String WITHDRAWAL_ACTIVITY = "/modulevocal/WithdrawalActivity"; //提现
|
public static final String WITHDRAWAL_ACTIVITY = "/modulevocal/WithdrawalActivity"; //提现
|
||||||
public static final String REAL_NAME_ACTIVITY ="/modulevocal/RealName1Activity"; //实名认证
|
public static final String REAL_NAME_ACTIVITY ="/modulevocal/RealNameActivity"; //实名认证
|
||||||
|
public static final String REAL_NAME_ACTIVITY2 ="/app/RealNameActivity"; //实名认证
|
||||||
|
public static final String H5 ="/moduleutil/WebViewActivity"; //实名认证
|
||||||
|
public static final String GIFT_WALL ="/moduleroom/UserGiftWallFragment"; //实名认证
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.qxcm.moduleutil.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import com.qxcm.moduleutil.base.CommonAppContext;
|
||||||
|
|
||||||
|
import java.net.Proxy;
|
||||||
|
import java.security.KeyManagementException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import retrofit2.Retrofit;
|
||||||
|
|
||||||
|
public class ApiHelper {
|
||||||
|
private static final String TAG = "ApiHelper";
|
||||||
|
|
||||||
|
private static ApiHelper mInstance;
|
||||||
|
private Retrofit mRetrofit;
|
||||||
|
private OkHttpClient mHttpClient;
|
||||||
|
|
||||||
|
private ApiHelper() {
|
||||||
|
this(30, 30, 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiHelper(int connTimeout, int readTimeout, int writeTimeout) {
|
||||||
|
try {
|
||||||
|
X509TrustManager trustAllCert = new X509TrustManager() {
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return new java.security.cert.X509Certificate[]{};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
SSLContext sslContext = null;
|
||||||
|
sslContext = SSLContext.getInstance("SSL");
|
||||||
|
sslContext.init(null, new TrustManager[]{trustAllCert}, new SecureRandom());
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder()
|
||||||
|
// .addInterceptor(new WifiProxyInterceptor(MyApplication.getInstance()))
|
||||||
|
.proxy(Proxy.NO_PROXY)
|
||||||
|
.sslSocketFactory(sslContext.getSocketFactory(), trustAllCert)
|
||||||
|
.hostnameVerifier((hostname, session) -> true)
|
||||||
|
.connectTimeout(connTimeout, TimeUnit.SECONDS)
|
||||||
|
.readTimeout(readTimeout, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(writeTimeout, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
mHttpClient = builder.build();
|
||||||
|
buildRetrofit(CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl());
|
||||||
|
} catch (KeyManagementException | NoSuchAlgorithmException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApiHelper getInstance() {
|
||||||
|
if (mInstance == null) {
|
||||||
|
mInstance = new ApiHelper();
|
||||||
|
}
|
||||||
|
return mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiHelper buildRetrofit(String baseUrl) {
|
||||||
|
mRetrofit = new Retrofit.Builder()
|
||||||
|
.baseUrl(baseUrl)
|
||||||
|
.client(mHttpClient)
|
||||||
|
.build();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T createService(Class<T> serviceClass) {
|
||||||
|
return mRetrofit.create(serviceClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.qxcm.moduleutil.utils;
|
||||||
|
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Streaming;
|
||||||
|
import retrofit2.http.Url;
|
||||||
|
|
||||||
|
public interface ApiInterface {
|
||||||
|
|
||||||
|
@Streaming //大文件时要加不然会OOM
|
||||||
|
@GET
|
||||||
|
Call<ResponseBody> downloadFile(@Url String fileUrl);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.qxcm.moduleutil.utils;
|
||||||
|
|
||||||
|
public interface DownloadListener {
|
||||||
|
void onStart();
|
||||||
|
|
||||||
|
void onProgress(int currentLength);
|
||||||
|
|
||||||
|
void onFinish(String localPath);
|
||||||
|
|
||||||
|
void onFailure();
|
||||||
|
}
|
||||||
@@ -0,0 +1,276 @@
|
|||||||
|
package com.qxcm.moduleutil.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.utils.TextUtils;
|
||||||
|
import com.blankj.utilcode.util.FileUtils;
|
||||||
|
import com.blankj.utilcode.util.ThreadUtils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class DownloadUtil {
|
||||||
|
private static final String TAG = DownloadUtil.class.getCanonicalName();
|
||||||
|
private static final Handler HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
|
protected ApiInterface mApi;
|
||||||
|
private Call<ResponseBody> mCall;
|
||||||
|
private File mFile;
|
||||||
|
private Thread mThread;
|
||||||
|
private String mApkPath; //下载到本地的视频路径
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
// private static final String PATH_APK = Environment.getExternalStorageDirectory() + "/qipao/apk";
|
||||||
|
|
||||||
|
private static final String PATH_APK = "/qipao/apk";
|
||||||
|
private static final String PATH_AUDIO = Environment.getExternalStorageDirectory() + "/qipao/audio";
|
||||||
|
|
||||||
|
|
||||||
|
public DownloadUtil(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
|
||||||
|
if (mApi == null) {
|
||||||
|
//初始化网络请求接口
|
||||||
|
mApi = ApiHelper.getInstance().createService(ApiInterface.class);
|
||||||
|
mApkPath = new File(mContext.getFilesDir(), PATH_APK).getAbsolutePath();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void downloadVoiceFile(String url, final DownloadListener downloadListener) {
|
||||||
|
|
||||||
|
String name = url;
|
||||||
|
//通过Url得到文件并创建本地文件
|
||||||
|
if (FileUtils.createOrExistsDir(PATH_AUDIO)) {
|
||||||
|
int i = name.lastIndexOf('/');//一定是找最后一个'/'出现的位置
|
||||||
|
if (i != -1) {
|
||||||
|
name = System.currentTimeMillis() + name.substring(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
File file = new File(PATH_AUDIO, name);
|
||||||
|
Call<ResponseBody> download = ApiHelper.getInstance().createService(ApiInterface.class).downloadFile(url);
|
||||||
|
download.enqueue(new Callback<ResponseBody>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||||
|
if (response != null && response.isSuccessful()) {
|
||||||
|
ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<Boolean>() {
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Boolean doInBackground() throws Throwable {
|
||||||
|
return writeResponseBodyToDisk(response.body(), file, downloadListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(@Nullable Boolean result) {
|
||||||
|
if (result != null && result) {
|
||||||
|
System.out.println("下载成功请查看");
|
||||||
|
} else {
|
||||||
|
System.out.println("下载失败,请稍后重试");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
System.out.println("服务器返回错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ResponseBody> call, Throwable t) {
|
||||||
|
System.out.println("网络不可用");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载到本地
|
||||||
|
*
|
||||||
|
* @param body 内容
|
||||||
|
* @param file
|
||||||
|
* @param downloadListener
|
||||||
|
* @return 成功或者失败
|
||||||
|
*/
|
||||||
|
private boolean writeResponseBodyToDisk(ResponseBody body, File file, DownloadListener downloadListener) {
|
||||||
|
try {
|
||||||
|
//创建一个文件
|
||||||
|
if (FileUtils.isFileExists(file) || !FileUtils.createOrExistsFile(file)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//初始化输入流
|
||||||
|
InputStream inputStream = null;
|
||||||
|
//初始化输出流
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
//设置每次读写的字节
|
||||||
|
byte[] fileReader = new byte[4096];
|
||||||
|
long fileSize = body.contentLength();
|
||||||
|
long fileSizeDownloaded = 0;
|
||||||
|
//请求返回的字节流
|
||||||
|
inputStream = body.byteStream();
|
||||||
|
//创建输出流
|
||||||
|
outputStream = new FileOutputStream(file);
|
||||||
|
//进行读取操作
|
||||||
|
while (true) {
|
||||||
|
int read = inputStream.read(fileReader);
|
||||||
|
if (read == -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//进行写入操作
|
||||||
|
outputStream.write(fileReader, 0, read);
|
||||||
|
fileSizeDownloaded += read;
|
||||||
|
}
|
||||||
|
|
||||||
|
//刷新
|
||||||
|
outputStream.flush();
|
||||||
|
HANDLER.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
downloadListener.onFinish(file.getAbsolutePath()); //下载完成
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
if (inputStream != null) {
|
||||||
|
//关闭输入流
|
||||||
|
inputStream.close();
|
||||||
|
}
|
||||||
|
if (outputStream != null) {
|
||||||
|
//关闭输出流
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void downloadFile(String url, final DownloadListener downloadListener) {
|
||||||
|
String name = url;
|
||||||
|
//通过Url得到文件并创建本地文件
|
||||||
|
if (FileUtils.createOrExistsDir(PATH_APK)) {
|
||||||
|
int i = name.lastIndexOf('/');//一定是找最后一个'/'出现的位置
|
||||||
|
if (i != -1) {
|
||||||
|
name = System.currentTimeMillis() + name.substring(i);
|
||||||
|
mApkPath = PATH_APK
|
||||||
|
+ name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(mApkPath)) {
|
||||||
|
Log.e(TAG, "downloadApk: 存储路径为空了");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//建立一个文件
|
||||||
|
mFile = new File(mApkPath);
|
||||||
|
if (FileUtils.createFileByDeleteOldFile(mFile)) {
|
||||||
|
if (mApi == null) {
|
||||||
|
Log.e(TAG, "downloadApk: 下载接口为空了");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mCall = mApi.downloadFile(url);
|
||||||
|
mCall.enqueue(new Callback<ResponseBody>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull final Response<ResponseBody> response) {
|
||||||
|
//下载文件放在子线程
|
||||||
|
mThread = new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
//保存到本地
|
||||||
|
writeFile2Disk(response, mFile, downloadListener);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mThread.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ResponseBody> call, Throwable t) {
|
||||||
|
downloadListener.onFailure(); //下载失败
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
downloadListener.onFinish(mApkPath); //下载完成
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeFile2Disk(Response<ResponseBody> response, File file, DownloadListener downloadListener) {
|
||||||
|
HANDLER.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
downloadListener.onStart();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
long currentLength = 0;
|
||||||
|
OutputStream os = null;
|
||||||
|
InputStream is = response.body().byteStream(); //获取下载输入流
|
||||||
|
long totalLength = response.body().contentLength();
|
||||||
|
try {
|
||||||
|
os = new FileOutputStream(file); //输出流
|
||||||
|
int len;
|
||||||
|
byte[] buff = new byte[1024];
|
||||||
|
while ((len = is.read(buff)) != -1) {
|
||||||
|
os.write(buff, 0, len);
|
||||||
|
currentLength += len;
|
||||||
|
Log.e(TAG, "当前进度: " + currentLength);
|
||||||
|
long finalCurrentLength = currentLength;
|
||||||
|
HANDLER.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
//计算当前下载百分比,并经由回调传出
|
||||||
|
downloadListener.onProgress((int) (100 * finalCurrentLength / totalLength));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//当百分比为100时下载结束,调用结束回调,并传出下载后的本地路径
|
||||||
|
if ((int) (100 * currentLength / totalLength) == 100) {
|
||||||
|
HANDLER.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
downloadListener.onFinish(mApkPath); //下载完成
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (os != null) {
|
||||||
|
try {
|
||||||
|
os.close(); //关闭输出流
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (is != null) {
|
||||||
|
try {
|
||||||
|
is.close(); //关闭输入流
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||