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..d6f2906ab 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java @@ -1,24 +1,34 @@ 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; import com.lxj.xpopup.core.CenterPopupView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.R; 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 +51,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 +87,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 +96,42 @@ 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) { - if (mCinemaTicketPopupWindowCallBack != null) { - mCinemaTicketPopupWindowCallBack.onCallBack(data); + if (mCinemaTicketPopupWindowCallBack != null) { + mCinemaTicketPopupWindowCallBack.onCallBack(data); + } + dialog.dismiss(); + } - 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); + MobclickAgent.onEvent(getContext(), "dj_exchange", "兑换按钮点"); } }); + InputMethodManager inputMethodManager = (InputMethodManager)ticketsPlusMinus.getContext().getSystemService(INPUT_METHOD_SERVICE); + inputMethodManager.hideSoftInputFromWindow(ticketsPlusMinus.getWindowToken(), 0); } public interface CinemaTicketPopupWindowCallBack { 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 5716e4c33..b562973be 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 @@ -481,6 +481,7 @@ public class LiveNetManager { * @param liveUid */ public void leaveRoomNew(String stream, String liveUid, HttpCallback callback) { + Log.e("观看时长","leaveRoomNew-----------------------"+liveUid); API.get().pdLiveApi(mContext) .leaveRoomNew("g" + liveUid, stream) .subscribeOn(Schedulers.io()) diff --git a/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java b/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java index 19e366823..6856890dd 100644 --- a/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java +++ b/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java @@ -183,6 +183,7 @@ public class OpenAdManager { if (model.getShowModel() == OpenAdModel.SHOW_DIY) { String nextTime= String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000)); SpUtil.setStringValue("open_ad_popup_time_" + model.getId(), nextTime); + showMap.remove(model.getId()); } if (model.getModel() == OpenAdModel.MODEL_BOTTOM) { new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> { diff --git a/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java b/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java index dca1733c3..a8a975dbc 100644 --- a/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java @@ -185,6 +185,19 @@ public class GoogleUtils { } } + public boolean getGoogleService() { + boolean flag; + try { + Class clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage"); + googlePay = clz.getConstructor(Activity.class).newInstance(mActivity); + flag = (boolean) googlePay.getClass().getMethod("getGoogleService").invoke(googlePay); + } catch (Exception e) { + throw new RuntimeException(e); + } + return flag; + } + + public void setFirebaseTokenListener(Activity activity, FirebaseTokenListener firebaseTokenListener) { Timer timer = new Timer(); TimerTask task = new TimerTask() { diff --git a/common/src/main/java/com/yunbao/common/views/APKUpdateCustomPopup.java b/common/src/main/java/com/yunbao/common/views/APKUpdateCustomPopup.java index 35d8a444c..b433c3957 100644 --- a/common/src/main/java/com/yunbao/common/views/APKUpdateCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/APKUpdateCustomPopup.java @@ -3,6 +3,7 @@ package com.yunbao.common.views; import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; import android.os.Handler; @@ -114,7 +115,7 @@ public class APKUpdateCustomPopup extends CenterPopupView { } else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) { //华为 //todo - launchAppDetail(mContext, "com.pdlive.shayu", "com.pdlive.shayu"); + launchAppDetail(mContext, "com.pdlive.shayu", "com.huawei.appmarket"); } else { versionImmediateUse.setVisibility(GONE); updateLine.setVisibility(VISIBLE); @@ -129,19 +130,31 @@ public class APKUpdateCustomPopup extends CenterPopupView { }); } + public static boolean isAppStoreExist(Context context) { + try { + PackageManager packageManager = context.getPackageManager(); + packageManager.getPackageInfo("com.huawei.appmarket", PackageManager.GET_ACTIVITIES); + return true; + } catch (PackageManager.NameNotFoundException e) { + return false; + } + } + + public static void launchAppDetail(Context mContext, String appPkg, String marketPkg) { try { if (TextUtils.isEmpty(appPkg)) { return; } - - Uri uri = Uri.parse("market://details?id=" + appPkg); - Intent intent = new Intent(Intent.ACTION_VIEW, uri); - if (!TextUtils.isEmpty(marketPkg)) { - intent.setPackage(marketPkg); + if (isAppStoreExist(mContext)) { + Uri uri = Uri.parse("appmarket://details?id=" + appPkg); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + if (!TextUtils.isEmpty(marketPkg)) { + intent.setPackage(marketPkg); + } + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + mContext.startActivity(intent); } - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - mContext.startActivity(intent); } catch (Exception e) { e.printStackTrace(); } 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..ed0ab01a7 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張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 二、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..852429a24 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張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 68ced0bf7..215f7ae42 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張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 二、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 577929083..5442dbf23 100644 --- a/config.gradle +++ b/config.gradle @@ -4,12 +4,12 @@ ext { buildToolsVersion: "29.0.2", minSdkVersion : 21, targetSdkVersion : 33, - versionCode : 458, + versionCode : 460, versionName : "6.6.3" ] manifestPlaceholders = [ //正式、 - //serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 serverHost : " https://ceshi.yaoulive.com", @@ -19,11 +19,12 @@ ext { baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB", baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", -// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 三星包 - isGooglePlay : 3, + +// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 + isGooglePlay : 1, //是否上报异常日志 - isUploadLog : true, + isUploadLog : true, //是否打包成插件包模式 - isPluginModel : false, + isPluginModel : false, ] } diff --git a/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java b/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java index 3dcc293ff..492603269 100644 --- a/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java +++ b/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java @@ -29,11 +29,8 @@ import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import java.util.Map; /** * 新写Google内付工具类做简单的封装 @@ -207,6 +204,11 @@ public class GoogleBillingManage implements PurchasesUpdatedListener { } } + public boolean getGoogleService() { + int code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext); + return code == 0; + } + int resultCode = -1; String resultToken = ""; String resultOrderId = ""; diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index 6005799c0..9d515497e 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -309,7 +309,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { SpannableStringBuilder builder = new SpannableStringBuilder(); if (bean.getType() == -3) { String str1 = WordUtil.isNewZh() ? "整蠱來了! " : "Pranks are coming"; - String str2 = WordUtil.isNewZh() ? "向 " : "too"; + String str2 = WordUtil.isNewZh() ? "向 " : "to"; builder.append(str1); int length = builder.length(); builder.append(bean.getUserNiceName()); @@ -318,7 +318,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { int length2 = builder.length(); builder.append(bean.getAnchorName()); builder.setSpan(new ForegroundColorSpan(0xFF73FFFF), length2, length2 + bean.getAnchorName().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - builder.append(WordUtil.isNewZh() ? "發出了 " : "Sent out " + bean.getContent()); + builder.append(WordUtil.isNewZh() ? "發出了 " + bean.getContent(): "Sent out " + bean.getContent()); mTextView.setText(builder); } else if (bean.getType() == -4) { String str1 = WordUtil.isNewZh() ? "成功拯救了 " : "Succeeded in saving"; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index 7ed21d2d1..2b11f8911 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -22,8 +22,6 @@ import com.opensource.svgaplayer.SVGADrawable; import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; -import com.tencent.imsdk.v2.V2TIMCallback; -import com.tencent.imsdk.v2.V2TIMManager; import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; @@ -65,9 +63,6 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; -import io.rong.imlib.IRongCoreCallback; -import io.rong.imlib.IRongCoreEnum; -import io.rong.imlib.chatroom.base.RongChatRoomClient; import pl.droidsonroids.gif.GifImageView; /** @@ -637,6 +632,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On private void gotoLive(String live_id) { + dismiss(); DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.party_studio), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 95406d0a0..60325da49 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -1,6 +1,5 @@ package com.yunbao.live.presenter; -import static com.blankj.utilcode.util.SnackbarUtils.dismiss; import static com.lzy.okgo.utils.HttpUtils.runOnUiThread; import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK; import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK; @@ -38,7 +37,6 @@ import android.widget.TextView; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.blankj.utilcode.util.ViewUtils; import com.tencent.trtc.TRTCCloud; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.bean.LiveInfoModel; @@ -858,7 +856,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { @Override public void onSuccess(RCRTCOtherRoom rcrtcOtherRoom) { rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener); - ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success"); + ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success"); new Handler(Looper.getMainLooper()).post(new Runnable() { public void run() { for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) { @@ -977,7 +975,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { @Override public void onSuccess(RCRTCOtherRoom rcrtcOtherRoom) { rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener); - ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success"); + ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success"); new Handler(Looper.getMainLooper()).post(new Runnable() { public void run() { Log.e("ry", liveid + "来了!!!!" + rcrtcOtherRoom.getRemoteUsers().size()); @@ -1660,7 +1658,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { } Log.e("ry", "多人接受成功" + mApplyUid); - ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success"); + ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success"); //遍历远端用户列表 for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) { Log.e("ry", rcrtcOtherRoom.getRemoteUsers().get(i).getUserId() + "收到rcrtcOtherRoom" + rcrtcOtherRoom.getRemoteUsers().size()); @@ -1697,7 +1695,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { @Override public void onError(String error) { - ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); + ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred"); } }); @@ -2332,7 +2330,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { * 主播与主播PK 断开连麦PK的回调 */ public void onLinkMicPkClose(int i) { - Log.e("ry",mPkUid+"aaaaqwqw"+i); + Log.e("ry", mPkUid + "aaaaqwqw" + i); PKing = false; LiveRyAnchorActivity.isDRPK = 0; @@ -2500,11 +2498,11 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { * 更新Pk分数 */ public void upDataPkScore(JSONArray pkScores, String uid, int time) { - String userID1 = (String) imageGrade1.getTag(); String userID2 = (String) imageGrade2.getTag(); String userID4 = (String) imageGrade4.getTag(); if (livePushRyViewHolder.timeTitle.getVisibility() == View.GONE) { + mHandler.removeMessages(WHAT_PK_TIME2); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) livePushRyViewHolder.timeTitle.getLayoutParams(); layoutParams.topMargin = DpUtil.dp2px(123); livePushRyViewHolder.timeTitle.setLayoutParams(layoutParams); @@ -2512,7 +2510,12 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { String pkTime = StringUtil.getDurationText(time * 1000); livePushRyViewHolder.textTime.setText(String.format(mContext.getString(R.string.pk_time), pkTime)); mPkTimeCount = time; - pkCountdownTimer(); + if (time>0){ + String s1 = StringUtil.getDurationText(mPkTimeCount * 1000); + livePushRyViewHolder.textTime.setText(String.format(mContext.getString(R.string.pk_time), s1)); + mHandler.sendEmptyMessage(WHAT_PK_TIME2); + } + } int pkScoreSize = pkScores.size(); if (pkScoreSize == 3) { 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 61f54a739..59fb289d2 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -387,7 +387,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private FrameLayout pa_pao_layout; private LinearLayout combo_layout; private TextView combo_number; - private View quick_gift_reminder ; + private View quick_gift_reminder; @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { @@ -720,6 +720,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } } + public void onQuickGifting3() { IMLoginManager.get(mContext).setQuickGiftIfFirst(); quick_gift_reminder.setVisibility(View.GONE); @@ -1565,7 +1566,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis pa_pao_layout = (FrameLayout) findViewById(R.id.pa_pao_layout); combo_layout = (LinearLayout) findViewById(R.id.combo_layout); combo_number = (TextView) findViewById(R.id.combo_number); - quick_gift_reminder = findViewById(R.id.quick_gift_reminder); + quick_gift_reminder = findViewById(R.id.quick_gift_reminder); pa_pao_layout.setVisibility(View.GONE); combo_layout.setVisibility(View.GONE); @@ -1825,6 +1826,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 重置数据 */ public void resetView() { + countdownHandler.removeCallbacks(countdownRunnable); svgaImageViewHashMap.clear(); pa_pao_layout.removeAllViews(); timeHandler.removeCallbacks(timeRunnable); @@ -2545,7 +2547,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * @param rank 小时榜 */ public void setHourRankData(long rank) { - if (mHotText != null) { + if (mHotText != null) { if (rank == 0) { mHotText.setText(R.string.no_rank_data); } else { @@ -2574,9 +2576,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } + public void setHotNum(String hotNum) { setHotData(formatBigNum.formatBigNum(hotNum)); } + /** * 更新心愿单进度 * @@ -4283,7 +4287,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bean1.setId(Integer.parseInt(giftModel.getId())); bean1.setName(giftModel.getGiftname()); bean1.setTag("1"); - + bean1.setPrice(WordUtil.isNewZh() ? "免费" : "free"); if (!IMLoginManager.get(mContext).isisNewUserOne()) { if (TextUtils.equals(taskModel.getSendgift(), "0")) { IMLoginManager.get(mContext).setNewUserGif(true); @@ -5010,6 +5014,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void upDataPkScore(JSONArray pkScores, int time) { + isShowGif = true; if (detailsView == null) { detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null); @@ -5050,9 +5055,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } }); - + countdownHandler.removeCallbacks(countdownRunnable); + if (time > 0) { + mPkTimeCount = time; + timeTitle.setVisibility(View.VISIBLE); + countdownHandler.post(countdownRunnable); + } } - + Log.e("多人Pk", "upDataPkScore mPkTimeCount:" +mPkTimeCount); for (int i = 0; i < pkScores.size(); i++) { JSONObject score = pkScores.getJSONObject(i); String userNiceName = score.getString("user_nicename"); @@ -5116,11 +5126,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } - if (time > 0) { - mPkTimeCount = time; - timeTitle.setVisibility(View.VISIBLE); - countdownHandler.postAtTime(countdownRunnable, getNextSecondTime()); - } + textPkName2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -5147,8 +5153,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void run() { mPkTimeCount--; if (mPkTimeCount > 0) {// + Log.e("多人Pk", "countdownRunnable mPkTimeCount:" +mPkTimeCount); String s1 = StringUtil.getDurationText(mPkTimeCount * 1000); textTime.setText(String.format(mContext.getString(R.string.pk_time), s1)); + Log.e("多人Pk", "countdownRunnable s1:" +s1); countdownHandler.postAtTime(countdownRunnable, getNextSecondTime()); } else { mPkTimeCount = 0; diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 703824e77..dff06b39b 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -56,7 +56,6 @@ import com.yunbao.common.event.LiveFloatEvent; import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent; -import com.yunbao.common.event.QuickGiftingEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; @@ -243,15 +242,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } public void setGiftRemainingQuantity(String giftRemainingQuantity) { - if (mLiveAudienceViewHolder!=null){ + if (mLiveAudienceViewHolder != null) { mLiveAudienceViewHolder.setGiftRemainingQuantity(giftRemainingQuantity); } } + public void setHotNum(String hotNum) { - if (mLiveRoomViewHolder!=null){ - mLiveRoomViewHolder.setHotNum(hotNum); - } + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.setHotNum(hotNum); + } } + public PortraitLiveManager(Activity context, Intent intent) { this.mContext = context; this.mIntent = intent; @@ -448,6 +449,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void run() { //加入房间发送Im消息 LiveNetManager.get(mContext).userJoinRoomNew(mLiveBean.getStream(), mLiveBean.getUid()); + Log.e("观看时长","userJoinRoomNew-----------------------"+mLiveBean.getUid()); } }; @@ -460,6 +462,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe .enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(EnterRoomNewModel data) { + Log.e("观看时长","enterRoomNew-----------------------"+ mLiveBean.getUid()); isEnterRoom = true; if (TextUtils.isEmpty(leaveStream)) { leaveStream = mLiveBean.getStream(); @@ -687,6 +690,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time")); + Log.e("多人Pk", "enterRoomNew drpk_time:" + pkInfo.getIntValue("drpk_time")); } // mLivePlayViewHolder.setLayoutInterface(new LivePlayRyViewHolder.PlayViewLayoutInterface() { // @Override @@ -809,6 +813,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void onRemove(boolean isQuit) { + Log.e("直播间接口调用排查", "onRemove---------------"); LiveNetManager.get(mContext).cancelLive(); liveHandler.removeCallbacks(sendFIm); linkMicPkStartHandler.removeCallbacks(linkMicPkStartRunnable); @@ -1846,6 +1851,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe if (!isEnterRoom) { return; } + LiveNetManager.get(mContext) + .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(String data) { + + } + + @Override + public void onError(String error) { + } + }); + leaveStream = ""; + leaveGroupId = ""; if (mLiveBean != null) { isEnterRoom = false; @@ -1854,19 +1872,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void onSuccess() { try { Log.i("tx", "退出成功" + mLiveBean.getUid()); - LiveNetManager.get(mContext) - .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback() { - @Override - public void onSuccess(String data) { - } - - @Override - public void onError(String error) { - } - }); - leaveStream = ""; - leaveGroupId = ""; } catch (Exception e) { e.printStackTrace(); @@ -1878,19 +1884,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) { try { - Log.i("tx", "退出成功" + mLiveBean.getUid()); - LiveNetManager.get(mContext) - .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback() { - @Override - public void onSuccess(String data) { - } - - @Override - public void onError(String error) { - } - }); - leaveStream = ""; - leaveGroupId = ""; +// Log.i("tx", "退出成功" + mLiveBean.getUid()); +// LiveNetManager.get(mContext) +// .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback() { +// @Override +// public void onSuccess(String data) { +// } +// +// @Override +// public void onError(String error) { +// } +// }); +// leaveStream = ""; +// leaveGroupId = ""; } catch (Exception e) { e.printStackTrace(); } diff --git a/live/src/main/res/layout/item_live_parcel.xml b/live/src/main/res/layout/item_live_parcel.xml index 9caae1385..84f13341f 100644 --- a/live/src/main/res/layout/item_live_parcel.xml +++ b/live/src/main/res/layout/item_live_parcel.xml @@ -63,8 +63,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="1dp" + android:singleLine="true" android:textColor="@color/white" - android:textSize="11sp" /> + android:textSize="9sp" /> 0) { v_table_redpoint.setVisibility(View.VISIBLE); - v_table_redpoint.setText(event.getNumber() + ""); + if (event.getNumber() > 99) { + v_table_redpoint.setText("99+"); + } else { + v_table_redpoint.setText(event.getNumber() + ""); + } + } else { v_table_redpoint.setVisibility(View.GONE); v_table_redpoint.setText(""); 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..83c66ccac 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -17,6 +17,7 @@ import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.ViewGroup; +import android.webkit.CookieManager; import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebSettings; @@ -55,6 +56,7 @@ import com.yunbao.common.utils.L; import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.live.views.LoadingView; import com.yunbao.main.R; import com.yunbao.main.activity.MainActivity; @@ -101,7 +103,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl Bus.getOn(this); String url = HtmlConfig.ENCOURAGE + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); -// String url = "https://coolshi.feioou.com/testAndroid.html"; +// String url = "https://api.coolydrama.com/?agentCode=186279"; final LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); mProgressBar = (ProgressBar) findViewById(R.id.progressbar); mWebView = new WebView(mContext); @@ -118,6 +120,12 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); + CookieManager cookieManager = CookieManager.getInstance(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + cookieManager.setAcceptThirdPartyCookies(mWebView, true); + } else { + cookieManager.setAcceptCookie(true); + } String appCachePath = mContext.getCacheDir().getAbsolutePath(); // mWebView.getSettings().setAppCachePath(appCachePath); mWebView.getSettings().setAllowFileAccess(true); @@ -399,6 +407,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 @@ -417,6 +426,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl } }); } else if (TextUtils.equals(data, "1")) { + ToastUtil.show(WordUtil.isNewZh() ? "兑换成功" : "Successful exchange"); mWebView.post(new Runnable() { @Override public void run() { diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 65e2d8cf4..14fa4c79d 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -46,6 +46,7 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.LiveClassManager; +import com.yunbao.common.manager.OpenAdManager; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; @@ -557,6 +558,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement @Override public void onResume() { super.onResume(); + OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false); } @Override 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 fc440dcad..9302f4762 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -104,6 +104,12 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { } } + @Override + public void onResume() { + super.onResume(); + mViewHolders[mViewPager.getCurrentItem()].onResume(); + } + @Override protected int getPageCount() { return 4; 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_encourage.xml b/main/src/main/res/layout/view_main_encourage.xml index d796f713a..bc84516d9 100644 --- a/main/src/main/res/layout/view_main_encourage.xml +++ b/main/src/main/res/layout/view_main_encourage.xml @@ -8,7 +8,7 @@ android:id="@+id/rootView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginBottom="45dp" + android:layout_marginBottom="68dp" android:orientation="vertical" />