Compare commits
14 Commits
59eeb1415b
...
dev_lxj
| Author | SHA1 | Date | |
|---|---|---|---|
| c96d41ccd7 | |||
| 3b6df9ec66 | |||
| 77a1d910f0 | |||
| 393c59dd1b | |||
| a883aa86e5 | |||
| 7e14ba3fcb | |||
| 43c431cc8f | |||
| bd4a769347 | |||
| 2673835fc6 | |||
| a4caa9b078 | |||
| 2f06d60fec | |||
| 7a084b6b2b | |||
| e55effea1a | |||
| bba729f5d0 |
25
.gitignore
vendored
25
.gitignore
vendored
@@ -1,20 +1,9 @@
|
||||
.idea/
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
build/
|
||||
local.properties
|
||||
# ProGuard files
|
||||
/app/proguard/
|
||||
/seeds.txt
|
||||
/usage.txt
|
||||
/mapping.txt
|
||||
.gradle/
|
||||
.externalNativeBuild/
|
||||
.DS_Store
|
||||
*.dm
|
||||
*.log
|
||||
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
1
.idea/.name
generated
1
.idea/.name
generated
@@ -1 +0,0 @@
|
||||
秘地
|
||||
6
.idea/appInsightsSettings.xml
generated
6
.idea/appInsightsSettings.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AppInsightsSettings">
|
||||
<option name="selectedTabId" value="Android Vitals" />
|
||||
</component>
|
||||
</project>
|
||||
117
.idea/codeStyles/Project.xml
generated
117
.idea/codeStyles/Project.xml
generated
@@ -1,117 +0,0 @@
|
||||
<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>
|
||||
6
.idea/compiler.xml
generated
6
.idea/compiler.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/deploymentTargetSelector.xml
generated
8
.idea/deploymentTargetSelector.xml
generated
@@ -13,12 +13,6 @@
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="moduleactivity">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="muduleactivity">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
6
.idea/encodings.xml
generated
6
.idea/encodings.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
33
.idea/gradle.xml
generated
33
.idea/gradle.xml
generated
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/moduleLogin" />
|
||||
<option value="$PROJECT_DIR$/moduleUtil" />
|
||||
<option value="$PROJECT_DIR$/modulecircle" />
|
||||
<option value="$PROJECT_DIR$/modulemain" />
|
||||
<option value="$PROJECT_DIR$/modulenews" />
|
||||
<option value="$PROJECT_DIR$/moduleroom" />
|
||||
<option value="$PROJECT_DIR$/moduletablayout" />
|
||||
<option value="$PROJECT_DIR$/modulevocal" />
|
||||
<option value="$PROJECT_DIR$/modulevoice" />
|
||||
<option value="$PROJECT_DIR$/timcommon" />
|
||||
<option value="$PROJECT_DIR$/tuichat" />
|
||||
<option value="$PROJECT_DIR$/tuiconversation" />
|
||||
<option value="$PROJECT_DIR$/tuicore" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
63
.idea/inspectionProfiles/Project_Default.xml
generated
63
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,63 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,java.lang.foreign.Arena,ofAuto,java.lang.foreign.Arena,global,android.content.Context,obtainStyledAttributes" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ADDITIONAL_TAGS" value="data,description:" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
6
.idea/kotlinc.xml
generated
6
.idea/kotlinc.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.24" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/migrations.xml
generated
10
.idea/migrations.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
55
.idea/misc.xml
generated
55
.idea/misc.xml
generated
@@ -1,55 +0,0 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="15">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jspecify.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
||||
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
||||
<item index="4" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
||||
<item index="6" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
|
||||
<item index="7" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="8" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
<item index="9" class="java.lang.String" itemvalue="jakarta.annotation.Nullable" />
|
||||
<item index="10" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||
<item index="11" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="12" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
||||
<item index="13" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
||||
<item index="14" class="java.lang.String" itemvalue="android.annotation.Nullable" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="15">
|
||||
<item index="0" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="org.jspecify.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="jakarta.annotation.Nonnull" />
|
||||
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
||||
<item index="5" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
||||
<item index="6" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
<item index="7" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
|
||||
<item index="8" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
||||
<item index="10" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="11" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="12" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
|
||||
<item index="13" class="java.lang.String" itemvalue="android.annotation.NonNull" />
|
||||
<item index="14" class="java.lang.String" itemvalue="lombok.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
17
.idea/runConfigurations.xml
generated
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -116,7 +116,7 @@ android {
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
jvmTarget = '11'
|
||||
}
|
||||
dexOptions {
|
||||
dexInProcess true
|
||||
@@ -144,13 +144,9 @@ dependencies {
|
||||
implementation files('libs/logger-2.2.2-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)
|
||||
//annotationProcessor
|
||||
annotationProcessor libs.arouter.compiler
|
||||
|
||||
implementation project(':modulevocal') // 必须
|
||||
annotationProcessor project(':modulevocal') // 关键!
|
||||
|
||||
@@ -158,6 +154,10 @@ dependencies {
|
||||
api project(":moduleLogin")
|
||||
implementation project(':modulemain')
|
||||
|
||||
implementation(libs.arouter.api.v150)
|
||||
//annotationProcessor
|
||||
annotationProcessor libs.arouter.compiler
|
||||
|
||||
//aar的名称,例如:WbCloudFaceLiveSdk-v6.0.0-1234567.aar,填入'WbCloudFaceLiveSdk-v6.0.0-1234567'
|
||||
// implementation(name: 'WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc', ext: 'aar')
|
||||
////2. 云normal SDK,
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
android:launchMode="singleTask">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".RealNameActivity"
|
||||
android:name="com.example.modulevocal.activity.RealNameActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.xscm.modulelogin.activity.ImproveInfoActivity;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.AppStateListener;
|
||||
import com.xscm.moduleutil.base.AppStateManager;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
@@ -69,8 +70,13 @@ public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPage
|
||||
if (!isTaskRoot()) {
|
||||
|
||||
if (SpUtil.getUnderagePassword() != null && !SpUtil.getUnderagePassword().isEmpty()) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken())
|
||||
.withString("type", "1").navigation();//type==1:青少年模式
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken())
|
||||
// .withString("type", "1").navigation();//type==1:青少年模式
|
||||
|
||||
Intent intent = new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken());
|
||||
intent.putExtra("title", "1");
|
||||
startActivity(intent);
|
||||
} else {
|
||||
// 如果没有设置青少年模式,应该导航到首页
|
||||
try {
|
||||
|
||||
11
build.gradle
11
build.gradle
@@ -3,8 +3,6 @@
|
||||
|
||||
// build.gradle (Project-level)
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.9.24' // 根据你使用的 Kotlin 版本调整
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
@@ -15,7 +13,6 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath libs.gradle // 或你使用的 Android Gradle 插件版本
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// ✅ 添加 ARouter 插件依赖
|
||||
classpath 'com.alibaba:arouter-register:1.0.2'
|
||||
@@ -28,6 +25,14 @@ plugins {
|
||||
alias(libs.plugins.android.library) apply false
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
}
|
||||
|
||||
subprojects {
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
}
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermsize=512m -Xx:+HeapDumponOutofMemoryError -Dfile.encoding=UTF-8
|
||||
org.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. For more details, visit
|
||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||
@@ -22,28 +22,27 @@ android.enableJetifier=true
|
||||
android.nonTransitiveRClass=true
|
||||
|
||||
arouter.register.auto=true
|
||||
|
||||
isBuildModule=false
|
||||
|
||||
#org.gradle.parallel=false
|
||||
#org.gradle.deamon=false
|
||||
android.injected.testOnly=false
|
||||
|
||||
APP_VERSION_NAME=1.1.0
|
||||
APP_VERSION_CODE=163
|
||||
APP_VERSION_NAME=1.1.1
|
||||
APP_VERSION_CODE=164
|
||||
|
||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||
org.gradle.parallel=true
|
||||
org.gradel.daemon=true
|
||||
org.gradel.configureondemand=true
|
||||
org.gradle.daemon=true
|
||||
org.gradle.configureondemand=true
|
||||
aaptOptions.cruncherEnabled false
|
||||
aaptOptions.useNewCruncher false
|
||||
|
||||
#android.enableR8=true
|
||||
#isModule
|
||||
modulevoice=false
|
||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
# ʽʱ
|
||||
beta=false
|
||||
|
||||
org.gradle.caching=false
|
||||
@@ -51,4 +50,7 @@ org.gradle.caching=false
|
||||
kapt.incremental.apt=false
|
||||
|
||||
# 或者禁用特定模块的增量编译
|
||||
#org.gradle.configureondemand=false
|
||||
#org.gradle.configureondemand=false
|
||||
|
||||
# 统一 Kotlin JVM 目标版本
|
||||
kotlin.jvm.target.validation.mode=warning
|
||||
@@ -47,6 +47,7 @@ logger = "2.2.0"
|
||||
loggingInterceptorVersion = "3.10.0"
|
||||
multidex = "2.0.1"
|
||||
ossAndroidSdkVersion = "2.9.21"
|
||||
permissionx = "1.7.1"
|
||||
persistentcookiejar = "v1.0.1"
|
||||
picture_libraryVersion = "v2.6.0"
|
||||
reactivexRxjava = "2.2.21"
|
||||
@@ -125,6 +126,7 @@ logger = { module = "com.orhanobut:logger", version.ref = "logger" }
|
||||
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
|
||||
#numberprogressbar-library = { module = "com.daimajia.numberprogressbar:library", version.ref = "libraryVersion" }
|
||||
okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptorVersion" }
|
||||
permissionx = { module = "com.guolindev.permissionx:permissionx", version.ref = "permissionx" }
|
||||
persistentcookiejar = { module = "com.github.franmontiel:PersistentCookieJar", version.ref = "persistentcookiejar" }
|
||||
#pictureselector-picture_library = { module = "com.github.LuckSiege.PictureSelector:picture_library", version.ref = "picture_libraryVersion" }
|
||||
reactivex-rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "reactivexRxjava" }
|
||||
@@ -164,4 +166,6 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVer
|
||||
#kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
|
||||
#alibaba-arouter = { id = "com.alibaba.arouter", version.ref = "arouter" }
|
||||
greendao-plugin = { id = "org.greenrobot.greendao", version.ref = "greendaoGradlePlugin" }
|
||||
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlinVersion" }
|
||||
kotlin-android-extensions = { id = "org.jetbrains.kotlin.android.extensions", version.ref = "kotlinVersion" }
|
||||
|
||||
|
||||
8
gradle/wrapper/gradle-wrapper.properties
vendored
8
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,8 +1,6 @@
|
||||
#Wed May 07 09:31:48 CST 2025
|
||||
#Mon Sep 22 21:05:11 CST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
#distributionUrl=file:///D:/Greadle/gradle-8.10.2-all.zip
|
||||
distributionUrl=file:///D:/Gradle/gradle-8.10.2-bin.zip
|
||||
zipStorePath=wrapper/distsl.
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.modulelogin.activity.ImproveInfoActivity;
|
||||
import com.xscm.modulelogin.activity.SwitchAccountsActivity;
|
||||
import com.xscm.modulemain.activity.MainActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
@@ -264,10 +265,20 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
|
||||
}
|
||||
|
||||
public void ysxl() {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4");
|
||||
intent.putExtra("title", "隐私协议");
|
||||
com.blankj.utilcode.util.ActivityUtils.startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
}
|
||||
|
||||
public void yhxy() {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation();
|
||||
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6");
|
||||
intent.putExtra("title", "用户协议");
|
||||
com.blankj.utilcode.util.ActivityUtils.startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
//apply plugin: 'kotlin-kapt' // 关键:Kotlin 注解处理器
|
||||
android {
|
||||
namespace 'com.xscm.moduleutil'
|
||||
compileSdk 35
|
||||
@@ -35,14 +35,14 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
jvmTarget = '11'
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
@@ -50,6 +50,13 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
// Kotlin 注解处理器参数(针对 Kotlin 代码)
|
||||
//kapt {
|
||||
// arguments {
|
||||
// arg("AROUTER_MODULE_NAME", project.getName())
|
||||
// }
|
||||
//}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
|
||||
@@ -139,8 +146,9 @@ dependencies {
|
||||
api(libs.alipay.alipaysdk.android)
|
||||
|
||||
api(libs.arouter.api.v150)
|
||||
annotationProcessor libs.arouter.annotation
|
||||
annotationProcessor libs.arouter.compiler
|
||||
// implementation 'com.alibaba:arouter-api:1.5.2'
|
||||
// kapt 'com.alibaba:arouter-compiler:1.5.2'/**/
|
||||
|
||||
api(libs.easypermissions)
|
||||
api(libs.xbanner)
|
||||
@@ -207,6 +215,8 @@ dependencies {
|
||||
|
||||
api 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
|
||||
api 'io.github.mayzs:paho.mqtt.android:1.2.1'
|
||||
|
||||
|
||||
// room数据库
|
||||
// def room_version = "2.5.0"
|
||||
// implementation "androidx.room:room-runtime:$room_version"
|
||||
@@ -219,4 +229,4 @@ dependencies {
|
||||
//aar的名称,例如:WbCloudNormal-v5.1.10-123456789.aar,填入 'WbCloudNormal-v5.1.10-123456789.aar'
|
||||
}
|
||||
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
//apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
@@ -766,7 +766,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(ChatInfo event) {
|
||||
String id = event.getId().replace("g", "");
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id).navigation();
|
||||
Intent intent = new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id);
|
||||
startActivity( intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id).navigation();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,13 +43,13 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewDataBinding> extends BaseAppCompatActivity<VDB> implements
|
||||
IView<Activity>, LocationProvider.LocationCallback {
|
||||
IView<Activity> {
|
||||
|
||||
protected P MvpPre;
|
||||
|
||||
protected abstract P bindPresenter();
|
||||
|
||||
private String city1;
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
@@ -120,7 +120,7 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
|
||||
// 错误处理
|
||||
}
|
||||
});
|
||||
initLocation();
|
||||
//initLocation();
|
||||
}
|
||||
});
|
||||
V2TIMManager.getInstance().addIMSDKListener(imSdkListener);
|
||||
@@ -184,51 +184,7 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
|
||||
}, false, 0).show();
|
||||
}
|
||||
|
||||
private SystemLocationProvider locationProvider;
|
||||
|
||||
private void initLocation() {
|
||||
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
// 请求定位权限
|
||||
ActivityCompat.requestPermissions(
|
||||
(Activity) this,
|
||||
new String[]{
|
||||
android.Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
},
|
||||
1001 // 自定义常量,比如 1001
|
||||
);
|
||||
}
|
||||
locationProvider = new SystemLocationProvider();
|
||||
|
||||
// 请求一次性的位置信息
|
||||
locationProvider.getLastKnownLocation(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationReceived(double latitude, double longitude, String city) {
|
||||
LogUtils.e("当前位置:" + city);
|
||||
city1 = city;
|
||||
EventBus.getDefault().post(city1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorMessage) {
|
||||
LogUtils.e("定位失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
if (requestCode == 1001) {
|
||||
if (locationProvider == null) {
|
||||
locationProvider = new SystemLocationProvider();
|
||||
}
|
||||
locationProvider.getLastKnownLocation(this, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.xscm.moduleutil.activity.news;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
|
||||
@@ -14,6 +15,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.NewsMessageList;
|
||||
import com.xscm.moduleutil.databinding.ActivityOfficialNoticeBinding;
|
||||
@@ -79,7 +81,10 @@ public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, Activ
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getApplicationContext(), item.getRoom_id()+"","");
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", 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();
|
||||
Intent intent = new Intent(OfficialNoticeActivity.this, WebViewActivity.class);
|
||||
intent.putExtra("url", item.getUrl());
|
||||
startActivity(intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", item.getUrl()).navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import static android.app.PendingIntent.getActivity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
@@ -124,6 +127,9 @@ public class RoomManager {
|
||||
if (!CommonAppContext.getInstance().playId.equals(roomId)) {
|
||||
MessageListenerSingleton.getInstance().joinGroup(roomId);
|
||||
exitRoom(CommonAppContext.getInstance().playId);
|
||||
CommonAppContext.getInstance().isShow = false;
|
||||
CommonAppContext.getInstance().isPlaying = false;
|
||||
EventBus.getDefault().post(new RoomOutEvent());
|
||||
} else if (CommonAppContext.getInstance().lable_id.equals("6")) {
|
||||
upInfo(context, roomId, password, true, null, true);
|
||||
return;
|
||||
@@ -334,7 +340,6 @@ public class RoomManager {
|
||||
ARouter.getInstance()
|
||||
.build(ARouteConstants.ROOM_DETAILS)
|
||||
.with(bundle)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
||||
.navigation(context);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.text.TextPaint;
|
||||
@@ -16,6 +19,7 @@ import androidx.databinding.DataBindingUtil;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.SpanUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.databinding.DialogPolicBinding;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
@@ -42,7 +46,12 @@ public class PolicyDialog extends Dialog {
|
||||
ClickableSpan clickSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6" ).withString("title", "用户协议").navigation();
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6");
|
||||
intent.putExtra("title", "用户协议");
|
||||
startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6" ).withString("title", "用户协议").navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +63,12 @@ public class PolicyDialog extends Dialog {
|
||||
ClickableSpan ysClickSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4");
|
||||
intent.putExtra("title", "隐私协议");
|
||||
startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
@@ -9,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.TeenagerInfo;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
@@ -55,7 +57,11 @@ public class YouthModelDialog extends BaseDialog<IndexDialogYouthModelBinding> {
|
||||
// } else {
|
||||
// ARouter.getInstance().build(ARouteConstants.SET_YOUTH_PWD_ACTIVITY).withInt("type", SetYouthPasswordActivity.SET_TYPE).navigation();
|
||||
// }
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken()).navigation();
|
||||
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken());
|
||||
getContext().startActivity(intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken()).navigation();
|
||||
dismiss();
|
||||
});
|
||||
|
||||
|
||||
@@ -122,6 +122,9 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
|
||||
|
||||
@Override
|
||||
public void onNext(WalletBean walletBean) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().wallet(walletBean);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.xscm.moduleutil.http;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* 通用的API响应处理回调类
|
||||
* 统一处理所有接口的响应和错误情况
|
||||
*/
|
||||
public abstract class ApiResponseCallback<T> implements Callback<BaseModel<T>> {
|
||||
private Context mContext;
|
||||
|
||||
// 构造方法,传入上下文用于显示提示
|
||||
public ApiResponseCallback(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<T>> call, Response<BaseModel<T>> response) {
|
||||
// 统一处理HTTP响应
|
||||
if (response.isSuccessful()) {
|
||||
// 处理200-299范围内的HTTP状态码
|
||||
BaseModel<T> body = response.body();
|
||||
|
||||
if (body != null) {
|
||||
// 根据code值进行不同处理
|
||||
switch (body.getCode()) {
|
||||
case 1: // 接口返回成功
|
||||
// 业务成功,回调给具体实现
|
||||
// 即使data为null也调用onSuccess,由具体实现决定如何处理null值
|
||||
onSuccess(body.getData());
|
||||
break;
|
||||
case 0: // 接口请求成功但数据错误
|
||||
// 显示错误信息
|
||||
// String errorMsg = body.getMsg() != null ? body.getMsg() : "操作失败,请重试";
|
||||
// showToast(errorMsg);
|
||||
onFailure(new Exception(body.getMsg()));
|
||||
break;
|
||||
case 301: // 登录失效
|
||||
// 显示错误信息并退出应用
|
||||
// String loginErrorMsg = body.getMsg() != null ? body.getMsg() : "登录已失效,请重新登录";
|
||||
showToast(body.getMsg());
|
||||
|
||||
try {
|
||||
// 发送退出登录事件
|
||||
// EventBus.getDefault().post(new com.xscm.moduleutil.event.LogOutEvent());
|
||||
|
||||
// 清除登录信息
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
|
||||
// 跳转到登录页面
|
||||
// android.content.Intent intent = new android.content.Intent(CommonAppContext.getInstance(), Class.forName("com.xscm.midi.LaunchPageActivity"));
|
||||
// intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK | android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
// CommonAppContext.getInstance().startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
onFailure(new Exception(body.getMsg()));
|
||||
break;
|
||||
default:
|
||||
// 其他错误情况
|
||||
String defaultErrorMsg = body.getMsg() != null ? body.getMsg() : "未知错误";
|
||||
showToast(defaultErrorMsg);
|
||||
onFailure(new Exception(defaultErrorMsg));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// 响应体为空的情况
|
||||
String errorMsg = "获取数据失败,请重试";
|
||||
showToast(errorMsg);
|
||||
onFailure(new Exception(errorMsg));
|
||||
}
|
||||
} else {
|
||||
// 处理HTTP错误状态码
|
||||
String errorInfo;
|
||||
try {
|
||||
if (response.errorBody() != null) {
|
||||
errorInfo = response.errorBody().string();
|
||||
// 可以在这里统一解析错误响应体
|
||||
} else {
|
||||
errorInfo = "请求失败,状态码:" + response.code();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
errorInfo = "请求失败,状态码:" + response.code();
|
||||
e.printStackTrace();
|
||||
}
|
||||
showToast("");
|
||||
onFailure(new Exception(errorInfo));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<T>> call, Throwable t) {
|
||||
// 统一处理网络异常
|
||||
String errorMsg;
|
||||
if (t instanceof IOException) {
|
||||
// errorMsg = "网络异常,请检查网络连接";
|
||||
} else {
|
||||
// errorMsg = "请求处理失败,请重试";
|
||||
}
|
||||
showToast("");
|
||||
// 回调给具体实现处理
|
||||
onFailure(t);
|
||||
}
|
||||
|
||||
// 显示提示信息
|
||||
private void showToast(String message) {
|
||||
if (mContext != null) {
|
||||
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
// 业务成功时的回调,由具体接口实现
|
||||
public abstract void onSuccess(T data);
|
||||
|
||||
// 错误时的回调,可选实现
|
||||
public void onFailure(Throwable t) {
|
||||
// 可以留空,由子类选择性实现
|
||||
LogUtils.e("接口错误:",t);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.xscm.moduleutil.http;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class BusinessAwareConverterFactory extends Converter.Factory {
|
||||
private final GsonConverterFactory originalFactory;
|
||||
private final Context context;
|
||||
|
||||
public BusinessAwareConverterFactory(Context context) {
|
||||
this.context = context;
|
||||
this.originalFactory = GsonConverterFactory.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Converter<ResponseBody, ?> responseBodyConverter(Type type,
|
||||
Annotation[] annotations,
|
||||
Retrofit retrofit) {
|
||||
final Converter<ResponseBody, ?> delegate =
|
||||
originalFactory.responseBodyConverter(type, annotations, retrofit);
|
||||
|
||||
return new Converter<ResponseBody, Object>() {
|
||||
@Override
|
||||
public Object convert(ResponseBody value) throws IOException {
|
||||
// 先读取响应字符串检查业务状态码
|
||||
String responseString = value.string();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(responseString);
|
||||
int code = jsonObject.getInt("code");
|
||||
String msg = jsonObject.getString("msg");
|
||||
|
||||
if (code == 301) {
|
||||
handleForceLogout();
|
||||
ToastUtils.showShort(msg);
|
||||
}
|
||||
|
||||
// 重新构建 ResponseBody 供原始转换器使用
|
||||
ResponseBody newValue = ResponseBody.create(value.contentType(), responseString);
|
||||
return delegate.convert(newValue);
|
||||
|
||||
} catch (JSONException e) {
|
||||
throw new IOException("");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleForceLogout() {
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -193,6 +193,7 @@ public class RetrofitClient {
|
||||
|
||||
private Retrofit provideRetrofit(OkHttpClient client) {
|
||||
return new Retrofit.Builder()
|
||||
.addConverterFactory(new BusinessAwareConverterFactory(CommonAppContext.getInstance()))
|
||||
.addConverterFactory(MyConverterFactory.create())/**/
|
||||
// .addConverterFactory(GsonConverterFactory.create())
|
||||
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
||||
@@ -234,7 +235,29 @@ public class RetrofitClient {
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
/**
|
||||
* 检查网络连接状态
|
||||
* @return true表示网络可用,false表示网络不可用
|
||||
*/
|
||||
private boolean isNetworkAvailable() {
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager) CommonAppContext.getInstance()
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (connectivityManager != null) {
|
||||
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
|
||||
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络不可用时的统一处理方法
|
||||
* @param observer BaseObserver对象
|
||||
* @param <T> 泛型类型
|
||||
*/
|
||||
private <T> void handleNetworkUnavailable(BaseObserver<T> observer) {
|
||||
ToastUtils.showShort("网络不可用,请检查网络设置");
|
||||
observer.onError(new Throwable("网络不可用,请检查网络设置"));
|
||||
}
|
||||
public <T> T createApiClient(Class<T> apiClientClass) {
|
||||
return mRetrofit.create(apiClientClass);
|
||||
}
|
||||
@@ -258,6 +281,7 @@ public class RetrofitClient {
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<String> body = response.body();
|
||||
|
||||
observer.onNext(body.getMsg());
|
||||
|
||||
}
|
||||
@@ -367,6 +391,7 @@ public class RetrofitClient {
|
||||
sApiServer.exchangeCoin(earnings_num).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
|
||||
onNextRetu(response, observer);
|
||||
}
|
||||
|
||||
@@ -400,7 +425,7 @@ public class RetrofitClient {
|
||||
public void onResponse(Call<BaseModel<FirstChargeBean>> call, Response<BaseModel<FirstChargeBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<FirstChargeBean> baseModel = response.body();
|
||||
if (baseModel != null) {
|
||||
if (baseModel.getCode()==1){
|
||||
observer.onNext(baseModel.getData());
|
||||
} else {
|
||||
ToastUtils.showShort("获取数据失败");
|
||||
@@ -1301,7 +1326,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<MyRoomBean>>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("获取房间列表失败", t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1345,7 +1371,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<TopRoom>>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("getTopRooms", t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1748,6 +1775,11 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
public void roomGetIn(String roomId, String password, BaseObserver<RoomInfoResp> observer) {
|
||||
if (!isNetworkAvailable()) {
|
||||
handleNetworkUnavailable(observer);
|
||||
CommonAppContext.getInstance().isRoomJoininj=false;
|
||||
return;
|
||||
}
|
||||
sApiServer.roomGetIn(roomId, password).enqueue(new Callback<BaseModel<RoomInfoResp>>() {
|
||||
|
||||
@Override
|
||||
@@ -1827,7 +1859,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<MyCpRoom>>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("myCpRoom", t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2026,8 +2059,7 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
// TODO: 2025/3/15 获取主持人列表
|
||||
public void getHostList(String roomId, String
|
||||
type, BaseObserver<List<HostBean>> observer) {
|
||||
public void getHostList(String roomId, String type, BaseObserver<List<HostBean>> observer) {
|
||||
sApiServer.getHostList(roomId, type).enqueue(new Callback<BaseModel<List<HostBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<HostBean>>> call, Response<BaseModel<List<HostBean>>> response) {
|
||||
@@ -2046,8 +2078,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getSearch(String keyWord, String
|
||||
type, BaseObserver<List<RoomSearchResp>> observer) {
|
||||
public void getSearch(String keyWord, String type, BaseObserver<List<RoomSearchResp>> observer) {
|
||||
sApiServer.getSearch(keyWord, type).enqueue(new Callback<BaseModel<List<RoomSearchResp>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<RoomSearchResp>>> call, Response<BaseModel<List<RoomSearchResp>>> response) {
|
||||
@@ -2086,8 +2117,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getCharmList(String roomId, String stime, String etime, String
|
||||
p, BaseObserver<RoomDetails> observer) {
|
||||
public void getCharmList(String roomId, String stime, String etime, String p, BaseObserver<RoomDetails> observer) {
|
||||
sApiServer.getCharmList(roomId, stime, etime, p).enqueue(new Callback<BaseModel<RoomDetails>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomDetails>> call, Response<BaseModel<RoomDetails>> response) {
|
||||
@@ -2146,26 +2176,22 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void roomAuctionJoin(String auctionId, String userId, String giftId, String
|
||||
num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).enqueue(new Callback<BaseModel<RoomAuction.AuctionListBean>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomAuction.AuctionListBean>> call, Response<BaseModel<RoomAuction.AuctionListBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<RoomAuction.AuctionListBean> baseModel = response.body();
|
||||
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData());
|
||||
} else {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
public void roomAuctionJoin(String auctionId, String userId, String giftId, String num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).enqueue(new ApiResponseCallback<RoomAuction.AuctionListBean>(CommonAppContext.getInstance()) {
|
||||
@Override
|
||||
public void onSuccess(RoomAuction.AuctionListBean data) {
|
||||
// 确保即使data为null也能够正确传递给observer
|
||||
if (data == null){
|
||||
data = new RoomAuction.AuctionListBean();
|
||||
}
|
||||
observer.onNext(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RoomAuction.AuctionListBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
public void onFailure(Throwable t) {
|
||||
super.onFailure(t);
|
||||
RoomAuction.AuctionListBean yy=new RoomAuction.AuctionListBean();
|
||||
observer.onNext(yy);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2180,6 +2206,7 @@ public class RetrofitClient {
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("auction",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2197,7 +2224,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2211,7 +2238,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2225,7 +2252,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2241,7 +2268,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("editRoom",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2256,7 +2284,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("setPresidedRatio",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2272,7 +2301,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("postHostAdd",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2287,7 +2317,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("reward_zone",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2301,7 +2332,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("upSong",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2315,7 +2347,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("clearApply",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2356,7 +2389,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("helpApply",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2371,7 +2405,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("setRoomApply",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2386,13 +2421,13 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("giveGift",t);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String
|
||||
type, String pit_number, String heart_id, BaseObserver<String> observer) {
|
||||
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String type, String pit_number, String heart_id, BaseObserver<String> observer) {
|
||||
sApiServer.roomGift(room_id, gift_id, gift_num, to_uid, type, pit_number, heart_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
@@ -2401,7 +2436,9 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("解析失败:roomGift", t.toString());
|
||||
observer.onNext( "");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2579,8 +2616,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void setMutePit(String roomId, String user_id, String
|
||||
isMute, BaseObserver<String> observer) {
|
||||
public void setMutePit(String roomId, String user_id, String isMute, BaseObserver<String> observer) {
|
||||
sApiServer.setMutePit(roomId, user_id, isMute).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
@@ -2589,7 +2625,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("setMutePit", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2604,7 +2641,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("setLockPit", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2618,7 +2656,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("downPit", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2632,7 +2671,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("kickOutRoom", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2646,7 +2686,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("applySong", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2660,7 +2701,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("agreeSong", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2674,7 +2716,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("endSong", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2769,6 +2812,7 @@ public class RetrofitClient {
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("changeSong", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2783,7 +2827,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("hostUserPit", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2836,7 +2881,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("topRelationCard", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2850,7 +2896,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("deleteRelationCard", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2906,7 +2953,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("setUserDecorate", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2938,7 +2986,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("publishZone", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2952,7 +3001,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("likeZone", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2966,7 +3016,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("deleteComment", t.toString());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2982,7 +3033,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("deleteZone", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2997,7 +3049,9 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("commentZone", t.toString());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3012,7 +3066,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("clearLoginInfo", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3027,13 +3082,13 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("cancel", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getPostData(String new_password, String mobile, String code, String
|
||||
userId, BaseObserver<String> observer) {
|
||||
public void getPostData(String new_password, String mobile, String code, String userId, BaseObserver<String> observer) {
|
||||
sApiServer.getPostData(new_password, mobile, code, userId).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
@@ -3066,7 +3121,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("forgotPassword", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3081,7 +3137,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("createAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3096,7 +3153,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("editAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3113,7 +3171,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("editUserInfo", t.toString());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -3126,7 +3185,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("editUserBg", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3141,7 +3201,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("userGuanz", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3155,7 +3216,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3170,7 +3232,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
@@ -3220,7 +3282,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("removeBlackList", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3235,7 +3298,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("upAddAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3249,7 +3313,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("moveAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3278,7 +3343,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("deleteAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -3290,7 +3356,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("deleteAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3306,7 +3373,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("likeAlbum", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3320,7 +3388,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("getRealNameResult", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3334,7 +3403,8 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("changeRoom", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3348,13 +3418,13 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
ToastUtils.showShort(t.toString());
|
||||
// ToastUtils.showShort(t.toString());
|
||||
LogUtils.e("changeRoomType", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onNextRetu
|
||||
(Response<BaseModel<String>> response, BaseObserver<String> observer) {
|
||||
public void onNextRetu(Response<BaseModel<String>> response, BaseObserver<String> observer) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<String> string = response.body();
|
||||
if (string != null) {
|
||||
@@ -3380,8 +3450,7 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
/// 获取活动礼物列表
|
||||
public void getBoxGiftList(String giftBagId, String
|
||||
roomId, BaseObserver<BlindBoxBean> observer) {
|
||||
public void getBoxGiftList(String giftBagId, String roomId, BaseObserver<BlindBoxBean> observer) {
|
||||
sApiServer.getBoxGiftList(giftBagId, roomId).enqueue(new Callback<BaseModel<BlindBoxBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<BlindBoxBean>> call, Response<BaseModel<BlindBoxBean>> response) {
|
||||
@@ -3512,8 +3581,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void xlhMyRecord(String roomId, String page, String
|
||||
pageSize, BaseObserver<List<GiftBean>> observer) {
|
||||
public void xlhMyRecord(String roomId, String page, String pageSize, BaseObserver<List<GiftBean>> observer) {
|
||||
sApiServer.xlhMyRecord(roomId, page, pageSize).enqueue(new Callback<BaseModel<List<GiftBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<GiftBean>>> call, Response<BaseModel<List<GiftBean>>> response) {
|
||||
@@ -3532,8 +3600,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getAllRecord(String giftBagId, String page, String
|
||||
pageSize, BaseObserver<List<GiftBean>> observer) {
|
||||
public void getAllRecord(String giftBagId, String page, String pageSize, BaseObserver<List<GiftBean>> observer) {
|
||||
sApiServer.getAllRecord(giftBagId, page, pageSize).enqueue(new Callback<BaseModel<List<GiftBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<GiftBean>>> call, Response<BaseModel<List<GiftBean>>> response) {
|
||||
|
||||
@@ -21,9 +21,9 @@ public class ARouteConstants {
|
||||
public static final String CREATED_ROOM = "/modulevocal/CreatedRoomActivity"; //创建房间
|
||||
public static final String WITHDRAWAL_ACTIVITY = "/modulevocal/WithdrawalActivity"; //提现
|
||||
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"; //实名认证
|
||||
public static final String REAL_NAME_ACTIVITY2 ="/modulevocal/RealNameActivity"; //实名认证
|
||||
public static final String H5 ="/moduleUtil/WebViewActivity"; //网页
|
||||
// public static final String GIFT_WALL ="/moduleroom/UserGiftWallFragment"; //实名认证
|
||||
public static final String RECHARGE_ACTIVITY ="/modulevocal/RechargeActivity"; //实名认证
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public enum EnvironmentEnum {
|
||||
1600106397,
|
||||
"05b406b4541e413887d8d2bf9be8642c",
|
||||
"tcp://1.13.181.248",
|
||||
"https://chatvespa.qxmier.com");
|
||||
"https://tmd.xscmmidi.site/h5");
|
||||
|
||||
private final String serverUrl;//服务器地址
|
||||
private final String ALI_AUTH_KEY;//阿里云授权key
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.xscm.moduleutil.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
|
||||
public class AvatarWithDecoration extends AppCompatImageView {
|
||||
// 挂件图片
|
||||
private Drawable decoration;
|
||||
// 挂件位置偏移量
|
||||
private int decorationOffsetX = 0;
|
||||
private int decorationOffsetY = 0;
|
||||
// 挂件大小比例(相对于头像)
|
||||
private float decorationScale = 0.3f;
|
||||
|
||||
public AvatarWithDecoration(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public AvatarWithDecoration(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public AvatarWithDecoration(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AvatarWithDecoration);
|
||||
decoration = a.getDrawable(R.styleable.AvatarWithDecoration_decoration);
|
||||
decorationScale = a.getFloat(R.styleable.AvatarWithDecoration_decorationScale, 0.3f);
|
||||
decorationOffsetX = a.getInt(R.styleable.AvatarWithDecoration_decorationOffsetX, 0);
|
||||
decorationOffsetY = a.getInt(R.styleable.AvatarWithDecoration_decorationOffsetY, 0);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
// 可以在这里设置默认的挂件
|
||||
decoration = getResources().getDrawable(R.mipmap.xlh_image);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
|
||||
// 如果有挂件,则绘制挂件
|
||||
if (decoration != null) {
|
||||
drawDecoration(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawDecoration(Canvas canvas) {
|
||||
// 获取头像的宽高
|
||||
int avatarWidth = getWidth();
|
||||
int avatarHeight = getHeight();
|
||||
|
||||
// 计算挂件的大小
|
||||
int decorationWidth = (int) (avatarWidth * decorationScale);
|
||||
int decorationHeight = (int) (avatarHeight * decorationScale);
|
||||
|
||||
// 计算挂件的位置(右下角)
|
||||
int left = avatarWidth - decorationWidth + decorationOffsetX;
|
||||
int top = avatarHeight - decorationHeight + decorationOffsetY;
|
||||
int right = left + decorationWidth;
|
||||
int bottom = top + decorationHeight;
|
||||
|
||||
// 设置挂件的绘制边界
|
||||
decoration.setBounds(left, top, right, bottom);
|
||||
|
||||
// 绘制挂件
|
||||
decoration.draw(canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置挂件图片
|
||||
*/
|
||||
public void setDecoration(Drawable decoration) {
|
||||
this.decoration = decoration;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置挂件图片(通过Bitmap)
|
||||
*/
|
||||
public void setDecoration(Bitmap bitmap) {
|
||||
if (bitmap != null) {
|
||||
this.decoration = new BitmapDrawable(getResources(), bitmap);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置挂件位置偏移量
|
||||
*/
|
||||
public void setDecorationOffset(int offsetX, int offsetY) {
|
||||
this.decorationOffsetX = offsetX;
|
||||
this.decorationOffsetY = offsetY;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置挂件大小比例
|
||||
*/
|
||||
public void setDecorationScale(float scale) {
|
||||
if (scale > 0 && scale <= 1) {
|
||||
this.decorationScale = scale;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,373 @@
|
||||
package com.xscm.moduleutil.view;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.xscm.moduleutil.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class FashionAvatarView extends View {
|
||||
// 头像相关属性
|
||||
private Bitmap mAvatarBitmap;
|
||||
private String mAvatarUrl;
|
||||
private Drawable mPlaceholderAvatar;
|
||||
private int mAvatarRadius;
|
||||
private int mAvatarBorderWidth;
|
||||
private int mAvatarBorderColor;
|
||||
|
||||
// 顶部标签属性
|
||||
private String mTagText;
|
||||
private int mTagTextColor;
|
||||
private float mTagTextSize;
|
||||
private int mTagBackgroundColor;
|
||||
private float mTagCornerRadius;
|
||||
private int mTagPadding;
|
||||
private int mTagOffsetY; // 标签Y轴偏移量
|
||||
|
||||
// 底部文字属性
|
||||
private String mBottomText;
|
||||
private int mBottomTextColor;
|
||||
private float mBottomTextSize;
|
||||
private int mBottomTextOffsetY; // 底部文字Y轴偏移量
|
||||
|
||||
// 爱心装饰属性
|
||||
private Drawable mHeartIcon;
|
||||
private int mHeartCount;
|
||||
private int mHeartSize;
|
||||
private List<PointF> mHeartPositions = new ArrayList<>();
|
||||
private Random mRandom = new Random();
|
||||
|
||||
// 画笔
|
||||
private Paint mAvatarPaint;
|
||||
private Paint mTextPaint;
|
||||
private Paint mTagBgPaint;
|
||||
|
||||
public FashionAvatarView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public FashionAvatarView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public FashionAvatarView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initAttrs(context, attrs);
|
||||
initPaints();
|
||||
}
|
||||
|
||||
private void initAttrs(Context context, AttributeSet attrs) {
|
||||
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.FashionAvatarView);
|
||||
|
||||
// 头像属性
|
||||
mAvatarUrl = ta.getString(R.styleable.FashionAvatarView_avatarUrl);
|
||||
mPlaceholderAvatar = ta.getDrawable(R.styleable.FashionAvatarView_placeholderAvatar);
|
||||
mAvatarRadius = ta.getDimensionPixelSize(R.styleable.FashionAvatarView_avatarRadius, dp2px(60));
|
||||
mAvatarBorderWidth = ta.getDimensionPixelSize(R.styleable.FashionAvatarView_avatarBorderWidth, dp2px(2));
|
||||
mAvatarBorderColor = ta.getColor(R.styleable.FashionAvatarView_avatarBorderColor, Color.parseColor("#FFD700"));
|
||||
|
||||
// 顶部标签属性
|
||||
mTagText = ta.getString(R.styleable.FashionAvatarView_tagText);
|
||||
mTagTextColor = ta.getColor(R.styleable.FashionAvatarView_tagTextColor, Color.WHITE);
|
||||
mTagTextSize = ta.getDimension(R.styleable.FashionAvatarView_tagTextSize, sp2px(12));
|
||||
mTagBackgroundColor = ta.getColor(R.styleable.FashionAvatarView_tagBackgroundColor, Color.parseColor("#FFA500"));
|
||||
mTagCornerRadius = ta.getDimension(R.styleable.FashionAvatarView_tagCornerRadius, dp2px(4));
|
||||
mTagPadding = ta.getDimensionPixelSize(R.styleable.FashionAvatarView_tagPadding, dp2px(4));
|
||||
mTagOffsetY = ta.getDimensionPixelSize(R.styleable.FashionAvatarView_tagOffsetY, 0);
|
||||
|
||||
// 底部文字属性
|
||||
mBottomText = ta.getString(R.styleable.FashionAvatarView_bottomText);
|
||||
mBottomTextColor = ta.getColor(R.styleable.FashionAvatarView_bottomTextColor, Color.WHITE);
|
||||
mBottomTextSize = ta.getDimension(R.styleable.FashionAvatarView_bottomTextSize, sp2px(14));
|
||||
mBottomTextOffsetY = ta.getDimensionPixelSize(R.styleable.FashionAvatarView_bottomTextOffsetY, dp2px(10));
|
||||
|
||||
// 爱心装饰属性
|
||||
mHeartIcon = ta.getDrawable(R.styleable.FashionAvatarView_heartIcon);
|
||||
if (mHeartIcon == null) {
|
||||
try {
|
||||
mHeartIcon = context.getResources().getDrawable(R.mipmap.xlh_image);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
mHeartCount = ta.getInt(R.styleable.FashionAvatarView_heartCount, 6);
|
||||
mHeartSize = ta.getDimensionPixelSize(R.styleable.FashionAvatarView_heartSize, dp2px(16));
|
||||
|
||||
ta.recycle();
|
||||
|
||||
// 加载头像
|
||||
if (mAvatarUrl != null && !mAvatarUrl.isEmpty()) {
|
||||
loadAvatarFromNetwork();
|
||||
} else if (mPlaceholderAvatar != null) {
|
||||
mAvatarBitmap = drawableToBitmap(mPlaceholderAvatar);
|
||||
}
|
||||
}
|
||||
|
||||
private void initPaints() {
|
||||
// 头像画笔
|
||||
mAvatarPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mAvatarPaint.setDither(true);
|
||||
|
||||
// 文字画笔
|
||||
mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mTextPaint.setTextAlign(Paint.Align.CENTER);
|
||||
|
||||
// 标签背景画笔
|
||||
mTagBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mTagBgPaint.setColor(mTagBackgroundColor);
|
||||
}
|
||||
|
||||
private void loadAvatarFromNetwork() {
|
||||
Glide.with(this)
|
||||
.asBitmap()
|
||||
.load(mAvatarUrl)
|
||||
.into(new SimpleTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
|
||||
mAvatarBitmap = resource;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed(@Nullable Drawable errorDrawable) {
|
||||
super.onLoadFailed(errorDrawable);
|
||||
if (mPlaceholderAvatar != null) {
|
||||
mAvatarBitmap = drawableToBitmap(mPlaceholderAvatar);
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Bitmap drawableToBitmap(Drawable drawable) {
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
}
|
||||
|
||||
if (drawable == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int width = drawable.getIntrinsicWidth();
|
||||
int height = drawable.getIntrinsicHeight();
|
||||
|
||||
if (width <= 0) width = mAvatarRadius * 2;
|
||||
if (height <= 0) height = mAvatarRadius * 2;
|
||||
|
||||
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
private void initHeartPositions() {
|
||||
mHeartPositions.clear();
|
||||
|
||||
if (mHeartIcon == null || mHeartCount <= 0 || mHeartSize <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int centerX = getWidth() / 2;
|
||||
int centerY = getAvatarCenterY();
|
||||
// 爱心围绕的半径,比头像大一些
|
||||
int radius = mAvatarRadius + mAvatarBorderWidth + mHeartSize / 2;
|
||||
|
||||
for (int i = 0; i < mHeartCount; i++) {
|
||||
// 随机分布在头像周围
|
||||
double angle = 2 * Math.PI * mRandom.nextDouble();
|
||||
// 稍微随机调整距离,让分布更自然
|
||||
float distanceFactor = 0.8f + mRandom.nextFloat() * 0.4f;
|
||||
|
||||
float x = (float) (centerX + radius * distanceFactor * Math.cos(angle));
|
||||
float y = (float) (centerY + radius * distanceFactor * Math.sin(angle));
|
||||
mHeartPositions.add(new PointF(x, y));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
// 计算宽度:直径 + 左右可能的爱心空间
|
||||
int width = 2 * (mAvatarRadius + mAvatarBorderWidth + mHeartSize / 2);
|
||||
|
||||
// 计算高度:头像直径 + 标签高度 + 底部文字高度 + 间距
|
||||
int tagHeight = (int) (mTagTextSize + mTagPadding * 2);
|
||||
int bottomTextHeight = (int) mBottomTextSize;
|
||||
int height = 2 * (mAvatarRadius + mAvatarBorderWidth)
|
||||
+ tagHeight / 2 // 标签一半在头像内
|
||||
+ bottomTextHeight + mBottomTextOffsetY
|
||||
+ dp2px(10);
|
||||
|
||||
setMeasuredDimension(resolveSize(width, widthMeasureSpec),
|
||||
resolveSize(height, heightMeasureSpec));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
// 视图大小确定后计算爱心位置
|
||||
initHeartPositions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
|
||||
if (getWidth() == 0 || getHeight() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int centerX = getWidth() / 2;
|
||||
int avatarCenterY = getAvatarCenterY();
|
||||
|
||||
// 1. 绘制爱心装饰
|
||||
drawHearts(canvas);
|
||||
|
||||
// 2. 绘制头像边框
|
||||
mAvatarPaint.setColor(mAvatarBorderColor);
|
||||
mAvatarPaint.setStyle(Paint.Style.FILL);
|
||||
canvas.drawCircle(centerX, avatarCenterY, mAvatarRadius + mAvatarBorderWidth, mAvatarPaint);
|
||||
|
||||
// 3. 绘制头像
|
||||
if (mAvatarBitmap != null) {
|
||||
mAvatarPaint.setShader(new BitmapShader(mAvatarBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
|
||||
canvas.drawCircle(centerX, avatarCenterY, mAvatarRadius, mAvatarPaint);
|
||||
mAvatarPaint.setShader(null);
|
||||
}
|
||||
|
||||
// 4. 绘制顶部标签
|
||||
drawTag(canvas, centerX, avatarCenterY);
|
||||
|
||||
// 5. 绘制底部文字
|
||||
drawBottomText(canvas, centerX);
|
||||
}
|
||||
|
||||
private int getAvatarCenterY() {
|
||||
// 计算头像中心Y坐标,考虑标签的高度
|
||||
int tagHeight = (int) (mTagTextSize + mTagPadding * 2);
|
||||
return mAvatarRadius + mAvatarBorderWidth + tagHeight / 2 + mTagOffsetY;
|
||||
}
|
||||
|
||||
private void drawHearts(Canvas canvas) {
|
||||
if (mHeartIcon == null || mHeartPositions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.save();
|
||||
for (PointF point : mHeartPositions) {
|
||||
int left = (int) (point.x - mHeartSize / 2);
|
||||
int top = (int) (point.y - mHeartSize / 2);
|
||||
int right = left + mHeartSize;
|
||||
int bottom = top + mHeartSize;
|
||||
|
||||
// 只绘制在视图范围内的爱心
|
||||
if (right > 0 && bottom > 0 && left < getWidth() && top < getHeight()) {
|
||||
mHeartIcon.setBounds(left, top, right, bottom);
|
||||
mHeartIcon.draw(canvas);
|
||||
}
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
private void drawTag(Canvas canvas, int centerX, int avatarCenterY) {
|
||||
if (mTagText == null || mTagText.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算标签文字宽度
|
||||
mTextPaint.setTextSize(mTagTextSize);
|
||||
float textWidth = mTextPaint.measureText(mTagText);
|
||||
|
||||
// 计算标签背景矩形
|
||||
float tagLeft = centerX - textWidth / 2 - mTagPadding;
|
||||
float tagRight = centerX + textWidth / 2 + mTagPadding;
|
||||
// 标签底部与头像顶部对齐
|
||||
float tagBottom = avatarCenterY - mAvatarRadius - mAvatarBorderWidth;
|
||||
float tagTop = tagBottom - mTagTextSize - mTagPadding * 2;
|
||||
|
||||
RectF tagRect = new RectF(tagLeft, tagTop, tagRight, tagBottom);
|
||||
|
||||
// 绘制标签背景
|
||||
canvas.drawRoundRect(tagRect, mTagCornerRadius, mTagCornerRadius, mTagBgPaint);
|
||||
|
||||
// 绘制标签文字
|
||||
mTextPaint.setColor(mTagTextColor);
|
||||
Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();
|
||||
float baseLineY = tagBottom - mTagPadding - fontMetrics.bottom;
|
||||
canvas.drawText(mTagText, centerX, baseLineY, mTextPaint);
|
||||
}
|
||||
|
||||
private void drawBottomText(Canvas canvas, int centerX) {
|
||||
if (mBottomText == null || mBottomText.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算文字位置:头像底部下方
|
||||
int textY = getAvatarCenterY() + mAvatarRadius + mAvatarBorderWidth + mBottomTextOffsetY;
|
||||
|
||||
mTextPaint.setColor(mBottomTextColor);
|
||||
mTextPaint.setTextSize(mBottomTextSize);
|
||||
|
||||
Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();
|
||||
float baseLineY = textY - fontMetrics.top;
|
||||
|
||||
canvas.drawText(mBottomText, centerX, baseLineY, mTextPaint);
|
||||
}
|
||||
|
||||
// dp转px
|
||||
private int dp2px(float dp) {
|
||||
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
// sp转px
|
||||
private float sp2px(float sp) {
|
||||
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
|
||||
getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
// 设置器方法
|
||||
public void setAvatarUrl(String url) {
|
||||
this.mAvatarUrl = url;
|
||||
loadAvatarFromNetwork();
|
||||
}
|
||||
|
||||
public void setTagText(String text) {
|
||||
this.mTagText = text;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setBottomText(String text) {
|
||||
this.mBottomText = text;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setHeartIcon(Drawable heartIcon) {
|
||||
this.mHeartIcon = heartIcon;
|
||||
initHeartPositions();
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.xscm.moduleutil.widget.room
|
||||
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
open class BaseViewModel : ViewModel(),LifecycleObserver {
|
||||
|
||||
val roomInfoData=MutableLiveData<RoomInfoResp>()
|
||||
private val passRoom by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val error by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val finally by lazy { MutableLiveData<Int>() }
|
||||
//加入房间
|
||||
fun jiaoRoom(roomId:String, password:String){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求失败,出现异常
|
||||
*/
|
||||
fun getError(): LiveData<Exception> {
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求完成,在此处做一些关闭操作
|
||||
*/
|
||||
fun getFinally(): LiveData<Int> {
|
||||
return finally
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xscm.moduleutil.widget.room
|
||||
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
* 自定义异常信息显示
|
||||
*/
|
||||
data class PassRoomException(var msg: String,var code: Int) : IOException()
|
||||
15
moduleUtil/src/main/res/drawable/bg_person.xml
Normal file
15
moduleUtil/src/main/res/drawable/bg_person.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 背景颜色,与原代码中的#8D6F28保持一致 -->
|
||||
<solid android:color="#8D6F28" />
|
||||
|
||||
<!-- 圆角半径,可以根据需要调整大小 -->
|
||||
<corners android:radius="@dimen/dp_5" />
|
||||
|
||||
<!-- 可选:添加内边距,让文字与边框有一定距离 -->
|
||||
<padding
|
||||
android:left="@dimen/dp_2"
|
||||
android:right="@dimen/dp_2"
|
||||
android:top="@dimen/dp_2"
|
||||
android:bottom="@dimen/dp_2" />
|
||||
</shape>
|
||||
15
moduleUtil/src/main/res/drawable/bg_round_corner.xml
Normal file
15
moduleUtil/src/main/res/drawable/bg_round_corner.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 背景颜色,与原代码中的#8D6F28保持一致 -->
|
||||
<solid android:color="#906C49E4" />
|
||||
|
||||
<!-- 圆角半径,可以根据需要调整大小 -->
|
||||
<corners android:radius="@dimen/dp_5" />
|
||||
|
||||
<!-- 可选:添加内边距,让文字与边框有一定距离 -->
|
||||
<padding
|
||||
android:left="@dimen/dp_2"
|
||||
android:right="@dimen/dp_2"
|
||||
android:top="@dimen/dp_2"
|
||||
android:bottom="@dimen/dp_2" />
|
||||
</shape>
|
||||
@@ -313,6 +313,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/exchange_layout"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/exchange_layout"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<View
|
||||
@@ -325,6 +326,7 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_option"
|
||||
app:layout_constraintTop_toTopOf="@+id/exchange_layout"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/exchange_layout"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:id="@+id/exchange_layout"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_rk_bj.webp
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_rk_bj.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 171 KiB |
38
moduleUtil/src/main/res/values/attrs.xml
Normal file
38
moduleUtil/src/main/res/values/attrs.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<resources>
|
||||
|
||||
<declare-styleable name="FashionAvatarView">
|
||||
<!-- 头像相关属性 -->
|
||||
<attr name="avatarUrl" format="string" />
|
||||
<attr name="placeholderAvatar" format="reference" />
|
||||
<attr name="avatarRadius" format="dimension" />
|
||||
<attr name="avatarBorderWidth" format="dimension" />
|
||||
<attr name="avatarBorderColor" format="color" />
|
||||
|
||||
<!-- 顶部标签相关属性 -->
|
||||
<attr name="tagText" format="string" />
|
||||
<attr name="tagTextColor" format="color" />
|
||||
<attr name="tagTextSize" format="dimension" />
|
||||
<attr name="tagBackgroundColor" format="color" />
|
||||
<attr name="tagCornerRadius" format="dimension" />
|
||||
<attr name="tagPadding" format="dimension" />
|
||||
<attr name="tagOffsetY" format="dimension" />
|
||||
|
||||
<!-- 底部文字相关属性 -->
|
||||
<attr name="bottomText" format="string" />
|
||||
<attr name="bottomTextColor" format="color" />
|
||||
<attr name="bottomTextSize" format="dimension" />
|
||||
<attr name="bottomTextOffsetY" format="dimension" />
|
||||
|
||||
<!-- 爱心装饰相关属性 -->
|
||||
<attr name="heartIcon" format="reference" />
|
||||
<attr name="heartCount" format="integer" />
|
||||
<attr name="heartSize" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AvatarWithDecoration">
|
||||
<attr name="decoration" format="reference" />
|
||||
<attr name="decorationScale" format="float" />
|
||||
<attr name="decorationOffsetX" format="integer" />
|
||||
<attr name="decorationOffsetY" format="integer" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
@@ -244,7 +244,9 @@ public class CircleCategoryFragment extends BaseMvpFragment<CirclePresenter, Fra
|
||||
|
||||
@Override
|
||||
public void setLikeZone(int type) {
|
||||
// MvpPre.getCircleList(page + "", "10");
|
||||
if (type == 1) {
|
||||
MvpPre.getCircleList(page + "", "10");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ android {
|
||||
enabled = true
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
jvmTarget = '11'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,7 @@ dependencies {
|
||||
implementation (libs.arouter.api.v150)
|
||||
//annotationProcessor
|
||||
annotationProcessor libs.arouter.compiler
|
||||
implementation libs.permissionx
|
||||
|
||||
}
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 前台定位权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<!-- 后台定位权限(Android 10+) -->
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
<application
|
||||
>
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.modulemain.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@@ -16,9 +18,12 @@ import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
@@ -32,6 +37,12 @@ import com.example.modulenews.fragment.NewsFragment;
|
||||
import com.example.moduleroom.activity.RoomActivity;
|
||||
import com.example.modulevocal.fragment.VocalRangeFragment;
|
||||
import com.example.modulevoice.fragment.VoiceFragment;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
import com.permissionx.guolindev.callback.ExplainReasonCallback;
|
||||
import com.permissionx.guolindev.callback.ForwardToSettingsCallback;
|
||||
import com.permissionx.guolindev.callback.RequestCallback;
|
||||
import com.permissionx.guolindev.request.ExplainScope;
|
||||
import com.permissionx.guolindev.request.ForwardScope;
|
||||
import com.xscm.modulemain.R;
|
||||
import com.xscm.modulemain.contacts.HomeContacts;
|
||||
import com.xscm.modulemain.databinding.ActivityMainBinding;
|
||||
@@ -56,6 +67,8 @@ import com.xscm.moduleutil.utils.BackgroundManager;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.location.LocationProvider;
|
||||
import com.xscm.moduleutil.utils.location.SystemLocationProvider;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMValueCallback;
|
||||
@@ -69,7 +82,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Route(path = ARouteConstants.ME)
|
||||
public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBinding> implements HomeContacts.View, View.OnClickListener {
|
||||
public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBinding>
|
||||
implements HomeContacts.View, View.OnClickListener, LocationProvider.LocationCallback {
|
||||
private static int index = -1;
|
||||
|
||||
public static boolean isShortsShowing() {
|
||||
@@ -178,6 +192,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -262,6 +277,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
// 最推荐的方法
|
||||
private void clearAllOtherTasksAndRestart() {
|
||||
// Intent intent = new Intent(this, MainActivity.class);
|
||||
@@ -278,6 +294,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
// 可选:如果上面的方法不够彻底,可以配合使用
|
||||
Runtime.getRuntime().gc(); // 建议垃圾回收
|
||||
}
|
||||
|
||||
/**
|
||||
* 优雅地退出应用,避免闪屏
|
||||
*/
|
||||
@@ -366,7 +383,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
} else if (id == R.id.riv) {
|
||||
String roomId = CommonAppContext.getInstance().playId;
|
||||
if (!TextUtils.isEmpty(roomId)) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(this, CommonAppContext.getInstance().playId,"");
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(this, CommonAppContext.getInstance().playId, "");
|
||||
|
||||
// MvpPre.getRoomOnline(roomId, "1", "100");
|
||||
// AppStateManager stateManager = AppStateManager.getInstance();
|
||||
@@ -540,24 +557,63 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MvpPre.getMyInfo(SpUtil.getUserId() + "");//获取首充是否需要展示
|
||||
|
||||
// mBinding.ivShouchl.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
// 请求GPS相关权限(精确位置+可选的后台权限)
|
||||
requestGpsPermissions();
|
||||
|
||||
}
|
||||
|
||||
private void requestGpsPermissions() {
|
||||
PermissionX.init(this)
|
||||
// 请求精确位置权限(包含GPS定位能力)
|
||||
.permissions(
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
// 如需后台使用GPS,添加此权限(Android 10+)
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION
|
||||
).explainReasonBeforeRequest()
|
||||
.onExplainRequestReason(new ExplainReasonCallback() {
|
||||
@Override
|
||||
public void onExplainReason(ExplainScope scope, List<String> deniedList) {
|
||||
String message = "需要GPS权限以获取您的精确位置,用于导航/定位功能";
|
||||
// 若包含后台权限,补充说明
|
||||
|
||||
scope.showRequestReasonDialog(deniedList, message, "确定", "取消");
|
||||
}
|
||||
})
|
||||
// 权限被永久拒绝时,引导至设置页面
|
||||
.onForwardToSettings(new ForwardToSettingsCallback() {
|
||||
@Override
|
||||
public void onForwardToSettings(ForwardScope scope, List<String> deniedList) {
|
||||
scope.showForwardToSettingsDialog(deniedList, "GPS权限被拒绝,无法使用定位功能,请去设置开启", "去设置", "取消");
|
||||
}
|
||||
})
|
||||
// 权限请求结果回调
|
||||
.request(new RequestCallback() {
|
||||
@Override
|
||||
public void onResult(boolean allGranted, List<String> grantedList, List<String> deniedList) {
|
||||
if (allGranted) {
|
||||
// Toast.makeText(MainActivity.this, "GPS权限已授予,可开始定位", Toast.LENGTH_SHORT).show();
|
||||
initLocation(); // 启动GPS定位逻辑
|
||||
} else {
|
||||
Toast.makeText(MainActivity.this, "GPS权限被拒绝,无法使用定位功能", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(UnreadCountEvent event) {
|
||||
long aLong = event.getALong();
|
||||
long bLong = event.getBLong();
|
||||
if (aLong==0 && bLong==0){
|
||||
if (aLong == 0 && bLong == 0) {
|
||||
mBinding.tvMessage.setVisibility(View.GONE);
|
||||
}else {
|
||||
} else {
|
||||
mBinding.tvMessage.setVisibility(View.VISIBLE);
|
||||
mBinding.tvMessage.setText(String.valueOf(event.getALong()+event.getBLong()));
|
||||
mBinding.tvMessage.setText(String.valueOf(event.getALong() + event.getBLong()));
|
||||
}
|
||||
|
||||
// if (event.getALong() == 0) {
|
||||
@@ -619,6 +675,25 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String city1;
|
||||
|
||||
@Override
|
||||
public void onLocationReceived(double latitude, double longitude, String city) {
|
||||
LogUtils.e("当前位置:" + city);
|
||||
city1 = city;
|
||||
EventBus.getDefault().post(city1);
|
||||
LogUtils.e("@@@1", "开始定位", "描述:", "当前位置" + city);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorMessage) {
|
||||
|
||||
LogUtils.e("@@@1", "开始定位", "描述:", "失败");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static int getCurrentVersionCode(Context context) {
|
||||
try {
|
||||
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||
@@ -737,13 +812,13 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
}
|
||||
|
||||
if (!isPlaying){
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(this, CommonAppContext.getInstance().playId,"");
|
||||
if (!isPlaying) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(this, CommonAppContext.getInstance().playId, "");
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
|
||||
|
||||
}else {
|
||||
} else {
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(this, CommonAppContext.getInstance().playId,"");
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(this, CommonAppContext.getInstance().playId, "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -840,9 +915,35 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// @Override
|
||||
// protected void onPause() {
|
||||
// super.onPause();
|
||||
// moveTaskToBack(true);
|
||||
// }
|
||||
private SystemLocationProvider locationProvider;
|
||||
|
||||
private void initLocation() {
|
||||
// 在Activity或Fragment中调用
|
||||
|
||||
|
||||
locationProvider = new SystemLocationProvider();
|
||||
|
||||
// 请求一次性的位置信息
|
||||
locationProvider.getLastKnownLocation(this, this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == 1001) {
|
||||
if (locationProvider == null) {
|
||||
locationProvider = new SystemLocationProvider();
|
||||
}
|
||||
locationProvider.getLastKnownLocation(this, this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin-kapt'
|
||||
android {
|
||||
namespace 'com.example.moduleroom'
|
||||
compileSdk 35
|
||||
@@ -34,7 +35,12 @@ android {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
|
||||
// 与 dependencies 同级别
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
|
||||
implementation libs.appcompat
|
||||
@@ -48,9 +54,12 @@ dependencies {
|
||||
implementation project(':moduleUtil')
|
||||
implementation project(':moduletablayout')
|
||||
|
||||
implementation 'com.alibaba:arouter-api:1.5.2'
|
||||
// implementation 'com.alibaba:arouter-api:1.5.2'
|
||||
//annotationProcessor
|
||||
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||||
// annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||||
|
||||
implementation 'com.alibaba:arouter-api:1.5.2'
|
||||
kapt 'com.alibaba:arouter-compiler:1.5.2'
|
||||
|
||||
implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'
|
||||
|
||||
|
||||
@@ -39,6 +39,17 @@
|
||||
android:name=".service.MediaProjectionService"
|
||||
android:foregroundServiceType="mediaProjection">
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".service.ForegroundService"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:foregroundServiceType="microphone|camera|mediaPlayback" />
|
||||
<service
|
||||
android:name=".service.CancelNoticeService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@ package com.example.moduleroom.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
@@ -35,6 +36,7 @@ import com.example.moduletablayout.listener.OnTabSelectListener;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.adapter.GiftTwoDetailsFragment;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
@@ -499,7 +501,14 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
mBinding.ivWf.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", giftDetailResp.getRule_url()).withString("title", "盲盒规则").navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", giftDetailResp.getRule_url()).withString("title", "盲盒规则").navigation();
|
||||
|
||||
Intent intent = new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", giftDetailResp.getRule_url());
|
||||
intent.putExtra("title", "盲盒规则");
|
||||
startActivity(intent);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.example.moduleroom.dialog;
|
||||
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomOrderMic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -24,6 +25,7 @@ import com.example.moduleroom.contacts.RoomSettingContacts;
|
||||
import com.example.moduleroom.databinding.DialogRoomSettingFragmentBinding;
|
||||
import com.example.moduleroom.fragment.RoomBackgroundDialogFragment;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.event.EffectEvent;
|
||||
@@ -291,7 +293,11 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
}
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
|
||||
if (roomId != null) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=" + 2 + "&fromId=" + roomId).navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=" + 2 + "&fromId=" + roomId).navigation();
|
||||
Intent intent = new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=" + 2 + "&fromId=" + roomId);
|
||||
|
||||
startActivity(intent);
|
||||
}else {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.example.moduleroom.fragment.RelationshipFragment;
|
||||
import com.example.moduleroom.presenter.RoomUserPresenter;
|
||||
import com.example.zhouwei.library.CustomPopWindow;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.RelationCardBean;
|
||||
@@ -202,7 +203,11 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
|
||||
// UserGiftWallRoomFragment.newInstance(Integer.parseInt(user_id)).show(getChildFragmentManager(), "UserGiftWallRoomFragment");
|
||||
}else if (id == R.id.room_jb){
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id).withString("title", "举报").navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id).withString("title", "举报").navigation();
|
||||
Intent intent = new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id);
|
||||
intent.putExtra("title", "举报");
|
||||
startActivity(intent);
|
||||
}else if (id==R.id.iv_avatar){
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", userInfo.getUser_id()+"").navigation();
|
||||
dismiss();
|
||||
@@ -270,7 +275,12 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
} else if (id == R.id.action_report) {
|
||||
// showContent = "点击 Item菜单6";
|
||||
//TODO 举报功能
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id).withString("title", "举报").navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id).withString("title", "举报").navigation();
|
||||
Intent intent=new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id);
|
||||
intent.putExtra("title", "举报");
|
||||
startActivity(intent);
|
||||
|
||||
dismiss();
|
||||
} else if (id == R.id.action_blacklist) {
|
||||
MvpPre.addBlackList(user_id);
|
||||
|
||||
@@ -9,8 +9,6 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import android.os.CountDownTimer;
|
||||
import android.util.DisplayMetrics;
|
||||
@@ -18,8 +16,6 @@ import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
@@ -36,9 +32,7 @@ import com.example.moduleroom.dialog.RoomGiftDialogFragment;
|
||||
import com.example.moduleroom.dialog.RoomOnlineDialogFragment;
|
||||
import com.example.moduleroom.dialog.RoomUserInfoFragment;
|
||||
import com.example.moduleroom.presenter.FriendshipRoomPresenter;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.base.BaseRoomFragment;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
@@ -51,15 +45,12 @@ import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.ClickUtils;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.StringUtil;
|
||||
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
||||
import com.xscm.moduleutil.widget.SharedViewModel;
|
||||
import com.xscm.moduleutil.widget.floatingView.IFloatingView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -1005,7 +996,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).setrlMic(true);
|
||||
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
||||
AgoraManager.getInstance(getActivity()).setLocalAudioEnabled( false,SpUtil.getUserId()+"");
|
||||
// AgoraManager.getInstance(getActivity()).setLocalAudioEnabled( false,SpUtil.getUserId()+"");
|
||||
}
|
||||
}
|
||||
configPowerBtn();
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.xscm.moduleutil.event.RoomJoinMountModel;
|
||||
import com.xscm.moduleutil.rtc.MusicPlayBean;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMMessage;
|
||||
import com.tencent.imsdk.v2.V2TIMSendCallback;
|
||||
|
||||
@@ -13,20 +13,14 @@ import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.activity.RoomActivity;
|
||||
import com.example.moduleroom.contacts.RoomAuctionContacts;
|
||||
@@ -41,7 +35,6 @@ import com.example.moduleroom.dialog.RoomUserInfoFragment;
|
||||
import com.example.moduleroom.presenter.RoomAuctionPresenterTow;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
@@ -54,22 +47,16 @@ import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.dialog.RoomAuctionWebViewDialog;
|
||||
import com.xscm.moduleutil.dialog.WebViewDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ClickUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.StringUtil;
|
||||
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
||||
import com.xscm.moduleutil.widget.RoomMakeWheatView;
|
||||
import com.xscm.moduleutil.widget.SharedViewModel;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,9 +25,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ObjectUtils;
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
@@ -51,7 +49,6 @@ import com.xscm.moduleutil.event.CabinEvent;
|
||||
import com.xscm.moduleutil.event.RoomBeckoningEvent;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.SharedViewModel;
|
||||
import com.xscm.moduleutil.widget.dialog.CommonDialog;
|
||||
@@ -60,7 +57,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
package com.example.moduleroom.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.TouchDelegate;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
@@ -40,7 +36,6 @@ import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.rtc.AgoraIsOPen;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.rtc.MusicFileBean;
|
||||
import com.xscm.moduleutil.rtc.MusicPlayBean;
|
||||
|
||||
@@ -32,7 +32,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.blankj.utilcode.util.ObjectUtils;
|
||||
import com.example.moduleroom.R;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
|
||||
|
||||
// 同时启动两个service,共享同一个NotificationID,并且将他们同时置为前台状态,
|
||||
// 此时会出现两个前台服务,但通知管理器里只有一个关联的通知。
|
||||
// 这时我们在其中一个服务中调用 stopForeground(true),
|
||||
// 这个服务前台状态会被取消,同时状态栏通知也被移除。另外一个服务并没有受到影响,还是前台服务状态,但是此时,状态栏通知已经没了!
|
||||
// 其oom_adj值还是没变的
|
||||
class CancelNoticeService : Service() {
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (null == intent) {
|
||||
//服务被系统kill掉之后重启进来的
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
ForegroundNotification.startForeground(this)
|
||||
Thread {
|
||||
SystemClock.sleep(1000)
|
||||
// stopForeground(true)
|
||||
Log.d("ForegroundService", "CancelNoticeService onStartCommand: CancelNoticeService" )
|
||||
ForegroundNotification.stopForeground(this)
|
||||
// stopSelf()
|
||||
}.start()
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d("ForegroundService", "onDestroy: CancelNoticeService")
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
|
||||
fun Context.startForegroundService() {
|
||||
Intent(this, ForegroundService::class.java).also { intent ->
|
||||
if (Build.VERSION.SDK_INT >= 34) {
|
||||
this.startForegroundService(intent)
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
this.startForegroundService(intent)
|
||||
} else {
|
||||
this.startService(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun Context.hideBackground(hide: Boolean) {
|
||||
var appTasks: List<ActivityManager.AppTask>? = null
|
||||
val activityManager = getSystemService(
|
||||
Context.ACTIVITY_SERVICE
|
||||
) as? ActivityManager
|
||||
if (activityManager != null && activityManager.appTasks.also {
|
||||
appTasks = it
|
||||
} != null && appTasks?.isNotEmpty() == true) {
|
||||
appTasks?.get(0)?.setExcludeFromRecents(hide)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun Activity.ignoreBattery() {
|
||||
val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)
|
||||
intent.data = Uri.parse("package:$packageName")
|
||||
startActivityForResult(intent, 1)
|
||||
}
|
||||
|
||||
fun Activity.startAccessibilitySetting() {
|
||||
runCatching {
|
||||
val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun isServiceRunning(context: Context, serviceName: String="com.voice.module_live.keepalive.ForegroundService"): Boolean {
|
||||
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
if (activityManager != null) {
|
||||
for (service in activityManager.getRunningServices(Int.MAX_VALUE)) {
|
||||
if (serviceName == service.service.className) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.*
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.content.getSystemService
|
||||
import com.example.moduleroom.activity.RoomActivity
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object ForegroundNotification {
|
||||
private const val CHANNEL_FOREGROUND = "foreground-notification"
|
||||
const val NOTICE_ID = 233
|
||||
private var service: Service? = null
|
||||
|
||||
private fun createChannelIfNeeded(context: Context) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
|
||||
|
||||
val foregroundChannel =
|
||||
NotificationChannel(CHANNEL_FOREGROUND, "前台服务", NotificationManager.IMPORTANCE_MIN)
|
||||
.apply {
|
||||
setShowBadge(false)
|
||||
enableLights(false)
|
||||
enableVibration(false)
|
||||
lockscreenVisibility = Notification.VISIBILITY_SECRET
|
||||
}
|
||||
context.getSystemService<NotificationManager>()
|
||||
?.createNotificationChannel(foregroundChannel)
|
||||
}
|
||||
|
||||
fun startForeground(service: Service) {
|
||||
ForegroundNotification.service = service
|
||||
createChannelIfNeeded(service)
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
service,
|
||||
0,
|
||||
Intent(service, RoomActivity::class.java),
|
||||
PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
val notification = NotificationCompat.Builder(service, CHANNEL_FOREGROUND)
|
||||
.setSmallIcon(com.xscm.moduleutil.R.mipmap.ic_launcher_app)
|
||||
.setContentText("正在运行")
|
||||
.setContentIntent(pendingIntent)
|
||||
.setLocalOnly(true)
|
||||
.setPriority(NotificationCompat.PRIORITY_MIN)
|
||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
|
||||
.setOngoing(true)
|
||||
.setShowWhen(false)
|
||||
.build()
|
||||
service.startForeground(NOTICE_ID, notification)
|
||||
}
|
||||
|
||||
fun stopForeground(service: Service) {
|
||||
val manager = service.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
manager?.cancel(NOTICE_ID)
|
||||
service.stopForeground(true)
|
||||
}
|
||||
|
||||
fun cancelNotice(service: Service) {
|
||||
val manager = service.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
manager?.cancel(NOTICE_ID)
|
||||
}
|
||||
|
||||
fun stopForeground() {
|
||||
val manager =
|
||||
service?.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
manager?.cancel(NOTICE_ID)
|
||||
service?.stopForeground(true)
|
||||
}
|
||||
|
||||
fun startForegroundIfNeed(service: Service) {
|
||||
val manager = service.getSystemService(Service.NOTIFICATION_SERVICE) as? NotificationManager
|
||||
var needStart = true
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
manager?.activeNotifications?.forEach {
|
||||
needStart = (it.id == NOTICE_ID).not()
|
||||
}
|
||||
}
|
||||
if (needStart) {
|
||||
startForeground(service)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.util.Log
|
||||
import java.util.*
|
||||
|
||||
//前台服务
|
||||
class ForegroundService : Service() {
|
||||
private var logInt = 0
|
||||
private var timer: Timer? = null
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
ForegroundNotification.startForeground(this)
|
||||
timer = Timer()
|
||||
timer?.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
Log.d("ForegroundService", "Timer task ${logInt++}")
|
||||
}
|
||||
}, 0L, 300L)
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (null == intent) {
|
||||
//服务被系统kill掉之后重启进来的
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
ForegroundNotification.startForegroundIfNeed(this)
|
||||
if (ServiceHelper.cancelNotice) {
|
||||
Log.d("ForegroundService", "onStartCommand: CancelNoticeService")
|
||||
val intent = Intent(this, CancelNoticeService::class.java)
|
||||
startService(intent)
|
||||
}
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d("ForegroundService", "onDestroy: $timer")
|
||||
|
||||
timer?.cancel()
|
||||
ForegroundNotification.stopForeground(this)
|
||||
// 重启自己
|
||||
startForegroundService()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.example.moduleroom.service;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
|
||||
public class RoomPlayService extends Service {
|
||||
|
||||
private NotificationManager notificationManager;
|
||||
|
||||
private String notificationId = "room_play_channelId";
|
||||
|
||||
private String notificationName = "room_play_channelName";
|
||||
|
||||
//通知的唯一标识号。
|
||||
private static final int NOTIFICATION_ID = 11210666;
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
//创建NotificationChannel
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(notificationId, notificationName, NotificationManager.IMPORTANCE_HIGH);
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
startForeground(1, getNotification());
|
||||
}
|
||||
|
||||
private Notification getNotification() {
|
||||
|
||||
// PendingIntent如果用户选择此通知,则启动我们的活动
|
||||
// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0);
|
||||
|
||||
Notification.Builder builder = new Notification.Builder(this)
|
||||
.setTicker("正在运行")
|
||||
.setSmallIcon(R.mipmap.ic_launcher_app)
|
||||
|
||||
// .setContentIntent(pendingIntent)
|
||||
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
|
||||
.setContentText("运行中");
|
||||
|
||||
//设置Notification的ChannelID,否则不能正常显示
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
builder.setChannelId(notificationId);
|
||||
}
|
||||
Notification notification = builder.build();
|
||||
|
||||
//发送通知
|
||||
// notificationManager.notify(NOTIFICATION_ID,notification);
|
||||
return notification;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (notificationManager != null) {
|
||||
notificationManager.cancel(NOTIFICATION_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.example.moduleroom.service
|
||||
|
||||
object ServiceHelper {
|
||||
|
||||
var cancelNotice = false
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
//package com.example.moduleroom.view;
|
||||
//import android.content.Context;
|
||||
//import android.graphics.drawable.Drawable;
|
||||
//import android.util.AttributeSet;
|
||||
//import android.view.View;
|
||||
//import android.view.animation.Animation;
|
||||
//import android.view.animation.RotateAnimation;
|
||||
//import android.widget.Button;
|
||||
//import android.widget.ImageView;
|
||||
//import android.widget.LinearLayout;
|
||||
//import android.widget.RelativeLayout;
|
||||
//import android.widget.TextView;
|
||||
//
|
||||
//import androidx.annotation.Nullable;
|
||||
//
|
||||
//import com.example.moduleroom.R;
|
||||
//
|
||||
//public class QXMeetGiftView extends RelativeLayout {
|
||||
//
|
||||
// private TextView giftNameLabel;
|
||||
// private ImageView giftPriceBgView;
|
||||
// private Button giftCoin;
|
||||
// private ImageView bgImageView;
|
||||
// private ImageView giftBgImageView;
|
||||
// private ImageView giftImageView;
|
||||
//
|
||||
// private boolean isLockGift;
|
||||
// private Object model; // 这里用 Object 代替 QXDrawGiftModel
|
||||
//
|
||||
// public QXMeetGiftView(Context context) {
|
||||
// super(context);
|
||||
// initSubviews(context);
|
||||
// }
|
||||
//
|
||||
// public QXMeetGiftView(Context context, @Nullable AttributeSet attrs) {
|
||||
// super(context, attrs);
|
||||
// initSubviews(context);
|
||||
// }
|
||||
//
|
||||
// public QXMeetGiftView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
// super(context, attrs, defStyleAttr);
|
||||
// initSubviews(context);
|
||||
// }
|
||||
//
|
||||
// private void initSubviews(Context context) {
|
||||
// // 创建背景图片视图
|
||||
// bgImageView = new ImageView(context);
|
||||
// bgImageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
// bgImageView.setImageResource(R.drawable.ac_left_gift_bg);
|
||||
// LayoutParams bgParams = new LayoutParams(
|
||||
// LayoutParams.MATCH_PARENT,
|
||||
// LayoutParams.MATCH_PARENT
|
||||
// );
|
||||
// bgParams.addRule(ALIGN_PARENT_TOP);
|
||||
// bgParams.addRule(ALIGN_PARENT_LEFT);
|
||||
// bgParams.addRule(ALIGN_PARENT_RIGHT);
|
||||
// bgParams.bottomMargin = dpToPx(19); // 底部偏移-19
|
||||
// addView(bgImageView, bgParams);
|
||||
//
|
||||
// // 创建礼物背景光效视图
|
||||
// giftBgImageView = new ImageView(context);
|
||||
// giftBgImageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
// giftBgImageView.setImageResource(R.drawable.ac_lock_gift_light_bg);
|
||||
// giftBgImageView.setVisibility(View.GONE); // 初始隐藏
|
||||
// LayoutParams giftBgParams = new LayoutParams(
|
||||
// LayoutParams.MATCH_PARENT,
|
||||
// LayoutParams.MATCH_PARENT
|
||||
// );
|
||||
// giftBgParams.addRule(ALIGN_PARENT_TOP);
|
||||
// giftBgParams.addRule(ALIGN_PARENT_LEFT);
|
||||
// giftBgParams.addRule(ALIGN_PARENT_RIGHT);
|
||||
// giftBgParams.bottomMargin = dpToPx(19);
|
||||
// addView(giftBgImageView, giftBgParams);
|
||||
//
|
||||
// // 创建礼物图片视图
|
||||
// giftImageView = new ImageView(context);
|
||||
// giftImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
|
||||
// LayoutParams giftImageParams = new LayoutParams(
|
||||
// LayoutParams.MATCH_PARENT,
|
||||
// LayoutParams.WRAP_CONTENT
|
||||
// );
|
||||
// giftImageParams.addRule(CENTER_IN_PARENT);
|
||||
// giftImageParams.setMargins(dpToPx(6), dpToPx(6), dpToPx(6), 0);
|
||||
// addView(giftImageView, giftImageParams);
|
||||
//
|
||||
// // 创建价格背景视图
|
||||
// giftPriceBgView = new ImageView(context);
|
||||
// giftPriceBgView.setImageResource(R.drawable.ac_meet_gift_name_bg);
|
||||
// LayoutParams priceBgParams = new LayoutParams(
|
||||
// LayoutParams.MATCH_PARENT,
|
||||
// dpToPx(15)
|
||||
// );
|
||||
// priceBgParams.addRule(ALIGN_PARENT_BOTTOM);
|
||||
// priceBgParams.bottomMargin = dpToPx(15); // 在名称标签上方
|
||||
// addView(giftPriceBgView, priceBgParams);
|
||||
//
|
||||
// // 创建金币按钮
|
||||
// giftCoin = new Button(context);
|
||||
// giftCoin.setTextColor(0xFFC7BF62);
|
||||
// // 设置按钮图标
|
||||
// Drawable coinDrawable = getResources().getDrawable(R.drawable.sky_item_coin);
|
||||
// coinDrawable.setBounds(0, 0, dpToPx(12), dpToPx(12));
|
||||
// giftCoin.setCompoundDrawables(coinDrawable, null, null, null);
|
||||
// giftCoin.setTextSize(10);
|
||||
// giftCoin.setBackgroundColor(0x00000000); // 透明背景
|
||||
// LayoutParams coinParams = new LayoutParams(
|
||||
// LayoutParams.WRAP_CONTENT,
|
||||
// LayoutParams.WRAP_CONTENT
|
||||
// );
|
||||
// coinParams.addRule(CENTER_IN_PARENT, TRUE);
|
||||
// addView(giftCoin, coinParams);
|
||||
//
|
||||
// // 创建礼物名称标签
|
||||
// giftNameLabel = new TextView(context);
|
||||
// giftNameLabel.setTextColor(0xFFFFFFFF);
|
||||
// giftNameLabel.setTextSize(12);
|
||||
// giftNameLabel.setGravity(android.view.Gravity.CENTER);
|
||||
// LayoutParams nameParams = new LayoutParams(
|
||||
// LayoutParams.MATCH_PARENT,
|
||||
// dpToPx(15)
|
||||
// );
|
||||
// nameParams.addRule(ALIGN_PARENT_BOTTOM);
|
||||
// addView(giftNameLabel, nameParams);
|
||||
//
|
||||
// // 调整视图层级
|
||||
// bringChildToFront(giftPriceBgView);
|
||||
// bringChildToFront(giftCoin);
|
||||
// }
|
||||
//
|
||||
// public void setIsLockGift(boolean isLockGift) {
|
||||
// this.isLockGift = isLockGift;
|
||||
//
|
||||
// // 设置背景图片
|
||||
// int bgResource = isLockGift ?
|
||||
// R.drawable.ac_lock_gift_bg : R.drawable.ac_meet_gift_name_bg;
|
||||
// bgImageView.setImageResource(bgResource);
|
||||
//
|
||||
// // 显示/隐藏光效背景
|
||||
// giftBgImageView.setVisibility(isLockGift ? View.VISIBLE : View.GONE);
|
||||
//
|
||||
// if (isLockGift) {
|
||||
// // 重新设置礼物图片的约束
|
||||
// LayoutParams params = (LayoutParams) giftImageView.getLayoutParams();
|
||||
// params.width = scaleWidth(62);
|
||||
// params.height = scaleWidth(62);
|
||||
// params.addRule(CENTER_IN_PARENT);
|
||||
// params.setMargins(0, 0, 0, 0);
|
||||
// giftImageView.setLayoutParams(params);
|
||||
// } else {
|
||||
// // 恢复原始约束
|
||||
// LayoutParams params = (LayoutParams) giftImageView.getLayoutParams();
|
||||
// params.width = LayoutParams.MATCH_PARENT;
|
||||
// params.height = LayoutParams.WRAP_CONTENT;
|
||||
// params.addRule(CENTER_IN_PARENT);
|
||||
// params.setMargins(dpToPx(6), dpToPx(6), dpToPx(6), 0);
|
||||
// giftImageView.setLayoutParams(params);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void setModel(Object model) {
|
||||
// this.model = model;
|
||||
// // 这里需要根据您的 QXDrawGiftModel 类来实现具体逻辑
|
||||
// /*
|
||||
// if (model instanceof QXDrawGiftModel) {
|
||||
// QXDrawGiftModel giftModel = (QXDrawGiftModel) model;
|
||||
//
|
||||
// // 使用图片加载库加载图片
|
||||
// // Glide.with(getContext()).load(giftModel.getBaseImage()).into(giftImageView);
|
||||
//
|
||||
// giftNameLabel.setText(giftModel.getGiftName());
|
||||
// giftCoin.setText(giftModel.getGiftPrice());
|
||||
// }
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// public void startAnimation() {
|
||||
// // 礼物图片顺时针旋转动画
|
||||
// RotateAnimation rotateAnimation = new RotateAnimation(
|
||||
// 0, 360, // 从 0 度旋转到 360 度
|
||||
// Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
// Animation.RELATIVE_TO_SELF, 0.5f
|
||||
// );
|
||||
// rotateAnimation.setDuration(3000); // 3 秒
|
||||
// rotateAnimation.setRepeatCount(Animation.INFINITE);
|
||||
// rotateAnimation.setRepeatMode(Animation.RESTART);
|
||||
// rotateAnimation.setInterpolator(getContext(), android.R.anim.linear_interpolator);
|
||||
// giftImageView.startAnimation(rotateAnimation);
|
||||
//
|
||||
// // 光效背景逆时针旋转动画
|
||||
// RotateAnimation rotateAnimation1 = new RotateAnimation(
|
||||
// 0, -360, // 从 0 度旋转到 -360 度
|
||||
// Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
// Animation.RELATIVE_TO_SELF, 0.5f
|
||||
// );
|
||||
// rotateAnimation1.setDuration(3000); // 3 秒
|
||||
// rotateAnimation1.setRepeatCount(Animation.INFINITE);
|
||||
// rotateAnimation1.setRepeatMode(Animation.RESTART);
|
||||
// rotateAnimation1.setInterpolator(getContext(), android.R.anim.linear_interpolator);
|
||||
// giftBgImageView.startAnimation(rotateAnimation1);
|
||||
// }
|
||||
//
|
||||
// public void resetAnimation() {
|
||||
// giftImageView.clearAnimation();
|
||||
// giftBgImageView.clearAnimation();
|
||||
// }
|
||||
//
|
||||
// public void stopAnimation() {
|
||||
// giftImageView.clearAnimation();
|
||||
// giftBgImageView.clearAnimation();
|
||||
// }
|
||||
//
|
||||
// // 辅助方法:dp 转 px
|
||||
// private int dpToPx(int dp) {
|
||||
// float density = getResources().getDisplayMetrics().density;
|
||||
// return Math.round(dp * density);
|
||||
// }
|
||||
//
|
||||
// // 缩放宽度方法(对应 ScaleWidth)
|
||||
// private int scaleWidth(int value) {
|
||||
// // 这里需要根据您的缩放逻辑实现
|
||||
// // 通常可以根据屏幕密度进行缩放
|
||||
// float scale = getResources().getDisplayMetrics().density;
|
||||
// return (int) (value * scale);
|
||||
// }
|
||||
//
|
||||
// // Getter 方法
|
||||
// public TextView getGiftNameLabel() {
|
||||
// return giftNameLabel;
|
||||
// }
|
||||
//
|
||||
// public ImageView getGiftPriceBgView() {
|
||||
// return giftPriceBgView;
|
||||
// }
|
||||
//
|
||||
// public Button getGiftCoin() {
|
||||
// return giftCoin;
|
||||
// }
|
||||
//
|
||||
// public ImageView getBgImageView() {
|
||||
// return bgImageView;
|
||||
// }
|
||||
//
|
||||
// public ImageView getGiftBgImageView() {
|
||||
// return giftBgImageView;
|
||||
// }
|
||||
//
|
||||
// public ImageView getGiftImageView() {
|
||||
// return giftImageView;
|
||||
// }
|
||||
//
|
||||
// public boolean isLockGift() {
|
||||
// return isLockGift;
|
||||
// }
|
||||
//
|
||||
// public Object getModel() {
|
||||
// return model;
|
||||
// }
|
||||
//}
|
||||
@@ -482,7 +482,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--https://tmd.xscmmidi.site/data/avatar/head_pic.png-->
|
||||
<com.xscm.moduleutil.widget.DropViewRoom
|
||||
android:id="@+id/xlh_rk"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -520,7 +520,6 @@
|
||||
</com.xscm.moduleutil.widget.DropViewRoom>
|
||||
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.floatingView.Floa
|
||||
android:id="@+id/flaoat"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
|
||||
@@ -61,5 +61,9 @@ dependencies {
|
||||
//annotationProcessor
|
||||
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||||
|
||||
implementation files('libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar')
|
||||
implementation files('libs/WbCloudNormal-v5.1.10-4e3e198.aar')
|
||||
|
||||
|
||||
}
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
BIN
modulevocal/libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar
Normal file
BIN
modulevocal/libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar
Normal file
Binary file not shown.
BIN
modulevocal/libs/WbCloudNormal-v5.1.10-4e3e198.aar
Normal file
BIN
modulevocal/libs/WbCloudNormal-v5.1.10-4e3e198.aar
Normal file
Binary file not shown.
@@ -38,9 +38,6 @@
|
||||
android:name=".activity.CreateAlbumActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RealName1Activity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.RevenueActivity"
|
||||
android:exported="false"
|
||||
@@ -143,6 +140,9 @@
|
||||
android:name=".activity.UnderageActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RealNameActivity"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ActivityAboutUsBinding;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
@@ -17,12 +20,21 @@ public class AboutUsActivity extends BaseAppCompatActivity<ActivityAboutUsBindin
|
||||
mBinding.tvAppVersion.setText("Version " + CommonAppConfig.getInstance().getVersion());
|
||||
|
||||
mBinding.llYonghu.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation();
|
||||
Intent intent = new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6");
|
||||
intent.putExtra("title", "用户协议");
|
||||
startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation();
|
||||
});
|
||||
|
||||
mBinding.llYins.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", "file:///android_asset/page_show.html").withString("title", "隐私协议").navigation();
|
||||
Intent intent = new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4");
|
||||
intent.putExtra("title", "隐私协议");
|
||||
startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.xscm.midi;
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
@@ -11,16 +11,10 @@ import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.blankj.utilcode.util.RegexUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.RealNameConacts;
|
||||
import com.example.modulevocal.databinding.ActivityRealNameBinding;
|
||||
import com.example.modulevocal.presenter.RealNamePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.midi.databinding.ActivityRealNameBinding;
|
||||
import com.tencent.cloud.huiyansdkface.facelight.api.WbCloudFaceContant;
|
||||
import com.tencent.cloud.huiyansdkface.facelight.api.WbCloudFaceVerifySdk;
|
||||
import com.tencent.cloud.huiyansdkface.facelight.api.listeners.WbCloudFaceVerifyLoginListener;
|
||||
@@ -28,6 +22,13 @@ 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.WbFaceVerifyResult;
|
||||
import com.tencent.cloud.huiyansdkface.facelight.process.FaceVerifyStatus;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
@@ -11,6 +12,7 @@ import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ActivityUnderageBinding;
|
||||
import com.example.modulevocal.presenter.UnderagePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
@@ -190,8 +192,14 @@ public class UnderageActivity extends BaseMvpActivity<UnderagePresenter, Activit
|
||||
private void navigateToNextPage() {
|
||||
// ToastUtils.showShort("密码设置成功");
|
||||
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken())
|
||||
.withString("type", "1").navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken())
|
||||
// .withString("type", "1").navigation();
|
||||
Intent intent = new Intent(UnderageActivity.this, WebViewActivity.class);
|
||||
intent.putExtra("type", "1");
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken());
|
||||
startActivity(intent);
|
||||
|
||||
|
||||
mBinding.verificationcodeview.setText("");
|
||||
finish();
|
||||
// 这里可以添加页面跳转逻辑
|
||||
|
||||
@@ -19,6 +19,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.adapter.PayMethodAdapter;
|
||||
import com.example.modulevocal.conacts.WithdrawalConacts;
|
||||
import com.example.modulevocal.databinding.ActivityWithdrawalBinding;
|
||||
@@ -103,7 +104,11 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
|
||||
});
|
||||
|
||||
mBinding.tvLhjy.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url",walletBean.getUrl()).withString("title", walletBean.getTitle()).navigation();
|
||||
Intent intent = new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", walletBean.getUrl());
|
||||
intent.putExtra("title", walletBean.getTitle());
|
||||
startActivity(intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url",walletBean.getUrl()).withString("title", walletBean.getTitle()).navigation();
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
tools:context=".activity.RealNameActivity">
|
||||
tools:context="com.example.modulevocal.activity.RealNameActivity">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -34,7 +34,7 @@ android {
|
||||
enabled = true
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
jvmTarget = '11'
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
@@ -59,6 +59,8 @@ dependencies {
|
||||
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||||
|
||||
implementation project(':moduleroom')
|
||||
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
@@ -3,6 +3,7 @@ package com.example.modulevoice.fragment;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -28,6 +29,7 @@ import com.example.modulevoice.databinding.FragmentVoiceCategoryBinding;
|
||||
import com.example.modulevoice.presenter.VoiceCategoryPresenter;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
@@ -125,7 +127,11 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
* type=1时,该值表示房间id;type=2时,表示文章id
|
||||
*/
|
||||
BannerModel bannerModel = (BannerModel) model;
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", bannerModel.getUrl()).withString("title", "首页横幅").navigation();
|
||||
Intent intent=new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", bannerModel.getUrl());
|
||||
intent.putExtra("title", "首页横幅");
|
||||
startActivity(intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", bannerModel.getUrl()).withString("title", "首页横幅").navigation();
|
||||
}
|
||||
});
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.example.modulevoice.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class MarqueeTextView extends androidx.appcompat.widget.AppCompatTextView {
|
||||
public MarqueeTextView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public MarqueeTextView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public MarqueeTextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
// 始终返回true,确保能获取焦点
|
||||
@Override
|
||||
public boolean isFocused() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,6 @@
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_num_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_num_bg"
|
||||
|
||||
Reference in New Issue
Block a user