修改 测试问题

This commit is contained in:
18401019693 2023-12-12 10:51:30 +08:00
parent d0b7b065b2
commit ecca9b7b8b
12 changed files with 186 additions and 63 deletions

View File

@ -1,8 +1,18 @@
package com.yunbao.common.bean; package com.yunbao.common.bean;
public class CoolConfig extends BaseModel { public class CoolConfig extends BaseModel {
private int rate=1; private int rate = 1;
private String ticketCount="0" ; 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() { public String getTicketCount() {
return ticketCount; return ticketCount;

View File

@ -1,7 +1,14 @@
package com.yunbao.common.dialog; package com.yunbao.common.dialog;
import static android.content.Context.INPUT_METHOD_SERVICE;
import android.content.Context; import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View; import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; 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.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.math.BigDecimal; import java.math.BigDecimal;
public class CinemaTicketPopupWindow extends CenterPopupView { public class CinemaTicketPopupWindow extends CenterPopupView {
private CoolConfig mCoolConfig; private CoolConfig mCoolConfig;
private TextView cinemaTicket, ticketsPlusMinus, quantityNeed; private TextView cinemaTicket, quantityNeed, quantityNeed2;
private EditText ticketsPlusMinus;
private int ticket = 1; private int ticket = 1;
private CinemaTicketPopupWindowCallBack mCinemaTicketPopupWindowCallBack; private CinemaTicketPopupWindowCallBack mCinemaTicketPopupWindowCallBack;
@ -41,9 +50,30 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
cinemaTicket = findViewById(R.id.cinema_ticket); cinemaTicket = findViewById(R.id.cinema_ticket);
ticketsPlusMinus = findViewById(R.id.tickets_plus_minus); ticketsPlusMinus = findViewById(R.id.tickets_plus_minus);
quantityNeed = findViewById(R.id.quantity_need); 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)); 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() { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
@ -56,9 +86,8 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
if (ticket > 1) { if (ticket > 1) {
ticket = ticket - 1; ticket = ticket - 1;
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
ticketsPlusMinus.setText(String.valueOf(ticket)); 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,24 +95,25 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
ticket = ticket + 1; ticket = ticket + 1;
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
ticketsPlusMinus.setText(String.valueOf(ticket)); 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() { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_exchange), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
if (ticket>=1&&ticket<=9999){
LiveNetManager.get(getContext()) LiveNetManager.get(getContext())
.buyTicket(String.valueOf(ticket), new HttpCallback<String>() { .buyTicket(String.valueOf(ticket), new HttpCallback<String>() {
@Override @Override
public void onSuccess(String data) { public void onSuccess(String data) {
ToastUtil.show(WordUtil.isNewZh() ? "兑换成功" : "Successful exchange");
if (mCinemaTicketPopupWindowCallBack != null) { if (mCinemaTicketPopupWindowCallBack != null) {
mCinemaTicketPopupWindowCallBack.onCallBack(data); mCinemaTicketPopupWindowCallBack.onCallBack(data);
} }
dialog.dismiss(); dialog.dismiss();
} }
@Override @Override
@ -91,8 +121,15 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
ToastUtil.show(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 { public interface CinemaTicketPopupWindowCallBack {

View File

@ -32,6 +32,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="0" android:text="0"
android:inputType="number"
android:textColor="#DFEAFF" android:textColor="#DFEAFF"
android:textSize="15sp" /> android:textSize="15sp" />
@ -68,12 +69,14 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" /> android:layout_weight="1" />
<TextView <EditText
android:id="@+id/tickets_plus_minus" android:id="@+id/tickets_plus_minus"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="2" android:layout_weight="2"
android:background="@null"
android:gravity="center" android:gravity="center"
android:inputType="number"
android:singleLine="true" android:singleLine="true"
android:text="0" android:text="0"
android:textColor="#000000" android:textColor="#000000"
@ -86,6 +89,20 @@
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/quantity_need2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:textColor="#DFEAFF"
android:textSize="12sp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginStart="3dp"
android:src="@mipmap/icon_collectibles2" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -95,20 +112,23 @@
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:gravity="center"> android:gravity="center">
<TextView <TextView
android:id="@+id/quantity_need" android:id="@+id/quantity_need"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/conversion_quantity_need" android:text="@string/conversion_quantity_need"
android:textColor="#DFEAFF" android:textColor="#DFEAFF"
android:textSize="12sp" /> android:textSize="12sp" />
<ImageView <ImageView
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginStart="3dp" android:layout_marginStart="3dp"
android:src="@mipmap/icon_collectibles2" /> android:src="@mipmap/icon_collectibles2" />
</LinearLayout> </LinearLayout>
<ImageButton <ImageButton

View File

@ -1388,7 +1388,7 @@ Limited ride And limited avatar frame</string>
<string name="room_sill500_m">Above 500 coins</string> <string name="room_sill500_m">Above 500 coins</string>
<string name="combo">combo X</string> <string name="combo">combo X</string>
<string name="conversion_quantity">Exchange quantity:</string> <string name="conversion_quantity">Exchange quantity:</string>
<string name="conversion_quantity_need">Need %s</string> <string name="conversion_quantity_need">Balance %s</string>
<string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string> <string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string>
<string name="conversion_quantity_need_of_use1">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;</string> <string name="conversion_quantity_need_of_use1">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;</string>
<string name="conversion_quantity_need_of_use2">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;</string> <string name="conversion_quantity_need_of_use2">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;</string>

View File

@ -1385,9 +1385,9 @@
<string name="room_sill500_m">500以上星幣</string> <string name="room_sill500_m">500以上星幣</string>
<string name="combo">連擊×</string> <string name="combo">連擊×</string>
<string name="conversion_quantity">兌換數量:</string> <string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string> <string name="conversion_quantity_need">余额 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string> <string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string> <string name="conversion_quantity_need_of_use1">一、星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string> <string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string> <string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
</resources> </resources>

View File

@ -1159,7 +1159,7 @@
<string name="live_vote_close_yes"></string> <string name="live_vote_close_yes"></string>
<string name="live_vote_close_no"></string> <string name="live_vote_close_no"></string>
<string name="live_vote_hide_text">投票中</string> <string name="live_vote_hide_text">投票中</string>
<string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string> <string name="live_room_vote_over_tip">%s <br /> 問答框%s秒后消失</string>
<string name="live_anchor_vote_tip">請完整填寫</string> <string name="live_anchor_vote_tip">請完整填寫</string>
<string name="complete_information_consumable">填寫“*”的選項可完成</string> <string name="complete_information_consumable">填寫“*”的選項可完成</string>
<string name="love_powder">真愛粉\n頭像框(7天)</string> <string name="love_powder">真愛粉\n頭像框(7天)</string>
@ -1384,9 +1384,9 @@
<string name="room_sill500_m">500以上星幣</string> <string name="room_sill500_m">500以上星幣</string>
<string name="combo">連擊×</string> <string name="combo">連擊×</string>
<string name="conversion_quantity">兌換數量:</string> <string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string> <string name="conversion_quantity_need">余额 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string> <string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string> <string name="conversion_quantity_need_of_use1">一、星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string> <string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string> <string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
</resources> </resources>

View File

@ -1384,10 +1384,10 @@
<string name="room_sill500_m">500以上星幣</string> <string name="room_sill500_m">500以上星幣</string>
<string name="combo">連擊×</string> <string name="combo">連擊×</string>
<string name="conversion_quantity">兌換數量:</string> <string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string> <string name="conversion_quantity_need">余额 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string> <string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string> <string name="conversion_quantity_need_of_use1">一、星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string> <string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string> <string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
</resources> </resources>

View File

@ -1391,7 +1391,7 @@ Limited ride And limited avatar frame</string>
<string name="room_sill500_m">Above 500 coins</string> <string name="room_sill500_m">Above 500 coins</string>
<string name="combo">combo X</string> <string name="combo">combo X</string>
<string name="conversion_quantity">Exchange quantity:</string> <string name="conversion_quantity">Exchange quantity:</string>
<string name="conversion_quantity_need">Need %s</string> <string name="conversion_quantity_need">Balance %s</string>
<string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string> <string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string>
<string name="conversion_quantity_need_of_use1">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;</string> <string name="conversion_quantity_need_of_use1">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;</string>
<string name="conversion_quantity_need_of_use2">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;</string> <string name="conversion_quantity_need_of_use2">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;</string>

View File

@ -9,9 +9,9 @@ ext {
] ]
manifestPlaceholders = [ 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", baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
// true表示谷歌支付 false 0 1 2 // true表示谷歌支付 false 0 1 2
isGooglePlay : 1, isGooglePlay : 0,
// //
isUploadLog : true, isUploadLog : true,
// //
isPluginModel : false, isPluginModel : true,
] ]
} }

View File

@ -399,6 +399,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
public void onSuccess(CoolConfig data) { public void onSuccess(CoolConfig data) {
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
.enableDrag(false) .enableDrag(false)
.autoOpenSoftInput(false)
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34)) .maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
.asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() { .asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() {
@Override @Override

View File

@ -5,6 +5,7 @@ import android.content.Intent;
import android.os.Handler; import android.os.Handler;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.util.TypedValue;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
@ -29,10 +30,12 @@ import com.yunbao.common.bean.ImUserInfoModel;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager; import com.yunbao.common.manager.NoviceInstructorManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager; import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.views.AbsMainViewHolder; 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.bean.ImUserBean;
import com.yunbao.live.event.RecommendLiveRoomEvent; import com.yunbao.live.event.RecommendLiveRoomEvent;
import com.yunbao.live.http.ImHttpUtil; 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.R;
import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.adapter.SystemMessageAdapter; import com.yunbao.main.adapter.SystemMessageAdapter;
@ -229,7 +230,15 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsNotice.setVisibility(View.GONE); textNewsNotice.setVisibility(View.GONE);
} else { } else {
textNewsNotice.setVisibility(View.VISIBLE); 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); ImgLoader.display(mContext, userBean.getNewImage(), imgNewsNotice);
ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> { ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> {
@ -249,7 +258,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsInteraction.setVisibility(View.GONE); textNewsInteraction.setVisibility(View.GONE);
} else { } else {
textNewsInteraction.setVisibility(View.VISIBLE); 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); ImgLoader.display(mContext, userBean.getNewImage(), imgNewsInteraction);
ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> { ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> {
@ -269,7 +285,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsOnline.setVisibility(View.GONE); textNewsOnline.setVisibility(View.GONE);
} else { } else {
textNewsOnline.setVisibility(View.VISIBLE); 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); ImgLoader.display(mContext, userBean.getNewImage(), imgNewsOnline);
ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> { ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> {
@ -295,7 +318,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textSystemMessages.setVisibility(View.GONE); textSystemMessages.setVisibility(View.GONE);
} else { } else {
textSystemMessages.setVisibility(View.VISIBLE); 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); ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages);
ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> { ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> {
@ -402,11 +432,18 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
textNewsNotice.setText(""); textNewsNotice.setText("");
} else { } else {
String number = textNewsNotice.getText().toString().trim(); String number = textNewsNotice.getText().toString().trim();
int numberInt = Integer.parseInt(number) + 1;
textNewsNotice.setVisibility(View.VISIBLE); textNewsNotice.setVisibility(View.VISIBLE);
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)); textNewsNotice.setText(String.valueOf(numberInt));
} }
}
break; break;
//互動消息 //互動消息
case "2": case "2":
@ -417,8 +454,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
String number = textNewsInteraction.getText().toString().trim(); String number = textNewsInteraction.getText().toString().trim();
int numberInt = Integer.parseInt(number) + 1; int numberInt = Integer.parseInt(number) + 1;
textNewsInteraction.setVisibility(View.VISIBLE); textNewsInteraction.setVisibility(View.VISIBLE);
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)); textNewsInteraction.setText(String.valueOf(numberInt));
} }
}
break; break;
@ -431,8 +474,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
String number = textNewsOnline.getText().toString().trim(); String number = textNewsOnline.getText().toString().trim();
int numberInt = Integer.parseInt(number) + 1; int numberInt = Integer.parseInt(number) + 1;
textNewsOnline.setVisibility(View.VISIBLE); textNewsOnline.setVisibility(View.VISIBLE);
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)); textNewsOnline.setText(String.valueOf(numberInt));
} }
}
break; //在線客服 break; //在線客服
case "4": case "4":
if (textSystemMessages.getVisibility() == View.GONE) { if (textSystemMessages.getVisibility() == View.GONE) {
@ -442,8 +491,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
String number = textSystemMessages.getText().toString().trim(); String number = textSystemMessages.getText().toString().trim();
int numberInt = Integer.parseInt(number) + 1; int numberInt = Integer.parseInt(number) + 1;
textSystemMessages.setVisibility(View.VISIBLE); textSystemMessages.setVisibility(View.VISIBLE);
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)); textSystemMessages.setText(String.valueOf(numberInt));
} }
}
break; break;
} }
systemNumber = systemNumber + 1; systemNumber = systemNumber + 1;

View File

@ -52,8 +52,8 @@
<TextView <TextView
android:id="@+id/text_news_notice" android:id="@+id/text_news_notice"
android:layout_width="17dp" android:layout_width="20dp"
android:layout_height="17dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginEnd="17dp" android:layout_marginEnd="17dp"
@ -81,8 +81,8 @@
<TextView <TextView
android:id="@+id/text_system_messages" android:id="@+id/text_system_messages"
android:layout_width="17dp" android:layout_width="20dp"
android:layout_height="17dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginEnd="17dp" android:layout_marginEnd="17dp"
@ -108,8 +108,8 @@
<TextView <TextView
android:id="@+id/text_news_interaction" android:id="@+id/text_news_interaction"
android:layout_width="17dp" android:layout_width="20dp"
android:layout_height="17dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginEnd="17dp" android:layout_marginEnd="17dp"
@ -135,8 +135,8 @@
<TextView <TextView
android:id="@+id/text_news_online" android:id="@+id/text_news_online"
android:layout_width="17dp" android:layout_width="20dp"
android:layout_height="17dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginEnd="17dp" android:layout_marginEnd="17dp"