diff --git a/FaceUnity/build.gradle b/FaceUnity/build.gradle index 6a51680ba..b3c1d111c 100644 --- a/FaceUnity/build.gradle +++ b/FaceUnity/build.gradle @@ -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 { diff --git a/FaceUnity/src/main/AndroidManifest.xml b/FaceUnity/src/main/AndroidManifest.xml index 220544321..00f2e62ea 100644 --- a/FaceUnity/src/main/AndroidManifest.xml +++ b/FaceUnity/src/main/AndroidManifest.xml @@ -1,7 +1,5 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/IAP6Helper/build.gradle b/IAP6Helper/build.gradle index 29919cb60..0f459a391 100644 --- a/IAP6Helper/build.gradle +++ b/IAP6Helper/build.gradle @@ -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']) } \ No newline at end of file diff --git a/IAP6Helper/src/main/AndroidManifest.xml b/IAP6Helper/src/main/AndroidManifest.xml index b5f9f1046..5555ec35e 100644 --- a/IAP6Helper/src/main/AndroidManifest.xml +++ b/IAP6Helper/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ diff --git a/IAP6Helper/src/main/java/com/samsung/android/sdk/iap/lib/helper/IapHelper.java b/IAP6Helper/src/main/java/com/samsung/android/sdk/iap/lib/helper/IapHelper.java index 7e5ad8a55..a31cce9b8 100644 --- a/IAP6Helper/src/main/java/com/samsung/android/sdk/iap/lib/helper/IapHelper.java +++ b/IAP6Helper/src/main/java/com/samsung/android/sdk/iap/lib/helper/IapHelper.java @@ -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 mServiceQueue = new ArrayList(); @@ -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, diff --git a/Share/build.gradle b/Share/build.gradle index 3bde860d5..15f70e9d7 100644 --- a/Share/build.gradle +++ b/Share/build.gradle @@ -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 { diff --git a/Share/src/main/AndroidManifest.xml b/Share/src/main/AndroidManifest.xml index 0f2b62f39..3d3b90c8a 100644 --- a/Share/src/main/AndroidManifest.xml +++ b/Share/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/app/build.gradle b/app/build.gradle index ba03faba9..5be59f995 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 10f4ffe34..1c250b06d 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -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 ();} +-ignorewarnings diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index adc2c0efc..009b58ea4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> ();} +-ignorewarnings \ No newline at end of file diff --git a/common/src/main/AndroidManifest.xml b/common/src/main/AndroidManifest.xml index 5b9ff7982..f0de2499e 100644 --- a/common/src/main/AndroidManifest.xml +++ b/common/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/common/src/main/java/com/yunbao/common/adapter/BaseAdapter.java b/common/src/main/java/com/yunbao/common/adapter/BaseAdapter.java index e53971c5b..ba0cc148f 100644 --- a/common/src/main/java/com/yunbao/common/adapter/BaseAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/BaseAdapter.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.List; public abstract class BaseAdapter extends RecyclerView.Adapter { - private Context context; + public Context context; public List data; public BaseAdapter(Context context, List data) { @@ -34,7 +34,7 @@ public abstract class BaseAdapter extends RecyclerView.Adapter extends RecyclerView.Adapter mChild) { + child.clear(); /* if (mChild.size() > 8) { for (int i = 0; i < 8; i++) { diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java index ef0105714..91f5e4ca7 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java @@ -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); } } diff --git a/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java index d473abe0b..9f5e5aaad 100644 --- a/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java @@ -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); } diff --git a/common/src/main/java/com/yunbao/common/adapter/SudGameAdapter.java b/common/src/main/java/com/yunbao/common/adapter/SudGameAdapter.java new file mode 100644 index 000000000..fa2341323 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/SudGameAdapter.java @@ -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 { + public SudGameAdapter(Context context, List 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.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; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/CheckLiveModel.java b/common/src/main/java/com/yunbao/common/bean/CheckLiveModel.java index 4b4f7ca30..2d7d00c3e 100644 --- a/common/src/main/java/com/yunbao/common/bean/CheckLiveModel.java +++ b/common/src/main/java/com/yunbao/common/bean/CheckLiveModel.java @@ -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 { diff --git a/common/src/main/java/com/yunbao/common/bean/ConfigBean.java b/common/src/main/java/com/yunbao/common/bean/ConfigBean.java index ec6d14242..497026ce5 100644 --- a/common/src/main/java/com/yunbao/common/bean/ConfigBean.java +++ b/common/src/main/java/com/yunbao/common/bean/ConfigBean.java @@ -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; diff --git a/common/src/main/java/com/yunbao/common/bean/GuardPriceModel.java b/common/src/main/java/com/yunbao/common/bean/GuardPriceModel.java index 24568f683..bdaebd67e 100644 --- a/common/src/main/java/com/yunbao/common/bean/GuardPriceModel.java +++ b/common/src/main/java/com/yunbao/common/bean/GuardPriceModel.java @@ -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; diff --git a/common/src/main/java/com/yunbao/common/bean/SudGameInfoBean.java b/common/src/main/java/com/yunbao/common/bean/SudGameInfoBean.java new file mode 100644 index 000000000..d47f5fe09 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SudGameInfoBean.java @@ -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 + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/SudGameScoreBean.java b/common/src/main/java/com/yunbao/common/bean/SudGameScoreBean.java new file mode 100644 index 000000000..4742eaec0 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SudGameScoreBean.java @@ -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; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/SudSettleBean.java b/common/src/main/java/com/yunbao/common/bean/SudSettleBean.java new file mode 100644 index 000000000..9738a1e87 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SudSettleBean.java @@ -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 + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/AbsDialogCenterPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/AbsDialogCenterPopupWindow.java index b0b894576..a685192b0 100644 --- a/common/src/main/java/com/yunbao/common/dialog/AbsDialogCenterPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/AbsDialogCenterPopupWindow.java @@ -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(); + } + } } diff --git a/common/src/main/java/com/yunbao/common/dialog/GuardBuyCouponTipsDialog.java b/common/src/main/java/com/yunbao/common/dialog/GuardBuyCouponTipsDialog.java new file mode 100644 index 000000000..38b86f353 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GuardBuyCouponTipsDialog.java @@ -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("您有一張" + + "" + content + "優惠券
" + + "開通/續費" + content + "(1個月)時,
可享" + + "" + coupon + "折" + + "優惠 (折後:" + + "" + coin + "鑽)
" + + "是否使用優惠券?"); + } else { + tips = Html.fromHtml("You have a " + + "" + content + " coupon" + + " When activating/renewing " + content + "(1 month), you can enjoy a" + + " " + coupon + "% " + + "discount (After folding:" + + "" + coin + " diamonds" + + ")Do you want to use coupons?"); + } + 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(); + } + +} diff --git a/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsNewDialog.java b/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsNewDialog.java new file mode 100644 index 000000000..f8742fd99 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GuardBuyTipsNewDialog.java @@ -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(); + } + +} diff --git a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java index 0d64fa8c4..0328ea94f 100644 --- a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java @@ -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,40 +105,62 @@ 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>() { - @Override - public void onSuccess(ResponseModel data) { - - if (orderLevelCallback != null) { - orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg()); - } - dialog.dismiss(); + 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>() { + @Override + public void onSuccess(ResponseModel data) { + if (orderLevelCallback != null) { + orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg()); } + dialog.dismiss(); + } - @Override - public void onError(String error) { - if (orderLevelCallback != null) { - orderLevelCallback.onCallback(102, error); - } - dialog.dismiss(); + @Override + public void onError(String error) { + if (orderLevelCallback != null) { + orderLevelCallback.onCallback(102, error); } - }); + 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() { + @Override + public void onItemClick(JSONObject bean, int position) { + if (bean != null) { + balance = bean.getString("coin"); + balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance:") + balance); + } } }); - IMLoginManager.get(getContext()) - .updateUserCoin(new OnItemClickListener() { - @Override - public void onItemClick(JSONObject bean, int position) { - if (bean != null) { - balance = bean.getString("coin"); - balanceDiamond.setText(balance); - } - } - }); } public interface OrderLevelCallback { diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java b/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java new file mode 100644 index 000000000..96aefe35c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java @@ -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 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 data){ + settleBeans.clear(); + settleBeans.addAll(data); + LogUtils.e("yqw=====>"+settleBeans); + } + + private void sortByWinNum(List list){ + // 按照胜利数排序 settleBeans 列表 + Collections.sort(list, (bean1, bean2) -> { + return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序 + }); + } + + private void destroyDialog(){ + dismiss(); + countDownTimer.cancel(); + countDownTimer = null; + } + +} diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameMultipleDialog.java b/common/src/main/java/com/yunbao/common/dialog/SudGameMultipleDialog.java new file mode 100644 index 000000000..3ad4d68db --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameMultipleDialog.java @@ -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 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 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; + } + +} diff --git a/common/src/main/java/com/yunbao/common/dialog/SudLoadDialog.java b/common/src/main/java/com/yunbao/common/dialog/SudLoadDialog.java new file mode 100644 index 000000000..d0e074dcc --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/SudLoadDialog.java @@ -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; + } +} diff --git a/common/src/main/java/com/yunbao/common/event/CheckRemainingBalanceEvent.java b/common/src/main/java/com/yunbao/common/event/CheckRemainingBalanceEvent.java index 09471d14f..928b1e46a 100644 --- a/common/src/main/java/com/yunbao/common/event/CheckRemainingBalanceEvent.java +++ b/common/src/main/java/com/yunbao/common/event/CheckRemainingBalanceEvent.java @@ -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; + } } diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java index 3f3ad5128..e3a05088a 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java @@ -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 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); diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 45ddd7105..cc1d9b173 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -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>> getCode(); + /** + * 获取房间金豆门槛和赢家获得的金豆 + */ + @GET("/api/public/?service=Sudgameserver.checkRemainingBalance") + Observable> getScore( + @Query("room_id") String roomId + ); + + /** + * 获取游戏中玩家的信息 + */ + @GET("/api/public/?service=Sudgameserver.getGameUser") + Observable>> getSudGameInfo( + @Query("room_id") String roomId + ); + /** * 创建游戏房 * @@ -1198,7 +1216,7 @@ public interface PDLiveApi { Observable> getGuardOpenInfo(@Query("liveuid") String liveUid); @GET("/api/public/?service=Guard.openGuard") - Observable> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey, @Query("stream") String stream); + Observable> 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> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum); diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 7952cd01d..a06483cde 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -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 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> 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 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 callback) { + public void openGuard(String liveUid, String guardType, String priceKey, String stream,String coupon_type,String couponId, HttpCallback 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>() { diff --git a/common/src/main/java/com/yunbao/common/pay/samsung/SamsungUtil.java b/common/src/main/java/com/yunbao/common/pay/samsung/SamsungUtil.java index d77d30acc..d4b4080e2 100644 --- a/common/src/main/java/com/yunbao/common/pay/samsung/SamsungUtil.java +++ b/common/src/main/java/com/yunbao/common/pay/samsung/SamsungUtil.java @@ -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,9 +59,27 @@ 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); + } + + /** * 消耗指定商品 * diff --git a/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java b/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java index 780775644..39cba517d 100644 --- a/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java +++ b/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java @@ -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); + } + + } diff --git a/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java b/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java index e7fa09b58..6a36e2c1b 100644 --- a/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java +++ b/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java @@ -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 gameViewLiveData = new MutableLiveData<>(); // 游戏View回调 + private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励 + private List sudGameInfoBeanList = new ArrayList<>();//玩家信息 + public final MutableLiveData> listMutableLiveData = new MutableLiveData<>();//玩家排名信息 + + public void setSudGameInfoBeanList(List 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() { + @Override + public void onSuccess(SudGameScoreBean data) { + sudGameScoreBean = data; + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + + /** + * 进行排名和结算 + */ + public void sudGameRank(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) { + List 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 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()); } } diff --git a/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java b/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java index 1bfba5b82..43d0d5807 100644 --- a/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java +++ b/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java @@ -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); diff --git a/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java b/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java index dc358b332..082dc1802 100644 --- a/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java +++ b/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java @@ -170,6 +170,15 @@ public class SudMGPMGState implements Serializable { // 游戏结果玩家列表 public List 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 + + '}'; + } } } diff --git a/common/src/main/java/com/yunbao/common/utils/AppManager.java b/common/src/main/java/com/yunbao/common/utils/AppManager.java index 33c5c65c4..45d95dd91 100644 --- a/common/src/main/java/com/yunbao/common/utils/AppManager.java +++ b/common/src/main/java/com/yunbao/common/utils/AppManager.java @@ -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; diff --git a/common/src/main/java/com/yunbao/common/utils/SpUtil.java b/common/src/main/java/com/yunbao/common/utils/SpUtil.java index 11184c438..e188b7f0d 100644 --- a/common/src/main/java/com/yunbao/common/utils/SpUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/SpUtil.java @@ -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 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 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; + } + + /** * 保存一个字符串 */ diff --git a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java new file mode 100644 index 000000000..0eac169ab --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java @@ -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); + } +} diff --git a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java index c989802b0..1582856b1 100644 --- a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java @@ -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); } - - } }); } diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java index 731ff761e..ff0bc7364 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java @@ -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 sidebarChildModels = model.getChild(); itemView.findViewById(R.id.select_more_layout).setVisibility(sidebarChildModels.size() >= 8 ? View.VISIBLE : View.GONE); sendGoodGift.setText(model.getTitle()); diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java index 4a30f3397..01fb96bdb 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java @@ -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); } diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java index 43d54460a..c2aa51ee5 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java @@ -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()); } diff --git a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java index 9bb18cb88..09ff270a1 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java @@ -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 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() { + //获取筹码信息,检查是否足够 + LiveNetManager.get(getContext()).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { @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>() { + @Override + public void onSuccess(List 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() { @@ -279,9 +355,9 @@ public class LiveSudGamePopup extends BottomPopupView { break; } - } + @Subscribe(threadMode = ThreadMode.MAIN) public void onSudGameStatus(SubGameEvent event) { if (event.getType() == 0) { diff --git a/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java index 8cab49049..ef144cbfa 100644 --- a/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java @@ -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); diff --git a/common/src/main/java/com/yunbao/common/views/RigtsInterestsViewHolder.java b/common/src/main/java/com/yunbao/common/views/RigtsInterestsViewHolder.java index 0edee2dc5..0b671fdfc 100644 --- a/common/src/main/java/com/yunbao/common/views/RigtsInterestsViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/RigtsInterestsViewHolder.java @@ -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); } diff --git a/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java b/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java index 0ba2aa016..478dc447b 100644 --- a/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java @@ -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() { diff --git a/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java b/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java index 99ea4e543..2dd5c9411 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java +++ b/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java @@ -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)) { - gotoRoomView.setVisibility(VISIBLE); + 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); - - }); } diff --git a/common/src/main/res/drawable/anim_loading_double.xml b/common/src/main/res/drawable/anim_loading_double.xml new file mode 100644 index 000000000..2f726ba5d --- /dev/null +++ b/common/src/main/res/drawable/anim_loading_double.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/common/src/main/res/drawable/anim_loading_multiple.xml b/common/src/main/res/drawable/anim_loading_multiple.xml new file mode 100644 index 000000000..70912948d --- /dev/null +++ b/common/src/main/res/drawable/anim_loading_multiple.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_live_sud_game_top_new.xml b/common/src/main/res/drawable/bg_live_sud_game_top_new.xml index cddd65f5b..784608b98 100644 --- a/common/src/main/res/drawable/bg_live_sud_game_top_new.xml +++ b/common/src/main/res/drawable/bg_live_sud_game_top_new.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_live_sud_list.xml b/common/src/main/res/drawable/bg_live_sud_list.xml index 4216aa85c..ccace1e40 100644 --- a/common/src/main/res/drawable/bg_live_sud_list.xml +++ b/common/src/main/res/drawable/bg_live_sud_list.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml b/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml new file mode 100644 index 000000000..1c10e92bb --- /dev/null +++ b/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/order_level_progress_bg.xml b/common/src/main/res/drawable/order_level_progress_bg.xml index 587aa4c17..ebd60c369 100644 --- a/common/src/main/res/drawable/order_level_progress_bg.xml +++ b/common/src/main/res/drawable/order_level_progress_bg.xml @@ -14,7 +14,7 @@ - + diff --git a/common/src/main/res/drawable/shape_sub_rank.xml b/common/src/main/res/drawable/shape_sub_rank.xml new file mode 100644 index 000000000..a0d1f44c4 --- /dev/null +++ b/common/src/main/res/drawable/shape_sub_rank.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/activity_sud_game.xml b/common/src/main/res/layout/activity_sud_game.xml index 7688f57b5..06a8c86b6 100644 --- a/common/src/main/res/layout/activity_sud_game.xml +++ b/common/src/main/res/layout/activity_sud_game.xml @@ -2,6 +2,8 @@ @@ -14,17 +16,25 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - - + - - + android:textSize="8sp" /> - + android:layout_height="50dp" + android:layout_marginTop="93dp"> diff --git a/common/src/main/res/layout/dialog_guard_buy_coupon_tips.xml b/common/src/main/res/layout/dialog_guard_buy_coupon_tips.xml new file mode 100644 index 000000000..0c22f92be --- /dev/null +++ b/common/src/main/res/layout/dialog_guard_buy_coupon_tips.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_live_sud_game.xml b/common/src/main/res/layout/dialog_live_sud_game.xml index 338a4ed55..1de6f95e8 100644 --- a/common/src/main/res/layout/dialog_live_sud_game.xml +++ b/common/src/main/res/layout/dialog_live_sud_game.xml @@ -1,19 +1,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_sub_double.xml b/common/src/main/res/layout/dialog_sub_double.xml new file mode 100644 index 000000000..c86e5a573 --- /dev/null +++ b/common/src/main/res/layout/dialog_sub_double.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_sub_multiple.xml b/common/src/main/res/layout/dialog_sub_multiple.xml new file mode 100644 index 000000000..617e967af --- /dev/null +++ b/common/src/main/res/layout/dialog_sub_multiple.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_sud_load.xml b/common/src/main/res/layout/dialog_sud_load.xml new file mode 100644 index 000000000..636307c8a --- /dev/null +++ b/common/src/main/res/layout/dialog_sud_load.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/order_level_popup.xml b/common/src/main/res/layout/order_level_popup.xml index 987c2ae67..9e4ae27af 100644 --- a/common/src/main/res/layout/order_level_popup.xml +++ b/common/src/main/res/layout/order_level_popup.xml @@ -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" /> - + - - - diff --git a/common/src/main/res/layout/view_fun_games_child_view.xml b/common/src/main/res/layout/view_fun_games_child_view.xml index cf798f976..1f9dd4549 100644 --- a/common/src/main/res/layout/view_fun_games_child_view.xml +++ b/common/src/main/res/layout/view_fun_games_child_view.xml @@ -1,16 +1,16 @@ @@ -35,10 +34,11 @@ diff --git a/common/src/main/res/layout/view_fun_games_view.xml b/common/src/main/res/layout/view_fun_games_view.xml index 6da8f3b5a..6d155ca94 100644 --- a/common/src/main/res/layout/view_fun_games_view.xml +++ b/common/src/main/res/layout/view_fun_games_view.xml @@ -39,9 +39,10 @@ - - - @@ -63,6 +62,6 @@ android:maxLines="1" android:text="@string/guard_guard" android:textColor="#9A9A9A" - android:textSize="14sp" /> + android:textSize="10sp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml b/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml index 9698ed388..b1fff2453 100644 --- a/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml +++ b/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml @@ -1,17 +1,16 @@ + android:textSize="10sp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml b/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml index f2fdc04fc..f2d713165 100644 --- a/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml +++ b/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml @@ -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"> - - + - + - + + + + - + 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" /> + - \ No newline at end of file diff --git a/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml b/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml index 5ab821e4a..01feaca8e 100644 --- a/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml +++ b/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml @@ -2,7 +2,7 @@ + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:layout_marginTop="10dp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_new_roler_fun_games_view.xml b/common/src/main/res/layout/view_new_roler_fun_games_view.xml index 457a59633..164c35ae8 100644 --- a/common/src/main/res/layout/view_new_roler_fun_games_view.xml +++ b/common/src/main/res/layout/view_new_roler_fun_games_view.xml @@ -2,12 +2,12 @@ + android:layout_marginTop="15dp" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:overScrollMode="never" /> diff --git a/common/src/main/res/layout/view_sub_rank.xml b/common/src/main/res/layout/view_sub_rank.xml new file mode 100644 index 000000000..32a4495b0 --- /dev/null +++ b/common/src/main/res/layout/view_sub_rank.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/view_sud_game_user_list_holder.xml b/common/src/main/res/layout/view_sud_game_user_list_holder.xml index 42c914407..12dbc2365 100644 --- a/common/src/main/res/layout/view_sud_game_user_list_holder.xml +++ b/common/src/main/res/layout/view_sud_game_user_list_holder.xml @@ -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"> - + + + + + - + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xhdpi/sub_1.png b/common/src/main/res/mipmap-xhdpi/sub_1.png new file mode 100644 index 000000000..d2e3ed4f3 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_2.png b/common/src/main/res/mipmap-xhdpi/sub_2.png new file mode 100644 index 000000000..dc88bbbe9 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_3.png b/common/src/main/res/mipmap-xhdpi/sub_3.png new file mode 100644 index 000000000..ea360085b Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_again_en.png b/common/src/main/res/mipmap-xhdpi/sub_again_en.png new file mode 100644 index 000000000..0ef4f37bd Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_again_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_again_zh.png b/common/src/main/res/mipmap-xhdpi/sub_again_zh.png new file mode 100644 index 000000000..19e736458 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_again_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_bg.png b/common/src/main/res/mipmap-xhdpi/sub_bg.png new file mode 100644 index 000000000..7178231e7 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_bg.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_bg2.png b/common/src/main/res/mipmap-xhdpi/sub_bg2.png new file mode 100644 index 000000000..357798c60 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_bg2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_draw_en.png b/common/src/main/res/mipmap-xhdpi/sub_draw_en.png new file mode 100644 index 000000000..b0fd12771 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_draw_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_draw_zh.png b/common/src/main/res/mipmap-xhdpi/sub_draw_zh.png new file mode 100644 index 000000000..be79e21fa Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_draw_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_leave_en.png b/common/src/main/res/mipmap-xhdpi/sub_leave_en.png new file mode 100644 index 000000000..533c0dca4 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_leave_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_leave_zh.png b/common/src/main/res/mipmap-xhdpi/sub_leave_zh.png new file mode 100644 index 000000000..6b69f7404 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_leave_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_loss_en.png b/common/src/main/res/mipmap-xhdpi/sub_loss_en.png new file mode 100644 index 000000000..cded722b6 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_loss_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_loss_zh.png b/common/src/main/res/mipmap-xhdpi/sub_loss_zh.png new file mode 100644 index 000000000..df783c0b7 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_loss_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_over_en.png b/common/src/main/res/mipmap-xhdpi/sub_over_en.png new file mode 100644 index 000000000..3b2847992 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_over_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_over_zh.png b/common/src/main/res/mipmap-xhdpi/sub_over_zh.png new file mode 100644 index 000000000..719cd0f4e Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_over_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_vs.png b/common/src/main/res/mipmap-xhdpi/sub_vs.png new file mode 100644 index 000000000..6a77d88e3 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_vs.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_win_en.png b/common/src/main/res/mipmap-xhdpi/sub_win_en.png new file mode 100644 index 000000000..5cb13fa56 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_win_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_win_hat.png b/common/src/main/res/mipmap-xhdpi/sub_win_hat.png new file mode 100644 index 000000000..344e11b7f Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_win_hat.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sub_win_zh.png b/common/src/main/res/mipmap-xhdpi/sub_win_zh.png new file mode 100644 index 000000000..91457b195 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sub_win_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_bg_double.png b/common/src/main/res/mipmap-xhdpi/sud_load_bg_double.png new file mode 100644 index 000000000..43d3a504c Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_bg_double.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_bg_multiple.png b/common/src/main/res/mipmap-xhdpi/sud_load_bg_multiple.png new file mode 100644 index 000000000..e185ad395 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_bg_multiple.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_double.png b/common/src/main/res/mipmap-xhdpi/sud_load_double.png new file mode 100644 index 000000000..a7d00a92c Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_double.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_en.png b/common/src/main/res/mipmap-xhdpi/sud_load_en.png new file mode 100644 index 000000000..07e0d399b Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_multiple.png b/common/src/main/res/mipmap-xhdpi/sud_load_multiple.png new file mode 100644 index 000000000..dbd2148b4 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_multiple.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_skip_en.png b/common/src/main/res/mipmap-xhdpi/sud_load_skip_en.png new file mode 100644 index 000000000..1773f13c2 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_skip_en.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_skip_zh.png b/common/src/main/res/mipmap-xhdpi/sud_load_skip_zh.png new file mode 100644 index 000000000..ddfe6ceb6 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_skip_zh.png differ diff --git a/common/src/main/res/mipmap-xhdpi/sud_load_zh.png b/common/src/main/res/mipmap-xhdpi/sud_load_zh.png new file mode 100644 index 000000000..a81db51b5 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/sud_load_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/bg_live_sud_game_back_new2.png b/common/src/main/res/mipmap-xxhdpi/bg_live_sud_game_back_new2.png new file mode 100644 index 000000000..867b7a5b0 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/bg_live_sud_game_back_new2.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/guard_buy_tips_cancel_bg.png b/common/src/main/res/mipmap-xxhdpi/guard_buy_tips_cancel_bg.png new file mode 100644 index 000000000..0820358ec Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/guard_buy_tips_cancel_bg.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_min_game_new.png b/common/src/main/res/mipmap-xxhdpi/icon_min_game_new.png index b4aa97974..201572e1e 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/icon_min_game_new.png and b/common/src/main/res/mipmap-xxhdpi/icon_min_game_new.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_sud_history_live_new.png b/common/src/main/res/mipmap-xxhdpi/icon_sud_history_live_new.png index f9c550e28..447280a7b 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/icon_sud_history_live_new.png and b/common/src/main/res/mipmap-xxhdpi/icon_sud_history_live_new.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/live_dialog_top_game_icon.png b/common/src/main/res/mipmap-xxhdpi/live_dialog_top_game_icon.png new file mode 100644 index 000000000..65fc17742 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/live_dialog_top_game_icon.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_1.png b/common/src/main/res/mipmap-xxhdpi/sub_1.png new file mode 100644 index 000000000..a54791a4a Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_1.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_2.png b/common/src/main/res/mipmap-xxhdpi/sub_2.png new file mode 100644 index 000000000..8d633e398 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_2.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_3.png b/common/src/main/res/mipmap-xxhdpi/sub_3.png new file mode 100644 index 000000000..1b46f4465 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_3.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_again_en.png b/common/src/main/res/mipmap-xxhdpi/sub_again_en.png new file mode 100644 index 000000000..a6602cfb8 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_again_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_again_zh.png b/common/src/main/res/mipmap-xxhdpi/sub_again_zh.png new file mode 100644 index 000000000..add3f5671 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_again_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_bg.png b/common/src/main/res/mipmap-xxhdpi/sub_bg.png new file mode 100644 index 000000000..1ad394bf6 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_bg.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_bg2.png b/common/src/main/res/mipmap-xxhdpi/sub_bg2.png new file mode 100644 index 000000000..da1e6a5ee Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_bg2.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_draw_en.png b/common/src/main/res/mipmap-xxhdpi/sub_draw_en.png new file mode 100644 index 000000000..18be3bcfe Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_draw_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_draw_zh.png b/common/src/main/res/mipmap-xxhdpi/sub_draw_zh.png new file mode 100644 index 000000000..293d63557 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_draw_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_leave_en.png b/common/src/main/res/mipmap-xxhdpi/sub_leave_en.png new file mode 100644 index 000000000..f560d3924 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_leave_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_leave_zh.png b/common/src/main/res/mipmap-xxhdpi/sub_leave_zh.png new file mode 100644 index 000000000..5acd8ced7 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_leave_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_loss_en.png b/common/src/main/res/mipmap-xxhdpi/sub_loss_en.png new file mode 100644 index 000000000..08d24b34d Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_loss_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_loss_zh.png b/common/src/main/res/mipmap-xxhdpi/sub_loss_zh.png new file mode 100644 index 000000000..293871787 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_loss_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_over_en.png b/common/src/main/res/mipmap-xxhdpi/sub_over_en.png new file mode 100644 index 000000000..8320eeef3 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_over_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_over_zh.png b/common/src/main/res/mipmap-xxhdpi/sub_over_zh.png new file mode 100644 index 000000000..3736af6ba Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_over_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_vs.png b/common/src/main/res/mipmap-xxhdpi/sub_vs.png new file mode 100644 index 000000000..e2632e3df Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_vs.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_win_en.png b/common/src/main/res/mipmap-xxhdpi/sub_win_en.png new file mode 100644 index 000000000..97f1cbf58 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_win_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_win_hat.png b/common/src/main/res/mipmap-xxhdpi/sub_win_hat.png new file mode 100644 index 000000000..e13737596 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_win_hat.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sub_win_zh.png b/common/src/main/res/mipmap-xxhdpi/sub_win_zh.png new file mode 100644 index 000000000..d8860a4e3 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sub_win_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_bg_double.png b/common/src/main/res/mipmap-xxhdpi/sud_load_bg_double.png new file mode 100644 index 000000000..78260dda2 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_bg_double.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_bg_multiple.png b/common/src/main/res/mipmap-xxhdpi/sud_load_bg_multiple.png new file mode 100644 index 000000000..881fb74ab Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_bg_multiple.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_double.png b/common/src/main/res/mipmap-xxhdpi/sud_load_double.png new file mode 100644 index 000000000..7d728062c Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_double.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_en.png b/common/src/main/res/mipmap-xxhdpi/sud_load_en.png new file mode 100644 index 000000000..a8dcd1d1e Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_multiple.png b/common/src/main/res/mipmap-xxhdpi/sud_load_multiple.png new file mode 100644 index 000000000..1dccf0371 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_multiple.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_skip_en.png b/common/src/main/res/mipmap-xxhdpi/sud_load_skip_en.png new file mode 100644 index 000000000..cbcf8d603 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_skip_en.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_skip_zh.png b/common/src/main/res/mipmap-xxhdpi/sud_load_skip_zh.png new file mode 100644 index 000000000..5ccdaa950 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_skip_zh.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/sud_load_zh.png b/common/src/main/res/mipmap-xxhdpi/sud_load_zh.png new file mode 100644 index 000000000..0e3084cb2 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/sud_load_zh.png differ diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 12690278a..20b53e5fc 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1332,7 +1332,7 @@ Limited ride And limited avatar frame All Game Create a room "Room Name: " - Room ID: + ID: Please enter a room name Game type: Game threshold: @@ -1500,4 +1500,7 @@ Limited ride And limited avatar frame 1.Dragon\'s Wealth is a free golden bean benefit provided to live stream viewers by users who have activated the 【God Guardian】 feature; 2.Users who follow the anchor and participate in the activity will divide the gold beans of the activity after the countdown of five minutes ends; 3.The final interpretation of this activity belongs to PDLIVE. + + + *10% of the threshold will be charged as ticket diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 68329ce5d..7f1727fef 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1329,7 +1329,7 @@ 所有遊戲 創建房間 房間名稱: - 房間號: + ID: 請輸入房間名 游戲類型: 游戲門檻: @@ -1503,4 +1503,8 @@ 主播正在PK,稍後再試 佩戴 榮譽成就 + 使用 + 不使用 + + *將收取門檻的10%作為門票 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 7b9a8434d..a4e8fc718 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1328,7 +1328,7 @@ 所有遊戲 創建房間 房間名稱: - 房間號: + ID: 請輸入房間名 游戲類型: 游戲門檻: @@ -1502,4 +1502,8 @@ 主播正在PK,稍後再試 佩戴 榮譽成就 + 使用 + 不使用 + + *將收取門檻的10%作為門票 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index f6a3a7fa7..79684c5a6 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1327,7 +1327,7 @@ 所有遊戲 創建房間 房間名稱: - 房間號: + ID: 請輸入房間名 游戲類型: 游戲門檻: @@ -1497,6 +1497,10 @@ 短劇 完成*1 主播正在PK,稍後再試 + 使用 + 不使用 + + *將收取門檻的10%作為門票 的禮物展館 個人展館 全站展館 diff --git a/common/src/main/res/values/colors.xml b/common/src/main/res/values/colors.xml index d7a566eca..d0ad06807 100644 --- a/common/src/main/res/values/colors.xml +++ b/common/src/main/res/values/colors.xml @@ -13,6 +13,7 @@ #98000000 #323232 #fff + #99FFFFFF #85ffffff #969696 #f5f5f5 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 58140c5f3..1c6336b3c 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1334,7 +1334,7 @@ All Game Create a room "Room Name: " - Room ID: + ID: Please enter a room name Game type: Game threshold: @@ -1539,4 +1539,9 @@ Hidden Waiting for titling Waiting for assistance + Use + Not use + + + *10% of the threshold will be charged as ticket diff --git a/config.gradle b/config.gradle index 3f81a20b3..0446876e7 100644 --- a/config.gradle +++ b/config.gradle @@ -1,19 +1,19 @@ ext { android = [ - compileSdkVersion: 33, + compileSdkVersion: 34, buildToolsVersion: "29.0.2", - minSdkVersion : 21, - targetSdkVersion : 33, - versionCode : 681, + minSdkVersion : 23, + targetSdkVersion : 34, + versionCode : 690, versionName : "6.7.1" ] manifestPlaceholders = [ //正式、 +// serverHost : "https://napi.yaoulive.com", serverHost : "https://napi.yaoulive.com", -// 测试 - testServerHost : "https://ceshi.yaoulive.com", buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")), + testServerHost : "https://ceshi.yaoulive.com", //百度语音识别 diff --git a/dependencies.gradle b/dependencies.gradle index 3a028a4df..fd32a5d29 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -27,8 +27,8 @@ ext { "magicIndicator" : 'com.github.hackware1993:MagicIndicator:1.6.0',//ViewPager指示器 "banner" : 'com.ms:banner:1.0.0',//轮播图 "Luban" : 'top.zibin:Luban:1.1.8',//鲁班压缩图片 - "arouter" : 'com.alibaba:arouter-api:1.5.2',//ARouter - "arouter-compiler" : 'com.alibaba:arouter-compiler:1.2.2', + "arouter" : 'com.github.jadepeakpoet.ARouter:arouter-api:1.0.3',//ARouter + "arouter-compiler" : 'com.github.jadepeakpoet.ARouter:arouter-compiler:1.0.3', "leakcanary" : 'com.squareup.leakcanary:leakcanary-android:2.9.1', "blank-utilcode" : 'com.blankj:utilcode:1.30.0', diff --git a/gradle.properties b/gradle.properties index 8c8ea2d1f..bdc087ffa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,16 +13,19 @@ #Thu Feb 04 00:05:45 CST 2021 android.injected.testOnly=false org.gradle.daemon=true -org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.parallel=true org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=true +android.nonTransitiveRClass=false systemProp.http.proxyHost=127.0.0.1 systemProp.https.proxyHost=127.0.0.1 -systemProp.https.proxyPort=10809 -systemProp.http.proxyPort=10809 +systemProp.https.proxyPort=7890 +systemProp.http.proxyPort=7890 + + #android.enableR8.fullMode=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9276a5849..36be9d94f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip diff --git a/lib_country_code/build.gradle b/lib_country_code/build.gradle index 28d4b2620..3d969799f 100644 --- a/lib_country_code/build.gradle +++ b/lib_country_code/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'img-optimizer' apply from: "../package_config.gradle" android { + namespace "com.sahooz.library" compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion packagingOptions { diff --git a/lib_country_code/src/main/AndroidManifest.xml b/lib_country_code/src/main/AndroidManifest.xml index 9de290553..d52e91bed 100644 --- a/lib_country_code/src/main/AndroidManifest.xml +++ b/lib_country_code/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ +> diff --git a/lib_faceunity/build.gradle b/lib_faceunity/build.gradle index 8d7859c91..e508cc23c 100644 --- a/lib_faceunity/build.gradle +++ b/lib_faceunity/build.gradle @@ -4,6 +4,7 @@ apply plugin: 'kotlin-android' apply from: "../package_config.gradle" android { + namespace "com.yunbao.swfaceunity" compileSdkVersion 31 buildToolsVersion "30.0.3" diff --git a/lib_faceunity/src/main/AndroidManifest.xml b/lib_faceunity/src/main/AndroidManifest.xml index 0ec7a4108..b22474742 100644 --- a/lib_faceunity/src/main/AndroidManifest.xml +++ b/lib_faceunity/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java index 4812111ab..1defc06b1 100644 --- a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java +++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java @@ -37,7 +37,6 @@ import io.agora.beautyapi.faceunity.Config; import io.agora.beautyapi.faceunity.FaceUnityBeautyAPI; import io.agora.beautyapi.faceunity.FaceUnityBeautyAPIKt; import io.agora.beautyapi.faceunity.MirrorMode; -import io.agora.beautyapi.faceunity.R; import io.agora.rtc2.ChannelMediaOptions; import io.agora.rtc2.Constants; import io.agora.rtc2.IRtcEngineEventHandler; diff --git a/lib_google/build.gradle b/lib_google/build.gradle index 9670d94c4..d64f08f21 100644 --- a/lib_google/build.gradle +++ b/lib_google/build.gradle @@ -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.shayu.lib_google" + compileSdk rootProject.ext.android.compileSdkVersion defaultConfig { - minSdkVersion minSdkVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" - versionCode versionCode - versionName versionName - targetSdkVersion targetSdkVersion + minSdkVersion rootProject.ext.android.minSdkVersion + targetSdkVersion rootProject.ext.android.targetSdkVersion + versionCode rootProject.ext.android.versionCode + versionName rootProject.ext.android.versionName } buildTypes { @@ -21,8 +21,8 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_18 + targetCompatibility JavaVersion.VERSION_18 } } @@ -30,7 +30,7 @@ dependencies { implementation rootProject.ext.dependencies["appcompat-androidx"] //谷歌内购 - api 'com.android.billingclient:billing:5.0.0' + api 'com.android.billingclient:billing:7.0.0' //谷歌登录 api 'com.google.android.gms:play-services-auth:15.0.0' api 'com.google.android.gms:play-services-ads-identifier:15.0.1' @@ -39,6 +39,7 @@ dependencies { implementation platform('com.google.firebase:firebase-bom:30.5.0') implementation 'com.google.firebase:firebase-crashlytics' + api 'com.google.firebase:firebase-analytics:21.1.0' //implementation platform('com.google.firebase:firebase-bom:30.5.0') //implementation 'com.google.firebase:firebase-crashlytics' diff --git a/lib_google/src/main/AndroidManifest.xml b/lib_google/src/main/AndroidManifest.xml index deeb96ae2..a5918e68a 100644 --- a/lib_google/src/main/AndroidManifest.xml +++ b/lib_google/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/lib_huawei/build.gradle b/lib_huawei/build.gradle index c6c84d2fc..20b93e0a2 100644 --- a/lib_huawei/build.gradle +++ b/lib_huawei/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.library' apply from: "../package_config.gradle" android { + namespace "com.yunbao.huawei" compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion defaultConfig { diff --git a/lib_huawei/src/main/AndroidManifest.xml b/lib_huawei/src/main/AndroidManifest.xml index b9b2617ac..12bbd5002 100644 --- a/lib_huawei/src/main/AndroidManifest.xml +++ b/lib_huawei/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + > \ No newline at end of file diff --git a/live/build.gradle b/live/build.gradle index 216cbdb52..8db70af51 100644 --- a/live/build.gradle +++ b/live/build.gradle @@ -1 +1 @@ -apply plugin: 'com.android.library' apply plugin: 'img-optimizer' apply plugin: 'kotlin-android' apply from: "../package_config.gradle" android { compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" exclude "lib/arm64-v8a/libarcore_sdk_c.so" exclude "lib/arm64-v8a/libmediadecoder.so" exclude "lib/arm64-v8a/libMediaMuxer.so" exclude "lib/arm64-v8a/libarcore_sdk_jni.so" exclude "lib/arm64-v8a/libMediaUtils.so" exclude "lib/arm64-v8a/libcosmosffmpeg.so" } defaultConfig { minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName manifestPlaceholders = rootProject.ext.manifestPlaceholders ndk { abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64" } javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } aaptOptions { cruncherEnabled = false useNewCruncher = false } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } kotlinOptions { allWarningsAsErrors = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } repositories { flatDir { dirs 'libs', '../libs' } mavenCentral() } dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.0' implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation (name:'../libs/beautysdk-202202241203',ext:'aar') implementation (name:'../libs/svgaplayer-release-v1.2.1',ext:'aar') //socket.io implementation('io.socket:socket.io-client:1.0.0') { exclude group: 'org.json', module: 'json' } //common api project(path:':lib_faceunity')//声网-新娱美颜 api project(path:':FaceUnity')//融云-新娱美颜 api project(path:':common')//公共库 // api project(path:':SVGAlibrary')//svga api project(':Share')//分享 annotationProcessor rootProject.ext.dependencies["arouter-compiler"] //工具 implementation 'com.eightbitlab:blurview:1.6.6' implementation 'com.google.code.gson:gson:2.8.6' implementation "com.getkeepsafe.relinker:relinker:1.4.4" } \ No newline at end of file +apply plugin: 'com.android.library' apply plugin: 'img-optimizer' apply plugin: 'kotlin-android' apply from: "../package_config.gradle" android { namespace "com.yunbao.live" compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" exclude "lib/arm64-v8a/libarcore_sdk_c.so" exclude "lib/arm64-v8a/libmediadecoder.so" exclude "lib/arm64-v8a/libMediaMuxer.so" exclude "lib/arm64-v8a/libarcore_sdk_jni.so" exclude "lib/arm64-v8a/libMediaUtils.so" exclude "lib/arm64-v8a/libcosmosffmpeg.so" } defaultConfig { minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName manifestPlaceholders = rootProject.ext.manifestPlaceholders ndk { abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64" } javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } aaptOptions { cruncherEnabled = false useNewCruncher = false } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } kotlinOptions { allWarningsAsErrors = true } compileOptions { sourceCompatibility JavaVersion.VERSION_18 targetCompatibility JavaVersion.VERSION_18 } } repositories { flatDir { dirs 'libs', '../libs' } mavenCentral() } dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.0' implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation (name:'../libs/beautysdk-202202241203',ext:'aar') implementation (name:'../libs/svgaplayer-release-v1.2.1',ext:'aar') //socket.io implementation('io.socket:socket.io-client:1.0.0') { exclude group: 'org.json', module: 'json' } //common api project(path:':lib_faceunity')//声网-新娱美颜 api project(path:':FaceUnity')//融云-新娱美颜 api project(path:':common')//公共库 // api project(path:':SVGAlibrary')//svga api project(':Share')//分享 annotationProcessor rootProject.ext.dependencies["arouter-compiler"] //工具 implementation 'com.eightbitlab:blurview:1.6.6' implementation 'com.google.code.gson:gson:2.8.6' implementation "com.getkeepsafe.relinker:relinker:1.4.4" } \ No newline at end of file diff --git a/live/src/main/AndroidManifest.xml b/live/src/main/AndroidManifest.xml index 98ec3f02f..4603df43e 100644 --- a/live/src/main/AndroidManifest.xml +++ b/live/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + > diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index ed8ae2ae2..9c4e70bf8 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -104,6 +104,7 @@ import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.ProcessResultUtil; import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java index 6826205bd..6be9e8cf9 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java @@ -133,7 +133,7 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter content += " " + text; } if (mIntoIndex == 0) { - LiveHttpUtil.setReport(mToUid, content, file1, file2, file3, mVideoId, new HttpCallback() { + LiveHttpUtil.setReport(mToUid, bean.getName(),text, file1, file2, file3, mVideoId, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index ee9bcad2a..272e72fe8 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -235,7 +235,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl //丢包率 long lossRate = statusBean.packetLostRate; //带宽 - String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth; +// String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth; // Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth); } } diff --git a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java index 1a568cb1f..ce3a11f0e 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java @@ -4,6 +4,7 @@ import android.Manifest; import android.app.Activity; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -33,8 +34,13 @@ import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.RoomMicStatusModel; import com.yunbao.common.bean.SudGameChatImModel; +import com.yunbao.common.bean.SudGameInfoBean; +import com.yunbao.common.bean.SudGameScoreBean; import com.yunbao.common.bean.SudGameUserModel; +import com.yunbao.common.dialog.SudGameDoubleDialog; +import com.yunbao.common.dialog.SudGameMultipleDialog; import com.yunbao.common.dialog.SudGameInputPopupWindow; +import com.yunbao.common.dialog.SudLoadDialog; import com.yunbao.common.event.CheckRemainingBalanceEvent; import com.yunbao.common.event.SubGameEvent; import com.yunbao.common.event.SudGameSocketImEvent; @@ -44,7 +50,6 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.imrongcloud.GameRyMicManager; import com.yunbao.common.sud.QuickStartGameViewModel; -import com.yunbao.common.sud.decorator.SudFSMMGDecorator; import com.yunbao.common.sud.model.GameConfigModel; import com.yunbao.common.sud.model.GameViewInfoModel; import com.yunbao.common.sud.state.SudMGPAPPState; @@ -93,6 +98,9 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M private ProcessResultUtil mProcessResultUtil; private List muteUser = new ArrayList<>(); private boolean imOff; + private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗 + private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗 + private SudLoadDialog sudLoadDialog;//加载弹窗 @Override protected int getLayoutId() { @@ -227,7 +235,8 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class); mInteractionID = mCreateSudRoomModel.getLongSudGameId(); mLiveUid = mCreateSudRoomModel.getSudGameRoomId(); - + //第二次进入时,viewmodel数据丢失,所以初始化时直接获取 + gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),mContext); gameContainer = findViewById(R.id.game_container); roomName = findViewById(R.id.room_name); roomNumber = findViewById(R.id.room_number); @@ -428,6 +437,7 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M 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; @@ -448,12 +458,38 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M // 设置游戏安全操作区域 GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel(); gameViewRectModel.left = 0; - gameViewRectModel.top = DpUtil.dp2px(155); + gameViewRectModel.top = DpUtil.dp2px(180);//游戏安全区域 gameViewRectModel.right = 0; gameViewRectModel.bottom = DpUtil.dp2px(155); gameViewModel.gameViewRectModel = gameViewRectModel; + //初始化结算弹窗 + sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏 + sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏 + sudLoadDialog = new SudLoadDialog(this);//加载弹窗 + //游戏结算结束 + 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)); + } + }); } @Subscribe(threadMode = ThreadMode.MAIN) @@ -461,12 +497,14 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M switch (event.getSudMGPMGState()) { case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN: - - LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { + //获取筹码信息,检查是否足够 + LiveNetManager.get(mContext).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { @Override - public void onSuccess(CheckRemainingBalance data) { - if (TextUtils.equals(String.valueOf(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(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); @@ -491,9 +529,31 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M }); 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(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback>() { + @Override + public void onSuccess(List data) { + if (!data.isEmpty()){ + gameViewModel.setSudGameInfoBeanList(data); + gameViewModel.sudGameRank(event.getMgCommonGameSettle()); + }else { + ToastUtil.show(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(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(), mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { diff --git a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java index aa244ac55..ab1fb748b 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java @@ -4,6 +4,7 @@ import android.Manifest; import android.app.Activity; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -16,6 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.alibaba.android.arouter.facade.annotation.Route; +import com.blankj.utilcode.util.LogUtils; import com.google.gson.Gson; import com.lxj.xpopup.XPopup; import com.lzf.easyfloat.EasyFloat; @@ -32,10 +34,16 @@ import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.RoomMicStatusModel; import com.yunbao.common.bean.SudGameChatImModel; +import com.yunbao.common.bean.SudGameInfoBean; +import com.yunbao.common.bean.SudGameScoreBean; import com.yunbao.common.bean.SudGameUserModel; +import com.yunbao.common.bean.SudSettleBean; +import com.yunbao.common.dialog.AbsDialogCenterPopupWindow; +import com.yunbao.common.dialog.SudGameDoubleDialog; +import com.yunbao.common.dialog.SudGameMultipleDialog; import com.yunbao.common.dialog.SudGameInputPopupWindow; +import com.yunbao.common.dialog.SudLoadDialog; import com.yunbao.common.event.CheckRemainingBalanceEvent; -import com.yunbao.common.event.LiveFloatEvent; import com.yunbao.common.event.SudGameSocketImEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.base.HttpCallback; @@ -70,7 +78,6 @@ import cn.rongcloud.rtc.api.RCRTCRemoteUser; import cn.rongcloud.rtc.api.RCRTCRoom; import cn.rongcloud.rtc.api.stream.RCRTCInputStream; import cn.rongcloud.rtc.base.RTCErrorCode; -import io.agora.beautyapi.faceunity.agora.LiveFloatView; import io.agora.beautyapi.faceunity.agora.SWAuManager; import io.rong.imlib.IRongCoreCallback; import io.rong.imlib.IRongCoreEnum; @@ -96,6 +103,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M private List muteUser = new ArrayList<>(); private boolean imOff; private boolean isSw = CommonAppConfig.getInstance().getConfig().isSw(); + private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗 + private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗 + private SudLoadDialog sudLoadDialog;//加载弹窗 @Override protected int getLayoutId() { @@ -257,6 +267,8 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class); mInteractionID = mCreateSudRoomModel.getLongSudGameId(); mLiveUid = mCreateSudRoomModel.getSudGameRoomId(); + //第二次进入时,viewmodel数据丢失,所以初始化时直接获取 + gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),mContext); gameContainer = findViewById(R.id.game_container); roomName = findViewById(R.id.room_name); @@ -476,6 +488,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M 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; @@ -496,12 +509,39 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M // 设置游戏安全操作区域 GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel(); gameViewRectModel.left = 0; - gameViewRectModel.top = DpUtil.dp2px(155); + gameViewRectModel.top = DpUtil.dp2px(180); //游戏安全区域 gameViewRectModel.right = 0; gameViewRectModel.bottom = DpUtil.dp2px(155); gameViewModel.gameViewRectModel = gameViewRectModel; + //初始化结算弹窗 + sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏 + sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏 + sudLoadDialog = new SudLoadDialog(this);//加载弹窗 + //游戏结算结束 + 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)); + } + }); } @Subscribe(threadMode = ThreadMode.MAIN) @@ -509,12 +549,14 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M switch (event.getSudMGPMGState()) { case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN: - - LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { + //获取筹码信息,检查是否足够 + LiveNetManager.get(mContext).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { @Override - public void onSuccess(CheckRemainingBalance data) { - if (TextUtils.equals(String.valueOf(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(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); @@ -539,9 +581,31 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M }); 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(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback>() { + @Override + public void onSuccess(List data) { + if (!data.isEmpty()){ + gameViewModel.setSudGameInfoBeanList(data); + gameViewModel.sudGameRank(event.getMgCommonGameSettle());//结算游戏 + }else { + ToastUtil.show(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(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(), mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback() { @Override public void onSuccess(CheckRemainingBalance data) { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java index 9668838bf..72dd4fdcd 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java @@ -41,7 +41,9 @@ import com.yunbao.common.bean.GuardUserInfoModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.custom.LiveGuardScalePageTransformer; import com.yunbao.common.dialog.AbsDialogPopupWindow; +import com.yunbao.common.dialog.GuardBuyCouponTipsDialog; import com.yunbao.common.dialog.GuardBuyTipsDialog; +import com.yunbao.common.dialog.GuardBuyTipsNewDialog; import com.yunbao.common.dialog.GuardUpgradePopup; import com.yunbao.common.dialog.LiveBuyGuardSelectPopup; import com.yunbao.common.glide.ImgLoader; @@ -247,6 +249,9 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { : WordUtil.getNewString(R.string.open_the_god_guard)); } guardPriceModel = price.get(0); + discountPrice.setTag("1"); + discount.setTag(guardPriceModel.getCouponId()); + if (TextUtils.isEmpty(guardPriceModel.getDiscountPrice())) { discountPrice.setText(String.valueOf(guardPriceModel.getOriginalPrice())); originalPrice.setVisibility(GONE); @@ -308,6 +313,8 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { @Override public void onLiveBuyGuardSelectListener(GuardPriceModel model) { guardPriceModel = model; + discountPrice.setTag(String.valueOf(guardPriceModel.getPriceKey())); + discount.setTag(guardPriceModel.getCouponId()); if (TextUtils.isEmpty(guardPriceModel.getDiscountPrice())) { discountPrice.setText(String.valueOf(guardPriceModel.getOriginalPrice())); originalPrice.setVisibility(GONE); @@ -340,204 +347,27 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { ViewClicksAntiShake.clicksAntiShake(openTheGuard, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - if (TextUtils.equals(userInfo.getIsOpen(), "1")) { - GuardBuyTipsDialog - .showBuyOrRenewDialog(mContext, - discountPrice.getText().toString(), - dataTipModel.getGuardName(), dataTipModel.isOpen(), - mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() { - @Override - public void onCancelClick() { - dismiss(); - } + if (TextUtils.equals(mGuardUserInfoModel.getIsOpen(), "1") && + dataTipModel.getGuardType() < mGuardUserInfoModel.getGuardType()) { + //开通比当前低级的的守护 + GuardBuyTipsNewDialog.showBuyOrRenewDialog(mContext); + }else{ + //判断是否选择的是一个月 + if(discountPrice.getTag().equals("1")&&!discount.getTag().toString().equals("0")){ + GuardBuyCouponTipsDialog.showBuyOrRenewDialog(mContext, WordUtil.isNewZh() ? guardPriceModel.getCouponDiscount() : guardPriceModel.getCouponDiscountEn(), guardPriceModel.getCouponDiscountPrice(), dataTipModel.getGuardName(), new DialogUitl.SimpleCallback3() { + @Override + public void onConfirmClick(Dialog dialog) { + bugGurd(true); + } - @Override - public void onConfirmClick(Dialog dialog, String content) { - - LiveNetManager.get(activity) - .openGuard(mLiveUid, - String.valueOf(dataTipModel.getGuardType()), - String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback() { - @Override - public void onSuccess(String data) { - if (TextUtils.equals(data, "22")) { - new DialogUitl.Builder(mContext) - .setView(R.layout.dialog_live_unfollow) - .setConfirmString(mContext.getString(R.string.charge)) - .setContent(mContext.getString(R.string.insufficient_balance)) - .setClickCallback(new DialogUitl.SimpleCallback() { - @Override - public void onConfirmClick(Dialog dialog, String content) { - LiveBuyGuardDialog.this.dismiss(); - ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); - } - }).build().show(); - } else { - IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType()); - ToastUtil.show(data); - dismiss(); - if (dataTipModel.getGuardType() == 3) { - new XPopup.Builder(mContext) - .dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true - .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) - .show(); - } - } - - } - - @Override - public void onError(String error) { - ToastUtil.show(error); - } - }); - } - }); - } else { - if (userInfo.getGuardType() > dataTipModel.getGuardType()) { - String name = "星之守護"; - switch (userInfo.getGuardType()) { - case 1: - name = WordUtil.isNewZh() ? "星之守護" : "star guardian"; - break; - case 2: - name = WordUtil.isNewZh() ? "王之守護" : "king guardian"; - break; - case 3: - name = WordUtil.isNewZh() ? "神之守護" : "god guardian"; - break; - - } - StringBuffer buffer = new StringBuffer(); - if (WordUtil.isNewZh()) { - buffer.append("您的【") - .append(name).append("】已過期\n").append("開通相同或更高等級守護將會保留您的守護等級").append("開通低等級守護將重新計算您的守護等級"); - } else { - buffer.append("Your [") - .append(name).append("] has expired").append("active the same or higher level of guardian will retain your guardian level").append("active lower level guardian will recalculate your guardian level"); - } - GuardBuyTipsDialog - .showBuyOrRenewDialog(mContext, - null, - buffer.toString(), false, - null, -200, new DialogUitl.SimpleCallback2() { - @Override - public void onCancelClick() { - - } - - @Override - public void onConfirmClick(Dialog dialog, String content) { - GuardBuyTipsDialog - .showBuyOrRenewDialog(mContext, - discountPrice.getText().toString(), - dataTipModel.getGuardName(), dataTipModel.isOpen(), - mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() { - @Override - public void onCancelClick() { - dismiss(); - } - - @Override - public void onConfirmClick(Dialog dialog, String content) { - - LiveNetManager.get(activity) - .openGuard(mLiveUid, - String.valueOf(dataTipModel.getGuardType()), - String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback() { - @Override - public void onSuccess(String data) { - if (TextUtils.equals(data, "22")) { - new DialogUitl.Builder(mContext) - .setView(R.layout.dialog_live_unfollow) - .setConfirmString(mContext.getString(R.string.charge)) - .setContent(mContext.getString(R.string.insufficient_balance)) - .setClickCallback(new DialogUitl.SimpleCallback() { - @Override - public void onConfirmClick(Dialog dialog, String content) { - LiveBuyGuardDialog.this.dismiss(); - ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); - } - }).build().show(); - } else { - IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType()); - ToastUtil.show(data); - dismiss(); - if (dataTipModel.getGuardType() == 3) { - new XPopup.Builder(mContext) - .dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true - .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) - .show(); - } - } - - } - - @Override - public void onError(String error) { - ToastUtil.show(error); - } - }); - } - }); - } - }); - }else { - GuardBuyTipsDialog - .showBuyOrRenewDialog(mContext, - discountPrice.getText().toString(), - dataTipModel.getGuardName(), dataTipModel.isOpen(), - mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() { - @Override - public void onCancelClick() { - dismiss(); - } - - @Override - public void onConfirmClick(Dialog dialog, String content) { - - LiveNetManager.get(activity) - .openGuard(mLiveUid, - String.valueOf(dataTipModel.getGuardType()), - String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback() { - @Override - public void onSuccess(String data) { - if (TextUtils.equals(data, "22")) { - new DialogUitl.Builder(mContext) - .setView(R.layout.dialog_live_unfollow) - .setConfirmString(mContext.getString(R.string.charge)) - .setContent(mContext.getString(R.string.insufficient_balance)) - .setClickCallback(new DialogUitl.SimpleCallback() { - @Override - public void onConfirmClick(Dialog dialog, String content) { - LiveBuyGuardDialog.this.dismiss(); - ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); - } - }).build().show(); - } else { - IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType()); - ToastUtil.show(data); - dismiss(); - if (dataTipModel.getGuardType() == 3) { - new XPopup.Builder(mContext) - .dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true - .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) - .show(); - } - } - - } - - @Override - public void onError(String error) { - ToastUtil.show(error); - } - }); - } - }); + @Override + public void onCancel() { + bugGurd(false); + } + }); + }else{ + bugGurd(false); } - - } switch (dataTipModel.getGuardType()) { case 1: @@ -605,6 +435,208 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { } + private void bugGurd(boolean isCoupon) { + if (TextUtils.equals(userInfo.getIsOpen(), "1")) { + GuardBuyTipsDialog + .showBuyOrRenewDialog(mContext, + isCoupon?guardPriceModel.getCouponDiscountPrice():discountPrice.getText().toString(), + dataTipModel.getGuardName(), dataTipModel.isOpen(), + mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() { + @Override + public void onCancelClick() { + dismiss(); + } + + @Override + public void onConfirmClick(Dialog dialog, String content) { + + LiveNetManager.get(activity) + .openGuard(mLiveUid, + String.valueOf(dataTipModel.getGuardType()), + String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0",discount.getTag().toString(), new HttpCallback() { + @Override + public void onSuccess(String data) { + if (TextUtils.equals(data, "22")) { + new DialogUitl.Builder(mContext) + .setView(R.layout.dialog_live_unfollow) + .setConfirmString(mContext.getString(R.string.charge)) + .setContent(mContext.getString(R.string.insufficient_balance)) + .setClickCallback(new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + LiveBuyGuardDialog.this.dismiss(); + ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); + } + }).build().show(); + } else { + IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType()); + ToastUtil.show(data); + dismiss(); + if (dataTipModel.getGuardType() == 3) { + new XPopup.Builder(mContext) + .dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true + .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) + .show(); + } + } + + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + }); + } else { + if (userInfo.getGuardType() > dataTipModel.getGuardType()) { + String name = "星之守護"; + switch (userInfo.getGuardType()) { + case 1: + name = WordUtil.isNewZh() ? "星之守護" : "star guardian"; + break; + case 2: + name = WordUtil.isNewZh() ? "王之守護" : "king guardian"; + break; + case 3: + name = WordUtil.isNewZh() ? "神之守護" : "god guardian"; + break; + + } + StringBuffer buffer = new StringBuffer(); + if (WordUtil.isNewZh()) { + buffer.append("您的【") + .append(name).append("】已過期\n").append("開通相同或更高等級守護將會保留您的守護等級").append("開通低等級守護將重新計算您的守護等級"); + } else { + buffer.append("Your [") + .append(name).append("] has expired").append("active the same or higher level of guardian will retain your guardian level").append("active lower level guardian will recalculate your guardian level"); + } + GuardBuyTipsDialog + .showBuyOrRenewDialog(mContext, + null, + buffer.toString(), false, + null, -200, new DialogUitl.SimpleCallback2() { + @Override + public void onCancelClick() { + + } + + @Override + public void onConfirmClick(Dialog dialog, String content) { + GuardBuyTipsDialog + .showBuyOrRenewDialog(mContext, + isCoupon?guardPriceModel.getCouponDiscountPrice():discountPrice.getText().toString(), + dataTipModel.getGuardName(), dataTipModel.isOpen(), + mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() { + @Override + public void onCancelClick() { + dismiss(); + } + + @Override + public void onConfirmClick(Dialog dialog, String content) { + + LiveNetManager.get(activity) + .openGuard(mLiveUid, + String.valueOf(dataTipModel.getGuardType()), + String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0",discount.getTag().toString(), new HttpCallback() { + @Override + public void onSuccess(String data) { + if (TextUtils.equals(data, "22")) { + new DialogUitl.Builder(mContext) + .setView(R.layout.dialog_live_unfollow) + .setConfirmString(mContext.getString(R.string.charge)) + .setContent(mContext.getString(R.string.insufficient_balance)) + .setClickCallback(new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + LiveBuyGuardDialog.this.dismiss(); + ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); + } + }).build().show(); + } else { + IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType()); + ToastUtil.show(data); + dismiss(); + if (dataTipModel.getGuardType() == 3) { + new XPopup.Builder(mContext) + .dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true + .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) + .show(); + } + } + + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + }); + } + }); + }else { + GuardBuyTipsDialog + .showBuyOrRenewDialog(mContext, + isCoupon?guardPriceModel.getCouponDiscountPrice():discountPrice.getText().toString(), + dataTipModel.getGuardName(), dataTipModel.isOpen(), + mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() { + @Override + public void onCancelClick() { + dismiss(); + } + + @Override + public void onConfirmClick(Dialog dialog, String content) { + + LiveNetManager.get(activity) + .openGuard(mLiveUid, + String.valueOf(dataTipModel.getGuardType()), + String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0",discount.getTag().toString(), new HttpCallback() { + @Override + public void onSuccess(String data) { + if (TextUtils.equals(data, "22")) { + new DialogUitl.Builder(mContext) + .setView(R.layout.dialog_live_unfollow) + .setConfirmString(mContext.getString(R.string.charge)) + .setContent(mContext.getString(R.string.insufficient_balance)) + .setClickCallback(new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + LiveBuyGuardDialog.this.dismiss(); + ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); + } + }).build().show(); + } else { + IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType()); + ToastUtil.show(data); + dismiss(); + if (dataTipModel.getGuardType() == 3) { + new XPopup.Builder(mContext) + .dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true + .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) + .show(); + } + } + + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + }); + } + + + } + } + private void closeAnimSudGameListEvent(View view) { ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotation", -90f, 0f); animator.setDuration(animDuration); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java index 656fcc4ae..4814d3a59 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java @@ -66,7 +66,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { ImageView userSex, tagKing; RoundedImageView guardIcon; SVGAImageView giftSvga; - TextView btnGuardOpen; + ImageView btnGuardOpen; TextView guard_hint; TextView guard_time; View guardian_task_view; @@ -117,11 +117,11 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { IMLoginManager.get(mContext).setGuardRedPoint(); if (WordUtil.isNewZh()) { ViewGroup.LayoutParams layoutParams = guardian_task_view.getLayoutParams(); - layoutParams.width = DpUtil.dp2px(50); + layoutParams.width = DpUtil.dp2px(48); guardian_task_view.setLayoutParams(layoutParams); } else { ViewGroup.LayoutParams layoutParams = guardian_task_view.getLayoutParams(); - layoutParams.width = DpUtil.dp2px(78); + layoutParams.width = DpUtil.dp2px(68); guardian_task_view.setLayoutParams(layoutParams); } @@ -203,18 +203,18 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { if (TextUtils.equals(data.getIsOpen(), "0")) { guardianTask.setVisibility(GONE); myGraudGrade.setVisibility(GONE); - btnGuardOpen.setText(WordUtil.isNewZh() ? "開通守護" : "Open Guard"); + btnGuardOpen.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_first_icon)); guard_hint.setText(WordUtil.isNewZh() ? "快為您喜歡的主播開通守護吧!" : "Turn on the guard for your favorite anchor!"); } else { if (data.getGuardType() == 0) { guardianTask.setVisibility(GONE); myGraudGrade.setVisibility(GONE); - btnGuardOpen.setText(WordUtil.isNewZh() ? "開通守護" : "Open Guard"); + btnGuardOpen.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_first_icon)); guard_hint.setText(WordUtil.isNewZh() ? "快為您喜歡的主播開通守護吧!" : "Turn on the guard for your favorite anchor!"); } else { guardianTask.setVisibility(VISIBLE); myGraudGrade.setVisibility(VISIBLE); - btnGuardOpen.setText(WordUtil.isNewZh() ? "續費守護" : "Renewal"); + btnGuardOpen.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_icon)); StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(WordUtil.isNewZh() ? "您是當前主播的" : "You are the "); switch (data.getGuardType()) { @@ -260,7 +260,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { ToastUtil.show(error); guardianTask.setVisibility(GONE); myGraudGrade.setVisibility(GONE); - btnGuardOpen.setText(WordUtil.isNewZh() ? "開通守護" : "Open Guard"); + btnGuardOpen.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_first_icon)); } }); LiveNetManager.get(getContext()) @@ -347,7 +347,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { guardLevel.setText(String.valueOf(guardUserModel.getGuardLevel())); ImgLoader.display(mContext, guardUserModel.getAvatar(), guardIcon); - giftSvga.setImageResource(R.mipmap.guardian_img_wings_p); + giftSvga.setImageResource(R.mipmap.guardian_img_wings); if (TextUtils.equals(guardUserModel.getGuardLevelCard(), "0")) { switch (guardUserModel.getGuardType()) { case 1: diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardDialogFragment.java index 936906683..a47a5005b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardDialogFragment.java @@ -1,6 +1,5 @@ package com.yunbao.live.dialog; -import android.app.Dialog; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.Gravity; @@ -24,14 +23,10 @@ import com.yunbao.common.Constants; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.dialog.AbsDialogFragment; -import com.yunbao.common.dialog.GuardBuyTipsDialog; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.utils.CommonIconUtil; -import com.yunbao.common.utils.DialogUitl; -import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.utils.ToastUtils; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.adapter.GuardAdapter; @@ -48,10 +43,10 @@ import java.util.List; * 2024/02/22 */ public class LiveNewGuardDialogFragment extends AbsDialogFragment implements View.OnClickListener { - private ImageView guardIcon, userSex, userLevel; + private ImageView guardIcon, userSex,mBtnBuy, userLevel; private ConstraintLayout mRootLayout; private CommonRefreshView mRefreshView; - private TextView mBtnBuy, userName, userGuard, tip1, tip2; + private TextView userName, userGuard, tip1, tip2; private SVGAImageView giftSvga; private LinearLayout userLayout; @@ -117,7 +112,7 @@ public class LiveNewGuardDialogFragment extends AbsDialogFragment implements Vie relativeLayout = mRootView.findViewById(R.id.guard_relativeLayout); mBtnBuy.setOnClickListener(this); mBtnBuy.setEnabled(true); - mBtnBuy.setText(R.string.guard_buy_2); + mBtnBuy.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_first_icon)); initView(); } @@ -222,13 +217,13 @@ public class LiveNewGuardDialogFragment extends AbsDialogFragment implements Vie tip1.setText(R.string.guard_tip_0); } else if (guardType == Constants.GUARD_TYPE_DAY) { tip1.setText(mContext.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime()); - mBtnBuy.setText(R.string.guard_buy_3); + mBtnBuy.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_icon)); } else if (guardType == Constants.GUARD_TYPE_MONTH) { tip1.setText(mContext.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime()); - mBtnBuy.setText(R.string.guard_buy_3); + mBtnBuy.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_icon)); } else if (guardType == Constants.GUARD_TYPE_YEAR) { tip1.setText(mContext.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime()); - mBtnBuy.setText(R.string.guard_buy_3); + mBtnBuy.setImageDrawable(getResources().getDrawable(R.mipmap.guard_btn_buy_icon)); } } } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index d2e0c33d8..6ebfb5e08 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -153,6 +153,8 @@ public class LiveGiftAnimPresenter { private ObjectAnimator mGifGiftTipShowAnimatorBuyVip; private ObjectAnimator mGifGiftTipHideAnimatorBuyVip; + private ObjectAnimator mGifGiftTipShowAnimatorfull_sud_layout_name; + private LiveGiftViewHolder[] mLiveGiftViewHolders; private ConcurrentLinkedQueue mQueue; @@ -276,6 +278,7 @@ public class LiveGiftAnimPresenter { mFrameImageView = (FrameImageView) v.findViewById(R.id.all_frame_img); full_service_notice_new = v.findViewById(R.id.full_service_notice_new); + full_live_room_game_view = v.findViewById(R.id.sud_layout_name); full_service_notice_new_bg = v.findViewById(R.id.full_service_notice_new_bg); full_service_notice_new_icon = v.findViewById(R.id.full_service_notice_new_icon); full_service_notice_new_text = v.findViewById(R.id.full_service_notice_new_text); @@ -622,6 +625,15 @@ public class LiveGiftAnimPresenter { }); } + + public void startGiftTipAnimatormSud(){ + mDp500 = DpUtil.dp2px(-300); + mGifGiftTipShowAnimatorfull_sud_layout_name = ObjectAnimator.ofFloat(full_live_room_game_view, "translationX", mDp500, 0); + mGifGiftTipShowAnimatorfull_sud_layout_name.setDuration(600); + mGifGiftTipShowAnimatorfull_sud_layout_name.setInterpolator(new LinearInterpolator()); + mGifGiftTipShowAnimatorfull_sud_layout_name.start(); + } + private void setGitTipAnimatormGifGiftTipShowAnimatorfull_service_notice_new() { mDp500 = DpUtil.dp2px(500); mGifGiftTipShowAnimatorfull_service_notice_new = ObjectAnimator.ofFloat(full_service_notice_new, "translationX", mDp500, 0); @@ -656,6 +668,9 @@ public class LiveGiftAnimPresenter { } + + + /** * 釋放全局通知 */ @@ -1071,8 +1086,13 @@ public class LiveGiftAnimPresenter { mGifGiftTipGroupAllServer.setAlpha(1f); mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE); textRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, ""); - mIvLook.setVisibility(View.VISIBLE); + if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){ + mIvLook.setVisibility(View.GONE); + }else{ + mIvLook.setVisibility(View.VISIBLE); + } mIvLook.setTag(bean); + mIvLook.setVisibility(mLiveUid.equals(bean.getUid())?View.GONE:View.VISIBLE); mGifGiftTipShowAnimatorAllServer.start(); } @@ -1116,7 +1136,11 @@ public class LiveGiftAnimPresenter { break; } mIvLook.setText(R.string.participate_in); - mIvLook.setVisibility(View.VISIBLE); + if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){ + mIvLook.setVisibility(View.GONE); + }else{ + mIvLook.setVisibility(View.VISIBLE); + } superNotice.setBackgroundResource(R.mipmap.icon_blind_box_headlines); textRender.blindBoxText(mContext, mGifGiftTipAllServer, serverNotifyEvent); } @@ -1160,6 +1184,7 @@ public class LiveGiftAnimPresenter { AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent; View iv_look_full_service_notice_new3; ImageView iv_look_full_service_notice_new2; + View full_live_room_game_view; public void showAllServerNotifyFFGGGD(AllServerNotifyFFGGGDJANEvent event, boolean showB) { if (TextUtils.isEmpty(event.getBackgroundImage())) return; @@ -1206,10 +1231,10 @@ public class LiveGiftAnimPresenter { int unameSize = textMsg.length(); builder.setSpan(new ForegroundColorSpan(Color.parseColor(dto.getColour())), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } - if (!showB) { + if (!showB ||CommonAppConfig.getInstance().getUid().equals(mLiveUid)) { iv_look_full_service_notice_new3.setVisibility(View.GONE); } else { - if (TextUtils.equals(event.getJumpType(), "0")) { + if (TextUtils.equals(event.getJumpType(), "0")||CommonAppConfig.getInstance().getUid().equals(mLiveUid)) { iv_look_full_service_notice_new3.setVisibility(View.GONE); } else { iv_look_full_service_notice_new3.setVisibility(View.VISIBLE); @@ -1299,8 +1324,12 @@ public class LiveGiftAnimPresenter { if (!TextUtils.isEmpty(event.getIsOnlookers()) && TextUtils.equals("0", event.getIsOnlookers())) { mIvLookBuyGuardNew.setVisibility(View.GONE); } else { - mIvLookBuyGuardNew.setVisibility(View.VISIBLE); - mIvLookBuyGuardNew.setText(WordUtil.isNewZh() ? "圍觀" : "Views"); + if(event.getLiveuid().equals(mLiveUid)||CommonAppConfig.getInstance().getUid().equals(mLiveUid)){ + mIvLookBuyGuardNew.setVisibility(View.GONE); + }else{ + mIvLookBuyGuardNew.setVisibility(View.VISIBLE); + mIvLookBuyGuardNew.setText(WordUtil.isNewZh() ? "圍觀" : "Views"); + } } mGifGiftTipShowAnimatorBuyGuardNew.start(); @@ -1365,6 +1394,7 @@ public class LiveGiftAnimPresenter { //购买守护 全服通知 public void showBuyGuardGiftAnim(LiveReceiveGiftBean bean) { + mIvLookBuyGuard.setVisibility(mLiveUid.equals(bean.getUid())?View.GONE:View.VISIBLE); if (bean.ismTypeBuyGuard()) { mTempGifGiftBean = bean; if (mShowAllServer) { @@ -1502,6 +1532,8 @@ public class LiveGiftAnimPresenter { iv_look_buy_vip.setVisibility(View.GONE); } + iv_look_buy_vip.setVisibility(mLiveUid.equals(bean.getUid())?View.GONE:View.VISIBLE); + mGifGiftTipBuyVip.setSelected(false); if (!"0".equals(bean.getmLiveUId())) { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 8512f5bcb..492773d4b 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -490,7 +490,9 @@ public class SocketRyClient { } else if (action2 == 90) { NewAllServerNotifyGuardEvent notifyGuardEvent = GsonUtils.fromJson(map.toString(), NewAllServerNotifyGuardEvent.class); Bus.get().post(notifyGuardEvent); - buyGuardInSameRoom(map); + if(mLiveUid.equals(map.getString("liveuid"))){ + buyGuardInSameRoom(map); + } } else if (action2 == 91) {//通用模板 AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent = GsonUtils.fromJson(map.toString(), AllServerNotifyFFGGGDJANEvent.class); Bus.get().post(notifyFFGGGDJANEvent); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index d7da42ba4..113e2b776 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -470,7 +470,9 @@ public class SocketSwClient { } else if (action2 == 90) { NewAllServerNotifyGuardEvent notifyGuardEvent = GsonUtils.fromJson(map.toString(), NewAllServerNotifyGuardEvent.class); Bus.get().post(notifyGuardEvent); - buyGuardInSameRoom(map); + if(mLiveUid.equals(map.getString("liveuid"))){ + buyGuardInSameRoom(map); + } } else if (action2 == 91) { AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent = GsonUtils.fromJson(map.toString(), AllServerNotifyFFGGGDJANEvent.class); Bus.get().post(notifyFFGGGDJANEvent); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index ee14f4e47..112469ce7 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -758,7 +758,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } private TextView sud_text_name; - private LinearLayout sud_layout_name; + private RelativeLayout sud_layout_name; + private TextView sud_join; + private ImageView iconSudClose; private Handler sudNameHandler = new Handler(); private Runnable sudNameRunnable = new Runnable() { @Override @@ -771,9 +773,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void setSudName(String sudName, SudGameDateModel sudGameDateModel) { sud_text_name = (TextView) findViewById(R.id.sud_text_name); - sud_layout_name = (LinearLayout) findViewById(R.id.sud_layout_name); - sud_text_name.setText(WordUtil.isNewZh() ? String.format("主播创建了【%s】房间,快来与主播同玩~", sudName) : String.format("The anchor has created a 【%s】 room. Come and play with the anchor~", sudName)); - sud_layout_name.setVisibility(View.VISIBLE); + sud_layout_name = (RelativeLayout) findViewById(R.id.sud_layout_name); + iconSudClose = (ImageView) findViewById(R.id.iconSudClose); + //sud_layout_name.setVisibility(View.VISIBLE); ViewClicksAntiShake.clicksAntiShake(sud_layout_name, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { @@ -792,8 +794,34 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis sud_layout_name.setVisibility(View.GONE); } }); + ViewClicksAntiShake.clicksAntiShake(iconSudClose, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + sud_layout_name.setVisibility(View.GONE); + } + }); sudNameHandler.removeCallbacks(sudNameRunnable); sudNameHandler.postDelayed(sudNameRunnable, 10000); + sud_layout_name.post(new Runnable() { + @Override + public void run() { + RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) sud_layout_name.getLayoutParams(); + params1.width = mChatRecyclerView.getWidth()-DpUtil.dp2px(85); + sud_layout_name.setLayoutParams(params1); + } + }); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + sud_text_name.setText(WordUtil.isNewZh() ? String.format("主播创建了【%s】房间,快来与主播同玩~", sudName) : String.format("The anchor created a 【%s】 room", sudName)); + sud_layout_name.setVisibility(View.VISIBLE); + mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); + mLiveGiftAnimPresenter.startGiftTipAnimatormSud(); + } + },2000); + + } private View sudGameMin; @@ -2121,12 +2149,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis redPacket.setVisibility(View.GONE); if (dragonImmediateParticipation.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipation.setLayoutParams(layoutParams); } if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipationTime.setLayoutParams(layoutParams); } anchorTimeHandler.removeCallbacks(anchorTimeRunnable); @@ -2156,22 +2184,22 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis redPacket.setVisibility(View.VISIBLE); if (dragonImmediateParticipation.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(190); + layoutParams.topMargin = DpUtil.dp2px(240); dragonImmediateParticipation.setLayoutParams(layoutParams); } if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE && mContext instanceof LiveRyAnchorActivity || mContext instanceof LiveSwAnchorActivity) { RelativeLayout.LayoutParams layoutParamsredPacket = (RelativeLayout.LayoutParams) redPacket.getLayoutParams(); - layoutParamsredPacket.topMargin = DpUtil.dp2px(110); + layoutParamsredPacket.topMargin = DpUtil.dp2px(160); redPacket.setLayoutParams(layoutParamsredPacket); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipationTime.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(190); + layoutParams.topMargin = DpUtil.dp2px(240); dragonImmediateParticipationTime.setLayoutParams(layoutParams); } if (mContext instanceof LiveRyAnchorActivity || mContext instanceof LiveSwAnchorActivity) { if (dragonImmediateParticipationTime.getVisibility() == View.GONE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) redPacket.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); redPacket.setLayoutParams(layoutParams); } } @@ -2237,12 +2265,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis redPacket.setVisibility(View.GONE); if (dragonImmediateParticipation.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipation.setLayoutParams(layoutParams); } if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipationTime.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipationTime.setLayoutParams(layoutParams); } } @@ -3576,11 +3604,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis dragonImmediateParticipationTime.setVisibility(View.VISIBLE); if (redPacket.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(190); + layoutParams.topMargin = DpUtil.dp2px(240); dragonImmediateParticipationTime.setLayoutParams(layoutParams); } else { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipationTime.setLayoutParams(layoutParams); } String s1 = StringUtil.getDurationText(sendMoneyTime * 1000); @@ -3590,11 +3618,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis dragonImmediateParticipation.setVisibility(View.VISIBLE); if (redPacket.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(190); + layoutParams.topMargin = DpUtil.dp2px(240); dragonImmediateParticipation.setLayoutParams(layoutParams); } else { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipation.setLayoutParams(layoutParams); } } @@ -3610,7 +3638,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis dragonImmediateParticipationTime.setLayoutParams(layoutParams); } else { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(110); + layoutParams.topMargin = DpUtil.dp2px(160); dragonImmediateParticipationTime.setLayoutParams(layoutParams); } } else { @@ -3649,7 +3677,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis dragonImmediateParticipation.setVisibility(View.VISIBLE); if (redPacket.getVisibility() == View.VISIBLE) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); - layoutParams.topMargin = DpUtil.dp2px(190); + layoutParams.topMargin = DpUtil.dp2px(240); dragonImmediateParticipation.setLayoutParams(layoutParams); } else { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); @@ -4416,29 +4444,30 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * @param bean */ public void showBuyVipMessage(LiveReceiveGiftBean bean) { + L.eSw("showBuyVipMessage:"+bean.getRoomnum()+"__"+mLiveUid); noble.setVisibility(View.VISIBLE); switch (bean.getNobilityid()) { case "1": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.BARON).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.BARON).setCallBack(() -> gotoLive(bean.getRoomnum())); break; case "2": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.VISCOUNT).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.VISCOUNT).setCallBack(() -> gotoLive(bean.getRoomnum())); break; case "3": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.MARQUIS).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.MARQUIS).setCallBack(() -> gotoLive(bean.getRoomnum())); break; case "4": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.DUKE).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.DUKE).setCallBack(() -> gotoLive(bean.getRoomnum())); break; case "5": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.KING).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.KING).setCallBack(() -> gotoLive(bean.getRoomnum())); break; case "6": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.EMPEROR).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.EMPEROR).setCallBack(() -> gotoLive(bean.getRoomnum())); break; case "7": - noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum()).setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR).setCallBack(() -> gotoLive(bean.getRoomnum())); + noble.setRootView(bean.getUhead(), bean.getUname(), bean.getAncherName(), bean.getRoomnum(),mLiveUid).setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR).setCallBack(() -> gotoLive(bean.getRoomnum())); break; } } diff --git a/live/src/main/res/drawable/background_live_sud_hint.xml b/live/src/main/res/drawable/background_live_sud_hint.xml new file mode 100644 index 000000000..52dd2db6d --- /dev/null +++ b/live/src/main/res/drawable/background_live_sud_hint.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_room_sud_hint.xml b/live/src/main/res/drawable/bg_live_room_sud_hint.xml new file mode 100644 index 000000000..bcfe90830 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_room_sud_hint.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_room_sud_hint_join.xml b/live/src/main/res/drawable/bg_live_room_sud_hint_join.xml new file mode 100644 index 000000000..d9794df65 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_room_sud_hint_join.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/guard_buy_bottom_bg.png b/live/src/main/res/drawable/guard_buy_bottom_bg.png new file mode 100644 index 000000000..1bb0c6d68 Binary files /dev/null and b/live/src/main/res/drawable/guard_buy_bottom_bg.png differ diff --git a/live/src/main/res/drawable/guard_buy_bottom_bg.xml b/live/src/main/res/drawable/guard_buy_bottom_bg.xml deleted file mode 100644 index 04bb75341..000000000 --- a/live/src/main/res/drawable/guard_buy_bottom_bg.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/live/src/main/res/drawable/guard_buy_center_bg.png b/live/src/main/res/drawable/guard_buy_center_bg.png new file mode 100644 index 000000000..44becfe48 Binary files /dev/null and b/live/src/main/res/drawable/guard_buy_center_bg.png differ diff --git a/live/src/main/res/drawable/guard_buy_center_bg.xml b/live/src/main/res/drawable/guard_buy_center_bg.xml deleted file mode 100644 index 5fd926d13..000000000 --- a/live/src/main/res/drawable/guard_buy_center_bg.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/live/src/main/res/drawable/guard_buy_top_bg.png b/live/src/main/res/drawable/guard_buy_top_bg.png new file mode 100644 index 000000000..fa9ea9daa Binary files /dev/null and b/live/src/main/res/drawable/guard_buy_top_bg.png differ diff --git a/live/src/main/res/drawable/guard_buy_top_bg.xml b/live/src/main/res/drawable/guard_buy_top_bg.xml deleted file mode 100644 index 7b46e52b4..000000000 --- a/live/src/main/res/drawable/guard_buy_top_bg.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/live/src/main/res/drawable/live_dialog_top_guardian_tasks_bg.png b/live/src/main/res/drawable/live_dialog_top_guardian_tasks_bg.png new file mode 100644 index 000000000..3babba344 Binary files /dev/null and b/live/src/main/res/drawable/live_dialog_top_guardian_tasks_bg.png differ diff --git a/live/src/main/res/layout/dialog_live_guard.xml b/live/src/main/res/layout/dialog_live_guard.xml index 53b607437..79b41d55d 100644 --- a/live/src/main/res/layout/dialog_live_guard.xml +++ b/live/src/main/res/layout/dialog_live_guard.xml @@ -9,7 +9,7 @@ android:layout_height="match_parent" android:layout_marginTop="59dp" android:layout_marginBottom="71dp" - android:background="@drawable/background_live_guard"> + android:background="@drawable/guard_buy_top_bg"> - + android:layout_width="48dp" + android:layout_height="20dp" + android:layout_marginTop="6dp" + android:src="@drawable/live_dialog_top_guardian_tasks_bg" + /> @@ -121,11 +121,6 @@ android:textColor="@color/white" android:textSize="12sp" /> - + android:background="@drawable/guard_buy_center_bg"> + android:background="@drawable/guard_buy_bottom_bg"> - - + android:textSize="14sp" /> \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_new_guard.xml b/live/src/main/res/layout/dialog_new_guard.xml index 6130d180e..e8e05bd0c 100644 --- a/live/src/main/res/layout/dialog_new_guard.xml +++ b/live/src/main/res/layout/dialog_new_guard.xml @@ -17,6 +17,36 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"> + + + + + + @@ -143,30 +173,29 @@ android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:drawablePadding="4dp" - android:text="456" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" + android:text="456" android:textColor="#A281FD" android:textSize="11sp" android:visibility="gone" /> - - @@ -195,7 +224,7 @@ android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:scaleType="centerCrop" - android:src="@mipmap/guardian_img_wings" + android:src="@mipmap/guardian_img_wings" android:visibility="visible" app:riv_oval="true" /> @@ -204,7 +233,7 @@ android:id="@+id/gift_svga" android:layout_width="match_parent" android:layout_height="match_parent" - android:src="@mipmap/guardian_img_wings" + android:src="@mipmap/guardian_img_wings" android:visibility="visible" app:autoPlay="true" /> diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index f3e474019..5bbcef852 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -515,7 +515,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentBottom="true" - android:layout_marginEnd="150dp" + android:layout_marginEnd="144dp" android:layout_marginBottom="-2dp" android:text="99" android:textColor="#FFB403" diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 85d467f17..de45e45ae 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -745,8 +745,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="12dp" - android:layout_marginTop="100dp" - android:visibility="gone" /> + android:layout_marginTop="160dp" + android:visibility="gone" + tools:visibility="visible"/> + android:layout_marginEnd="5dp" + android:layout_marginBottom="1dp"> + android:textSize="12sp" + tools:text="btn" + tools:textColor="@color/white" /> @@ -1514,10 +1516,11 @@ + android:visibility="gone" + tools:visibility="visible"> + + android:layout_height="wrap_content" + android:layout_alignParentBottom="true"> + tools:visibility="visible" /> + android:visibility="gone" /> + android:layout_height="46dp" + android:layout_gravity="end" + android:layout_marginEnd="16dp" + android:layout_marginBottom="5dp" + android:src="@mipmap/turntable_icon" + android:visibility="gone" + tools:visibility="visible" /> + app:indicator_height="8dp" + tools:visibility="visible" /> - + android:paddingStart="5dp" + android:visibility="gone" + tools:visibility="visible"> + + + + - + android:textSize="10sp" + android:visibility="visible" + tools:visibility="visible" /> + + + + + android:layout_marginStart="220dp" + tools:visibility="gone"> Trick instructions Entertainment Tricky has been newly upgraded. Go and set up Tricky content to add more fun to the live broadcast room! Go now + Join + Guard tasks \ No newline at end of file diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml index 4421ef568..04f92fff9 100644 --- a/live/src/main/res/values/strings.xml +++ b/live/src/main/res/values/strings.xml @@ -143,4 +143,6 @@ 整蠱說明 娛樂整蠱全新升級,快去設置整蠱内容,給直播間增加更多趣味吧! 立即前往 + 加入 + 守護任務 diff --git a/main/build.gradle b/main/build.gradle index d1b0f355a..cd4cb7565 100644 --- a/main/build.gradle +++ b/main/build.gradle @@ -3,8 +3,8 @@ apply plugin: 'img-optimizer' apply from: "../package_config.gradle" android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - buildToolsVersion rootProject.ext.android.buildToolsVersion + namespace "com.yunbao.main" + compileSdk rootProject.ext.android.compileSdkVersion packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" @@ -31,7 +31,12 @@ 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 { @@ -54,8 +59,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_18 + targetCompatibility JavaVersion.VERSION_18 } } repositories { @@ -83,7 +88,6 @@ dependencies { implementation project(path: ':lib_country_code') //抽屉菜单 implementation 'com.justkiddingbaby:slidemenu:1.3.0' - implementation 'com.xj.marqueeView:marqueeView:0.1.20' //引导层 implementation 'com.binioter:guideview:1.0.0' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' diff --git a/main/src/main/AndroidManifest.xml b/main/src/main/AndroidManifest.xml index 99d1147e3..dd1cd4331 100644 --- a/main/src/main/AndroidManifest.xml +++ b/main/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + > @@ -62,8 +62,8 @@ android:screenOrientation="portrait" /> + android:configChanges="locale|layoutDirection|keyboard" + android:screenOrientation="portrait" /> - + - - + + + - - - \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 5764d71db..e1655c875 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -1,6 +1,7 @@ package com.yunbao.main.activity; import static com.yunbao.common.CommonAppContext.isReady; +import static com.yunbao.common.manager.imrongcloud.RongcloudIMManager.connectIM; import android.Manifest; import android.animation.Animator; @@ -52,6 +53,7 @@ import com.tencent.imsdk.v2.V2TIMSDKListener; import com.tencent.imsdk.v2.V2TIMUserFullInfo; import com.yunbao.common.bean.QiniuLog; import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.LogUtil; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.CommonAppConfig; @@ -375,7 +377,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene RouteUtil.forwardLoginInvalid("登錄失效"); return; } - RongcloudIMManager.connectIM(mContext.getApplication()); + connectIM(mContext.getApplication()); position = 0; mTabButtonGroup.setCurPosition(0); } @@ -852,13 +854,30 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } private void showStartDialog() { - if (isReady == true) { MainStartDialogFragment dialogFragment = new MainStartDialogFragment(); dialogFragment.setMainStartChooseCallback(true, this); dialogFragment.show(getSupportFragmentManager(), "MainStartDialogFragment"); } else { - ToastUtil.show("正在初始化,請稍等...."); + connectIM(AppManager.getInstance().getMainActivity(), new RongIMClient.ConnectCallback() { + @Override + public void onSuccess(String t) { + MainStartDialogFragment dialogFragment = new MainStartDialogFragment(); + dialogFragment.setMainStartChooseCallback(true, MainActivity.this); + dialogFragment.show(getSupportFragmentManager(), "MainStartDialogFragment"); + } + + @Override + public void onError(RongIMClient.ConnectionErrorCode e) { + ToastUtil.show(R.string.net_error+""+e.toString()); + } + + @Override + public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) { + ToastUtil.show(R.string.net_error+""+code); + } + }); + } } diff --git a/main/src/main/java/com/yunbao/main/activity/SamsungFragment.java b/main/src/main/java/com/yunbao/main/activity/SamsungFragment.java index 6ec25fd5b..8fa0a3d02 100644 --- a/main/src/main/java/com/yunbao/main/activity/SamsungFragment.java +++ b/main/src/main/java/com/yunbao/main/activity/SamsungFragment.java @@ -1,8 +1,6 @@ package com.yunbao.main.activity; -import static com.yunbao.main.activity.MyWalletActivity.dis; - import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; @@ -16,13 +14,6 @@ import android.webkit.WebView; import androidx.fragment.app.Fragment; -import com.facebook.appevents.AppEventsConstants; -import com.samsung.android.sdk.iap.lib.helper.HelperDefine; -import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener; -import com.samsung.android.sdk.iap.lib.vo.ErrorVo; -import com.samsung.android.sdk.iap.lib.vo.PurchaseVo; -import com.yunbao.common.http.CommonHttpUtil; -import com.yunbao.common.http.HttpCallback; import com.yunbao.common.pay.samsung.SamsungUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; @@ -104,41 +95,38 @@ public class SamsungFragment extends Fragment { mProductId = ProductId; mOrderid = OrderNumber; MoneyUsds = MoneyUsd; - - SamsungUtil.newInstance(getActivity()).buy(mProductId, new OnPaymentListener() { + SamsungUtil.newInstance(getActivity()).buy(mProductId, new SamsungUtil.OnPaymentListener() { @Override - public void onPayment(ErrorVo _errorVO, PurchaseVo _purchaseVO) { - if (_purchaseVO != null) { - SamsungUtil.newInstance(getActivity()).consume(_purchaseVO.getPurchaseId()); - payHandler.post(new Runnable() { - @Override - public void run() { - CommonHttpUtil.notifySamsung(_purchaseVO.getPurchaseId(), mOrderid, new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - ToastUtil.show(getString(R.string.pay_suc)); - dis(); - } - } - }); - } - }); - } else { - payHandler.post(new Runnable() { - @Override - public void run() { - if (_errorVO.getErrorCode() == HelperDefine.IAP_PAYMENT_IS_CANCELED) { - ToastUtil.show(getString(R.string.pay_cancel)); - } else { - ToastUtil.show(_errorVO.getErrorString()); - } - } - }); - } + public void onPaymentSuccess(String purchaseVo) { + SamsungUtil.newInstance(getActivity()).consume(purchaseVo); + payHandler.post(new Runnable() { + @Override + public void run() { +// CommonHttpUtil.notifySamsung(_purchaseVO.getPurchaseId(), mOrderid, new HttpCallback() { +// @Override +// public void onSuccess(int code, String msg, String[] info) { +// if (code == 0) { +// ToastUtil.show(getString(R.string.pay_suc)); +// dis(); +// } +// } +// }); + } + }); + } + + @Override + public void onPaymentFailed(String errorVo) { + payHandler.post(new Runnable() { + @Override + public void run() { + ToastUtil.show(errorVo); + } + }); } }); } + lastClickTime = currentTime; Log.e(TAG, "ProductId" + ProductId + "OrderNumber" + OrderNumber + "MoneyUsd" + MoneyUsd); @@ -154,6 +142,7 @@ public class SamsungFragment extends Fragment { public void androidGoBack() { getActivity().onBackPressed(); } + } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index c8e9d9579..85de4e099 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -18,12 +18,9 @@ import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.activity.AbsActivity; -import com.yunbao.common.dialog.SkitCheckInWasSuccessfulPopup; import com.yunbao.common.event.FloatWarOrderEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.RouteUtil; -import com.yunbao.live.dialog.LiveBuyGuardDialog; -import com.yunbao.live.dialog.LiveGuardDialog; import com.yunbao.live.dialog.LivePrankDialogFragment; import com.yunbao.main.R; diff --git a/pluginsForAnchor/build.gradle b/pluginsForAnchor/build.gradle index dff9b69f7..cf887fa31 100644 --- a/pluginsForAnchor/build.gradle +++ b/pluginsForAnchor/build.gradle @@ -3,8 +3,8 @@ apply plugin: 'com.android.application' android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - buildToolsVersion rootProject.ext.android.buildToolsVersion + namespace "com.pdlive.plugins" + compileSdk rootProject.ext.android.compileSdkVersion packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" diff --git a/pluginsForAnchor/src/main/AndroidManifest.xml b/pluginsForAnchor/src/main/AndroidManifest.xml index 8b45ca164..ef9fe17a3 100644 --- a/pluginsForAnchor/src/main/AndroidManifest.xml +++ b/pluginsForAnchor/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@