Compare commits
72 Commits
声网升级
...
dev_sudgam
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2eea1f1b75 | ||
| 3f1fe93f3d | |||
|
|
8c9cf4e3a8 | ||
| 0451f518d5 | |||
| a154f480f6 | |||
|
|
29badbf725 | ||
|
|
e89f22329f | ||
|
|
81e08d41af | ||
| d89b356395 | |||
| 4d2985456d | |||
| 48e3ff46ab | |||
|
|
6dd3e02c1d | ||
| d8e9cc2189 | |||
|
|
0310628ba3 | ||
| 2f54fdab12 | |||
|
|
a3228f48c2 | ||
|
|
35c83a255a | ||
|
|
0aeb2d32c2 | ||
|
|
313320473f | ||
|
|
2b86927b5b | ||
|
|
bf3ebfedbd | ||
|
|
1a2db91ceb | ||
|
|
9fa4924278 | ||
|
|
3318fa761c | ||
| a7421ba1a6 | |||
|
|
40a081caa6 | ||
|
|
1485173227 | ||
|
|
d5b60523a5 | ||
|
|
309d04653e | ||
|
|
45ae3b1624 | ||
|
|
e874c2ee16 | ||
|
|
002f0ad654 | ||
|
|
bb49472817 | ||
|
|
05e4ff89d7 | ||
| 020b5c1025 | |||
|
|
2cf10cc35a | ||
|
|
4c53c990e9 | ||
|
|
cd8b58a0ec | ||
| b41bd3b89b | |||
|
|
d66f098692 | ||
|
|
f131fcf546 | ||
|
|
eeb1cc008a | ||
| 6eba9558e1 | |||
|
|
0425b56106 | ||
|
|
c5de062171 | ||
|
|
f82dbccaa5 | ||
| 07d6b959d5 | |||
|
|
f59e5e527a | ||
|
|
c20147bf8f | ||
|
|
45743e3070 | ||
|
|
b8b43c1ef2 | ||
|
|
b7c53a3b21 | ||
| cb0772c9e3 | |||
| edc738d80b | |||
| b5417f90b4 | |||
| 98095e07ee | |||
| 9764b3370e | |||
| 0396e2d06d | |||
| 186b9d61ee | |||
| b7c0f5d3ec | |||
| 949c0ab759 | |||
| 5f3ebb4235 | |||
| ab24348f72 | |||
| 022806d9da | |||
| c92e8dd8bc | |||
| 8d5990c25b | |||
| 225929c891 | |||
| bc63a3e601 | |||
| c33975fe67 | |||
| c033340aad | |||
| 24170d55e2 | |||
| e36fbdc6b8 |
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-parcelize'
|
apply plugin: 'kotlin-parcelize'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||||
@@ -21,4 +23,5 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// api 'com.google.code.gson:gson:2.8.8'
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-parcelize'
|
apply plugin: 'kotlin-parcelize'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
|
|||||||
165
app/build.gradle
@@ -3,56 +3,12 @@ apply plugin: 'img-optimizer'
|
|||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'com.alibaba.arouter'
|
apply plugin: 'com.alibaba.arouter'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
dexOptions {
|
|
||||||
jumboMode = true
|
|
||||||
}
|
|
||||||
project.tasks.getByName("tasks").doFirst {
|
project.tasks.getByName("tasks").doFirst {
|
||||||
|
|
||||||
}
|
}
|
||||||
/* flavorDimensions "packageApk"
|
|
||||||
productFlavors {
|
|
||||||
LinkTest {
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
|
||||||
}
|
|
||||||
LinkOfficial {
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
|
||||||
}
|
|
||||||
GoogleTest {
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
|
||||||
}
|
|
||||||
GoogleOfficial{
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
/* applicationVariants.all { variant ->
|
|
||||||
variant.mergeAssetsProvider.configure {
|
|
||||||
doLast {
|
|
||||||
delete(fileTree(dir: outputDir, includes: [
|
|
||||||
'model/ai_bgseg_green.bundle',
|
|
||||||
'model/ai_face_processor.bundle',
|
|
||||||
'model/ai_face_processor_lite.bundle',
|
|
||||||
'model/ai_hairseg.bundle',
|
|
||||||
'model/ai_hand_processor.bundle',
|
|
||||||
'model/ai_human_processor.bundle',
|
|
||||||
'model/ai_human_processor_gpu.bundle',
|
|
||||||
'model/ai_human_processor_mb_fast.bundle',
|
|
||||||
'graphics/body_slim.bundle',
|
|
||||||
'graphics/controller_cpp.bundle',
|
|
||||||
'graphics/face_beautification.bundle',
|
|
||||||
'graphics/face_makeup.bundle',
|
|
||||||
'graphics/fuzzytoonfilter.bundle',
|
|
||||||
'graphics/fxaa.bundle',
|
|
||||||
'graphics/tongue.bundle'
|
|
||||||
]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||||
@@ -128,22 +84,27 @@ android {
|
|||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
println "清空build文件夹";
|
println "清空build文件夹";
|
||||||
for (final def project in rootProject.getAllprojects()) {
|
/* for (final def project in rootProject.getAllprojects()) {
|
||||||
delete project.buildDir
|
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
||||||
println project.buildDir
|
delete project.buildDir
|
||||||
}
|
delete project.rootDir.absolutePath+File.separator+"app"+File.separator+name
|
||||||
|
println project.buildDir
|
||||||
|
}*/
|
||||||
|
//delete project.rootDir.absolutePath + File.separator + "outputs"
|
||||||
String variantName = variant.name.capitalize()
|
String variantName = variant.name.capitalize()
|
||||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||||
processManifestTask.doLast { pm ->
|
processManifestTask.doLast { pm ->
|
||||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
String manifestPath = "build/intermediates/bundle_manifest/google_onlineRelease/bundle-manifest/AndroidManifest.xml"
|
||||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
def isGooglePlay = variant.name.contains("google")
|
||||||
println "谷歌版本:" + isGooglePlay
|
println "谷歌版本:" + isGooglePlay
|
||||||
println "文件存在" + file(manifestPath).exists()
|
println "文件存在" + file(manifestPath).exists()
|
||||||
println "" + (isGooglePlay != 0)
|
println "" + (isGooglePlay != 0)
|
||||||
println "" + (file(manifestPath).exists() && isGooglePlay != 0)
|
println "" + (file(manifestPath).exists() && isGooglePlay)
|
||||||
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
if (file(manifestPath).exists() && isGooglePlay) {
|
||||||
def manifestContent = file(manifestPath).getText()
|
def manifestContent = file(manifestPath).getText()
|
||||||
println "移除权限"
|
println "移除权限"
|
||||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||||
@@ -152,8 +113,8 @@ android {
|
|||||||
} else {
|
} else {
|
||||||
print "not Exists = " + manifestPath
|
print "not Exists = " + manifestPath
|
||||||
}
|
}
|
||||||
manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
|
manifestPath = "build/intermediates/merged_manifests/google_onlineRelease/processReleaseManifest/AndroidManifest.xml"
|
||||||
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
if (file(manifestPath).exists() && isGooglePlay) {
|
||||||
def manifestContent = file(manifestPath).getText()
|
def manifestContent = file(manifestPath).getText()
|
||||||
println "移除权限2"
|
println "移除权限2"
|
||||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||||
@@ -198,24 +159,56 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variant.outputs.all {
|
variant.assemble.doLast { vt ->
|
||||||
def isGoogle = "链接"
|
def channel = ''
|
||||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) {
|
def server = ''
|
||||||
isGoogle = "谷歌"
|
if (variant.name.contains('huawei')) {
|
||||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
channel = "华为"
|
||||||
isGoogle = "Huawei"
|
} else if (variant.name.contains('samsung')) {
|
||||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
channel = "三星"
|
||||||
isGoogle = "Samsung"
|
} else if (variant.name.contains('google')) {
|
||||||
|
channel = "谷歌"
|
||||||
|
} else {
|
||||||
|
channel = "链接"
|
||||||
}
|
}
|
||||||
def isPlugin = "完整"
|
if (variant.name.contains('online')) {
|
||||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
server = '正式服'
|
||||||
isPlugin = "插件"
|
} else {
|
||||||
|
server = '测试服'
|
||||||
}
|
}
|
||||||
def isTest = "测试服"
|
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.apk"
|
||||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
variant.outputs.forEach { fe ->
|
||||||
isTest = "正式服"
|
copy {
|
||||||
|
from fe.outputFile
|
||||||
|
into file("${project.rootDir}\\outputs\\apk\\")
|
||||||
|
rename { fn ->
|
||||||
|
fileName
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
|
||||||
|
}
|
||||||
|
tasks.named("sign${variant.name.capitalize()}Bundle", com.android.build.gradle.internal.tasks.FinalizeBundleTask) {
|
||||||
|
File file = finalBundleFile.asFile.get()
|
||||||
|
def channel = ''
|
||||||
|
def server = ''
|
||||||
|
if (variant.name.startsWith('huawei')) {
|
||||||
|
channel = "华为"
|
||||||
|
} else if (variant.name.startsWith('samsung')) {
|
||||||
|
channel = "三星"
|
||||||
|
} else if (variant.name.startsWith('google')) {
|
||||||
|
channel = "谷歌"
|
||||||
|
} else {
|
||||||
|
channel = "链接"
|
||||||
|
}
|
||||||
|
if (variant.name.contains('online')) {
|
||||||
|
server = '正式服'
|
||||||
|
} else {
|
||||||
|
server = '测试服'
|
||||||
|
}
|
||||||
|
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.aab"
|
||||||
|
File finalFile = new File("${project.rootDir}\\outputs\\aab", fileName)
|
||||||
|
finalBundleFile.set(finalFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
@@ -256,9 +249,17 @@ android {
|
|||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
ndk {
|
ndk {
|
||||||
// TODO: 谷歌商城需要兼容两个平台
|
Gradle gradle = getGradle()
|
||||||
//abiFilters "armeabi-v7a", "arm64-v8a"
|
String tskReqStr = gradle.getStartParameter().getTaskRequests().args.toString()
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
println("处理ndk 版本 = " + tskReqStr)
|
||||||
|
def isLink = tskReqStr.contains("Link")
|
||||||
|
if (isLink) {
|
||||||
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||||||
|
println("打包ndk 链接")
|
||||||
|
} else {
|
||||||
|
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
|
println("打包ndk其他")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions {
|
annotationProcessorOptions {
|
||||||
@@ -313,18 +314,4 @@ dependencies {
|
|||||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 链接包需要注释掉 否正无法更新 谷歌包需要打开
|
|
||||||
/*
|
|
||||||
project.afterEvaluate {
|
|
||||||
android.applicationVariants.all { variant ->
|
|
||||||
variant.outputs.each { output ->
|
|
||||||
output.processResources.doFirst { pm->
|
|
||||||
String manifestPath = output.processResources.manifestFile;
|
|
||||||
def manifestContent = file(manifestPath).getText()
|
|
||||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
|
||||||
file(manifestPath).write(manifestContent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
@@ -30,7 +30,6 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
|||||||
import com.tencent.imsdk.v2.V2TIMManager;
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||||
import com.yunbao.common.http.Data;
|
|
||||||
import com.yunbao.common.manager.OpenAdManager;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.BuildConfig;
|
import com.yunbao.common.BuildConfig;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
apply from: "config.gradle"
|
apply from: "config.gradle"
|
||||||
apply from: "dependencies.gradle"
|
apply from: "dependencies.gradle"
|
||||||
|
apply from: "config.gradle"
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.6.20'
|
ext.kotlin_version = '1.6.20'
|
||||||
@@ -49,9 +49,9 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
/*task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}*/
|
||||||
ext {
|
ext {
|
||||||
IS_PUBLISH_LOCAL=true
|
IS_PUBLISH_LOCAL=true
|
||||||
LIB_VERSION="1.0.6"
|
LIB_VERSION="1.0.6"
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
publishNonDefault true
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||||
@@ -211,11 +210,17 @@ dependencies {
|
|||||||
//侧滑删除
|
//侧滑删除
|
||||||
api 'com.yanzhenjie.recyclerview:x:1.3.2'
|
api 'com.yanzhenjie.recyclerview:x:1.3.2'
|
||||||
|
|
||||||
//华为支付插件包
|
huawei_onlineImplementation project(':lib_huawei')
|
||||||
//api project(':lib_huawei')
|
huawei_testImplementation project(':lib_huawei')
|
||||||
|
|
||||||
//google插件包
|
samsung_onlineImplementation project(":lib_google")
|
||||||
api project(':lib_google')
|
samsung_testImplementation project(":lib_google")
|
||||||
|
|
||||||
|
google_onlineImplementation project(":lib_google")
|
||||||
|
google_testImplementation project(":lib_google")
|
||||||
|
|
||||||
|
link_onlineImplementation project(":lib_google")
|
||||||
|
link_testImplementation project(":lib_google")
|
||||||
|
|
||||||
//samsung插件包
|
//samsung插件包
|
||||||
api project(':IAP6Helper')
|
api project(':IAP6Helper')
|
||||||
@@ -230,4 +235,6 @@ dependencies {
|
|||||||
//ExoPlayer,腾讯的播放器不支持无缝切换
|
//ExoPlayer,腾讯的播放器不支持无缝切换
|
||||||
api 'com.google.android.exoplayer:exoplayer:2.18.2'
|
api 'com.google.android.exoplayer:exoplayer:2.18.2'
|
||||||
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
|
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
|
||||||
|
|
||||||
|
api rootProject.ext.dependencies["blank-utilcode"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ public class Constants {
|
|||||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
||||||
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
||||||
|
|
||||||
|
public static final String PrankSendData = "PrankSendData";//整蛊进度
|
||||||
|
|
||||||
public static final int SOCKET_WHAT_CONN = 0;
|
public static final int SOCKET_WHAT_CONN = 0;
|
||||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||||
public static final int SOCKET_WHAT_BROADCAST = 1;
|
public static final int SOCKET_WHAT_BROADCAST = 1;
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.BaseViewHolder> {
|
||||||
|
public Context context;
|
||||||
|
public List<T> data;
|
||||||
|
|
||||||
|
public BaseAdapter(Context context, List<T> data) {
|
||||||
|
this.context = context;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(context).inflate(getItemLayoutId(), parent, false);
|
||||||
|
return new BaseViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(BaseAdapter.BaseViewHolder holder, int position) {
|
||||||
|
T t = data.get(position);
|
||||||
|
convert(holder, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return data == null ? 0 : data.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void convert(BaseViewHolder holder, T item);
|
||||||
|
|
||||||
|
public abstract int getItemLayoutId();
|
||||||
|
|
||||||
|
class BaseViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
private HashMap<Integer,View> views;
|
||||||
|
|
||||||
|
public BaseViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
views = new HashMap<>();
|
||||||
|
if (onItemClickListener != null){
|
||||||
|
itemView.setOnClickListener(v ->onItemClickListener.onItemClick(getAdapterPosition()) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public View getView(int id) {
|
||||||
|
View view = views.get(id);
|
||||||
|
if (view == null) {
|
||||||
|
view = itemView.findViewById(id);
|
||||||
|
views.put(id, view);
|
||||||
|
if (onItemClickListener != null){
|
||||||
|
view.setOnClickListener(v -> {
|
||||||
|
onItemClickListener.onItemChildClick(v, getAdapterPosition());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnItemClickListener onItemClickListener;
|
||||||
|
|
||||||
|
public void setOnItemClickListener(OnItemClickListener onItemClickListener){
|
||||||
|
this.onItemClickListener = onItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemClickListener{
|
||||||
|
default void onItemClick(int position){}
|
||||||
|
|
||||||
|
default void onItemChildClick(View view,int position){}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.SudSettleBean;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SudGameAdapter extends BaseAdapter<SudSettleBean> {
|
||||||
|
public SudGameAdapter(Context context, List<SudSettleBean> data) {
|
||||||
|
super(context, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AppCompatImageView sub_rank_image;
|
||||||
|
private RoundedImageView sub_head;
|
||||||
|
private AppCompatTextView sub_rank_text,sub_name,sub_score;
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
@Override
|
||||||
|
public void convert(BaseAdapter<SudSettleBean>.BaseViewHolder holder, SudSettleBean item) {
|
||||||
|
sub_rank_image = (AppCompatImageView) holder.getView(R.id.sub_rank_image);
|
||||||
|
sub_rank_text = (AppCompatTextView) holder.getView(R.id.sub_rank_text);
|
||||||
|
sub_head = (RoundedImageView) holder.getView(R.id.sub_head);
|
||||||
|
sub_name = (AppCompatTextView) holder.getView(R.id.sub_name);
|
||||||
|
sub_score = (AppCompatTextView) holder.getView(R.id.sub_score);
|
||||||
|
|
||||||
|
switch (item.getRank()){
|
||||||
|
case 1:
|
||||||
|
sub_rank_text.setVisibility(View.GONE);
|
||||||
|
sub_rank_image.setVisibility(View.VISIBLE);
|
||||||
|
sub_rank_image.setImageResource(R.mipmap.sub_1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
sub_rank_text.setVisibility(View.GONE);
|
||||||
|
sub_rank_image.setVisibility(View.VISIBLE);
|
||||||
|
sub_rank_image.setImageResource(R.mipmap.sub_2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
sub_rank_text.setVisibility(View.GONE);
|
||||||
|
sub_rank_image.setVisibility(View.VISIBLE);
|
||||||
|
sub_rank_image.setImageResource(R.mipmap.sub_3);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sub_rank_text.setVisibility(View.VISIBLE);
|
||||||
|
sub_rank_image.setVisibility(View.GONE);
|
||||||
|
sub_rank_text.setText(String.valueOf(item.getRank()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImgLoader.display(context, item.getAvatar_url(),sub_head);
|
||||||
|
sub_name.setText(item.getNick_name());
|
||||||
|
if (item.getWin_num()>0){
|
||||||
|
sub_score.setText("+"+item.getWin_num());
|
||||||
|
}else {
|
||||||
|
sub_score.setText(String.valueOf(item.getWin_num()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemLayoutId() {
|
||||||
|
return R.layout.view_sub_rank;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,10 @@ public class AnchorRecommendModel extends BaseModel {
|
|||||||
|
|
||||||
@SerializedName("live_battle_pass_show_status")
|
@SerializedName("live_battle_pass_show_status")
|
||||||
private int showWarOrder = 0;//是否显示首页戰令
|
private int showWarOrder = 0;//是否显示首页戰令
|
||||||
|
@SerializedName("live_battle_pass_image_cn")
|
||||||
|
private String battlePassImageCn;
|
||||||
|
@SerializedName("live_battle_pass_image_en")
|
||||||
|
private String battlePassImageEn;
|
||||||
//是否支持换一批0=不支持 1=支持
|
//是否支持换一批0=不支持 1=支持
|
||||||
|
|
||||||
@SerializedName("up_show")
|
@SerializedName("up_show")
|
||||||
@@ -58,6 +62,22 @@ public class AnchorRecommendModel extends BaseModel {
|
|||||||
return listShow;
|
return listShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBattlePassImageCn() {
|
||||||
|
return battlePassImageCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBattlePassImageCn(String battlePassImageCn) {
|
||||||
|
this.battlePassImageCn = battlePassImageCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBattlePassImageEn() {
|
||||||
|
return battlePassImageEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBattlePassImageEn(String battlePassImageEn) {
|
||||||
|
this.battlePassImageEn = battlePassImageEn;
|
||||||
|
}
|
||||||
|
|
||||||
public AnchorRecommendModel setListShow(int listShow) {
|
public AnchorRecommendModel setListShow(int listShow) {
|
||||||
this.listShow = listShow;
|
this.listShow = listShow;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -56,4 +56,15 @@ public class PrankGiftBean extends BaseModel{
|
|||||||
public void setGiftId(String giftId) {
|
public void setGiftId(String giftId) {
|
||||||
this.giftId = giftId;
|
this.giftId = giftId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PrankGiftBean{" +
|
||||||
|
"title='" + title + '\'' +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", icon='" + icon + '\'' +
|
||||||
|
", num=" + num +
|
||||||
|
", giftId='" + giftId + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PrankGiftResultBean extends BaseModel{
|
||||||
|
private List<PrankGiftBean> prank_list;
|
||||||
|
private String status;
|
||||||
|
private String prank_type;
|
||||||
|
|
||||||
|
public List<PrankGiftBean> getPrank_list() {
|
||||||
|
return prank_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrank_list(List<PrankGiftBean> prank_list) {
|
||||||
|
this.prank_list = prank_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrank_type() {
|
||||||
|
return prank_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrank_type(String prank_type) {
|
||||||
|
this.prank_type = prank_type;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PrankProgressBean extends BaseModel {
|
||||||
|
private int status;//整蛊状态 0.关闭 1.开启
|
||||||
|
private int prank_turntable_status;// 转盘整蛊状态 0=关闭 1=开启
|
||||||
|
private int prank_type;// 整蛊类型 1.礼物整蛊 2.连击整蛊
|
||||||
|
private List<PrankList> prank_list;// 整蛊进度
|
||||||
|
private List<PrankList> completed_list;// 待完成的整蛊
|
||||||
|
|
||||||
|
public PrankProgressBean(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static class PrankList{
|
||||||
|
private int gift_id;// 礼物ID
|
||||||
|
private int gift_num;// 整蛊需要的礼物数量
|
||||||
|
private String prank_content; // 整蛊内容
|
||||||
|
private int send_num; // 用户已赠送的礼物数量
|
||||||
|
private int completed_num;// 待完成的整蛊次数
|
||||||
|
private String gift_name;// 礼物名称
|
||||||
|
private String gift_icon; // 礼物图片链接
|
||||||
|
|
||||||
|
private String gift_name_en;
|
||||||
|
|
||||||
|
private int continuous_click_num;
|
||||||
|
|
||||||
|
public int getContinuous_click_num() {
|
||||||
|
return continuous_click_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContinuous_click_num(int continuous_click_num) {
|
||||||
|
this.continuous_click_num = continuous_click_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGift_name_en() {
|
||||||
|
return gift_name_en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGift_name_en(String gift_name_en) {
|
||||||
|
this.gift_name_en = gift_name_en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGift_id() {
|
||||||
|
return gift_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGift_id(int gift_id) {
|
||||||
|
this.gift_id = gift_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGift_num() {
|
||||||
|
return gift_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGift_num(int gift_num) {
|
||||||
|
this.gift_num = gift_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrank_content() {
|
||||||
|
return prank_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrank_content(String prank_content) {
|
||||||
|
this.prank_content = prank_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSend_num() {
|
||||||
|
return send_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSend_num(int send_num) {
|
||||||
|
this.send_num = send_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCompleted_num() {
|
||||||
|
return completed_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompleted_num(int completed_num) {
|
||||||
|
this.completed_num = completed_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGift_name() {
|
||||||
|
return gift_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGift_name(String gift_name) {
|
||||||
|
this.gift_name = gift_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGift_icon() {
|
||||||
|
return gift_icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGift_icon(String gift_icon) {
|
||||||
|
this.gift_icon = gift_icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
//计算完成度
|
||||||
|
public double getCompletionRate() {
|
||||||
|
if (gift_num == 0) return 0; // Avoid division by zero
|
||||||
|
return (double) send_num / gift_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PrankList{" +
|
||||||
|
"gift_id=" + gift_id +
|
||||||
|
", gift_num=" + gift_num +
|
||||||
|
", prank_content='" + prank_content + '\'' +
|
||||||
|
", send_num=" + send_num +
|
||||||
|
", completed_num=" + completed_num +
|
||||||
|
", gift_name='" + gift_name + '\'' +
|
||||||
|
", gift_icon='" + gift_icon + '\'' +
|
||||||
|
", gift_name_en='" + gift_name_en + '\'' +
|
||||||
|
", continuous_click_num=" + continuous_click_num +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrank_type() {
|
||||||
|
return prank_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrank_type(int prank_type) {
|
||||||
|
this.prank_type = prank_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PrankList> getPrank_list() {
|
||||||
|
return prank_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrank_list(List<PrankList> prank_list) {
|
||||||
|
this.prank_list = prank_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PrankList> getCompleted_list() {
|
||||||
|
return completed_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompleted_list(List<PrankList> completed_list) {
|
||||||
|
this.completed_list = completed_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrank_turntable_status() {
|
||||||
|
return prank_turntable_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrank_turntable_status(int prank_turntable_status) {
|
||||||
|
this.prank_turntable_status = prank_turntable_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PrankProgressBean{" +
|
||||||
|
"status=" + status +
|
||||||
|
", prank_turntable_status=" + prank_turntable_status +
|
||||||
|
", prank_type=" + prank_type +
|
||||||
|
", prank_list=" + prank_list +
|
||||||
|
", completed_list=" + completed_list +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
public class SudGameInfoBean {
|
||||||
|
private String uid;//玩家id
|
||||||
|
private String nick_name;//玩家昵称
|
||||||
|
private String avatar_url;//玩家头像
|
||||||
|
private String gender;//玩家性别
|
||||||
|
private int is_ai;//是否是ai
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNick_name() {
|
||||||
|
return nick_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNick_name(String nick_name) {
|
||||||
|
this.nick_name = nick_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar_url() {
|
||||||
|
return avatar_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar_url(String avatar_url) {
|
||||||
|
this.avatar_url = avatar_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGender() {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGender(String gender) {
|
||||||
|
this.gender = gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIs_ai() {
|
||||||
|
return is_ai;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_ai(int is_ai) {
|
||||||
|
this.is_ai = is_ai;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SudGameInfoBean{" +
|
||||||
|
"uid=" + uid +
|
||||||
|
", nick_name='" + nick_name + '\'' +
|
||||||
|
", avatar_url='" + avatar_url + '\'' +
|
||||||
|
", gender='" + gender + '\'' +
|
||||||
|
", is_ai=" + is_ai +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
public class SudGameScoreBean extends BaseModel{
|
||||||
|
private int golden_bean_remaining_balance;//
|
||||||
|
private int room_sill;//房间的金豆门槛
|
||||||
|
private int room_ticket;//收取的门票费
|
||||||
|
private int room_win_num;//赢家获得的金豆
|
||||||
|
private int game_mode;//1.双人对战 2.多人游戏
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SudGameScoreBean{" +
|
||||||
|
"golden_bean_remaining_balance=" + golden_bean_remaining_balance +
|
||||||
|
", room_sill=" + room_sill +
|
||||||
|
", room_ticket=" + room_ticket +
|
||||||
|
", room_win_num=" + room_win_num +
|
||||||
|
", game_mode=" + game_mode +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGame_mode() {
|
||||||
|
return game_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGame_mode(int game_mode) {
|
||||||
|
this.game_mode = game_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGolden_bean_remaining_balance() {
|
||||||
|
return golden_bean_remaining_balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGolden_bean_remaining_balance(int golden_bean_remaining_balance) {
|
||||||
|
this.golden_bean_remaining_balance = golden_bean_remaining_balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRoom_sill() {
|
||||||
|
return room_sill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoom_sill(int room_sill) {
|
||||||
|
this.room_sill = room_sill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRoom_ticket() {
|
||||||
|
return room_ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoom_ticket(int room_ticket) {
|
||||||
|
this.room_ticket = room_ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRoom_win_num() {
|
||||||
|
return room_win_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoom_win_num(int room_win_num) {
|
||||||
|
this.room_win_num = room_win_num;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SudSettleBean {
|
||||||
|
private String uid;//玩家id
|
||||||
|
private String nick_name;//玩家昵称
|
||||||
|
private String avatar_url;//玩家头像
|
||||||
|
private int rank;//玩家排名
|
||||||
|
private int win_num;//赢得或者失去的金豆
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNick_name() {
|
||||||
|
return nick_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNick_name(String nick_name) {
|
||||||
|
this.nick_name = nick_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar_url() {
|
||||||
|
return avatar_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar_url(String avatar_url) {
|
||||||
|
this.avatar_url = avatar_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRank() {
|
||||||
|
return rank;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRank(int rank) {
|
||||||
|
this.rank = rank;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWin_num() {
|
||||||
|
return win_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWin_num(int win_num) {
|
||||||
|
this.win_num = win_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SudSettleBean(String uid, String nick_name, String avatar_url, int rank, int win_num) {
|
||||||
|
this.uid = uid;
|
||||||
|
this.nick_name = nick_name;
|
||||||
|
this.avatar_url = avatar_url;
|
||||||
|
this.rank = rank;
|
||||||
|
this.win_num = win_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SudSettleBean{" +
|
||||||
|
"uid='" + uid + '\'' +
|
||||||
|
", nick_name='" + nick_name + '\'' +
|
||||||
|
", avatar_url='" + avatar_url + '\'' +
|
||||||
|
", rank=" + rank +
|
||||||
|
", win_num=" + win_num +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.yunbao.common.custom;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
|
||||||
|
import com.stx.xhb.androidx.transformers.BasePageTransformer;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
|
||||||
|
public class LiveGuardScalePageTransformer extends BasePageTransformer {
|
||||||
|
/**
|
||||||
|
* author: xiaohaibin.
|
||||||
|
* time: 2018/10/9
|
||||||
|
* mail:xhb_199409@163.com
|
||||||
|
* github:https://github.com/xiaohaibin
|
||||||
|
* describe: 适用于一屏显示多个模式
|
||||||
|
*/
|
||||||
|
private float mMinScale = 0.85f;
|
||||||
|
private float mMinAlpha = 1f;
|
||||||
|
|
||||||
|
public LiveGuardScalePageTransformer() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveGuardScalePageTransformer(float minAlpha, float minScale) {
|
||||||
|
setMinAlpha(minAlpha);
|
||||||
|
setMinScale(minScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleInvisiblePage(View view, float position) {
|
||||||
|
ViewCompat.setAlpha(view, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleLeftPage(View view, float position) {
|
||||||
|
float scale = Math.max(mMinScale, 1 + position);
|
||||||
|
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||||
|
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||||
|
view.setTranslationX(horzMargin - vertMargin / 2);
|
||||||
|
view.setScaleX(scale);
|
||||||
|
view.setScaleY( scale);
|
||||||
|
view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleRightPage(View view, float position) {
|
||||||
|
float scale = Math.max(mMinScale, 1 - position);
|
||||||
|
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||||
|
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||||
|
view.setTranslationX( -horzMargin + vertMargin / 2);
|
||||||
|
view.setScaleX( scale);
|
||||||
|
|
||||||
|
view.setScaleY( scale);
|
||||||
|
view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinAlpha(float minAlpha) {
|
||||||
|
if (minAlpha >= 0.6f && minAlpha <= 1.0f) {
|
||||||
|
mMinAlpha = minAlpha;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinScale(float minScale) {
|
||||||
|
if (minScale >= 0.6f && minScale <= 1.0f) {
|
||||||
|
mMinScale = minScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,11 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
|||||||
public abstract void buildDialog(XPopup.Builder builder);
|
public abstract void buildDialog(XPopup.Builder builder);
|
||||||
public abstract int bindLayoutId();
|
public abstract int bindLayoutId();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onShow() {
|
||||||
|
super.onShow();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getImplLayoutId() {
|
protected int getImplLayoutId() {
|
||||||
return bindLayoutId();
|
return bindLayoutId();
|
||||||
@@ -36,4 +41,24 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
|||||||
buildDialog(builder);
|
buildDialog(builder);
|
||||||
builder.asCustom(this).show();
|
builder.asCustom(this).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dismiss监听
|
||||||
|
*/
|
||||||
|
private OnDismissListener onDismissListener;
|
||||||
|
public interface OnDismissListener{
|
||||||
|
void onDismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnDismissListener(OnDismissListener onDismissListener) {
|
||||||
|
this.onDismissListener = onDismissListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDismiss() {
|
||||||
|
super.onDismiss();
|
||||||
|
if (onDismissListener != null){
|
||||||
|
onDismissListener.onDismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,172 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.SudSettleBean;
|
||||||
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 双人小游戏结算弹窗
|
||||||
|
*/
|
||||||
|
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||||
|
public SudGameDoubleDialog(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int bindLayoutId() {
|
||||||
|
return R.layout.dialog_sub_double;
|
||||||
|
}
|
||||||
|
|
||||||
|
private AppCompatImageView sub_win_hat,sub_leave,sub_again,sub_title;
|
||||||
|
private RoundedImageView sub_win_head,sub_loss_head;
|
||||||
|
private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time;
|
||||||
|
private CountDownTimer countDownTimer;
|
||||||
|
private List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
|
builder.dismissOnTouchOutside(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
sub_title = findViewById(R.id.sub_title);//弹窗标题
|
||||||
|
sub_win_hat = findViewById(R.id.sub_win_hat);//胜利皇冠(平局隐藏)
|
||||||
|
sub_leave = findViewById(R.id.sub_leave);//离开按钮
|
||||||
|
sub_again = findViewById(R.id.sub_again);//再来一局按钮
|
||||||
|
sub_win_head = findViewById(R.id.sub_win_head);//胜利方头像
|
||||||
|
sub_loss_head = findViewById(R.id.sub_loss_head);//失败方头像
|
||||||
|
sub_win_name = findViewById(R.id.sub_win_name);//胜利方昵称
|
||||||
|
sub_win_score = findViewById(R.id.sub_win_score);//胜利方分数
|
||||||
|
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
|
||||||
|
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
|
||||||
|
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||||
|
|
||||||
|
|
||||||
|
initData();
|
||||||
|
|
||||||
|
if (WordUtil.isNewZh()){
|
||||||
|
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||||
|
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||||
|
}else {
|
||||||
|
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||||
|
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||||
|
sub_again.setOnClickListener(v-> {
|
||||||
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||||
|
destroyDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
private void initData() {
|
||||||
|
if (settleBeans.size() == 2){
|
||||||
|
sortByWinNum(settleBeans);
|
||||||
|
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
||||||
|
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
||||||
|
|
||||||
|
ImgLoader.display(mContext,sudSettleBean1.getAvatar_url(),sub_win_head);
|
||||||
|
ImgLoader.display(mContext,sudSettleBean2.getAvatar_url(),sub_loss_head);
|
||||||
|
sub_win_name.setText(sudSettleBean1.getNick_name());
|
||||||
|
sub_loss_name.setText(sudSettleBean2.getNick_name());
|
||||||
|
if (sudSettleBean1.getWin_num()>0){
|
||||||
|
sub_win_score.setText("+"+sudSettleBean1.getWin_num());
|
||||||
|
}else {
|
||||||
|
sub_win_score.setText(String.valueOf(sudSettleBean1.getWin_num()));
|
||||||
|
}
|
||||||
|
sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num()));
|
||||||
|
|
||||||
|
if (sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num()){
|
||||||
|
//平局
|
||||||
|
if (WordUtil.isNewZh()){
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_draw_zh);
|
||||||
|
}else {
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_draw_en);
|
||||||
|
}
|
||||||
|
sub_win_hat.setVisibility(View.GONE);
|
||||||
|
}else {
|
||||||
|
//有胜负
|
||||||
|
sub_win_hat.setVisibility(View.VISIBLE);
|
||||||
|
if (CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid())){
|
||||||
|
//本人胜利
|
||||||
|
if (WordUtil.isNewZh()){
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_win_zh);
|
||||||
|
}else {
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_win_en);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//本人失败
|
||||||
|
if (WordUtil.isNewZh()){
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_loss_zh);
|
||||||
|
}else {
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_loss_en);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onShow() {
|
||||||
|
super.onShow();
|
||||||
|
//关闭倒计时
|
||||||
|
countDownTimer = new CountDownTimer(10000, 1000){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick(long l) {
|
||||||
|
sub_time.setText(String.valueOf((l+500)/1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
destroyDialog();
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
initData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSudSettleList(List<SudSettleBean> data){
|
||||||
|
settleBeans.clear();
|
||||||
|
settleBeans.addAll(data);
|
||||||
|
LogUtils.e("yqw=====>"+settleBeans);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sortByWinNum(List<SudSettleBean> list){
|
||||||
|
// 按照胜利数排序 settleBeans 列表
|
||||||
|
Collections.sort(list, (bean1, bean2) -> {
|
||||||
|
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void destroyDialog(){
|
||||||
|
dismiss();
|
||||||
|
countDownTimer.cancel();
|
||||||
|
countDownTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.SudGameAdapter;
|
||||||
|
import com.yunbao.common.bean.SudSettleBean;
|
||||||
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多人小游戏弹窗
|
||||||
|
*/
|
||||||
|
public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
|
||||||
|
public SudGameMultipleDialog(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int bindLayoutId() {
|
||||||
|
return R.layout.dialog_sub_multiple;
|
||||||
|
}
|
||||||
|
|
||||||
|
private RecyclerView sub_recycle_rank;
|
||||||
|
private AppCompatImageView sub_leave,sub_again,sub_title;
|
||||||
|
private AppCompatTextView sub_time;
|
||||||
|
private CountDownTimer countDownTimer;
|
||||||
|
private SudGameAdapter sudGameAdapter;
|
||||||
|
private final List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||||
|
@Override
|
||||||
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
|
builder.dismissOnTouchOutside(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
sub_recycle_rank = findViewById(R.id.sub_recycle_rank);//分数排名
|
||||||
|
sub_leave = findViewById(R.id.sub_leave);//离开按钮
|
||||||
|
sub_again = findViewById(R.id.sub_again);//再来一局按钮
|
||||||
|
sub_title = findViewById(R.id.sub_title);//弹窗标题
|
||||||
|
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||||
|
|
||||||
|
if (WordUtil.isNewZh()){
|
||||||
|
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||||
|
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_over_zh);
|
||||||
|
}else {
|
||||||
|
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||||
|
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||||
|
sub_title.setImageResource(R.mipmap.sub_over_en);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||||
|
sub_again.setOnClickListener(v-> {
|
||||||
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||||
|
destroyDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
//设置排名数据
|
||||||
|
sudGameAdapter = new SudGameAdapter(mContext,settleBeans);
|
||||||
|
sub_recycle_rank.setLayoutManager(new LinearLayoutManager(mContext));
|
||||||
|
sub_recycle_rank.setAdapter(sudGameAdapter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@Override
|
||||||
|
protected void onShow() {
|
||||||
|
super.onShow();
|
||||||
|
//关闭倒计时
|
||||||
|
countDownTimer = new CountDownTimer(10000, 1000){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick(long l) {
|
||||||
|
sub_time.setText(String.valueOf((l+500)/1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
destroyDialog();
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
sudGameAdapter.notifyDataSetChanged();
|
||||||
|
// limitItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSudSettleList(List<SudSettleBean> data){
|
||||||
|
settleBeans.clear();
|
||||||
|
settleBeans.addAll(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置最多显示的高度
|
||||||
|
private void limitItem(){
|
||||||
|
sub_recycle_rank.post(() -> {
|
||||||
|
View itemView = sub_recycle_rank.getChildAt(0);
|
||||||
|
if (itemView != null){
|
||||||
|
int height = (int) (itemView.getHeight()*3.5);
|
||||||
|
ViewGroup.LayoutParams layoutParams = sub_recycle_rank.getLayoutParams();
|
||||||
|
layoutParams.height = height;
|
||||||
|
sub_recycle_rank.setLayoutParams(layoutParams);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void destroyDialog(){
|
||||||
|
dismiss();
|
||||||
|
countDownTimer.cancel();
|
||||||
|
countDownTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
public class SudLoadDialog extends AbsDialogCenterPopupWindow{
|
||||||
|
public SudLoadDialog(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LinearLayoutCompat sud_load_bg;
|
||||||
|
private AppCompatImageView sud_load,sud_load_skip,sud_load_again;
|
||||||
|
private ProgressBar sud_load_bar_double,sud_load_bar_multiple;
|
||||||
|
private int isDouble = 0;//游戏模式 1:双人对战 2:多人游戏
|
||||||
|
private int clickStatus = 0;//0:什么都不点击 1:点击跳过 2:点击再来一局
|
||||||
|
|
||||||
|
public int getClickStatus() {
|
||||||
|
return clickStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClickStatus(int clickStatus) {
|
||||||
|
this.clickStatus = clickStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
|
builder.dismissOnTouchOutside(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int bindLayoutId() {
|
||||||
|
return R.layout.dialog_sud_load;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
sud_load_bg = findViewById(R.id.sud_load_bg);
|
||||||
|
sud_load = findViewById(R.id.sud_load);
|
||||||
|
sud_load_skip = findViewById(R.id.sud_load_skip);
|
||||||
|
sud_load_again = findViewById(R.id.sud_load_again);
|
||||||
|
sud_load_bar_double = findViewById(R.id.sud_load_bar_double);
|
||||||
|
sud_load_bar_multiple = findViewById(R.id.sud_load_bar_multiple);
|
||||||
|
|
||||||
|
if (WordUtil.isNewZh()){
|
||||||
|
sud_load.setImageResource(R.mipmap.sud_load_zh);
|
||||||
|
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_zh);
|
||||||
|
sud_load_again.setImageResource(R.mipmap.sub_again_zh);
|
||||||
|
}else {
|
||||||
|
sud_load.setImageResource(R.mipmap.sud_load_en);
|
||||||
|
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_en);
|
||||||
|
sud_load_again.setImageResource(R.mipmap.sub_again_en);
|
||||||
|
}
|
||||||
|
|
||||||
|
sud_load_skip.setOnClickListener(v->{
|
||||||
|
clickStatus = 1;
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
|
||||||
|
sud_load_again.setOnClickListener(v->{
|
||||||
|
clickStatus = 2;
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onShow() {
|
||||||
|
super.onShow();
|
||||||
|
if (isDouble == 1){
|
||||||
|
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_double));
|
||||||
|
sud_load_bar_double.setVisibility(View.VISIBLE);
|
||||||
|
sud_load_bar_multiple.setVisibility(View.GONE);
|
||||||
|
}else {
|
||||||
|
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_multiple));
|
||||||
|
sud_load_bar_double.setVisibility(View.GONE);
|
||||||
|
sud_load_bar_multiple.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
// new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
// if (this.isShow()){
|
||||||
|
// dismiss();
|
||||||
|
// }
|
||||||
|
// },10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDouble(int isDouble){
|
||||||
|
this.isDouble = isDouble;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,6 +37,8 @@ public class AllServerNotifyFFGGGDJANEvent extends BaseModel {
|
|||||||
private List<ButtonStyleDTO> buttonStyle;
|
private List<ButtonStyleDTO> buttonStyle;
|
||||||
@SerializedName("h5_type")
|
@SerializedName("h5_type")
|
||||||
private String h5Type;
|
private String h5Type;
|
||||||
|
@SerializedName("left_image")
|
||||||
|
private String leftImage;
|
||||||
|
|
||||||
public String getH5Type() {
|
public String getH5Type() {
|
||||||
return h5Type;
|
return h5Type;
|
||||||
@@ -47,6 +49,14 @@ public class AllServerNotifyFFGGGDJANEvent extends BaseModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLeftImage() {
|
||||||
|
return leftImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeftImage(String leftImage) {
|
||||||
|
this.leftImage = leftImage;
|
||||||
|
}
|
||||||
|
|
||||||
public String getMethod() {
|
public String getMethod() {
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,22 @@
|
|||||||
package com.yunbao.common.event;
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
|
||||||
public class CheckRemainingBalanceEvent extends BaseModel {
|
public class CheckRemainingBalanceEvent extends BaseModel {
|
||||||
public int seatIndex=0;
|
public int seatIndex=0;
|
||||||
private String SudMGPMGState;
|
private String SudMGPMGState;
|
||||||
|
private boolean subReady = false;//是否直接自动准备
|
||||||
|
private SudMGPMGState.MGCommonGameSettle mgCommonGameSettle;//结算数据
|
||||||
|
|
||||||
|
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle() {
|
||||||
|
return mgCommonGameSettle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckRemainingBalanceEvent setMgCommonGameSettle(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
||||||
|
this.mgCommonGameSettle = mgCommonGameSettle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getSudMGPMGState() {
|
public String getSudMGPMGState() {
|
||||||
return SudMGPMGState;
|
return SudMGPMGState;
|
||||||
@@ -23,4 +35,13 @@ public class CheckRemainingBalanceEvent extends BaseModel {
|
|||||||
this.seatIndex = seatIndex;
|
this.seatIndex = seatIndex;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CheckRemainingBalanceEvent setSubReady(boolean subReady){
|
||||||
|
this.subReady = subReady;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getSubReady(){
|
||||||
|
return subReady;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.bumptech.glide.request.RequestOptions;
|
|||||||
import com.bumptech.glide.request.target.CustomTarget;
|
import com.bumptech.glide.request.target.CustomTarget;
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -226,14 +227,20 @@ public class ImgLoader {
|
|||||||
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
||||||
.into(imageView);
|
.into(imageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayDrawable(Context context, String url, final DrawableCallback callback) {
|
public static void displayDrawable(Context context, String url, final DrawableCallback callback) {
|
||||||
|
displayDrawable(context, url, -1, -1, callback);
|
||||||
|
}
|
||||||
|
public static void displayDrawable(Context context, String url, int width, int height, final DrawableCallback callback) {
|
||||||
|
|
||||||
if (TextUtils.isEmpty(url) || !contextIsExist(context)) {
|
if (TextUtils.isEmpty(url) || !contextIsExist(context)) {
|
||||||
if (callback != null)
|
if (callback != null)
|
||||||
callback.onLoadFailed();
|
callback.onLoadFailed();
|
||||||
} else {
|
} else {
|
||||||
Glide.with(context).asDrawable().load(url).thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
|
RequestBuilder<Drawable> builder = Glide.with(context).asDrawable().load(url);
|
||||||
|
if (width != -1 && height != -1) {
|
||||||
|
builder = builder.override(width, height);
|
||||||
|
}
|
||||||
|
builder.thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ import com.yunbao.common.bean.NobleTrumpetModel;
|
|||||||
import com.yunbao.common.bean.OpenAdModel;
|
import com.yunbao.common.bean.OpenAdModel;
|
||||||
import com.yunbao.common.bean.PkRankBean;
|
import com.yunbao.common.bean.PkRankBean;
|
||||||
import com.yunbao.common.bean.PrankGiftBean;
|
import com.yunbao.common.bean.PrankGiftBean;
|
||||||
|
import com.yunbao.common.bean.PrankGiftResultBean;
|
||||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||||
|
import com.yunbao.common.bean.PrankProgressBean;
|
||||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||||
import com.yunbao.common.bean.RandomPkUserBean;
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
import com.yunbao.common.bean.RankPkInfoBean;
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
@@ -68,6 +70,8 @@ import com.yunbao.common.bean.SendMoneyLongModel;
|
|||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.SlideInBannerModel;
|
import com.yunbao.common.bean.SlideInBannerModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
import com.yunbao.common.bean.SudGameUserModel;
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
import com.yunbao.common.bean.SudRoomListModel;
|
import com.yunbao.common.bean.SudRoomListModel;
|
||||||
import com.yunbao.common.bean.SudgameCodeModel;
|
import com.yunbao.common.bean.SudgameCodeModel;
|
||||||
@@ -505,7 +509,16 @@ public interface PDLiveApi {
|
|||||||
* 获取整蛊列表
|
* 获取整蛊列表
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Prank.prankList")
|
@GET("/api/public/?service=Prank.prankList")
|
||||||
Observable<ResponseModel<List<PrankGiftBean>>> prankList(@Query("anchor_id") String anchor_id);
|
Observable<ResponseModel<PrankGiftResultBean>>prankList(
|
||||||
|
@Query("anchor_id") String anchor_id,
|
||||||
|
@Query("prank_type") String prank_type
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取整蛊进度列表
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.prankCompletedList")
|
||||||
|
Observable<ResponseModel<PrankProgressBean>> getPrankProgressList(@Query("anchor_id") String anchor_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置礼物整蛊
|
* 设置礼物整蛊
|
||||||
@@ -513,9 +526,11 @@ public interface PDLiveApi {
|
|||||||
@GET("/api/public/?service=Prank.setPrank")
|
@GET("/api/public/?service=Prank.setPrank")
|
||||||
Observable<ResponseModel<List<BaseModel>>> setPrank(
|
Observable<ResponseModel<List<BaseModel>>> setPrank(
|
||||||
@Query("anchor_id") String anchor_id,
|
@Query("anchor_id") String anchor_id,
|
||||||
@Query("gift_id") String gift_id,
|
@Query("status") String status,
|
||||||
@Query("gift_num") String gift_num,
|
@Query("prank_json") String prank_json,
|
||||||
@Query("prank_content") String prank_content
|
@Query("prank_type") String prank_type,
|
||||||
|
@Query("is_cleared") String is_cleared
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1009,6 +1024,22 @@ public interface PDLiveApi {
|
|||||||
@GET("/api/public/?service=Sudgame.getCode")
|
@GET("/api/public/?service=Sudgame.getCode")
|
||||||
Observable<ResponseModel<List<SudgameCodeModel>>> getCode();
|
Observable<ResponseModel<List<SudgameCodeModel>>> getCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取房间金豆门槛和赢家获得的金豆
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Sudgameserver.checkRemainingBalance")
|
||||||
|
Observable<ResponseModel<SudGameScoreBean>> getScore(
|
||||||
|
@Query("room_id") String roomId
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取游戏中玩家的信息
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Sudgameserver.getGameUser")
|
||||||
|
Observable<ResponseModel<List<SudGameInfoBean>>> getSudGameInfo(
|
||||||
|
@Query("room_id") String roomId
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建游戏房
|
* 创建游戏房
|
||||||
*
|
*
|
||||||
@@ -1235,4 +1266,17 @@ public interface PDLiveApi {
|
|||||||
);
|
);
|
||||||
@GET("/api/public/?service=Tx.getShengwangToken")
|
@GET("/api/public/?service=Tx.getShengwangToken")
|
||||||
Observable<ResponseModel<SwTokenModel>> getSwToken();
|
Observable<ResponseModel<SwTokenModel>> getSwToken();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param anchor_id
|
||||||
|
* @param gift_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.anchorClickFinish")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> anchorClickFinish(
|
||||||
|
@Query("anchor_id")String anchor_id,
|
||||||
|
@Query("gift_id")String gift_id
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ import com.yunbao.common.bean.NobleTrumpetModel;
|
|||||||
import com.yunbao.common.bean.OpenAdModel;
|
import com.yunbao.common.bean.OpenAdModel;
|
||||||
import com.yunbao.common.bean.PkRankBean;
|
import com.yunbao.common.bean.PkRankBean;
|
||||||
import com.yunbao.common.bean.PrankGiftBean;
|
import com.yunbao.common.bean.PrankGiftBean;
|
||||||
|
import com.yunbao.common.bean.PrankGiftResultBean;
|
||||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||||
|
import com.yunbao.common.bean.PrankProgressBean;
|
||||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||||
import com.yunbao.common.bean.RandomPkUserBean;
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
import com.yunbao.common.bean.RankPkInfoBean;
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
@@ -66,6 +68,8 @@ import com.yunbao.common.bean.RoomMicStatusModel;
|
|||||||
import com.yunbao.common.bean.SendMoneyLongModel;
|
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
import com.yunbao.common.bean.SudGameUserModel;
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
import com.yunbao.common.bean.SudRoomListModel;
|
import com.yunbao.common.bean.SudRoomListModel;
|
||||||
import com.yunbao.common.bean.SudgameCodeModel;
|
import com.yunbao.common.bean.SudgameCodeModel;
|
||||||
@@ -880,9 +884,9 @@ public class LiveNetManager {
|
|||||||
/**
|
/**
|
||||||
* 获取转盘整蛊列表
|
* 获取转盘整蛊列表
|
||||||
*/
|
*/
|
||||||
public void getPrankGiftList(String mLiveUid, HttpCallback<List<PrankGiftBean>> callback) {
|
public void getPrankGiftList(String mLiveUid, String prank_type,HttpCallback<PrankGiftResultBean> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.prankList(mLiveUid)
|
.prankList(mLiveUid,prank_type)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe(responseModel -> {
|
.subscribe(responseModel -> {
|
||||||
@@ -899,12 +903,31 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取整蛊进度列表
|
||||||
|
*/
|
||||||
|
public void getPrankProgressList(String mLiveUid, HttpCallback<PrankProgressBean> callback){
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getPrankProgressList(mLiveUid)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(responseModel->{
|
||||||
|
if (callback != null){
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
},throwable->{
|
||||||
|
if (callback != null){
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
} ).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置礼物整蛊
|
* 设置礼物整蛊
|
||||||
*/
|
*/
|
||||||
public void setPrankGift(String mLiveUid, String gift_id, String gift_num, String prank_content, HttpCallback<PrankHttpTurntableBean> callback) {
|
public void setPrankGift(String mLiveUid, String status, String prank_json,String prank_type,String is_cleared, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.setPrank(mLiveUid, gift_id, gift_num, prank_content)
|
.setPrank(mLiveUid, status, prank_json, prank_type,is_cleared)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe(responseModel -> {
|
.subscribe(responseModel -> {
|
||||||
@@ -2273,6 +2296,48 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取房间金豆门槛和赢家获得的金豆
|
||||||
|
* @param roomId
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getScore(String roomId,HttpCallback<SudGameScoreBean> callback){
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getScore(roomId)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(sudGameScoreBeanResponseModel -> {
|
||||||
|
if (callback != null){
|
||||||
|
callback.onSuccess(sudGameScoreBeanResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (callback != null){
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取游戏中所有玩家的信息
|
||||||
|
* @param roomId
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getSudGameInfo(String roomId,HttpCallback<List<SudGameInfoBean>> callback){
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getSudGameInfo(roomId)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(infoModel->{
|
||||||
|
if (callback != null){
|
||||||
|
callback.onSuccess(infoModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
},throwable -> {
|
||||||
|
if (callback != null){
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
||||||
@@ -3192,6 +3257,31 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void anchorClickFinish(String mLiveId, String giftId, HttpCallback<List<BaseModel>>callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.anchorClickFinish(mLiveId, giftId)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
||||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
|
|||||||
@@ -54,10 +54,18 @@ public class OpenAdManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
runnableMap.clear();
|
if (runnableMap != null) {
|
||||||
showMap.clear();
|
runnableMap.clear();
|
||||||
list.clear();
|
}
|
||||||
waitRunnableMap.clear();
|
if (showMap != null) {
|
||||||
|
showMap.clear();
|
||||||
|
}
|
||||||
|
if (list != null) {
|
||||||
|
list.clear();
|
||||||
|
}
|
||||||
|
if (waitRunnableMap != null) {
|
||||||
|
waitRunnableMap.clear();
|
||||||
|
}
|
||||||
list = null;
|
list = null;
|
||||||
runNowRunnable = null;
|
runNowRunnable = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,9 @@ public class RandomPkManager {
|
|||||||
.randomPK(new HttpCallback<String>() {
|
.randomPK(new HttpCallback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String data) {
|
public void onSuccess(String data) {
|
||||||
|
if (debugUid != null) {
|
||||||
|
pkUid = data = debugUid;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Integer.parseInt(data);//检测返回的data是否为数字uid,不是的话开始下一轮
|
Integer.parseInt(data);//检测返回的data是否为数字uid,不是的话开始下一轮
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -152,9 +155,8 @@ public class RandomPkManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pkUid = data;
|
pkUid = data;
|
||||||
if (debugUid != null) {
|
|
||||||
pkUid = data = debugUid;
|
ToastUtil.showDebug("随机PK:"+pkUid+"|"+data);
|
||||||
}
|
|
||||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
pkTimer.onStartPK(data);
|
pkTimer.onStartPK(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,13 @@ import com.yunbao.common.sud.decorator.SudFSTAPPDecorator;
|
|||||||
import com.yunbao.common.sud.model.GameConfigModel;
|
import com.yunbao.common.sud.model.GameConfigModel;
|
||||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||||
import com.yunbao.common.sud.state.MGStateResponse;
|
import com.yunbao.common.sud.state.MGStateResponse;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.SudJsonUtils;
|
import com.yunbao.common.utils.SudJsonUtils;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
import tech.sud.logger.LogUtils;
|
||||||
import tech.sud.mgp.core.ISudFSMStateHandle;
|
import tech.sud.mgp.core.ISudFSMStateHandle;
|
||||||
import tech.sud.mgp.core.ISudFSTAPP;
|
import tech.sud.mgp.core.ISudFSTAPP;
|
||||||
import tech.sud.mgp.core.ISudListenerInitSDK;
|
import tech.sud.mgp.core.ISudListenerInitSDK;
|
||||||
@@ -479,4 +481,13 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
return sudFSMMGDecorator.getSudFSMMGCache();
|
return sudFSMMGDecorator.getSudFSMMGCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏结算状态
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
|
||||||
|
LogUtils.e("yqw=====>"+model);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,13 @@ import android.view.View;
|
|||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
import com.yunbao.common.bean.PrankProgressBean;
|
||||||
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
|
import com.yunbao.common.bean.SudSettleBean;
|
||||||
import com.yunbao.common.bean.SudgameCodeModel;
|
import com.yunbao.common.bean.SudgameCodeModel;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
@@ -15,9 +20,14 @@ import com.yunbao.common.manager.IMLoginManager;
|
|||||||
import com.yunbao.common.sud.model.GameConfigModel;
|
import com.yunbao.common.sud.model.GameConfigModel;
|
||||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import tech.sud.mgp.core.ISudFSMMG;
|
import tech.sud.mgp.core.ISudFSMMG;
|
||||||
import tech.sud.mgp.core.ISudFSMStateHandle;
|
import tech.sud.mgp.core.ISudFSMStateHandle;
|
||||||
@@ -62,6 +72,22 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
public String languageCode = "zh-TW";
|
public String languageCode = "zh-TW";
|
||||||
|
|
||||||
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
||||||
|
private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励
|
||||||
|
private List<SudGameInfoBean> sudGameInfoBeanList = new ArrayList<>();//玩家信息
|
||||||
|
public final MutableLiveData<List<SudSettleBean>> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
|
||||||
|
|
||||||
|
public void setSudGameInfoBeanList(List<SudGameInfoBean> sudGameInfoBeanList) {
|
||||||
|
this.sudGameInfoBeanList = sudGameInfoBeanList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SudGameScoreBean getSudGameScoreBean() {
|
||||||
|
return sudGameScoreBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSudGameScoreBean(SudGameScoreBean sudGameScoreBean) {
|
||||||
|
this.sudGameScoreBean = sudGameScoreBean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向接入方服务器获取code
|
* 向接入方服务器获取code
|
||||||
@@ -70,7 +96,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
||||||
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
languageCode = "zh-TW";
|
languageCode = "zh-TW";
|
||||||
}else {
|
} else {
|
||||||
languageCode = "en-US";
|
languageCode = "en-US";
|
||||||
}
|
}
|
||||||
// TODO: 2022/6/10 注意,这里是演示使用OkHttpClient请求hello-sud服务
|
// TODO: 2022/6/10 注意,这里是演示使用OkHttpClient请求hello-sud服务
|
||||||
@@ -147,6 +173,81 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取房间的金豆数量和赢家获得的金豆
|
||||||
|
*/
|
||||||
|
public void getScore(String roomId, Activity activity) {
|
||||||
|
LiveNetManager.get(activity).getScore(roomId, new HttpCallback<SudGameScoreBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(SudGameScoreBean data) {
|
||||||
|
sudGameScoreBean = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行排名和结算
|
||||||
|
*/
|
||||||
|
public void sudGameRank(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
||||||
|
List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||||
|
int playerNum = mgCommonGameSettle.results.size();//玩家人数
|
||||||
|
int winnerNUm = countWinners(mgCommonGameSettle.results);//第一名人数
|
||||||
|
int winNum;//赢得或者失去的金豆
|
||||||
|
// 构建结算信息
|
||||||
|
for (SudMGPMGState.MGCommonGameSettle.PlayerResult playerResult : mgCommonGameSettle.results) {
|
||||||
|
String uid = playerResult.uid;
|
||||||
|
int rank = playerResult.rank;
|
||||||
|
SudGameInfoBean sudGameInfoBean = findGameInfoBean(uid);
|
||||||
|
if (sudGameInfoBean == null) return;
|
||||||
|
|
||||||
|
if (sudGameScoreBean.getGame_mode() == 1) {
|
||||||
|
//双人游戏
|
||||||
|
if (winnerNUm == 1){
|
||||||
|
winNum = (rank == 1) ? (int) (sudGameScoreBean.getRoom_sill() * 0.8) : -sudGameScoreBean.getRoom_sill();
|
||||||
|
}else {
|
||||||
|
winNum = -sudGameScoreBean.getRoom_ticket();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//多人游戏
|
||||||
|
if (rank == 1){
|
||||||
|
winNum = (playerNum*sudGameScoreBean.getRoom_win_num()-winnerNUm*sudGameScoreBean.getRoom_sill())/winnerNUm;
|
||||||
|
}else {
|
||||||
|
winNum = -sudGameScoreBean.getRoom_sill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
settleBeans.add(new SudSettleBean(uid,sudGameInfoBean.getNick_name(),sudGameInfoBean.getAvatar_url(),rank,winNum));
|
||||||
|
}
|
||||||
|
// 更新LiveData
|
||||||
|
listMutableLiveData.setValue(settleBeans);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统计第一名的玩家数量
|
||||||
|
private int countWinners(List<SudMGPMGState.MGCommonGameSettle.PlayerResult> results) {
|
||||||
|
int count = 0;
|
||||||
|
for (SudMGPMGState.MGCommonGameSettle.PlayerResult result : results) {
|
||||||
|
if (result.rank == 1) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据uid查找对应的游戏信息Bean
|
||||||
|
private SudGameInfoBean findGameInfoBean(String uid) {
|
||||||
|
for (SudGameInfoBean sudGameInfoBean : sudGameInfoBeanList) {
|
||||||
|
if (sudGameInfoBean.getUid().equals(uid)) {
|
||||||
|
return sudGameInfoBean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置当前用户id(接入方定义)
|
* 设置当前用户id(接入方定义)
|
||||||
*/
|
*/
|
||||||
@@ -255,7 +356,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
@Override
|
@Override
|
||||||
public void onGameMGCommonGameState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameState model) {
|
public void onGameMGCommonGameState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameState model) {
|
||||||
super.onGameMGCommonGameState(handle, model);
|
super.onGameMGCommonGameState(handle, model);
|
||||||
Log.e("QuickStartGameViewModel",model.toString());
|
Log.e("QuickStartGameViewModel", model.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ package com.yunbao.common.sud.decorator;
|
|||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
@@ -177,11 +178,11 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
} else {
|
} else {
|
||||||
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
||||||
}
|
}
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(mgCommonGameSettle));
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
|
||||||
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
|
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN).setSubReady(false));
|
||||||
// if (listener == null) {
|
// if (listener == null) {
|
||||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
// } else {
|
// } else {
|
||||||
@@ -258,7 +259,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
// } else {
|
// } else {
|
||||||
// listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
|
// listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
|
||||||
// }
|
// }
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表(2021-12-30新增,现在只支持碰碰我最强)
|
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表(2021-12-30新增,现在只支持碰碰我最强)
|
||||||
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);
|
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);
|
||||||
|
|||||||
@@ -170,6 +170,15 @@ public class SudMGPMGState implements Serializable {
|
|||||||
// 游戏结果玩家列表
|
// 游戏结果玩家列表
|
||||||
public List<PlayerResult> results;
|
public List<PlayerResult> results;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MGCommonGameSettle{" +
|
||||||
|
"gameMode=" + gameMode +
|
||||||
|
", gameRoundId='" + gameRoundId + '\'' +
|
||||||
|
", results=" + results +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 游戏结果玩家定义
|
* 游戏结果玩家定义
|
||||||
*/
|
*/
|
||||||
@@ -181,6 +190,19 @@ public class SudMGPMGState implements Serializable {
|
|||||||
public int isEscaped; // 是否逃跑 1:逃跑 0:非逃跑
|
public int isEscaped; // 是否逃跑 1:逃跑 0:非逃跑
|
||||||
public String killerId; // 杀自己的玩家的id
|
public String killerId; // 杀自己的玩家的id
|
||||||
public int isAI; // 是否是AI玩家,1为AI
|
public int isAI; // 是否是AI玩家,1为AI
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PlayerResult{" +
|
||||||
|
"uid='" + uid + '\'' +
|
||||||
|
", rank=" + rank +
|
||||||
|
", award=" + award +
|
||||||
|
", score=" + score +
|
||||||
|
", isEscaped=" + isEscaped +
|
||||||
|
", killerId='" + killerId + '\'' +
|
||||||
|
", isAI=" + isAI +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
common/src/main/java/com/yunbao/common/utils/ViewUtils.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
public class ViewUtils {
|
||||||
|
public static <T extends View> T findViewById(View view,int id,Class<T> clazz){
|
||||||
|
return view.findViewById(id);
|
||||||
|
}
|
||||||
|
public static <T extends View> T findViewById(View view,int id){
|
||||||
|
return view.findViewById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@ package com.yunbao.common.views;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
@@ -11,6 +13,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.core.BottomPopupView;
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
@@ -19,7 +22,11 @@ import com.yunbao.common.bean.CheckRemainingBalance;
|
|||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
import com.yunbao.common.dialog.DebugDialog;
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
|
import com.yunbao.common.dialog.SudGameDoubleDialog;
|
||||||
|
import com.yunbao.common.dialog.SudGameMultipleDialog;
|
||||||
|
import com.yunbao.common.dialog.SudLoadDialog;
|
||||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
import com.yunbao.common.event.HideShowEvent;
|
import com.yunbao.common.event.HideShowEvent;
|
||||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||||
@@ -57,6 +64,9 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
private TextView gameTitle, roomName, roomNumber;
|
private TextView gameTitle, roomName, roomNumber;
|
||||||
private RoundedImageView mAvatar;
|
private RoundedImageView mAvatar;
|
||||||
private boolean selfClick = false;
|
private boolean selfClick = false;
|
||||||
|
private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗
|
||||||
|
private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗
|
||||||
|
private SudLoadDialog sudLoadDialog;//加载弹窗
|
||||||
|
|
||||||
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
|
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -69,7 +79,13 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
mCreateSudRoomModel = createSudRoomModel;
|
mCreateSudRoomModel = createSudRoomModel;
|
||||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||||
|
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||||
|
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),getActivity());
|
||||||
IMLoginManager.get(context).setSudGame("");
|
IMLoginManager.get(context).setSudGame("");
|
||||||
|
//初始化结算弹窗
|
||||||
|
sudGameDoubleDialog = new SudGameDoubleDialog(context);//双人游戏
|
||||||
|
sudGameMultipleDialog = new SudGameMultipleDialog(context);//多人游戏
|
||||||
|
sudLoadDialog = new SudLoadDialog(context);//加载弹窗
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回自定义弹窗的布局
|
// 返回自定义弹窗的布局
|
||||||
@@ -166,6 +182,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||||
|
gameConfigModel.ui.gameSettle.hide = true;//是否隐藏结算界面(false: 显示; true: 隐藏,默认为 false)
|
||||||
|
|
||||||
gameConfigModel.ui.lobby_players.custom = true;
|
gameConfigModel.ui.lobby_players.custom = true;
|
||||||
gameConfigModel.ui.join_btn.custom = true;
|
gameConfigModel.ui.join_btn.custom = true;
|
||||||
@@ -173,6 +190,29 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
gameConfigModel.ui.start_btn.custom = true;
|
gameConfigModel.ui.start_btn.custom = true;
|
||||||
// SudMGP平台64bit游戏ID
|
// SudMGP平台64bit游戏ID
|
||||||
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
|
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
|
||||||
|
|
||||||
|
//游戏结算结束
|
||||||
|
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
||||||
|
if (sudLoadDialog.getClickStatus() == 0) {
|
||||||
|
sudLoadDialog.dismiss();
|
||||||
|
if (gameViewModel.getSudGameScoreBean().getGame_mode() == 1) {
|
||||||
|
//双人游戏
|
||||||
|
sudGameDoubleDialog.setSudSettleList(sudSettleBeans);
|
||||||
|
sudGameDoubleDialog.showDialog();
|
||||||
|
} else {
|
||||||
|
//多人游戏
|
||||||
|
sudGameMultipleDialog.setSudSettleList(sudSettleBeans);
|
||||||
|
sudGameMultipleDialog.showDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//加载弹窗监听
|
||||||
|
sudLoadDialog.setOnDismissListener(() -> {
|
||||||
|
if (sudLoadDialog.getClickStatus() == 2){
|
||||||
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||||
@@ -225,11 +265,14 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
switch (event.getSudMGPMGState()) {
|
switch (event.getSudMGPMGState()) {
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||||
LiveNetManager.get(getContext()).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
//获取筹码信息,检查是否足够
|
||||||
|
LiveNetManager.get(getContext()).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameScoreBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(CheckRemainingBalance data) {
|
public void onSuccess(SudGameScoreBean data) {
|
||||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
if (data.getGolden_bean_remaining_balance() == 1) {
|
||||||
|
gameViewModel.setSudGameScoreBean(data);
|
||||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||||
|
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfReady(event.getSubReady());
|
||||||
} else {
|
} else {
|
||||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
ToastUtil.show("貨幣数量不足 ");
|
ToastUtil.show("貨幣数量不足 ");
|
||||||
@@ -251,9 +294,31 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||||
|
//结算状态
|
||||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||||
|
sudLoadDialog.setClickStatus(0);
|
||||||
|
sudLoadDialog.setDouble(gameViewModel.getSudGameScoreBean().getGame_mode());
|
||||||
|
sudLoadDialog.showDialog();
|
||||||
|
//获取用户信息
|
||||||
|
LiveNetManager.get(getContext()).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<SudGameInfoBean> data) {
|
||||||
|
if (!data.isEmpty()){
|
||||||
|
gameViewModel.setSudGameInfoBeanList(data);
|
||||||
|
gameViewModel.sudGameRank(event.getMgCommonGameSettle());
|
||||||
|
}else {
|
||||||
|
ToastUtil.show(getContext().getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||||
|
//点击开始游戏
|
||||||
LiveNetManager.get(getContext()).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
LiveNetManager.get(getContext()).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||||
HttpCallback<CheckRemainingBalance>() {
|
HttpCallback<CheckRemainingBalance>() {
|
||||||
@@ -279,9 +344,9 @@ public class LiveSudGamePopup extends BottomPopupView {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onSudGameStatus(SubGameEvent event) {
|
public void onSudGameStatus(SubGameEvent event) {
|
||||||
if (event.getType() == 0) {
|
if (event.getType() == 0) {
|
||||||
|
|||||||
6
common/src/main/res/drawable/anim_loading_double.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:drawable="@mipmap/sud_load_double"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
/>
|
||||||
6
common/src/main/res/drawable/anim_loading_multiple.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:drawable="@mipmap/sud_load_multiple"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
/>
|
||||||
5
common/src/main/res/drawable/live_room_menu_red.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="320dp" />
|
||||||
|
<solid android:color="#FD2D48" />
|
||||||
|
</shape>
|
||||||
6
common/src/main/res/drawable/shape_sub_rank.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="20dp"/>
|
||||||
|
<solid android:color="@color/white"/>
|
||||||
|
<stroke android:width="1dp" android:color="#FF333333"/>
|
||||||
|
</shape>
|
||||||
@@ -182,10 +182,34 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp">
|
||||||
android:src="@mipmap/icon_zhenggu" />
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/icon_zhenggu" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/red_menu"
|
||||||
|
android:layout_width="6dp"
|
||||||
|
android:layout_height="6dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:background="@drawable/live_room_menu_red"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:minWidth="14dp"
|
||||||
|
android:paddingLeft="3dp"
|
||||||
|
android:paddingRight="3dp"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="10sp"
|
||||||
|
android:translationY="-4dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
201
common/src/main/res/layout/dialog_sub_double.xml
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@mipmap/sub_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="68dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="45dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_win_hat"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/sub_win_hat"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/sub_win_head"
|
||||||
|
android:layout_width="70dp"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_corner_radius="360dp"
|
||||||
|
app:riv_border_color="#FFFFDCB3"
|
||||||
|
app:riv_border_width="1dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_win_name"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="用户昵称哈哈哈"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_win_score"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:textColor="@color/white_60"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="+10000"/>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:src="@mipmap/sub_vs"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<!-- <androidx.appcompat.widget.AppCompatImageView-->
|
||||||
|
<!-- android:id="@+id/sub_loss_hat"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:src="@mipmap/sub_win_hat"-->
|
||||||
|
<!-- android:layout_centerHorizontal="true"/>-->
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/sub_loss_head"
|
||||||
|
android:layout_width="70dp"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_corner_radius="360dp"
|
||||||
|
app:riv_border_color="#FFFFDCB3"
|
||||||
|
app:riv_border_width="1dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_loss_name"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="用户昵称"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_loss_score"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:textColor="@color/white_60"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="+10000"/>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_leave"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/sub_leave_zh"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:textColor="#FF5B5B5B"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:text="10"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
android:layout_marginTop="10dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_again"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/sub_again_zh"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:textColor="@color/white_60"
|
||||||
|
android:text="@string/sub_admission_fee"
|
||||||
|
android:singleLine="true"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/sub_win_zh"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
82
common/src/main/res/layout/dialog_sub_multiple.xml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="45dp"
|
||||||
|
android:paddingBottom="22dp"
|
||||||
|
android:background="@mipmap/sub_bg2"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/sub_recycle_rank"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="190dp"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_leave"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/sub_leave_zh"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:textColor="#FF5B5B5B"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:text="10"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
android:layout_marginTop="10dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_again"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/sub_again_zh"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:textColor="#FFAAAAAA"
|
||||||
|
android:text="@string/sub_admission_fee"
|
||||||
|
android:singleLine="true"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/sub_over_zh"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
65
common/src/main/res/layout/dialog_sud_load.xml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:id="@+id/sud_load_bg"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sud_load"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/sud_load_zh"
|
||||||
|
android:layout_marginTop="16dp"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_marginTop="19dp"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/sud_load_bar_double"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:indeterminateBehavior="repeat"
|
||||||
|
android:indeterminateDrawable="@drawable/anim_loading_double"
|
||||||
|
android:indeterminateDuration="500"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/sud_load_bar_multiple"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:indeterminateBehavior="repeat"
|
||||||
|
android:indeterminateDrawable="@drawable/anim_loading_multiple"
|
||||||
|
android:indeterminateDuration="500"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sud_load_skip"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:src="@mipmap/sud_load_skip_zh"/>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sud_load_again"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@mipmap/sub_again_zh"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
75
common/src/main/res/layout/view_sub_rank.xml
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@drawable/shape_sub_rank"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:paddingStart="9dp"
|
||||||
|
android:paddingEnd="9dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="26dp"
|
||||||
|
android:layout_height="26dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/sub_rank_image"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/sub_1"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_rank_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/black2"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:text="4"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/sub_head"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
app:riv_corner_radius="360dp"
|
||||||
|
app:riv_border_width="1dp"
|
||||||
|
app:riv_border_color="#FF333333"
|
||||||
|
android:layout_marginStart="9dp"
|
||||||
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textColor="#FF333333"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:text="用户昵称"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/sub_score"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:textColor="#FF777777"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:text="+10000"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_1.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_2.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_3.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_again_en.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_again_zh.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_bg.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_bg2.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_draw_en.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_draw_zh.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_leave_en.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_leave_zh.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_loss_en.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_loss_zh.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_over_en.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_over_zh.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_vs.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_win_en.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_win_hat.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sub_win_zh.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_bg_double.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_bg_multiple.png
Normal file
|
After Width: | Height: | Size: 153 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_double.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_en.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_multiple.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_skip_en.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_skip_zh.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
common/src/main/res/mipmap-xhdpi/sud_load_zh.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_prank_gift_add_gift_to.png
Normal file
|
After Width: | Height: | Size: 933 B |
BIN
common/src/main/res/mipmap-xxhdpi/ic_prank_gift_del.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_prank_gift_switch.png
Normal file
|
After Width: | Height: | Size: 725 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_1.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_2.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_3.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_again_en.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_again_zh.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_bg.png
Normal file
|
After Width: | Height: | Size: 550 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_bg2.png
Normal file
|
After Width: | Height: | Size: 552 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_draw_en.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_draw_zh.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_leave_en.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_leave_zh.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_loss_en.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_loss_zh.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_over_en.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_over_zh.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_vs.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_win_en.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_win_hat.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sub_win_zh.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sud_load_bg_double.png
Normal file
|
After Width: | Height: | Size: 432 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sud_load_bg_multiple.png
Normal file
|
After Width: | Height: | Size: 395 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sud_load_double.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sud_load_en.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/sud_load_multiple.png
Normal file
|
After Width: | Height: | Size: 14 KiB |