Merge branch 'master' into dev_680_礼物展馆

# Conflicts:
#	common/src/main/res/values-zh-rHK/strings.xml
#	common/src/main/res/values-zh-rTW/strings.xml
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
#	gradle.properties
#	live/build.gradle
This commit is contained in:
Martin 2024-07-17 09:53:22 +08:00
commit 152848a04f
215 changed files with 3143 additions and 872 deletions

View File

@ -5,8 +5,8 @@ apply plugin: 'kotlin-parcelize'
apply from: "../package_config.gradle"
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
namespace "com.yunbao.faceunity"
compileSdk rootProject.ext.android.compileSdkVersion
packagingOptions {
pickFirst "lib/armeabi/libyuvutils.so"
pickFirst "lib/arm64-v8a/libyuvutils.so"
@ -48,8 +48,8 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_18
targetCompatibility JavaVersion.VERSION_18
}
}
repositories {

View File

@ -1,7 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.yunbao.faceunity"
>
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />

View File

@ -2,16 +2,16 @@ apply plugin: 'com.android.library'
apply from: "../package_config.gradle"
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
namespace "com.samsung.android.sdk.iap.lib"
compileSdk rootProject.ext.android.compileSdkVersion
defaultConfig {
minSdkVersion minSdkVersion
minSdkVersion rootProject.ext.android.minSdkVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
versionCode versionCode
versionName versionName
targetSdkVersion targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
targetSdkVersion rootProject.ext.android.targetSdkVersion
}
buildTypes {
@ -20,8 +20,15 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
buildFeatures {
buildConfig = true
}
}
repositories {
flatDir {
dirs 'libs', '../libs'
}
}
dependencies {
// api 'com.google.code.gson:gson:2.8.8'
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}

View File

@ -1,6 +1,5 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.samsung.android.sdk.iap.lib"
android:versionCode="601000004"
android:versionName="6.1.0">
<!-- version code [Major/Minor/Bug fix release/Build number ] : x xx xxx xxx -->

View File

@ -14,6 +14,7 @@ import com.samsung.android.iap.IAPConnector;
import com.samsung.android.sdk.iap.lib.R;
import com.samsung.android.sdk.iap.lib.activity.CheckPackageActivity;
import com.samsung.android.sdk.iap.lib.activity.PaymentActivity;
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
import com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask;
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
@ -33,7 +34,6 @@ public class IapHelper extends HelperDefine {
private static final String TAG = IapHelper.class.getSimpleName();
/**
* When you release a application, this Mode must be set to {@link HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION}
* Please double-check this mode before release.
*/
private int mMode = HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION.getValue();
@ -46,9 +46,9 @@ public class IapHelper extends HelperDefine {
// AsyncTask for API
// ========================================================================
private GetProductsDetailsTask mGetProductsDetailsTask = null;
private GetOwnedListTask mGetOwnedListTask = null;
private ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
private com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask mGetProductsDetailsTask = null;
private com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask mGetOwnedListTask = null;
private com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
// ========================================================================
private ArrayList<BaseService> mServiceQueue = new ArrayList<BaseService>();
@ -267,7 +267,7 @@ public class IapHelper extends HelperDefine {
if (mIapConnector == null || mContext == null) {
return false;
} else {
mGetProductsDetailsTask = new GetProductsDetailsTask(_baseService,
mGetProductsDetailsTask = new com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask(_baseService,
mIapConnector,
mContext,
_productIDs,
@ -344,7 +344,7 @@ public class IapHelper extends HelperDefine {
if (mIapConnector == null || mContext == null) {
return false;
} else {
mGetOwnedListTask = new GetOwnedListTask(_baseService,
mGetOwnedListTask = new com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask(_baseService,
mIapConnector,
mContext,
_productType,
@ -417,7 +417,7 @@ public class IapHelper extends HelperDefine {
mConsumePurchasedItemsTask.cancel(true);
}
mConsumePurchasedItemsTask = new ConsumePurchasedItemsTask(_baseService,
mConsumePurchasedItemsTask = new com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask(_baseService,
mIapConnector,
mContext,
_purchaseIds,

View File

@ -5,6 +5,7 @@ apply plugin: 'kotlin-parcelize'
apply from: "../package_config.gradle"
android {
namespace "com.pdlive.shayu"
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
packagingOptions {

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.pdlive.shayu">
xmlns:tools="http://schemas.android.com/tools">
<queries>
<package android:name="com.pdlive.shayu"/>

View File

@ -6,12 +6,8 @@ apply plugin: 'com.alibaba.arouter'
apply from: "../package_config.gradle"
android {
project.tasks.getByName("tasks").doFirst {
}
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
namespace "myname.pdlive.shayu"
compileSdk rootProject.ext.android.compileSdkVersion
packagingOptions {
pickFirst "lib/armeabi/libyuvutils.so"
pickFirst "lib/arm64-v8a/libyuvutils.so"
@ -81,8 +77,11 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_18
targetCompatibility JavaVersion.VERSION_18
}
buildFeatures {
buildConfig = true
}

View File

@ -196,9 +196,12 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
# If you use the byType method to obtain Service, add the following rules to protect the interface:
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
@ -308,3 +311,7 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
-keep class com.shayu.lib_huawei.**{*;}
-keep class io.agora.**{*;}
-keep class com.qiniu.**{*;}
-keep class com.qiniu.**{public <init>();}
-ignorewarnings

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="myname.pdlive.shayu">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission
android:name="android.permission.CALL_PHONE"

View File

@ -74,6 +74,7 @@ import java.util.List;
import myname.pdlive.shayu.R;
/**
* Created by cxf on 2018/9/17.
*/

View File

@ -4,27 +4,28 @@ apply from: "dependencies.gradle"
apply from: "config.gradle"
buildscript {
ext.kotlin_version = '1.6.20'
ext.kotlin_version = '1.8.22'
repositories {
maven { url "https://mvn.mob.com/android" }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//
maven { url 'https://repo1.maven.org/maven2/' }//
maven {url 'https://developer.huawei.com/repo/'}
maven { url "https://jitpack.io" }
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:8.3.1'
//png工具
classpath 'com.chenenyu:img-optimizer:1.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath "com.alibaba:arouter-register:1.0.2"
classpath "com.github.jadepeakpoet.ARouter:arouter-register:1.0.3"
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
}
@ -40,9 +41,9 @@ allprojects {
maven { url "https://mvn.mob.com/android" }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'http://developer.huawei.com/repo'}//
maven { url 'https://developer.huawei.com/repo'}//
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//
maven { url "https://jitpack.io" }
maven { url 'https://repo1.maven.org/maven2/' }//
google() // Google's Maven repository

View File

@ -2,10 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'img-optimizer'
apply plugin: 'kotlin-android'
apply from: "../package_config.gradle"
android {
namespace "com.yunbao.common"
compileSdk rootProject.ext.android.compileSdkVersion
publishNonDefault true
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
@ -13,7 +15,18 @@ android {
versionName rootProject.ext.android.versionName
manifestPlaceholders = rootProject.ext.manifestPlaceholders
ndk {
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
// abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
} else {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
@ -53,8 +66,11 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_18
targetCompatibility JavaVersion.VERSION_18
}
buildFeatures {
buildConfig = true
}
}
repositories {
@ -64,7 +80,9 @@ repositories {
}
dependencies {
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
api files('libs/jcc-bate-0.7.3.jar')
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
@ -159,14 +177,14 @@ dependencies {
//im
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
api 'com.google.code.gson:gson:2.8.8'
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' //
api 'cn.rongcloud.sdk:rtc_lib:5.7.0' //
// 5.1.2
api 'cn.rongcloud.sdk:im_lib:5.2.0.2'
api 'cn.rongcloud.sdk:im_lib:5.7.0'
// 5.1.2
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // UI
api 'cn.rongcloud.sdk:im_kit:5.7.0' // UI
//
api 'cn.rongcloud.sdk:sight:5.2.5.4'
api 'cn.rongcloud.sdk:sight:5.7.0'
api 'com.facebook.android:facebook-android-sdk:15.2.0'
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
@ -211,31 +229,36 @@ dependencies {
//
api 'com.yanzhenjie.recyclerview:x:1.3.2'
huawei_onlineImplementation project(':lib_huawei')
huawei_testImplementation project(':lib_huawei')
//
//api project(':lib_huawei')
samsung_onlineImplementation 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")
//google插件包
api project(':lib_google')
//samsung插件包
api project(':IAP6Helper')
//api project(':IAP6Helper')
//
api 'com.contrarywind:Android-PickerView:4.1.9'
//
api 'com.wuxiaolong.pullloadmorerecyclerview:library:1.1.2'
//
api 'com.contrarywind:Android-PickerView:4.1.9'
//UI框架
api 'com.github.xuexiangjys:XUI:1.1.6'
api 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0'
//ExoPlayer,
api 'com.google.android.exoplayer:exoplayer:2.18.2'
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
//
api 'com.github.FlyJingFish:GradientTextView:1.2.4'
//
api 'com.github.xiaohaibin:XBanner:androidx_v1.2.8'
//SDK
//api 'io.agora.rtc:agora-special-full:4.2.6.245'
//ExoPlayer,
api 'com.google.android.exoplayer:exoplayer:2.18.2'
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
api 'com.xj.marqueeView:marqueeView:0.1.20'
api rootProject.ext.dependencies["blank-utilcode"]

View File

@ -23,3 +23,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.qiniu.**{*;}
-keep class com.qiniu.**{public <init>();}
-ignorewarnings

View File

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yunbao.common">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
<!-- <uses-permission android:name="android.permission.INTERNET" />-->

View File

@ -9,7 +9,7 @@ import java.util.HashMap;
import java.util.List;
public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.BaseViewHolder> {
private Context context;
public Context context;
public List<T> data;
public BaseAdapter(Context context, List<T> data) {
@ -34,7 +34,7 @@ public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.Ba
return data == null ? 0 : data.size();
}
public abstract void convert(BaseViewHolder holder, T t);
public abstract void convert(BaseViewHolder holder, T item);
public abstract int getItemLayoutId();
@ -67,7 +67,7 @@ public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.Ba
private OnItemClickListener onItemClickListener;
private void setOnItemClickListener(OnItemClickListener onItemClickListener){
public void setOnItemClickListener(OnItemClickListener onItemClickListener){
this.onItemClickListener = onItemClickListener;
}

View File

@ -13,6 +13,7 @@ import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.views.InteractionGamesChildViewHolder;
import java.util.ArrayList;
@ -36,7 +37,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
return new InteractionGamesChildViewHolder(runGamesView);
return new InteractionGamesChildViewHolder(runGamesView,mContext);
}
@Override
@ -51,6 +52,9 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
if (activityID != 0) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
if(model.getSudGameIsNew().equals("1")){
SpUtil.getInstance().setLiveGameId(model.getId());
}
}

View File

@ -31,11 +31,16 @@ public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false);
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed);
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed,mContext);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
ViewGroup.LayoutParams.WRAP_CONTENT);
holder.itemView.setLayoutParams(layoutParams);
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
childViewHolder.setData(child.get(position), rigts);
}

View File

@ -11,11 +11,11 @@ import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.event.LiveNewRoleEvent;
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.InteractionGamesChildViewHolder;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.views.InteractionGamesChildBottomViewHolder;
import java.util.ArrayList;
import java.util.List;
@ -34,14 +34,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
return new InteractionGamesChildViewHolder(runGamesView);
return new InteractionGamesChildBottomViewHolder(runGamesView,mContext);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
InteractionGamesChildBottomViewHolder childViewHolder = (InteractionGamesChildBottomViewHolder) holder;
childViewHolder.setData(child.get(position), rigts);
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
childViewHolder.setItemViewClicks(new InteractionGamesChildBottomViewHolder.InteractionGamesCallBack() {
@Override
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
@ -52,6 +52,9 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
.setInteractionID(activityID)
.setChild(child)
.setInteraction(true));
if(model.getSudGameIsNew().equals("1")){
SpUtil.getInstance().setLiveGameId(model.getId());
}
}
@ -60,12 +63,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
});
}
@Override
public int getItemCount() {
return child.size();
}
public void updateData(List<CustomSidebarChildModel> mChild) {
child.clear();
/* if (mChild.size() > 8) {
for (int i = 0; i < 8; i++) {

View File

@ -39,13 +39,14 @@ public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter {
switch (viewType) {
case FUN_GAMES:
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false);
return new LiveNewRoleFunGamesViewHolder(runGamesView);
return new LiveNewRoleFunGamesViewHolder(runGamesView,mContext);
case RIGHTS_INTERESTS:
//特权
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false);
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed);
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed,mContext);
default:
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false);
return new LiveNewRoleInteractionGamesViewHolder(gamesView);
return new LiveNewRoleInteractionGamesViewHolder(gamesView,mContext);
}
}

View File

@ -30,11 +30,15 @@ public class NewRoleFunGamesAdapter extends RecyclerView.Adapter {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view2, parent, false);
return new NewRoleFunGamesChildViewHolder(runGamesView,false);
return new NewRoleFunGamesChildViewHolder(runGamesView,false,mContext);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
ViewGroup.LayoutParams.WRAP_CONTENT);
holder.itemView.setLayoutParams(layoutParams);
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
childViewHolder.setData(child.get(position), rigts);
}

View File

@ -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;
}
}

View File

@ -2,7 +2,6 @@ package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.BuildConfig;
public class CheckLiveModel extends BaseModel {

View File

@ -2,7 +2,6 @@ package com.yunbao.common.bean;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.BuildConfig;
import com.yunbao.common.utils.StringUtil;
import java.util.Arrays;

View File

@ -22,6 +22,30 @@ public class GuardPriceModel extends BaseModel {
private String discount;
@SerializedName("price_key")
private int priceKey;
@SerializedName("coupon_discount")
private String couponDiscount;
@SerializedName("coupon_discount_en")
private String couponDiscountEn;
@SerializedName("coupon_discount_price")
private String couponDiscountPrice;
@SerializedName("coupon_id")
private String couponId;
public String getCouponDiscount() {
return couponDiscount;
}
public String getCouponId() {
return couponId;
}
public String getCouponDiscountEn() {
return couponDiscountEn;
}
public String getCouponDiscountPrice() {
return couponDiscountPrice;
}
public String getOpeningTime() {
return openingTime;

View File

@ -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 +
'}';
}
}

View File

@ -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;
}
}

View File

@ -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 +
'}';
}
}

View File

@ -24,6 +24,11 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
public abstract void buildDialog(XPopup.Builder builder);
public abstract int bindLayoutId();
@Override
protected void onShow() {
super.onShow();
}
@Override
protected int getImplLayoutId() {
return bindLayoutId();
@ -36,4 +41,24 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
buildDialog(builder);
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();
}
}
}

View File

@ -0,0 +1,80 @@
package com.yunbao.common.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.text.Html;
import android.text.Spanned;
import android.view.View;
import android.widget.TextView;
import com.yunbao.common.R;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.WordUtil;
public class GuardBuyCouponTipsDialog {
/**
* @param context
* @param coin 钻石
* @param content 购买类型名称
* @param simpleCallback
*/
public static void showBuyOrRenewDialog(Context context, String coupon, String coin, String content,
DialogUitl.SimpleCallback3 simpleCallback) {
if (context instanceof Activity) {
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
return;
}
}
final Dialog dialog = new Dialog(context, R.style.dialog2);
dialog.setContentView(R.layout.dialog_guard_buy_coupon_tips);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
TextView btn_confirm = dialog.findViewById(R.id.btn_confirm);
TextView content2 = dialog.findViewById(R.id.content2);
Spanned tips;
if (WordUtil.isNewZh()) {
tips = Html.fromHtml("<font color='#FFE0BF'>您有一張</font>"
+ "<font color='#FF9937'>" + content + "優惠券</font><br>"
+ "<font color='#FFE0BF'>開通/續費" + content + "(1個月)時,</font><br><font color='#FFE0BF'>可享</font>"
+ "<strong><font color='#FF9937'>" + coupon + "折</font></strong>"
+ "<font color='#FFE0BF'>優惠 (折後:</font>"
+ "<font color='#FF9937'>" + coin + "鑽</font>)<br>"
+ "<font color='#FFE0BF'>是否使用優惠券?</font>");
} else {
tips = Html.fromHtml("<font color='#FFE0BF'>You have a </font>"
+ "<font color='#FF9937'>" + content + " coupon</font>"
+ "<font color='#FFE0BF'> When activating/renewing " + content + "(1 month), you can enjoy a</font>"
+ "<strong><font color='#FF9937'> " + coupon + "% </font></strong>"
+ "<font color='#FFE0BF'>discount (After folding:</font>"
+ "<font color='#FF9937'>" + coin + " diamonds</font>"
+ "<font color='#FFE0BF'>Do you want to use coupons?</font>");
}
content2.setText(tips);
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_cancel1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
simpleCallback.onCancel();
dialog.dismiss();
}
});
btn_confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
simpleCallback.onConfirmClick(dialog);
dialog.dismiss();
}
});
dialog.show();
}
}

View File

@ -0,0 +1,44 @@
package com.yunbao.common.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.yunbao.common.R;
import com.yunbao.common.utils.WordUtil;
public class GuardBuyTipsNewDialog {
/**
* @param context
*/
public static void showBuyOrRenewDialog(Context context) {
if (context instanceof Activity) {
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
return;
}
}
final Dialog dialog = new Dialog(context, R.style.dialog2);
dialog.setContentView(R.layout.dialog_guard_buy_tips);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
TextView btn_confirm = dialog.findViewById(R.id.btn_confirm);
btn_confirm.setText(WordUtil.isNewZh() ? "確認" : "Confirm");
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
}

View File

@ -1,7 +1,10 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
@ -16,6 +19,7 @@ import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -26,18 +30,19 @@ import java.math.BigDecimal;
* 战令等级 经验
*/
public class OrderLevelPopupWindow extends CenterPopupView {
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current, expText;
private TextView orderLevelDiamond, balanceDiamond, current, expText;
private int currentExperience, totalExperience;//当前经验全部经验
private String buyExp = "100", currentLevel, balance;
private String buyExp = "1", currentLevel, balance;
private ProgressBar progressBar;
private OrderLevelCallback orderLevelCallback;
private long maxExp;
private BattlePassUserInfoBean userInfoBean;
private Context mContext;
private EditText orderLevel;
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
int mCurrentExperience, int mTotalExperience,
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean, int mCurrentExperience, int mTotalExperience, String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
super(context);
this.mContext = context;
this.userInfoBean = userInfoBean;
currentExperience = mCurrentExperience;
totalExperience = mTotalExperience;
@ -67,15 +72,15 @@ public class OrderLevelPopupWindow extends CenterPopupView {
progressBar.setProgress(currentExperience);
expText.setText(String.format("%s/%s", userInfoBean.getBattlePassExp(), userInfoBean.getNextLevelExp()));
current.setText(String.format("Lv%s", currentLevel));
balanceDiamond.setText(balance);
balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance") + balance);
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
float exp = new BigDecimal(buyExp).floatValue();
if (exp > 100) {
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("100"));
if (exp > 1) {
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("1"));
buyExp = String.valueOf(buyExpBigDecimal.intValue());
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
orderLevelDiamond.setText("00 = " + buyExp + "00");
orderLevel.setText(buyExp);
}
}
@ -84,15 +89,14 @@ public class OrderLevelPopupWindow extends CenterPopupView {
@Override
public void onClick(View view) {
float exp = new BigDecimal(buyExp).floatValue();
if (exp < maxExp && exp < 10000) {
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100"));
if (exp < maxExp && (exp + 1) < 10000) {
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("1"));
buyExp = String.valueOf(buyExpBigDecimal.intValue());
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
orderLevelDiamond.setText("00 = " + buyExp + "00");
orderLevel.setText(buyExp);
} else if (exp >= maxExp) {
ToastUtil.show(WordUtil.isNewZh() ? "经验已滿" : "Experience full");
ToastUtil.show(WordUtil.isNewZh() ? "經驗超出,僅需" + maxExp + "經驗可達滿级" : "Exp exceeds.Only " + maxExp + " exp is needed to reach the max level.");
}
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@ -101,14 +105,34 @@ public class OrderLevelPopupWindow extends CenterPopupView {
dialog.dismiss();
}
});
orderLevel.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
buyExp = charSequence.toString();
orderLevelDiamond.setText("00 = " + charSequence.toString() + "00");
}
@Override
public void afterTextChanged(Editable editable) {
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.buying_experience), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
LiveNetManager.get(getContext())
.buyingExperiencePoint(buyExp, new HttpCallback<ResponseModel<Object>>() {
if(StringUtil.isEmpty(orderLevel.getText().toString())||"0".equals(orderLevel.getText().toString())){
ToastUtil.show(WordUtil.isNewZh()?"输入数字不可为0":"The input number cannot be 0");
return;
}
if (Integer.parseInt(orderLevel.getText().toString()+"00") <= maxExp) {
LiveNetManager.get(getContext()).buyingExperiencePoint(buyExp + "00", new HttpCallback<ResponseModel<Object>>() {
@Override
public void onSuccess(ResponseModel<Object> data) {
if (orderLevelCallback != null) {
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
}
@ -123,15 +147,17 @@ public class OrderLevelPopupWindow extends CenterPopupView {
dialog.dismiss();
}
});
} else {
ToastUtil.show(WordUtil.isNewZh() ? "經驗超出,僅需" + maxExp + "經驗可達滿级" : "Exp exceeds.Only " + maxExp + " exp is needed to reach the max level.");
}
}
});
IMLoginManager.get(getContext())
.updateUserCoin(new OnItemClickListener<JSONObject>() {
IMLoginManager.get(getContext()).updateUserCoin(new OnItemClickListener<JSONObject>() {
@Override
public void onItemClick(JSONObject bean, int position) {
if (bean != null) {
balance = bean.getString("coin");
balanceDiamond.setText(balance);
balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance") + balance);
}
}
});

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -1,10 +1,22 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.sud.state.SudMGPMGState;
public class CheckRemainingBalanceEvent extends BaseModel {
public int seatIndex=0;
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() {
return SudMGPMGState;
@ -23,4 +35,13 @@ public class CheckRemainingBalanceEvent extends BaseModel {
this.seatIndex = seatIndex;
return this;
}
public CheckRemainingBalanceEvent setSubReady(boolean subReady){
this.subReady = subReady;
return this;
}
public boolean getSubReady(){
return subReady;
}
}

View File

@ -243,10 +243,11 @@ public class LiveHttpUtil {
/**
* 举报用户 + 图片
*/
public static void setReport(String touid, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
public static void setReport(String touid,String report_argument, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.setReport", LiveHttpConsts.SET_REPORT)
.isMultipart(true)
.params("touid", touid)
.params("report_argument", report_argument)
.params("content", content);
if (file1 != null) {
request.params("file1", file1);

View File

@ -74,6 +74,8 @@ import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.SlideInBannerModel;
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.SudRoomListModel;
import com.yunbao.common.bean.SudgameCodeModel;
@ -1026,6 +1028,22 @@ public interface PDLiveApi {
@GET("/api/public/?service=Sudgame.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
);
/**
* 创建游戏房
*
@ -1198,7 +1216,7 @@ public interface PDLiveApi {
Observable<ResponseModel<GuardGetGuardOpenInfoModel>> getGuardOpenInfo(@Query("liveuid") String liveUid);
@GET("/api/public/?service=Guard.openGuard")
Observable<ResponseModel<Object>> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey, @Query("stream") String stream);
Observable<ResponseModel<Object>> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey, @Query("stream") String stream,@Query("coupon_type") String coupon_type,@Query("coupon_id") String coupon_id);
@GET("/api/public/?service=Guard.sendMoneyLong")
Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum);

View File

@ -72,6 +72,8 @@ import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.SetAttentsModel;
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.SudRoomListModel;
import com.yunbao.common.bean.SudgameCodeModel;
@ -2297,6 +2299,48 @@ public class LiveNetManager {
}).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) {
API.get().pdLiveApi(mContext)
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
@ -3017,9 +3061,9 @@ public class LiveNetManager {
}
public void openGuard(String liveUid, String guardType, String priceKey, String stream, HttpCallback<String> callback) {
public void openGuard(String liveUid, String guardType, String priceKey, String stream,String coupon_type,String couponId, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.openGuard(liveUid, guardType, priceKey, stream)
.openGuard(liveUid, guardType, priceKey, stream,coupon_type,couponId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<Object>>() {

View File

@ -3,7 +3,7 @@ package com.yunbao.common.pay.samsung;
import android.content.Context;
import com.google.gson.Gson;
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
import com.samsung.android.sdk.iap.lib.constants.HelperDefine;
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
@ -11,6 +11,8 @@ import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
import com.samsung.android.sdk.iap.lib.vo.PurchaseVo;
import com.yunbao.common.R;
import com.yunbao.common.utils.L;
import java.util.ArrayList;
@ -57,8 +59,26 @@ public class SamsungUtil {
*/
public void buy(String skuId, OnPaymentListener onPaymentListener) {
//购买
iapHelper.startPayment(skuId, "", onPaymentListener);
iapHelper.startPayment(skuId, "", (errorVo, purchaseVo) -> {
if (purchaseVo != null) {
onPaymentListener.onPaymentSuccess(purchaseVo.getPurchaseId());
} else {
if (errorVo.getErrorCode() == HelperDefine.IAP_PAYMENT_IS_CANCELED) {
onPaymentListener.onPaymentFailed(mContext.getString(R.string.pay_cancel));
} else {
onPaymentListener.onPaymentFailed(errorVo.getErrorString());
}
}
});
}
public interface OnPaymentListener {
void onPaymentSuccess(String purchaseVo);
void onPaymentFailed(String errorVo);
}
/**
* 消耗指定商品

View File

@ -17,11 +17,13 @@ import com.yunbao.common.sud.decorator.SudFSTAPPDecorator;
import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.model.GameViewInfoModel;
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.SudJsonUtils;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import tech.sud.logger.LogUtils;
import tech.sud.mgp.core.ISudFSMStateHandle;
import tech.sud.mgp.core.ISudFSTAPP;
import tech.sud.mgp.core.ISudListenerInitSDK;
@ -479,4 +481,13 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
return sudFSMMGDecorator.getSudFSMMGCache();
}
/**
* 游戏结算状态
*/
@Override
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
LogUtils.e("yqw=====>"+model);
}
}

View File

@ -6,8 +6,13 @@ import android.view.View;
import androidx.lifecycle.MutableLiveData;
import com.blankj.utilcode.util.LogUtils;
import com.yunbao.common.CommonAppConfig;
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.http.base.HttpCallback;
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.GameViewInfoModel;
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.Locale;
import java.util.function.Consumer;
import tech.sud.mgp.core.ISudFSMMG;
import tech.sud.mgp.core.ISudFSMStateHandle;
@ -62,6 +72,22 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
public String languageCode = "zh-TW";
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
@ -70,7 +96,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
languageCode = "zh-TW";
}else {
} else {
languageCode = "en-US";
}
// 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(接入方定义)
*/
@ -255,7 +356,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
@Override
public void onGameMGCommonGameState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameState model) {
super.onGameMGCommonGameState(handle, model);
Log.e("QuickStartGameViewModel",model.toString());
Log.e("QuickStartGameViewModel", model.toString());
}
}

View File

@ -8,6 +8,7 @@ package com.yunbao.common.sud.decorator;
import android.util.Log;
import com.blankj.utilcode.util.LogUtils;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
@ -177,11 +178,11 @@ public class SudFSMMGDecorator implements ISudFSMMG {
} else {
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;
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
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) {
// ISudFSMStateHandleUtils.handleSuccess(handle);
// } else {
@ -258,7 +259,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
// } else {
// 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;
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表2021-12-30新增现在只支持碰碰我最强
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);

View File

@ -170,6 +170,15 @@ public class SudMGPMGState implements Serializable {
// 游戏结果玩家列表
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 String killerId; // 杀自己的玩家的id
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 +
'}';
}
}
}

View File

@ -2,8 +2,8 @@ package com.yunbao.common.utils;
import android.app.Activity;
import android.util.Log;
import com.yunbao.common.BuildConfig;
import com.yunbao.common.manager.OpenAdManager;
import java.util.Stack;

View File

@ -4,8 +4,13 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;
import com.yunbao.common.CommonAppContext;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -37,9 +42,8 @@ public class SpUtil {
public static final String ANCHOR_PK_TIME = "anchorPkTime";
//播放短视频上下滑动引导页
public static final String READ_VIDEO_GUIDE = "readVideoGuide";
public static final String MESSAGE_SYS_DEL = "FIRST_DEL";
public static final String LIVE_GAME_NEWED_LIST = "LIVE_GAME_NEWED_LIST";
public SpUtil() {
mSharedPreferences = CommonAppContext.sInstance.getSharedPreferences("SharedPreferences", Context.MODE_PRIVATE);
@ -56,6 +60,41 @@ public class SpUtil {
return sInstance;
}
public static void setLiveGameId(String gameId) {
String gameMap = getStringValue(LIVE_GAME_NEWED_LIST);
List<String> gameNewList;
gameNewList = JSONArray.parseArray(gameMap, String.class);
L.eSw("gameMap:" + gameMap);
if (gameNewList == null) {
gameNewList = new ArrayList<>();
}
for (int i = 0; i < gameNewList.size(); i++) {
if (gameNewList.get(i).equals(gameId)) {
gameNewList.remove(i);
break;
}
}
gameNewList.add(gameId);
setStringValue(LIVE_GAME_NEWED_LIST, new Gson().toJson(gameNewList));
}
public static boolean isLiveGameNew(String gameId) {
String gameMap = getStringValue(LIVE_GAME_NEWED_LIST);
List<String> gameNewList = new ArrayList<>();
gameNewList = JSONArray.parseArray(gameMap, String.class);
if (gameNewList == null) {
gameNewList = new ArrayList<>();
}
boolean isNew = false;
for (int i = 0; i < gameNewList.size(); i++) {
if (gameNewList.get(i).equals(gameId)) {
isNew = true;
}
}
return !isNew;
}
/**
* 保存一个字符串
*/

View File

@ -0,0 +1,67 @@
package com.yunbao.common.views;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class InteractionGamesChildBottomViewHolder extends RecyclerView.ViewHolder {
private RoundedImageView funGamePic;
private TextView funGameName;
private Context mContext;
public InteractionGamesChildBottomViewHolder(@NonNull View itemView, Context context) {
super(itemView);
this.mContext = context;
funGamePic = itemView.findViewById(R.id.fun_game_pic);
funGameName = itemView.findViewById(R.id.fun_game_name);
}
public void setData(CustomSidebarChildModel model, boolean rigts) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
ViewGroup.LayoutParams.WRAP_CONTENT);
itemView.setLayoutParams(layoutParams);
if (rigts) {
ImgLoader.display(itemView.getContext(), model.getIcon(), funGamePic);
} else {
ImgLoader.display(itemView.getContext(), model.getResIcon(), funGamePic);
}
funGameName.setText(model.getTitle());
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")&& SpUtil.isLiveGameNew(model.getId())){
itemView.findViewById(R.id.icon_new_game).setVisibility(View.VISIBLE);
}else {
itemView.findViewById(R.id.icon_new_game).setVisibility(View.GONE);
}
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (interactionGamesCallBack != null) {
interactionGamesCallBack.onItemViewClicks(model, rigts);
}
}
});
}
private InteractionGamesCallBack interactionGamesCallBack;
public void setItemViewClicks(InteractionGamesCallBack callBack) {
interactionGamesCallBack = callBack;
}
public interface InteractionGamesCallBack {
void onItemViewClicks(CustomSidebarChildModel model, boolean rigts);
}
}

View File

@ -1,40 +1,48 @@
package com.yunbao.common.views;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder {
private ImageView funGamePic;
private RoundedImageView funGamePic;
private TextView funGameName;
private Context mContext;
public InteractionGamesChildViewHolder(@NonNull View itemView) {
public InteractionGamesChildViewHolder(@NonNull View itemView,Context mContext) {
super(itemView);
this.mContext = mContext;
funGamePic = itemView.findViewById(R.id.fun_game_pic);
funGameName = itemView.findViewById(R.id.fun_game_name);
}
public void setData(CustomSidebarChildModel model, boolean rigts) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
ViewGroup.LayoutParams.WRAP_CONTENT);
itemView.setLayoutParams(layoutParams);
if (rigts) {
ImgLoader.display(itemView.getContext(), model.getIcon(), funGamePic);
} else {
ImgLoader.display(itemView.getContext(), model.getResIcon(), funGamePic);
}
funGameName.setText(model.getTitle());
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")){
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")&& SpUtil.isLiveGameNew(model.getId())){
itemView.findViewById(R.id.icon_new_game).setVisibility(View.VISIBLE);
}else {
itemView.findViewById(R.id.icon_new_game).setVisibility(View.GONE);
@ -45,8 +53,6 @@ public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder {
if (interactionGamesCallBack != null) {
interactionGamesCallBack.onItemViewClicks(model, rigts);
}
}
});
}

View File

@ -1,6 +1,8 @@
package com.yunbao.common.views;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
@ -25,21 +27,22 @@ public class LiveNewRoleFunGamesViewHolder extends RecyclerView.ViewHolder {
private RecyclerView childList;
private ImageView selectMoreIcon;
boolean isShowMore = true;
private Context mContext;
public LiveNewRoleFunGamesViewHolder(@NonNull View itemView) {
public LiveNewRoleFunGamesViewHolder(@NonNull View itemView, Context context) {
super(itemView);
this.mContext = context;
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
selectMoreIcon = itemView.findViewById(R.id.select_more_icon);
selectMore = itemView.findViewById(R.id.select_more);
funGamesAdapter = new NewRoleFunGamesAdapter(itemView.getContext(),true);
funGamesAdapter = new NewRoleFunGamesAdapter(itemView.getContext(), true);
childList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
childList.setAdapter(funGamesAdapter);
}
public void setData(CustomSidebarInfoModel model) {
List<CustomSidebarChildModel> sidebarChildModels = model.getChild();
itemView.findViewById(R.id.select_more_layout).setVisibility(sidebarChildModels.size() >= 8 ? View.VISIBLE : View.GONE);
sendGoodGift.setText(model.getTitle());

View File

@ -1,11 +1,13 @@
package com.yunbao.common.views;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
@ -21,14 +23,14 @@ public class LiveNewRoleInteractionGamesViewHolder extends RecyclerView.ViewHold
private RecyclerView childList;
private ImageView selectMoreIcon;
boolean isShowMore = true;
public LiveNewRoleInteractionGamesViewHolder(@NonNull View itemView) {
public LiveNewRoleInteractionGamesViewHolder(@NonNull View itemView, Context context) {
super(itemView);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
selectMoreIcon = itemView.findViewById(R.id.select_more_icon);
funGamesAdapter = new LiveNewRoleInteractionGamesAdapter(itemView.getContext(), true);
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
childList.setLayoutManager(layoutManager);
childList.setAdapter(funGamesAdapter);
}

View File

@ -1,10 +1,13 @@
package com.yunbao.common.views;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
@ -21,19 +24,21 @@ public class LiveNewRoleRigtsInterestsViewHolder extends RecyclerView.ViewHolder
private TextView sendGoodGift;
private RecyclerView childList;
private boolean showRed = false;
public LiveNewRoleRigtsInterestsViewHolder(@NonNull View itemView,boolean showRed) {
private Context mContext;
public LiveNewRoleRigtsInterestsViewHolder(@NonNull View itemView, boolean showRed,Context mContext) {
super(itemView);
this.mContext = mContext;
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
funGamesAdapter = new LiveNewRoleFunGamesAdapter(itemView.getContext(), false,showRed);
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
LinearLayoutManager layoutManager = new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false);
childList.setLayoutManager(layoutManager);
childList.setAdapter(funGamesAdapter);
}
public void setData(CustomSidebarInfoModel model) {
sendGoodGift.setText(model.getTitle());
funGamesAdapter.updateData(generateData());
}

View File

@ -2,6 +2,8 @@ package com.yunbao.common.views;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
@ -11,6 +13,7 @@ import androidx.annotation.NonNull;
import androidx.lifecycle.Observer;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.LogUtils;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView;
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.CustomSidebarChildModel;
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.HideShowEvent;
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
@ -31,9 +38,11 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.model.GameViewInfoModel;
import com.yunbao.common.sud.state.SudMGPAPPState;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -57,6 +66,9 @@ public class LiveSudGamePopup extends BottomPopupView {
private TextView gameTitle, roomName, roomNumber;
private RoundedImageView mAvatar;
private boolean selfClick = false;
private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗
private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗
private SudLoadDialog sudLoadDialog;//加载弹窗
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
super(context);
@ -69,7 +81,22 @@ public class LiveSudGamePopup extends BottomPopupView {
mCreateSudRoomModel = createSudRoomModel;
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
//第二次进入时viewmodel数据丢失所以初始化时直接获取
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),getActivity());
IMLoginManager.get(context).setSudGame("");
// 设置游戏安全操作区域
GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel();
gameViewRectModel.left = 0;
gameViewRectModel.top = DpUtil.dp2px(50); //游戏安全区域
gameViewRectModel.right = 0;
gameViewRectModel.bottom = DpUtil.dp2px(30);
gameViewModel.gameViewRectModel = gameViewRectModel;
//初始化结算弹窗
sudGameDoubleDialog = new SudGameDoubleDialog(context);//双人游戏
sudGameMultipleDialog = new SudGameMultipleDialog(context);//多人游戏
sudLoadDialog = new SudLoadDialog(context);//加载弹窗
}
// 返回自定义弹窗的布局
@ -98,7 +125,7 @@ public class LiveSudGamePopup extends BottomPopupView {
gameTitle.setText(mCreateSudRoomModel.getSudGameName());
roomName.setText(mCreateSudRoomModel.getRoomName());
roomNumber.setText(mCreateSudRoomModel.getSudGameRoomId());
ImgLoader.display(getContext(), mCreateSudRoomModel.getAvatar(), mAvatar);
//ImgLoader.display(getContext(), mCreateSudRoomModel.getAvatar(), mAvatar);
}
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
@ -166,6 +193,7 @@ public class LiveSudGamePopup extends BottomPopupView {
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
gameConfigModel.ui.level.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.join_btn.custom = true;
@ -173,6 +201,29 @@ public class LiveSudGamePopup extends BottomPopupView {
gameConfigModel.ui.start_btn.custom = true;
// SudMGP平台64bit游戏ID
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<>();
@ -225,11 +276,14 @@ public class LiveSudGamePopup extends BottomPopupView {
switch (event.getSudMGPMGState()) {
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_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
public void onSuccess(CheckRemainingBalance data) {
if (data.getGoldenBeanRemainingBalance() == 1) {
public void onSuccess(SudGameScoreBean data) {
if (data.getGolden_bean_remaining_balance() == 1) {
gameViewModel.setSudGameScoreBean(data);
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfReady(event.getSubReady());
} else {
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("貨幣数量不足 ");
@ -251,9 +305,31 @@ public class LiveSudGamePopup extends BottomPopupView {
});
break;
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
//结算状态
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;
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
//点击开始游戏
LiveNetManager.get(getContext()).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
mCreateSudRoomModel.getSudGameRoomId(), new
HttpCallback<CheckRemainingBalance>() {
@ -279,9 +355,9 @@ public class LiveSudGamePopup extends BottomPopupView {
break;
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameStatus(SubGameEvent event) {
if (event.getType() == 0) {

View File

@ -1,8 +1,10 @@
package com.yunbao.common.views;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
@ -27,8 +29,10 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder {
private View red_point;
private boolean showRed = false;
private View total_image_red_point;
public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed) {
private Context mContext;
public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed, Context mContext) {
super(itemView);
this.mContext = mContext;
this.showRed = showRed;
funGamePic = itemView.findViewById(R.id.fun_game_pic);
funGameName = itemView.findViewById(R.id.fun_game_name);

View File

@ -27,7 +27,7 @@ public class RigtsInterestsViewHolder extends RecyclerView.ViewHolder {
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
childList = itemView.findViewById(R.id.child_list);
funGamesAdapter = new FunGamesAdapter(itemView.getContext(), false);
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 3));
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
childList.setAdapter(funGamesAdapter);
}

View File

@ -4,6 +4,7 @@ import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
@ -25,15 +26,19 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
private FrameLayout user_layout;
private RoundedImageView sud_game_user;
private LinearLayout layout;
private TextView userName;
private FrameLayout vacancy_sud_gameLayout;
public SudGameUserListViewHolder(@NonNull View itemView) {
super(itemView);
vacancy_sud_game = itemView.findViewById(R.id.vacancy_sud_game);
vacancy_sud_gameLayout = itemView.findViewById(R.id.vacancy_sud_gameLayout);
sud_game_user = itemView.findViewById(R.id.sud_game_user);
user_layout = itemView.findViewById(R.id.user_layout);
mic_status = itemView.findViewById(R.id.mic_status);
layout = itemView.findViewById(R.id.layout);
game_status = itemView.findViewById(R.id.game_status);
userName= itemView.findViewById(R.id.userName);
}
public void upData(SudGameUserModel sudGameUserModel, SudGameUserListAdapter.SudGameSmallCallBack sudGameSmallCallBack, int position) {
@ -46,7 +51,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
// }
// });
if (sudGameUserModel.isNullUser()) {
vacancy_sud_game.setVisibility(View.VISIBLE);
vacancy_sud_gameLayout.setVisibility(View.VISIBLE);
user_layout.setVisibility(View.GONE);
ViewClicksAntiShake.clicksAntiShake(vacancy_sud_game, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
@ -55,7 +60,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
}
});
} else {
vacancy_sud_game.setVisibility(View.GONE);
vacancy_sud_gameLayout.setVisibility(View.GONE);
user_layout.setVisibility(View.VISIBLE);
ImgLoader.display2(itemView.getContext(), sudGameUserModel.getAvatar(), sud_game_user);
if (sudGameUserModel.getMicStatus() == 2) {
@ -71,6 +76,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
} else {
game_status.setVisibility(View.GONE);
}
userName.setText(sudGameUserModel.getUserNicename());
ViewClicksAntiShake.clicksAntiShake(user_layout, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {

View File

@ -27,6 +27,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.R;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.BitmapUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.SVGAViewUtils;
import org.jetbrains.annotations.NotNull;
@ -56,6 +57,8 @@ public class NobleNoticeView extends FrameLayout {
private HorizontalScrollView contextLayout;
private RelativeLayout scrollLayout;
private ImageView nobleIcon;
private String anchorUid;
private String mLiveId;
public NobleNoticeView(@NonNull Context context) {
super(context);
@ -97,9 +100,11 @@ public class NobleNoticeView extends FrameLayout {
});
}
public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid) {
public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid,String mLiveId) {
this.uhead = uHead;
this.anchorNicknameStr = anchorNicknameStr.trim();
this.anchorUid = anchorUid;
this.mLiveId = mLiveId;
userName.setText(userNameStr);
anchorNickname.setText(anchorNicknameStr.trim());
if (TextUtils.isEmpty(anchorNicknameStr.trim())) {
@ -112,6 +117,10 @@ public class NobleNoticeView extends FrameLayout {
findViewById(R.id.anchor_nickname).setVisibility(VISIBLE);
openNoble.setText(mContext.getString(R.string.open_noble));
}
if(anchorUid.equals(mLiveId)){
L.eSw("showBuyVipMessage:"+anchorUid+"__"+mLiveId);
gotoRoomView.setVisibility(GONE);
}
return this;
}
@ -352,13 +361,15 @@ public class NobleNoticeView extends FrameLayout {
gotoRoomView.setLayoutParams(layoutParams);
contextLayout.setLayoutParams(contextLayoutParams);
if (!TextUtils.isEmpty(anchorNicknameStr)) {
if(mLiveId.equals(anchorUid)){
gotoRoomView.setVisibility(GONE);
}else{
gotoRoomView.setVisibility(VISIBLE);
}
findViewById(R.id.in).setVisibility(VISIBLE);
findViewById(R.id.anchor_nickname).setVisibility(VISIBLE);
}
contextLayout.setVisibility(VISIBLE);
});
}

View 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%"
/>

View 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%"
/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="360dp" />
<corners android:radius="10dp" />
<solid android:color="#B3414141" />
</shape>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
<solid android:color="#201E1A" />
<solid android:color="#292929" />
</shape>

View 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="7dp" />
<solid android:color="#B3414141" />
</shape>

View File

@ -14,7 +14,7 @@
<clip android:clipOrientation="horizontal">
<shape>
<corners android:radius="3dp" />
<solid android:color="#CE2BFF" />
<solid android:color="#936EFF" />
</shape>
</clip>
</item>

View 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>

View File

@ -2,6 +2,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#201E1A"
android:orientation="vertical">
@ -14,17 +16,25 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<LinearLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_width="138dp"
android:layout_height="38dp"
android:layout_marginStart="23dp"
android:layout_marginTop="48dp"
android:background="@drawable/bg_live_sud_game_top_new"
android:gravity="start|center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="10dp"
android:scaleType="centerCrop"
android:src="@mipmap/live_dialog_top_game_icon"
android:visibility="visible"
tools:visibility="visible"
app:riv_oval="true" />
<LinearLayout
android:layout_width="wrap_content"
@ -69,30 +79,27 @@
</LinearLayout>
<LinearLayout
android:layout_width="98dp"
android:layout_width="88dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="49dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="55dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/sud_history"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="14dp"
android:src="@mipmap/icon_sud_history_live_new" />
<TextView
<ImageView
android:id="@+id/exit"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/bg_live_sud_game_back_new"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@mipmap/bg_live_sud_game_back_new2"
android:gravity="center"
android:text="@string/video_exit"
android:textColor="#FFFFFF"
android:textSize="12sp" />
android:textSize="8sp" />
</LinearLayout>
<LinearLayout
@ -131,10 +138,8 @@
android:id="@+id/game_seat"
android:layout_width="34dp"
android:layout_height="34dp"
android:src="@mipmap/icon_game_seat" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
@ -146,13 +151,13 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="98dp">
android:layout_height="50dp"
android:layout_marginTop="93dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_list"
android:layout_marginStart="11dp"
android:layout_marginEnd="20dp"
android:layout_marginEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="310dp"
android:layout_height="260dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="243dp"
android:background="@drawable/guard_buy_tips_bg">
<ImageView
android:id="@+id/btn_cancel"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/icon_guard_buy_tips_close" />
<com.flyjingfish.gradienttextviewlib.GradientTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:letterSpacing="0.1"
android:text="@string/dialog_tip"
android:textSize="22dp"
app:gradient_angle="45"
app:gradient_endColor="#F9E1AE"
app:gradient_startColor="#C28413" />
<TextView
android:id="@+id/content2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:letterSpacing="0.1"
android:text="@string/current_guard_expires"
android:textColor="#FFE0BF"
android:textSize="14dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content">
<TextView
android:id="@+id/btn_cancel1"
android:layout_width="100dp"
android:gravity="center"
android:layout_height="38dp"
android:textColor="#F7F7F7"
android:textSize="15sp"
android:textStyle="bold"
android:background="@mipmap/guard_buy_tips_cancel_bg"
android:letterSpacing="0.1"
android:text="@string/live_guard_buy_coupon_tips_cancel" />
<TextView
android:layout_marginLeft="40dp"
android:id="@+id/btn_confirm"
android:layout_width="100dp"
android:gravity="center"
android:layout_height="38dp"
android:textColor="#893D0D"
android:textSize="15sp"
android:textStyle="bold"
android:background="@drawable/guard_buy_tips_sure_bg"
android:letterSpacing="0.1"
android:text="@string/live_guard_buy_coupon_tips_use" />
</LinearLayout>
</RelativeLayout>

View File

@ -1,19 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="650dp"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_live_sud_list"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/game_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="14dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/game_title"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
@ -22,6 +35,80 @@
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_marginLeft="10dp"
android:layout_width="121dp"
android:layout_height="39dp"
android:padding="2dp"
android:background="@drawable/dialog_live_sud_game_name_bg"
android:gravity="center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="6dp"
android:scaleType="centerCrop"
android:src="@mipmap/live_dialog_top_game_icon"
android:visibility="visible"
tools:visibility="visible"
app:riv_oval="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:visibility="gone"
android:ellipsize="end"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxWidth="98dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_number"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
@ -42,94 +129,15 @@
android:src="@mipmap/icon_min_game_new"
android:visibility="visible" />
<TextView
<ImageView
android:id="@+id/exit"
android:layout_width="30dp"
android:layout_marginEnd="12dp"
android:layout_height="30dp"
android:background="@drawable/bg_live_sud_game_back_new2"
android:background="@mipmap/bg_live_sud_game_back_new2"
android:gravity="center"
android:text="@string/video_exit"
android:textColor="#FFFFFF"
android:textSize="8sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/game_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="175dp"
android:layout_height="50dp"
android:layout_marginStart="15dp"
android:layout_marginTop="16dp"
android:background="@drawable/bg_live_sud_game_top"
android:gravity="center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="6dp"
android:scaleType="centerCrop"
android:visibility="gone"
app:riv_oval="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="4dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxWidth="98dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_number"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</FrameLayout>

View 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>

View 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>

View 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>

View File

@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="218dp"
android:layout_height="240dp"
android:id="@+id/root"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
android:background="@drawable/background_order_dialog"
@ -39,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="46dp"
android:text="Lv7"
android:textColor="#CE2BFF"
android:textColor="#2439B9"
android:textSize="14sp" />
<androidx.constraintlayout.widget.ConstraintLayout
@ -66,6 +67,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#000"
android:layout_marginRight="7dp"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -75,23 +77,23 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:gravity="center"
android:layout_marginTop="10dp"
android:layout_height="wrap_content"
android:text="@string/buying_experience_point"
android:textColor="#0D21B2"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buying_experience_point"
android:textColor="#0D21B2"
android:textSize="14sp" />
<LinearLayout
android:layout_width="90dp"
android:layout_height="25dp"
@ -103,7 +105,7 @@
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
<EditText
android:id="@+id/tickets_plus_minus"
android:layout_width="0dp"
android:layout_height="match_parent"
@ -111,6 +113,8 @@
android:background="@null"
android:gravity="center"
android:imeOptions="actionSend"
android:maxEms="4"
android:maxLength="4"
android:inputType="number"
android:singleLine="true"
android:text="0"
@ -129,8 +133,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="100"
android:textColor="#0D21B2"
android:text="00 = 100"
android:textColor="#000000"
android:textSize="11sp" />
<ImageView

View File

@ -38,7 +38,9 @@
<ImageView
android:id="@+id/btn_close"
android:layout_width="50dp"
android:layout_marginLeft="-35dp"
android:layout_height="50dp"
android:layout_toRightOf="@+id/layout"
android:paddingBottom="30dp"
android:src="@mipmap/icon_live_close_3" />

View File

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:paddingEnd="7dp"
android:gravity="start"
android:orientation="vertical">
<!--身份特权-->
<RelativeLayout
android:layout_width="40dp"
android:layout_width="55dp"
android:layout_height="40dp">
<!--普通工具合集-->
<ImageView
@ -27,7 +27,6 @@
android:layout_height="6dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="3dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_red_point"
tools:visibility="visible" />
@ -35,10 +34,11 @@
<TextView
android:id="@+id/fun_game_name"
android:layout_width="wrap_content"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/guard_guard"
android:gravity="center"
android:textColor="#9A9A9A"
android:textSize="10sp" />

View File

@ -39,9 +39,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" />
<LinearLayout

View File

@ -23,16 +23,13 @@
android:textColor="#F6F7FB"
android:textSize="14sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginBottom="16dp" />
<LinearLayout

View File

@ -16,13 +16,12 @@
<RelativeLayout
android:layout_width="50dp"
android:layout_height="50dp">
<!--普通工具合集-->
<ImageView
android:id="@+id/fun_game_pic"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@mipmap/live_more_icon_guard" />
@ -63,6 +62,6 @@
android:maxLines="1"
android:text="@string/guard_guard"
android:textColor="#9A9A9A"
android:textSize="14sp" />
android:textSize="10sp" />
</LinearLayout>

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:paddingEnd="30dp"
android:clickable="true"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/fun_game_pic"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@mipmap/live_more_icon_guard" />
<TextView
@ -21,6 +20,6 @@
android:layout_marginTop="2dp"
android:text="@string/guard_guard"
android:textColor="#9A9A9A"
android:textSize="14sp" />
android:textSize="10sp" />
</LinearLayout>

View File

@ -4,63 +4,70 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="7dp"
android:gravity="center"
android:gravity="start"
android:orientation="vertical">
<FrameLayout
android:layout_width="60dp"
<LinearLayout
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_height="wrap_content">
<ImageView
<RelativeLayout
android:layout_width="55dp"
android:layout_height="wrap_content">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/fun_game_pic"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@mipmap/live_more_icon_guard" />
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@mipmap/live_more_icon_guard"
android:visibility="visible"
app:riv_oval="true" />
<View
android:id="@+id/red_point"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="end"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentEnd="true"
android:background="@drawable/bg_red_point"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="gone" />
tools:visibility="visible" />
<ImageView
android:id="@+id/icon_new_game"
android:layout_width="26dp"
android:layout_height="13dp"
android:layout_width="23dp"
android:layout_height="10dp"
android:layout_gravity="end"
android:layout_marginTop="2dp"
android:layout_alignParentEnd="true"
android:visibility="gone"
android:layout_marginEnd="5dp"
tools:visibility="visible"
android:src="@mipmap/icon_new_game" />
</FrameLayout>
</RelativeLayout>
<TextView
android:id="@+id/fun_game_name"
android:layout_width="match_parent"
android:gravity="center"
android:layout_marginStart="1dp"
android:layout_marginEnd="1dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:gravity="center"
android:maxLines="1"
android:text="@string/guard_guard"
android:textColor="#9A9A9A"
app:autoSizeMaxTextSize="14sp"
app:autoSizeMinTextSize="5sp"
app:autoSizeStepGranularity="1sp"
app:autoSizeTextType="uniform"
android:textSize="10sp" />
</LinearLayout>
android:textSize="14sp" />
</LinearLayout>

View File

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginStart="15dp"
android:orientation="vertical">
<FrameLayout

View File

@ -2,12 +2,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="14dp">
<TextView
@ -23,5 +23,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp" />
</LinearLayout>

View File

@ -2,12 +2,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="14dp">
<TextView
@ -23,7 +23,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:overScrollMode="never" />
<LinearLayout
android:id="@+id/select_more_layout"

View File

@ -26,6 +26,7 @@
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_list"
android:layout_marginLeft="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" />

View 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>

View File

@ -3,50 +3,73 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical">
<FrameLayout
android:id="@+id/vacancy_sud_gameLayout"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:visibility="visible">
<ImageView
android:id="@+id/vacancy_sud_game"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="12dp"
android:src="@mipmap/icon_vacancy_sud_game"
android:visibility="visible" />
android:layout_width="34dp"
android:layout_height="50dp"
android:paddingBottom="5dp"
android:layout_marginStart="15dp"
android:src="@mipmap/icon_vacancy_sud_game" />
</FrameLayout>
<FrameLayout
android:id="@+id/user_layout"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_height="50dp"
android:visibility="visible">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/sud_game_user"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginTop="5dp"
android:layout_marginStart="15dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_vacancy_sud_game"
app:riv_oval="true" />
<ImageView
android:id="@+id/mic_status"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_width="9dp"
android:layout_height="9dp"
android:layout_marginTop="3dp"
android:layout_marginStart="15dp"
android:src="@mipmap/icon_game_close_wheat_mute" />
<ImageView
android:id="@+id/game_status"
android:layout_width="18dp"
android:layout_height="14dp"
android:layout_marginStart="5dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_width="17dp"
android:layout_height="11dp"
android:layout_marginTop="31dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_game_status" />
<TextView
android:id="@+id/userName"
android:text="用户名"
android:layout_marginTop="40dp"
android:ellipsize="end"
android:visibility="gone"
android:maxLines="1"
android:gravity="center"
android:textColor="#333333"
android:layout_marginStart="8dp"
android:textSize="8dp"
android:layout_gravity="center_horizontal"
android:layout_width="34dp"
android:layout_height="wrap_content"/>
</FrameLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

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