diff --git a/common/src/main/java/com/yunbao/common/bean/CoolConfig.java b/common/src/main/java/com/yunbao/common/bean/CoolConfig.java index 689e6972a..175e49804 100644 --- a/common/src/main/java/com/yunbao/common/bean/CoolConfig.java +++ b/common/src/main/java/com/yunbao/common/bean/CoolConfig.java @@ -1,8 +1,18 @@ package com.yunbao.common.bean; public class CoolConfig extends BaseModel { - private int rate=1; - private String ticketCount="0" ; + private int rate = 1; + private String ticketCount = "0"; + private String yuanbao = "0"; + + public String getYuanbao() { + return yuanbao; + } + + public CoolConfig setYuanbao(String yuanbao) { + this.yuanbao = yuanbao; + return this; + } public String getTicketCount() { return ticketCount; diff --git a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java index 010bf189a..9f00807f9 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java @@ -1,7 +1,14 @@ package com.yunbao.common.dialog; +import static android.content.Context.INPUT_METHOD_SERVICE; + import android.content.Context; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; import android.view.View; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; import android.widget.TextView; import androidx.annotation.NonNull; @@ -12,13 +19,15 @@ import com.yunbao.common.bean.CoolConfig; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import java.math.BigDecimal; public class CinemaTicketPopupWindow extends CenterPopupView { private CoolConfig mCoolConfig; - private TextView cinemaTicket, ticketsPlusMinus, quantityNeed; + private TextView cinemaTicket, quantityNeed, quantityNeed2; + private EditText ticketsPlusMinus; private int ticket = 1; private CinemaTicketPopupWindowCallBack mCinemaTicketPopupWindowCallBack; @@ -41,9 +50,30 @@ public class CinemaTicketPopupWindow extends CenterPopupView { cinemaTicket = findViewById(R.id.cinema_ticket); ticketsPlusMinus = findViewById(R.id.tickets_plus_minus); quantityNeed = findViewById(R.id.quantity_need); - cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString()); + quantityNeed2 = findViewById(R.id.quantity_need2); + cinemaTicket.setText(mCoolConfig.getTicketCount()); ticketsPlusMinus.setText(String.valueOf(ticket)); - quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString()); + quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+""); + quantityNeed.setText(mCoolConfig.getYuanbao()); + ticketsPlusMinus.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) { + if (!TextUtils.isEmpty(charSequence.toString())) { + ticket = new BigDecimal(charSequence.toString()).intValue(); + quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+""); + } + } + + @Override + public void afterTextChanged(Editable editable) { + + } + }); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { @@ -56,9 +86,8 @@ public class CinemaTicketPopupWindow extends CenterPopupView { if (ticket > 1) { ticket = ticket - 1; - cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString()); ticketsPlusMinus.setText(String.valueOf(ticket)); - quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString()); + quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+""); } } }); @@ -66,33 +95,41 @@ public class CinemaTicketPopupWindow extends CenterPopupView { @Override public void onClick(View view) { ticket = ticket + 1; - cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString()); ticketsPlusMinus.setText(String.valueOf(ticket)); - quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString()); + quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+""); } }); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_exchange), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - LiveNetManager.get(getContext()) - .buyTicket(String.valueOf(ticket), new HttpCallback() { - @Override - public void onSuccess(String data) { + if (ticket>=1&&ticket<=9999){ + LiveNetManager.get(getContext()) + .buyTicket(String.valueOf(ticket), new HttpCallback() { + @Override + public void onSuccess(String data) { + ToastUtil.show(WordUtil.isNewZh() ? "兑换成功" : "Successful exchange"); + if (mCinemaTicketPopupWindowCallBack != null) { + mCinemaTicketPopupWindowCallBack.onCallBack(data); + } + dialog.dismiss(); - if (mCinemaTicketPopupWindowCallBack != null) { - mCinemaTicketPopupWindowCallBack.onCallBack(data); } - dialog.dismiss(); - } - @Override - public void onError(String error) { - ToastUtil.show(error); - } - }); + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + }else { + ToastUtil.show(WordUtil.isNewZh() ? "兌換數量區間為[1 - 9999]" : "The exchange quantity range is [1-9999]"); + } + InputMethodManager inputMethodManager = (InputMethodManager)ticketsPlusMinus.getContext().getSystemService(INPUT_METHOD_SERVICE); + inputMethodManager.hideSoftInputFromWindow(ticketsPlusMinus.getWindowToken(), 0); } }); + InputMethodManager inputMethodManager = (InputMethodManager)ticketsPlusMinus.getContext().getSystemService(INPUT_METHOD_SERVICE); + inputMethodManager.hideSoftInputFromWindow(ticketsPlusMinus.getWindowToken(), 0); } public interface CinemaTicketPopupWindowCallBack { diff --git a/common/src/main/res/layout/cinema_ticket_popup.xml b/common/src/main/res/layout/cinema_ticket_popup.xml index 58778fa45..f6fc7096e 100644 --- a/common/src/main/res/layout/cinema_ticket_popup.xml +++ b/common/src/main/res/layout/cinema_ticket_popup.xml @@ -32,6 +32,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="0" + android:inputType="number" android:textColor="#DFEAFF" android:textSize="15sp" /> @@ -68,12 +69,14 @@ android:layout_height="match_parent" android:layout_weight="1" /> - + + + + + - + Above 500 coins combo X Exchange quantity: - Need %s + Balance %s Exchange&Usage Rules: 1.One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance; 2.One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie; diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 20f17754b..3e8b1cfdd 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1385,9 +1385,9 @@ 500以上星幣 連擊× 兌換數量: - 需要 %s + 余额 %s 兌換&使用規則: - 1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - 2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - 3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 + 一、星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index f14c42b6d..f7b12dd83 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1159,7 +1159,7 @@ 投票中 - %s
問答框%s秒后消失
+ %s
問答框%s秒后消失
請完整填寫 填寫“*”的選項可完成 真愛粉\n頭像框(7天) @@ -1384,9 +1384,9 @@ 500以上星幣 連擊× 兌換數量: - 需要 %s + 余额 %s 兌換&使用規則: - 1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - 2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - 3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 + 一、星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 68ced0bf7..a08bf972b 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1384,10 +1384,10 @@ 500以上星幣 連擊× 兌換數量: - 需要 %s + 余额 %s 兌換&使用規則: - 1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - 2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - 3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 + 一、星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index b8c3434d1..21579cb64 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1391,7 +1391,7 @@ Limited ride And limited avatar frame
Above 500 coins combo X Exchange quantity: - Need %s + Balance %s Exchange&Usage Rules: 1.One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance; 2.One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie; diff --git a/config.gradle b/config.gradle index 9cee3cf51..c9e395940 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 - //serverHost : " https://ceshi.yaoulive.com", + serverHost : " https://ceshi.yaoulive.com", //百度语音识别 @@ -21,10 +21,10 @@ ext { baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 - isGooglePlay : 1, + isGooglePlay : 0, //是否上报异常日志 isUploadLog : true, //是否打包成插件包模式 - isPluginModel : false, + isPluginModel : true, ] } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index d9c58e538..ba277a886 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -399,6 +399,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl public void onSuccess(CoolConfig data) { new XPopup.Builder(mContext) .enableDrag(false) + .autoOpenSoftInput(false) .maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34)) .asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() { @Override diff --git a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java index 2dbebab5f..f71385345 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.os.Handler; import android.text.TextUtils; import android.util.Log; +import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; @@ -29,10 +30,12 @@ import com.yunbao.common.bean.ImUserInfoModel; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.NoviceInstructorManager; import com.yunbao.common.manager.imrongcloud.MessageIMManager; import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.views.AbsMainViewHolder; @@ -41,8 +44,6 @@ import com.yunbao.live.activity.SystemMessageActivity; import com.yunbao.live.bean.ImUserBean; import com.yunbao.live.event.RecommendLiveRoomEvent; import com.yunbao.live.http.ImHttpUtil; -import com.yunbao.common.http.LiveHttpUtil; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.main.R; import com.yunbao.main.activity.MainActivity; import com.yunbao.main.adapter.SystemMessageAdapter; @@ -229,7 +230,15 @@ public class MainMessageViewHolder extends AbsMainViewHolder { textNewsNotice.setVisibility(View.GONE); } else { textNewsNotice.setVisibility(View.VISIBLE); - textNewsNotice.setText(userBean.getNum()); + int numberInt = Integer.parseInt(userBean.getNum()); + if (numberInt > 99) { + textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textNewsNotice.setText("99+"); + } else { + textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textNewsNotice.setText(String.valueOf(numberInt)); + } + } ImgLoader.display(mContext, userBean.getNewImage(), imgNewsNotice); ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> { @@ -249,7 +258,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder { textNewsInteraction.setVisibility(View.GONE); } else { textNewsInteraction.setVisibility(View.VISIBLE); - textNewsInteraction.setText(userBean.getNum()); + int numberInt = Integer.parseInt(userBean.getNum()); + if (numberInt > 99) { + textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textNewsInteraction.setText("99+"); + } else { + textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textNewsInteraction.setText(String.valueOf(numberInt)); + } } ImgLoader.display(mContext, userBean.getNewImage(), imgNewsInteraction); ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> { @@ -269,7 +285,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder { textNewsOnline.setVisibility(View.GONE); } else { textNewsOnline.setVisibility(View.VISIBLE); - textNewsOnline.setText(userBean.getNum()); + int numberInt = Integer.parseInt(userBean.getNum()); + if (numberInt > 99) { + textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textNewsOnline.setText("99+"); + } else { + textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textNewsOnline.setText(String.valueOf(numberInt)); + } } ImgLoader.display(mContext, userBean.getNewImage(), imgNewsOnline); ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> { @@ -278,7 +301,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder { netHandler.post(systemNumberRunnable); AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); if (userBean.getLink() != null && !"".equals(userBean.getLink())) { - // WebViewActivity.forward(mContext, userBean.getLink()); + // WebViewActivity.forward(mContext, userBean.getLink()); RouteUtil.forwardCustomerService(userBean.getLink()); } else { mContext.startActivity(new Intent(mContext, SystemMessageActivity.class) @@ -295,7 +318,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder { textSystemMessages.setVisibility(View.GONE); } else { textSystemMessages.setVisibility(View.VISIBLE); - textSystemMessages.setText(userBean.getNum()); + int numberInt = Integer.parseInt(userBean.getNum()); + if (numberInt > 99) { + textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textSystemMessages.setText("99+"); + } else { + textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textSystemMessages.setText(String.valueOf(numberInt)); + } } ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages); ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> { @@ -402,9 +432,16 @@ public class MainMessageViewHolder extends AbsMainViewHolder { textNewsNotice.setText(""); } else { String number = textNewsNotice.getText().toString().trim(); - int numberInt = Integer.parseInt(number) + 1; textNewsNotice.setVisibility(View.VISIBLE); - textNewsNotice.setText(String.valueOf(numberInt)); + int numberInt = Integer.parseInt(number) + 1; + if (numberInt > 99) { + textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textNewsNotice.setText("99+"); + } else { + textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textNewsNotice.setText(String.valueOf(numberInt)); + } + } break; @@ -417,7 +454,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder { String number = textNewsInteraction.getText().toString().trim(); int numberInt = Integer.parseInt(number) + 1; textNewsInteraction.setVisibility(View.VISIBLE); - textNewsInteraction.setText(String.valueOf(numberInt)); + if (numberInt > 99) { + textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textNewsInteraction.setText("99+"); + } else { + textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textNewsInteraction.setText(String.valueOf(numberInt)); + } } @@ -431,7 +474,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder { String number = textNewsOnline.getText().toString().trim(); int numberInt = Integer.parseInt(number) + 1; textNewsOnline.setVisibility(View.VISIBLE); - textNewsOnline.setText(String.valueOf(numberInt)); + if (numberInt > 99) { + textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textNewsOnline.setText("99+"); + } else { + textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textNewsOnline.setText(String.valueOf(numberInt)); + } } break; //在線客服 case "4": @@ -442,7 +491,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder { String number = textSystemMessages.getText().toString().trim(); int numberInt = Integer.parseInt(number) + 1; textSystemMessages.setVisibility(View.VISIBLE); - textSystemMessages.setText(String.valueOf(numberInt)); + if (numberInt > 99) { + textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9); + textSystemMessages.setText("99+"); + } else { + textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); + textSystemMessages.setText(String.valueOf(numberInt)); + } } break; } diff --git a/main/src/main/res/layout/view_main_message.xml b/main/src/main/res/layout/view_main_message.xml index c7650df8c..a783924f1 100644 --- a/main/src/main/res/layout/view_main_message.xml +++ b/main/src/main/res/layout/view_main_message.xml @@ -52,8 +52,8 @@