diff --git a/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java index bbbc9e328..1143372ba 100644 --- a/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java @@ -13,6 +13,7 @@ import com.yunbao.common.R; import com.yunbao.common.bean.CustomSidebarChildModel; import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.SpUtil; import com.yunbao.common.views.InteractionGamesChildViewHolder; import java.util.ArrayList; @@ -36,7 +37,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false); - return new InteractionGamesChildViewHolder(runGamesView); + return new InteractionGamesChildViewHolder(runGamesView,mContext); } @Override @@ -51,6 +52,9 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { if (activityID != 0) { Bus.get().post(new CustomDrawerPopupEvent() .setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild)); + if(model.getSudGameIsNew().equals("1")){ + SpUtil.getInstance().setLiveGameId(model.getId()); + } } diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java index 54c1f1c45..077196417 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java @@ -31,11 +31,16 @@ public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter { @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false); - return new NewRoleFunGamesChildViewHolder(runGamesView,showRed); + return new NewRoleFunGamesChildViewHolder(runGamesView,showRed,mContext); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int) + (mContext.getResources().getDisplayMetrics().widthPixels / 4.5), + ViewGroup.LayoutParams.WRAP_CONTENT); + holder.itemView.setLayoutParams(layoutParams); + NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder; childViewHolder.setData(child.get(position), rigts); } diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java index 3d17bf60e..7950a02ca 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java @@ -11,11 +11,11 @@ import androidx.recyclerview.widget.RecyclerView; import com.yunbao.common.R; import com.yunbao.common.bean.CustomSidebarChildModel; -import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.event.LiveNewRoleEvent; import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent; import com.yunbao.common.utils.Bus; -import com.yunbao.common.views.InteractionGamesChildViewHolder; +import com.yunbao.common.utils.SpUtil; +import com.yunbao.common.views.InteractionGamesChildBottomViewHolder; import java.util.ArrayList; import java.util.List; @@ -34,14 +34,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter { @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false); - return new InteractionGamesChildViewHolder(runGamesView); + return new InteractionGamesChildBottomViewHolder(runGamesView,mContext); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { - InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder; + InteractionGamesChildBottomViewHolder childViewHolder = (InteractionGamesChildBottomViewHolder) holder; childViewHolder.setData(child.get(position), rigts); - childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() { + childViewHolder.setItemViewClicks(new InteractionGamesChildBottomViewHolder.InteractionGamesCallBack() { @Override public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) { @@ -52,6 +52,9 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter { .setInteractionID(activityID) .setChild(child) .setInteraction(true)); + if(model.getSudGameIsNew().equals("1")){ + SpUtil.getInstance().setLiveGameId(model.getId()); + } } @@ -60,12 +63,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter { }); } + @Override public int getItemCount() { return child.size(); } public void updateData(List 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/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/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..289772384 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; @@ -26,18 +29,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 +71,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 +88,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 +104,58 @@ 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 (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/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index cda5437c1..3ccee21f9 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -1195,7 +1195,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 0aa79bb7d..0a6d10c5a 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 @@ -3015,9 +3015,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/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..fd4cc66ba 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java @@ -98,7 +98,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 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/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/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..1b54f1c8a 100644 --- a/common/src/main/res/layout/dialog_live_sud_game.xml +++ b/common/src/main/res/layout/dialog_live_sud_game.xml @@ -3,17 +3,19 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="650dp" + xmlns:tools="http://schemas.android.com/tools" android:background="@drawable/bg_live_sud_list" android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + - @@ -62,74 +138,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - - - - - - - - - - - - - - - - - - - - - \ 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_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-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/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index f7b69bd82..8397d6839 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: diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 0ca615a3c..c8249563d 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: 請輸入房間名 游戲類型: 游戲門檻: @@ -1501,4 +1501,6 @@ 短劇 完成*1 主播正在PK,稍後再試 + 使用 + 不使用 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index d2ff10baf..a1e772120 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: 請輸入房間名 游戲類型: 游戲門檻: @@ -1500,4 +1500,6 @@ 短劇 完成*1 主播正在PK,稍後再試 + 使用 + 不使用 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index f118df88a..b4cb55478 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,5 +1497,7 @@ 短劇 完成*1 主播正在PK,稍後再試 + 使用 + 不使用 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 136420081..16dd5cbc1 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1335,7 +1335,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: @@ -1506,4 +1506,6 @@ Limited ride And limited avatar frame Theater The anchor is in PK, please try again later once + Use + Not use diff --git a/config.gradle b/config.gradle index 3f81a20b3..c39514dfd 100644 --- a/config.gradle +++ b/config.gradle @@ -4,16 +4,16 @@ ext { buildToolsVersion: "29.0.2", minSdkVersion : 21, targetSdkVersion : 33, - versionCode : 681, + 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/gradle.properties b/gradle.properties index 5759f9c1a..c781c87a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,8 +23,7 @@ android.enableJetifier=true systemProp.http.proxyHost=127.0.0.1 systemProp.https.proxyHost=127.0.0.1 -systemProp.https.proxyPort=7890 -systemProp.http.proxyPort=7890 - +systemProp.https.proxyPort=10809 +systemProp.http.proxyPort=10809 #android.enableR8.fullMode=true \ No newline at end of file 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 46de579c3..316645f99 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -103,6 +103,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/SudRyGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java index 1a568cb1f..c50556c5e 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java @@ -448,7 +448,7 @@ 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; 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 4b8130988..95bf87cb6 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java @@ -496,7 +496,7 @@ 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; 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 2ca16c616..9492c8927 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/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 72dfc078f..372f890af 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -714,7 +714,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 @@ -727,9 +729,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() { @@ -748,8 +750,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; @@ -2073,12 +2101,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); @@ -2108,22 +2136,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); } } @@ -2189,12 +2217,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); } } @@ -3528,11 +3556,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); @@ -3542,11 +3570,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); } } @@ -3562,7 +3590,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 { @@ -3601,7 +3629,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(); @@ -4366,29 +4394,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 63412cec3..6335fc530 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" /> @@ -1515,10 +1517,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/src/main/AndroidManifest.xml b/main/src/main/AndroidManifest.xml index 99d1147e3..da4e5b304 100644 --- a/main/src/main/AndroidManifest.xml +++ b/main/src/main/AndroidManifest.xml @@ -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/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 3f92eb5b5..c55dd0955 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -15,12 +15,9 @@ import com.lxj.xpopup.XPopup; import com.yunbao.common.manager.IMLoginManager; 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;