这个提交包含在:
徐勤民 2024-07-25 15:06:59 +08:00
父节点 35059e6770
当前提交 e11c2c653b
共有 707 个文件被更改,包括 18622 次插入0 次删除

85
.gitignore vendored 普通文件
查看文件

@ -0,0 +1,85 @@
# Built application files
*.apk
*.aar
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
/app/key
output-metadata.json
# Android Profiling
*.hprof

1
app/.gitignore vendored 普通文件
查看文件

@ -0,0 +1 @@
/build

117
app/build.gradle 普通文件
查看文件

@ -0,0 +1,117 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId apps.applicationId
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode versions.versionCode
versionName versions.versionName
manifestPlaceholders = [
APP_NAME: apps.applicationName,
APP_ID : apps.applicationId,
]
buildConfigField("String", "APP_Name", "\"" + apps.applicationName + "\"")
flavorDimensions "versioncode"
}
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
if ("debug" != variant.buildType.name) {
def now = new Date()
def path = "../../../../../apks/${variant.buildType.name}/v${defaultConfig.versionName}_" + now.format("yyyy.MM.dd_HH")
outputFileName = path + "/${applicationId}.apk"
}
}
}
signingConfigs {
debug {
keyAlias 'livechat'
keyPassword '123456'
storeFile file('key.jks')
storePassword '123456'
}
releaseConfig {}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
androidExtensions {
experimental = true
}
namespace 'com.xuqinmin.android.app'
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation project(path: ':core')
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'tp.xmaihh:serialport:2.1'
implementation 'com.rabbitmq:amqp-client:5.15.0'
implementation 'com.github.weidongjian:androidWheelView:1.0.0'
//
implementation 'io.agora.rtc:full-sdk:4.2.3'
//
implementation 'com.github.centerzx:ShapeBlurView:1.0.5'
// implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
// implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
//
// implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
// implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
// implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
// implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
//
// implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
implementation 'com.github.leifzhang:IjkLib:0.4.3'
// json
implementation 'com.airbnb.android:lottie:3.4.0'
//
implementation 'com.danikula:videocache:2.7.1'
//eventbus
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'androidx.room:room-runtime:2.2.3'
// annotationProcessor "androidx.room:room-compiler:2.2.3"
kapt "androidx.room:room-compiler:2.2.3"
implementation("com.android.billingclient:billing:6.2.0")
// implementation("com.android.billingclient:billing-ktx:6.2.0")
}

二进制
app/key.jks 普通文件

二进制文件未显示。

22
app/proguard-rules.pro vendored 普通文件
查看文件

@ -0,0 +1,22 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# -keep class io.agora.**{*;}

查看文件

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- 网络权限 -->
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <!-- 对于 Android 12.0 及以上设备,还需要添加以下权限 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<queries package="${applicationId}">
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
<intent>
<action android:name="android.media.action.ACTION_VIDEO_CAPTURE" />
</intent>
</queries>
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="${APP_NAME}"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="android:label">
<activity
android:name=".ui.AboutActivity"
android:exported="false" />
<activity
android:name=".ui.SettingActivity"
android:exported="false" />
<activity
android:name=".ui.ChatActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible|adjustResize" />
<activity
android:name=".ui.FeedbackActivity"
android:exported="false" />
<activity
android:name=".ui.BlocklistActivity"
android:exported="false" />
<activity
android:name=".ui.FriendsActivity"
android:exported="false" />
<activity
android:name=".ui.CoinStoreActivity"
android:exported="false" />
<activity
android:name=".ui.EditActivity"
android:exported="false" />
<activity
android:name=".ui.VideoActivity"
android:exported="true" />
<activity
android:name=".ui.HomeActivity"
android:exported="false" />
<activity
android:name=".ui.LiveActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".ui.SearchingActivity"
android:exported="false" />
<activity
android:name=".ui.MainActivity"
android:exported="true" />
<activity
android:name=".ui.RegisterMoreActivity"
android:exported="false" />
<activity
android:name=".ui.RegisterActivity"
android:exported="false" />
<activity
android:name=".ui.WelcomeActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${APP_ID}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
<meta-data
android:name="design_width_in_dp"
android:value="375" />
<meta-data
android:name="design_height_in_dp"
android:value="812" />
</application>
</manifest>

查看文件

@ -0,0 +1 @@
{"v":"5.6.9","fr":20,"ip":0,"op":60,"w":160,"h":160,"nm":"answer","ddd":0,"assets":[{"id":"image_0","w":54,"h":68,"u":"images/","p":"img_0.png","e":0},{"id":"image_1","w":132,"h":132,"u":"images/","p":"img_1.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"路径 4234.png","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[5]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":10,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":15,"s":[5]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":20,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":25,"s":[5]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":30,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":35,"s":[5]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":40,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":45,"s":[5]},{"t":50,"s":[0]}],"ix":10},"p":{"a":0,"k":[79.5,81.5,0],"ix":2},"a":{"a":0,"k":[27,34,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"椭圆 795.png","cl":"png","refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[80,80,0],"ix":2},"a":{"a":0,"k":[66,66,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"椭圆 795.png","cl":"png","refId":"image_1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":30,"s":[100]},{"t":50,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[80,80,0],"ix":2},"a":{"a":0,"k":[66,66,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":30,"s":[100,100,100]},{"t":50,"s":[120,120,100]}],"ix":6}},"ao":0,"ip":30,"op":50,"st":30,"bm":0},{"ddd":0,"ind":4,"ty":2,"nm":"椭圆 795.png","cl":"png","refId":"image_1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":15,"s":[100]},{"t":35,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[80,80,0],"ix":2},"a":{"a":0,"k":[66,66,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":15,"s":[100,100,100]},{"t":35,"s":[120,120,100]}],"ix":6}},"ao":0,"ip":15,"op":35,"st":15,"bm":0},{"ddd":0,"ind":5,"ty":2,"nm":"椭圆 795.png","cl":"png","refId":"image_1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[100]},{"t":20,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[80,80,0],"ix":2},"a":{"a":0,"k":[66,66,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[100,100,100]},{"t":20,"s":[120,120,100]}],"ix":6}},"ao":0,"ip":0,"op":20,"st":0,"bm":0}],"markers":[]}

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制文件未显示。

二进制
app/src/main/assets/images/img_0.png 普通文件

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 749 B

二进制
app/src/main/assets/images/img_1.png 普通文件

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 2.9 KiB

查看文件

@ -0,0 +1 @@
{"v":"5.6.9","fr":20,"ip":0,"op":120,"w":700,"h":700,"nm":"matching","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"形状图层 3","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":60,"s":[100]},{"t":120,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[350,350,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":60,"s":[10,10,100]},{"t":120,"s":[95,95,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[192.221,0],[0,-192.221],[-192.221,0],[0,192.221]],"o":[[-192.221,0],[0,192.221],[192.221,0],[0,-192.221]],"v":[[0,-348.047],[-348.047,0],[0,348.047],[348.047,0]],"c":true},"ix":2,"x":"var $bm_rt;\n$bm_rt = content('\\u692d\\u5706 1').content('\\u8def\\u5f84 1').path;"},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.007843137255,0.654901960784,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":60,"s":[60]},{"t":120,"s":[12]}],"ix":5},"lc":2,"lj":2,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0.047,0.047],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":60,"op":120,"st":60,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"形状图层 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":30,"s":[100]},{"t":90,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[350,350,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":30,"s":[10,10,100]},{"t":90,"s":[95,95,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[192.221,0],[0,-192.221],[-192.221,0],[0,192.221]],"o":[[-192.221,0],[0,192.221],[192.221,0],[0,-192.221]],"v":[[0,-348.047],[-348.047,0],[0,348.047],[348.047,0]],"c":true},"ix":2,"x":"var $bm_rt;\n$bm_rt = content('\\u692d\\u5706 1').content('\\u8def\\u5f84 1').path;"},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.007843137255,0.654901960784,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":30,"s":[60]},{"t":90,"s":[12]}],"ix":5},"lc":2,"lj":2,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0.047,0.047],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":30,"op":90,"st":30,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"形状图层 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[100]},{"t":60,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[350,350,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[10,10,100]},{"t":60,"s":[95,95,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[192.221,0],[0,-192.221],[-192.221,0],[0,192.221]],"o":[[-192.221,0],[0,192.221],[192.221,0],[0,-192.221]],"v":[[0,-348.047],[-348.047,0],[0,348.047],[348.047,0]],"c":true},"ix":2,"x":"var $bm_rt;\n$bm_rt = content('\\u692d\\u5706 1').content('\\u8def\\u5f84 1').path;"},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.007843137255,0.654901960784,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[60]},{"t":60,"s":[12]}],"ix":5},"lc":2,"lj":2,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0.047,0.047],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0}],"markers":[]}

文件差异因一行或多行过长而隐藏

查看文件

@ -0,0 +1,14 @@
package com.xuqinmin.android.app;
import android.net.Uri;
import com.danikula.videocache.file.FileNameGenerator;
public class MyFileNameGenerator implements FileNameGenerator {
public String generate(String url) {
Uri uri = Uri.parse(url);
String videoId = uri.getQueryParameter("videoId");
return videoId + ".mp4";
}
}

查看文件

@ -0,0 +1,18 @@
package com.xuqinmin.android.app.common
import com.xuqinmin.android.app.MyApplication
class CountryHelper {
companion object {
fun getCountryName(code: String?): String {
var name = "United States"
if (code == null) return name
for (region in MyApplication.country) {
if (region.code == code) {
name = "${region.emoji} ${region.name}"
}
}
return name
}
}
}

查看文件

@ -0,0 +1,150 @@
package com.xuqinmin.android.app.common;
import android.content.Context;
import android.os.Environment;
import android.os.SystemClock;
import android.util.Log;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class CrashHandler implements Thread.UncaughtExceptionHandler {
private static String TAG = "CrashHandler";
// 系统默认的UncaughtException处理类
private Thread.UncaughtExceptionHandler mDefaultHandler;
// 用于格式化日期,作为日志文件名的一部分
private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
private static CrashHandler mCrashHandler;
private Context mContext;
private CrashHandler() {
}
public static CrashHandler getInstance() {
if (mCrashHandler == null) {
synchronized (CrashHandler.class) {
mCrashHandler = new CrashHandler();
}
}
return mCrashHandler;
}
public void init(Context context) {
mContext = context;
mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
}
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
if (!handleException(throwable) && mDefaultHandler != null) {
// 如果用户没有处理则让系统默认的异常处理器来处理
mDefaultHandler.uncaughtException(thread, throwable);
} else {
SystemClock.sleep(2000);
// 退出程序
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}
}
private boolean handleException(Throwable ex) {
if (ex == null) {
return false;
}
try {
saveCrashInfoFile(ex);
SystemClock.sleep(2000);
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
private String saveCrashInfoFile(Throwable ex) {
StringBuffer sb = new StringBuffer();
if (hasSdcard())
try {
SimpleDateFormat sDateFormat = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss", Locale.CHINA);
String date = sDateFormat.format(new Date());
sb.append("\r\n" + date + "\n");
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
ex.printStackTrace(printWriter);
Throwable cause = ex.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
}
printWriter.flush();
printWriter.close();
String result = writer.toString();
sb.append(result);
String fileName = writeFile(sb.toString());
return fileName;
} catch (Exception e) {
Log.e(TAG, "an error occured while writing file...", e);
sb.append("an error occured while writing file...\r\n");
writeFile(sb.toString());
}
return null;
}
private String writeFile(String text) {
Log.e("writeFile", text);
String time = formatter.format(new Date());
String fileName = "crash-demo-" + time + ".log";
String path = getGlobalpath();
File dir = new File(path);
if (!dir.exists()) {
dir.mkdir();
}
FileOutputStream fos = null;
try {
fos = new FileOutputStream(path + fileName, true);
fos.write(text.getBytes());
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return fileName;
}
public String getGlobalpath() {
return Environment.getExternalStorageDirectory().getAbsolutePath()
+ File.separator + "crash" + File.separator;
}
public boolean hasSdcard(){
return Environment.getExternalStorageState()
.equals(Environment.MEDIA_MOUNTED);
}
}

查看文件

@ -0,0 +1,27 @@
package com.xuqinmin.android.app.common
import com.xuqinmin.android.app.R
import com.xuqm.base.model.KeyValueData
class GenderHelper {
companion object {
val list_gender = listOf<KeyValueData<Int, String>>(
KeyValueData(-1, "Unknown"), KeyValueData(0, "Male"), KeyValueData(1, "Female")
)
fun getString(code: Int): String {
for (keyValueData in list_gender) {
if (keyValueData.key == code) return keyValueData.value
}
return "Unknown"
}
fun getImage(code: Int): Int {
return when (code) {
1 -> R.mipmap.female_selected
else -> R.mipmap.male_selected
}
}
}
}

查看文件

@ -0,0 +1,42 @@
package com.xuqinmin.android.app.common
import android.content.Intent
import com.xuqinmin.android.app.MyApplication
import com.xuqinmin.android.app.model.msg.CallModel
import com.xuqinmin.android.app.ui.LiveActivity
import com.xuqm.base.common.AppManager
import com.xuqm.base.common.GsonImplHelp
import com.xuqm.sdhbwfu.core.extensions.loge
class LiveHelper {
companion object {
/**
* 1=收到邀请2=发起邀请0=直接通话
*/
fun start(model: CallModel, type: Int) {
model.price.loge()
MyApplication.modelHideIn.coins.loge()
if (type == 2 && model.price > 0 && MyApplication.modelHideIn.coins < model.price) {
StoreHelper.showPay()
return
}
AppManager.getInstance().activity.startActivity(Intent(
AppManager.getInstance().activity, LiveActivity::class.java
).apply {
putExtra("model", GsonImplHelp.get().toJson(model))
putExtra("type", type)
})
}
fun start(model: String, type: Int) {
this.start(GsonImplHelp.get().toObject(model, CallModel::class.java), type)
}
}
}

查看文件

@ -0,0 +1,236 @@
package com.xuqinmin.android.app.common;
import android.text.TextUtils;
import android.util.Log;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeoutException;
public class RabbitMQClient {
private final String TAG = "RabbitMQ";
private final String FLAG_SEND = "send";
private final String FLAG_RECEIVE = "receive";
private final ConnectionFactory factory;
private Connection connection;
private Map<String, Channel> channelMap = new HashMap<>();
public static final String EXCHANGETYPE_FANOUT = "fanout"; //不用匹配路由发送给所有绑定转换器的队列
public static final String EXCHANGETYPE_DIRECT = "direct"; //匹配路由一致才发送给绑定转换器队列
public static final String EXCHANGETYPE_TOPIC = "topic"; // 通配符* # 匹配路由一致才发送给绑定转换器队列
public RabbitMQClient(String hostIp, int port, String username, String password) {
factory = new ConnectionFactory();
factory.setUsername(username);
factory.setPassword(password);
factory.setHost(hostIp);
factory.setPort(port);
factory.setVirtualHost("/");//类似数据库的意思
factory.setConnectionTimeout(15 * 1000); //连接时间设置为10秒
factory.setAutomaticRecoveryEnabled(true); //恢复连接通道
factory.setTopologyRecoveryEnabled(true); //恢复通道中 转换器队列绑定关系等
factory.setNetworkRecoveryInterval(5 * 1000); //恢复连接间隔默认5秒
}
/**
* @param message 需要发送的消息
* @param queueName 管道名称
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void sendQueueMessage(String message, String queueName) throws IOException, TimeoutException, AlreadyClosedException {
if (connection == null || !connection.isOpen()) {
connection = factory.newConnection();
}
if (!channelMap.containsKey(FLAG_SEND + queueName)) {
Channel channel = connection.createChannel();
channel.queueDeclare(queueName, false, false, false, null);
channelMap.put(FLAG_SEND + queueName, channel);
}
//空名字的交换机需要设置routingKey此时会将routingKey 作为 队列名使用
channelMap.get(FLAG_SEND + queueName).basicPublish("", queueName, null, message.getBytes());
}
/**
* @param exchangeName 交换机名称
* @param message 需要发送的消息
* @param queueName 队列名称
* @param routingKey 路由规则
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion 发送 exchangeType direct 类型的信息
**/
public void sendDirectTypeMessage(String exchangeName, String message, String queueName, String routingKey) throws IOException, TimeoutException, AlreadyClosedException {
if (connection == null || !connection.isOpen()) {
connection = factory.newConnection();
}
if (!channelMap.containsKey(FLAG_SEND + exchangeName + EXCHANGETYPE_DIRECT + queueName)) {
Channel channel = connection.createChannel();
channel.queueDeclare(queueName, false, false, false, null);
channel.exchangeDeclare(exchangeName, EXCHANGETYPE_DIRECT);
channelMap.put(FLAG_SEND + exchangeName + EXCHANGETYPE_DIRECT + queueName, channel);
}
channelMap.get(FLAG_SEND + exchangeName + EXCHANGETYPE_DIRECT + queueName).basicPublish(exchangeName, routingKey, null, message.getBytes());
}
/**
* @param exchangeName 交换机名称
* @param queueName 队列名称
* @param message 发送的消息
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion 发送 exchangeType fanout 类型的信息
**/
public void sendFanoutTypeMessage(String exchangeName, String queueName, String message) throws IOException, TimeoutException, AlreadyClosedException {
if (connection == null || !connection.isOpen()) {
connection = factory.newConnection();
}
if (!channelMap.containsKey(FLAG_SEND + exchangeName + EXCHANGETYPE_FANOUT + queueName)) {
Channel channel = connection.createChannel();
channel.queueDeclare(queueName, false, false, false, null);
channel.exchangeDeclare(exchangeName, EXCHANGETYPE_FANOUT);
channelMap.put(FLAG_SEND + exchangeName + EXCHANGETYPE_FANOUT + queueName, channel);
}
channelMap.get(FLAG_SEND + exchangeName + EXCHANGETYPE_FANOUT + queueName).basicPublish(exchangeName, "", null, message.getBytes());
}
/**
* @param exchangeName 交换机名称
* @param exchangeType 模式
* @param queueName 队列名称
* @param message 需要发送的消息
* @param routingKey 路由规则
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void sendExchangeNameQueueMessage(String exchangeName, String exchangeType, String message, String queueName, String routingKey) throws IOException, TimeoutException, AlreadyClosedException {
if (connection == null || !connection.isOpen()) {
connection = factory.newConnection();
}
if (!channelMap.containsKey(FLAG_SEND + exchangeName + exchangeType + queueName)) {
Channel channel = connection.createChannel();
channel.queueDeclare(queueName, false, false, false, null);
channel.exchangeDeclare(exchangeName, exchangeType);
channelMap.put(FLAG_SEND + exchangeName + exchangeType + queueName, channel);
}
if (exchangeType.equals(EXCHANGETYPE_FANOUT)) {
channelMap.get(FLAG_SEND + exchangeName + exchangeType + queueName).basicPublish(exchangeName, "", null, message.getBytes());
} else if (exchangeType.equals(EXCHANGETYPE_DIRECT)) {
channelMap.get(FLAG_SEND + exchangeName + exchangeType + queueName).basicPublish(exchangeName, routingKey, null, message.getBytes());
} else if (exchangeType.equals(EXCHANGETYPE_TOPIC)) {
channelMap.get(FLAG_SEND + exchangeName + exchangeType + queueName).basicPublish(exchangeName, routingKey, null, message.getBytes());
}
}
/**
* @param queueName 队列名称
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void receiveQueueMessage(final String queueName, final ResponseListener listener)
throws IOException, TimeoutException, AlreadyClosedException {
receiveQueueRoutingKeyMessage(queueName, "", "", "", listener);
}
/**
* @param queueName 队列名称
* @param routingKey 路由规则
* @param exchangeName 交换机名称
* @param exchangeType 交换机类型
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void receiveQueueRoutingKeyMessage(String queueName, final String routingKey, String exchangeName, String exchangeType, final ResponseListener listener)
throws IOException, TimeoutException, AlreadyClosedException {
if (exchangeType.equals(EXCHANGETYPE_DIRECT) || exchangeType.equals(EXCHANGETYPE_TOPIC)) {
if (TextUtils.isEmpty(routingKey)) {
throw new NullPointerException("路由规则不能为空");
}
}
if (!TextUtils.isEmpty(routingKey)) {
if (TextUtils.isEmpty(exchangeName)) {
throw new NullPointerException("交换机名称不能为空");
}
}
if (!channelMap.containsKey(FLAG_RECEIVE + routingKey + queueName)) {
if (connection == null || !connection.isOpen()) {
connection = factory.newConnection();
}
final Channel channel = connection.createChannel();
channel.queueDeclare(queueName, true, false, false, null);
//绑定转换器使用路由筛选消息
if (!TextUtils.isEmpty(routingKey)) {
channel.exchangeDeclare(exchangeName, exchangeType);
channel.queueBind(queueName, exchangeName, routingKey); //设置绑定
}
//监听队列
channel.basicConsume(queueName, false, new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope,
AMQP.BasicProperties properties, byte[] body)
throws IOException {
String message = new String(body, "UTF-8");
if (listener != null) {
listener.receive(message);
}
channel.basicAck(envelope.getDeliveryTag(), false); //消息应答
}
});
channelMap.put(FLAG_RECEIVE + routingKey + queueName, channel);
Log.e(TAG,"已经连接上了,队列名称:" + queueName);
}
}
/**
* 关闭所有资源
*/
public void close() {
for (Channel next : channelMap.values()) {
if (next != null && next.isOpen()) {
try {
next.close();
} catch (IOException | TimeoutException e) {
e.printStackTrace();
}
}
}
channelMap.clear();
if (connection != null && connection.isOpen()) {
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public interface ResponseListener {
void receive(String message);
}
}

查看文件

@ -0,0 +1,227 @@
package com.xuqinmin.android.app.common;
import android.os.SystemClock;
import android.text.TextUtils;
import com.rabbitmq.client.AlreadyClosedException;
import java.io.IOException;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeoutException;
public class RabbitMQUtil {
private boolean isRunning = true;
private RabbitMQClient rabbitMQ;
private ExecutorService executor;
public RabbitMQUtil(String hostIp, int port, String username, String password) {
rabbitMQ = new RabbitMQClient(hostIp, port, username, password);
executor = Executors.newSingleThreadExecutor(); //根据项目需要设置常用线程个数
}
/**
* @param message 发送的消息
* @param queueName 队列名称
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void sendMessage(final String message, final String queueName, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
executor.execute(new Runnable() {
@Override
public void run() {
try {
rabbitMQ.sendQueueMessage(message, queueName);
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
} catch (IOException | TimeoutException | AlreadyClosedException e) {
e.printStackTrace();
if (errorMessageListener!=null){
errorMessageListener.errorMessage(e);
}
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
}
}
});
}
/**
* @param message 发送的消息
* @param exchangeName 交换机名称
* @param queueName 队列名称
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void sendMessage(final String message, final String exchangeName, final String exchangeType, final String queueName, final String routingKey, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
executor.execute(new Runnable() {
@Override
public void run() {
try {
rabbitMQ.sendExchangeNameQueueMessage(exchangeName, exchangeType, message, queueName, routingKey);
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
} catch (IOException | TimeoutException | AlreadyClosedException e) {
e.printStackTrace();
if (errorMessageListener!=null){
errorMessageListener.errorMessage(e);
}
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
}
}
});
}
/**
* @param exchangeName 交换机名称
* @param queueName 队列名称
* @param message 需要发送的消息
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void sendFanoutTypeMessage(final String exchangeName, final String message, final String queueName, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
executor.execute(new Runnable() {
@Override
public void run() {
try {
rabbitMQ.sendFanoutTypeMessage(exchangeName, queueName, message);
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
} catch (IOException | TimeoutException | AlreadyClosedException e) {
e.printStackTrace();
if (errorMessageListener!=null){
errorMessageListener.errorMessage(e);
}
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
}
}
});
}
/**
* @param exchangeName 交换机名称
* @param message 需要发送的消息
* @param queueName 队列名称
* @param routingKey 路由规则
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion 发送 exchangeType direct 类型的信息
**/
public void sendDirectTypeMessage(final String exchangeName, final String queueName, final String message, final String routingKey, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
executor.execute(new Runnable() {
@Override
public void run() {
try {
rabbitMQ.sendDirectTypeMessage(exchangeName, queueName, message, routingKey);
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
} catch (IOException | TimeoutException | AlreadyClosedException e) {
e.printStackTrace();
if (errorMessageListener!=null){
errorMessageListener.errorMessage(e);
}
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
}
}
});
}
/**
* @param queueName 队列名称
* @date 创建时间:2020/9/8 0008
* @auther gaoxiaoxiong
* @Descriptiion
**/
public void receiveQueueMessage(String queueName, final ReceiveMessageListener listener,final ErrorMessageListener errorMessageListener) {
String newQueueName = null;
if (TextUtils.isEmpty(queueName)){
newQueueName = createDefaultQueueName(queueName);
}else {
newQueueName = queueName;
}
final String finalNewQueueName = newQueueName;
executor.execute(() -> {
while (isRunning) {
try {
rabbitMQ.receiveQueueMessage(finalNewQueueName, message -> {
if (listener != null) listener.receiveMessage(message);
});
} catch (IOException | TimeoutException | AlreadyClosedException e) {
if (errorMessageListener!=null){
errorMessageListener.errorMessage(e);
}
e.printStackTrace();
SystemClock.sleep(5000);
}
}
});
}
public void receiveQueueRoutingKeyMessage(String queueName, final String routingKey, final String exchangeName, final String exchangeType, final ReceiveMessageListener listener,final ErrorMessageListener errorMessageListener) {
String newQueueName = null;
if (TextUtils.isEmpty(queueName)){
newQueueName = createDefaultQueueName(queueName);
}else {
newQueueName = queueName;
}
final String finalNewQueueName = newQueueName;
executor.execute(new Runnable() {
@Override
public void run() {
while (isRunning) {
try {
rabbitMQ.receiveQueueRoutingKeyMessage(finalNewQueueName, routingKey, exchangeName, exchangeType, new RabbitMQClient.ResponseListener() {
@Override
public void receive(String message) {
if (listener != null) listener.receiveMessage(message);
}
});
} catch (IOException | TimeoutException | AlreadyClosedException e) {
if (errorMessageListener!=null){
errorMessageListener.errorMessage(e);
}
e.printStackTrace();
SystemClock.sleep(5000); //等待五秒
}
}
}
});
}
public String createDefaultQueueName(String routingKey) {
if (TextUtils.isEmpty(routingKey)){
routingKey = "";
}
return routingKey + "@" + UUID.randomUUID();
}
/**
* 建议
* 在application中关闭或者在结束工作时关闭
*/
public void close() {
isRunning = false;
executor.execute(new Runnable() {
@Override
public void run() {
rabbitMQ.close();
executor.shutdownNow();
}
});
}
public interface ReceiveMessageListener {
void receiveMessage(String message);
}
public interface SendMessageListener {
void sendMessage(boolean isSuccess);
}
public interface ErrorMessageListener{
void errorMessage(Exception e);
}
}

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.common
const val SHARE_RISK_LOCATION = "share_risk_location"
const val SHARE_RISK_PURE = "share_risk_pure"
const val MCC = "mcc"
const val DEVICE_ID = "deviceUuid"
const val USER_INFO = "user_info"

查看文件

@ -0,0 +1,59 @@
package com.xuqinmin.android.app.common
import com.xuqinmin.android.app.MyApplication
import com.xuqinmin.android.app.model.RecommendData
import com.xuqinmin.android.app.repository.Service
import com.xuqinmin.android.app.ui.dialog.DialogBalance
import com.xuqinmin.android.app.ui.dialog.DialogStore
import com.xuqm.base.di.manager.HttpManager
import com.xuqm.sdhbwfu.core.extensions.ioMain
import com.xuqm.sdhbwfu.core.extensions.showMessage
import com.xuqm.sdhbwfu.core.extensions.subscribeBy
class StoreHelper {
companion object {
fun showPay() {
HttpManager.getApi(Service::class.java)
.recommend(RecommendData(1))
.ioMain()
.subscribeBy(
{
if (null != it) {
DialogBalance.show(it) { ite ->
if (!MyApplication.isInit) {
"The initialization of the payment component failed. Please try again later.".showMessage()
MyApplication.startConnection()
} else
MyApplication.startPay(ite)
}
} else {
showPayView()
}
}, {
showPayView()
}
)
}
private fun showPayView() {
HttpManager.getApi(Service::class.java).orders()
.ioMain()
.subscribeBy({
if (null != it) {
DialogStore.show(it) { it2 ->
if (!MyApplication.isInit) {
"The initialization of the payment component failed. Please try again later.".showMessage()
MyApplication.startConnection()
} else
MyApplication.startPay(it2)
}
} else {
"Insufficient gold coins".showMessage()
}
}, {
it.showMessage()
})
}
}
}

查看文件

@ -0,0 +1,16 @@
package com.xuqinmin.android.app.db;
import androidx.room.PrimaryKey;
public class BaseEntity {
@PrimaryKey(autoGenerate = true)
private int _uid;
public int get_uid() {
return _uid;
}
public void set_uid(int _uid) {
this._uid = _uid;
}
}

查看文件

@ -0,0 +1,14 @@
package com.xuqinmin.android.app.db;
import androidx.room.Database;
import androidx.room.RoomDatabase;
import com.xuqinmin.android.app.db.msg.MessageDao;
import com.xuqinmin.android.app.db.msg.MessageEntity;
@Database(entities = {MessageEntity.class}, version = 2, exportSchema = false)
public abstract class MessageDatabase extends RoomDatabase {
public abstract MessageDao messageDao();
}

查看文件

@ -0,0 +1,23 @@
package com.xuqinmin.android.app.db;
import android.content.Context;
import androidx.room.Room;
public class XuqmDbHelper {
private static MessageDatabase dataBase;
public static MessageDatabase get() {
return dataBase;
}
public static void get(Context context) {
if (null == dataBase) {
dataBase = Room.databaseBuilder(context, MessageDatabase.class, "xuqm-im-db")
// .addMigrations(MIGRATION_1_2)
.allowMainThreadQueries() //允许在主线程 操作db
.build();
}
}
}

查看文件

@ -0,0 +1,29 @@
package com.xuqinmin.android.app.db.msg;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface MessageDao {
@Query("SELECT * FROM message WHERE (toUser = :user OR fromUser = :user) AND type = 'MSG' ORDER BY _uid LIMIT :pageSize OFFSET (:currentPage - 1) * :pageSize")
List<MessageEntity> getMessageList(int user, int currentPage, int pageSize);
@Insert
void insertAll(MessageEntity... devices);
@Update
void update(MessageEntity device);
@Delete
void delete(MessageEntity device);
@Query("DELETE FROM message")
void clearTable();
}

查看文件

@ -0,0 +1,57 @@
package com.xuqinmin.android.app.db.msg;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import com.xuqinmin.android.app.db.BaseEntity;
@Entity(tableName = "message")
public class MessageEntity extends BaseEntity {
@ColumnInfo(name = "type")
private String type;
@ColumnInfo(name = "toUser")
private int toUser;
@ColumnInfo(name = "fromUser")
private int fromUser;
@ColumnInfo(name = "msg")
private String message;
public MessageEntity(String type, int fromUser, int toUser, String message) {
this.type = type;
this.toUser = toUser;
this.fromUser = fromUser;
this.message = message;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getToUser() {
return toUser;
}
public void setToUser(int toUser) {
this.toUser = toUser;
}
public int getFromUser() {
return fromUser;
}
public void setFromUser(int fromUser) {
this.fromUser = fromUser;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

查看文件

@ -0,0 +1,28 @@
package com.xuqinmin.android.app.model
data class AnchorInfoModel(
val age: Int,
val bodyType: String,
val country: Int,
val cup: String,
val emId: String,
val fansNum: Int,
val followedNum: Int,
// 性别 0-男 1-女 -1 未填写性别
val gender: Int,
val headImage: String,
val height: Int,
val imId: String,
val isFollow: Int,
val language: List<String>,
val nickname: String,
val online: Int,
val pics: List<String>,
val price: Float,
val signature: String,
val sort: Int,
val userId: Int,
val videos: List<Video>,
val labels: List<Label>,
val weight: Int
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class BalanceChange(
val command: String,
val `data`: Balance
)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
class BlackListModel : ArrayList<BlackListModelItem>()

查看文件

@ -0,0 +1,18 @@
package com.xuqinmin.android.app.model
import com.xuqm.base.adapter.BaseItem
data class BlackListModelItem(
val age: Int,
val gender: Int,
val headImage: String,
val nickname: String,
val signature: String?,
//status
//integer <int32>
//0 关注 1 取消关注
val status: Int?,
val online: Int,
val role: Int,
val userId: Int
) : BaseItem()

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class CallData(
val callId: String,
val status: Int
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class CallFailData(
val callId: String,
val matchId: String,
val type: Int
)

查看文件

@ -0,0 +1,16 @@
package com.xuqinmin.android.app.model
data class CanCallModel(
val age: Int,
val callId: String,
val country: String,
val gender: Int,
val headImage: String,
val imId: String,
val nickname: String,
val price: Float,
val role: Int,
val rtcToken: String,
val signature: String,
val userId: Int
)

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.model
data class Coins(
val commission: Int,
val freezeComm: Int,
val goldCoins: Int,
val unFreezeComm: Int
)

查看文件

@ -0,0 +1,10 @@
package com.xuqinmin.android.app.model
data class CompleteData(
val male: Int?,
val age: String,
val nickname: String,
val avatar: String?,
val country: String?,
val labels: List<Int>,
)

查看文件

@ -0,0 +1,5 @@
package com.xuqinmin.android.app.model
data class CountryModel(
val Regions: List<Region>
)

查看文件

@ -0,0 +1,9 @@
package com.xuqinmin.android.app.model
data class Balance(
val commission: Double,
val freezeComm: Double,
val goldCoins: Double,
val serviceMessage: String,
val unFreezeComm: Double
)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
data class DataDate(var year: String?, var month: String?, var days: String?)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
data class DataInit(val device:String)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class DataLogin(
val device: String,
val openId: String,
val type: Int
)

查看文件

@ -0,0 +1,5 @@
package com.xuqinmin.android.app.model
import android.net.Uri
data class DataRegister(var name: String?, var gender: Int?, var avatar: String?, var country: String?)

查看文件

@ -0,0 +1,12 @@
package com.xuqinmin.android.app.model
data class DiscoverData(
val num: Int,
val size: Int,
/**
* 类型 0 热门 1 活跃 2 3 关注 4 粉丝
*/
val type: Int,
val content: String
)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
class DiscoverListModel : ArrayList<DiscoverModel>()

查看文件

@ -0,0 +1,21 @@
package com.xuqinmin.android.app.model
import com.xuqm.base.adapter.BaseItem
data class DiscoverModel(
val age: Int,
val agoraId: String,
val country: String,
val emId: String,
val headImage: String,
val imId: String,
val nickname: String,
//在线状态 0 离线 1 在线 2 忙碌
val online: Int,
val price: Int,
// 角色 0 用户 1 主播
val role: Int,
val signature: String,
val sort: Int,
val userId: Int
) : BaseItem()

查看文件

@ -0,0 +1,11 @@
package com.xuqinmin.android.app.model
data class EditUserData(
val age: String,
val country: String,
val headImage: String,
val labels: List<Int>,
val nickname: String,
val signature: String,
val gender: Int
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class EndData(
val callId: String?,
val matchId: String?,
)

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.model
data class FeedbackData(
val type: String = "",
val content: String,
val email: String?,
val `file`: String?,
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class FollowData(
val status: Int,
// 0 关注 1 取消关注
val userId: Int
)

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.model
data class FollowPageData(
// 类型 0 关注列表 1 粉丝列表
val status: Int,
val num: Int,
val size: Int,
)

查看文件

@ -0,0 +1,5 @@
package com.xuqinmin.android.app.model
data class GetFileData(
val fileName: String
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class GetFileModel(
val contentType: String,
val fileUrl: String,
val preUrl: String
)

查看文件

@ -0,0 +1,10 @@
package com.xuqinmin.android.app.model
data class GiftModel(
val gif: String,
val giftId: Int,
val gray: String,
val name: String,
val picture: String,
val price: Double
)

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.model
data class HistoryData(
val num: Int,
val size: Int,
// 0-通话 1-匹配 参数为空null所有
val type: Int?
)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
class HistoryListModel : ArrayList<HistoryModel>()

查看文件

@ -0,0 +1,14 @@
package com.xuqinmin.android.app.model
import com.xuqm.base.adapter.BaseItem
data class HistoryModel(
val agoraId: String,
val avatar: String,
val imId: String,
val msgId: String,
val nickname: String,
val online: Int,
val sendTime: Int,
val userId: Int
) : BaseItem()

查看文件

@ -0,0 +1,9 @@
package com.xuqinmin.android.app.model
data class Label(
val labelId: Int,
val name: String,
val icon: String,
val color: String,
val type: Int,
)

查看文件

@ -0,0 +1,9 @@
package com.xuqinmin.android.app.model
data class LabelX(
val color: String,
val icon: String,
val labelId: Int,
val name: String,
val type: Int
)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
class MatchLogModel : ArrayList<MatchLogModelItem>()

查看文件

@ -0,0 +1,28 @@
package com.xuqinmin.android.app.model
import com.airbnb.lottie.L
import com.xuqm.base.adapter.BaseItem
// "userId": 0,
// "nickname": "string",
// "headImage": "string",
// "online": 0,
// "times": 0,
// "callTimes": 0,
// "coins": 0,
// "isBlack": 0,
// "type": 0,
// "callType": 0
data class MatchLogModelItem(
val userId: Int,
val nickname: String,
val headImage: String,
val online: Int,
val times: Long,
val callTimes: Int,
val coins: Int,
val isBlack: Int,
val type: Int,
val callType: Int,
):BaseItem()

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class MatchingData(
val matchId: String,
val status: Int
)

查看文件

@ -0,0 +1,25 @@
package com.xuqinmin.android.app.model
data class ModelHideIn(
val age: String,
val agoraId: Int,
var coins: Int,
val country: String,
val emId: String,
val ext: String,
val fansNum: Int,
val followNum: Int,
val gender: Int,
val giftNum: Int,
val headImage: String,
val imId: String,
val isInfo: Int,
val labels: List<Label>,
val nickname: String,
val pics: List<Pic>,
val rtmToken: String,
val signature: String,
val token: String,
val userId: Int,
val videos: List<Video>
)

查看文件

@ -0,0 +1,28 @@
package com.xuqinmin.android.app.model
data class ModelInit(
val agoraKey: String,
val country: String,
val customerEmail: String,
val emKey: String,
val eula: String,
val gifts: String,
val imKey: String,
val imSecret: String,
val imserver: String,
val match: Int,
val matchPrice: Int,
val matchTimes: Int,
val policy: String,
val report: List<String>,
// 审核模式 0 非审核模式 1 审核模式
val review: Int,
val sendCoins: Int,
val tabs: List<Tab> = mutableListOf(),
val labels: List<Label> = mutableListOf(),
val terms: String,
val videoLogin: String,
val videoRecharge: String,
val voiceCalling: String,
val voiceIncoming: String
)

查看文件

@ -0,0 +1,9 @@
package com.xuqinmin.android.app.model
data class ModelResponse(
val code: Int,
val msg: String,
val data: String?,
val check: String,
val offset: String
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class MsgListData(
val imId: String,
val num: Int,
val size: Int
)

查看文件

@ -0,0 +1,10 @@
package com.xuqinmin.android.app.model
data class NewUserModel(
val coins: Int,
val content: String,
val money: String,
val payCode: String,
val price: String,
val time: Int
)

查看文件

@ -0,0 +1,12 @@
package com.xuqinmin.android.app.model
data class OrderModel(
val acode: String,
val addCoin: Int?,
val addWords: String?,
val coins: Int,
val originalCoin: Int?,
val price: Double,
val suggest: Int,
val uid: Int
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class PageData(
val num: Int,
val size: Int,
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class Pic(
val isCover: Int,
val pic: String,
val picId: Int
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class RecommendData(
// 0 默认配置 1 匹配中推荐充值 2 通话中匹配充值
val recommentType: Int
)

查看文件

@ -0,0 +1,12 @@
package com.xuqinmin.android.app.model
data class RecommendModel(
val acode: String,
val addCoin: Int,
val addWords: String,
val coins: Int,
val originalCoin: Int,
val price: Int,
val suggest: Int,
val uid: Int
)

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.model
data class Region(
val code: String,
val emoji: String,
val iso: String,
val name: String
)

查看文件

@ -0,0 +1,5 @@
package com.xuqinmin.android.app.model
data class RegionList(
val Regions: ArrayList<Region>
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class ReportData(
val type: String,
val userId: Int
)

查看文件

@ -0,0 +1,7 @@
package com.xuqinmin.android.app.model
data class SendGiftData(
val giftId: Int,
val num: Int,
val userId: Int
)

查看文件

@ -0,0 +1,5 @@
package com.xuqinmin.android.app.model
data class SendGiftModel(
val coins: Coins
)

查看文件

@ -0,0 +1,8 @@
package com.xuqinmin.android.app.model
data class SuggestAnchorData(
val userId: Int,
val num: Int,
val size: Int,
)

查看文件

@ -0,0 +1,3 @@
package com.xuqinmin.android.app.model
class SuggestAnchorModel : ArrayList<SuggestAnchorModelItem>()

查看文件

@ -0,0 +1,16 @@
package com.xuqinmin.android.app.model
import com.xuqm.base.adapter.BaseItem
data class SuggestAnchorModelItem(
val age: Int,
val country: String,
val emId: String,
val gender: Int,
val headImage: String,
val nickname: String,
val online: Int,
val price: Int,
val signature: String,
val userId: Int
):BaseItem()

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class SwitchData(
// 状态 0 关闭 1 开启
val status: Int
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class Tab(
val title: String,
val type: Int
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class UnlockData(
val uid: Int,
val videoId: Int
)

查看文件

@ -0,0 +1,5 @@
package com.xuqinmin.android.app.model
data class UnlockModel(
val coins: Int
)

查看文件

@ -0,0 +1,6 @@
package com.xuqinmin.android.app.model
data class UpDownData(
val status: Int,
val videoId: Int
)

某些文件未显示,因为此 diff 中更改的文件太多 显示更多