From 8c5ae3b61a9f01e332853023680f29ec27fe458b Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 7 Dec 2023 13:04:41 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=9B=B4=E5=A4=9A=E6=9D=A1=E4=BB=B6=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/bean/OpenAdModel.java | 44 ++++++++++++++++++- .../yunbao/common/manager/OpenAdManager.java | 18 ++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/OpenAdModel.java b/common/src/main/java/com/yunbao/common/bean/OpenAdModel.java index 0189513be..a6a4ce3ac 100644 --- a/common/src/main/java/com/yunbao/common/bean/OpenAdModel.java +++ b/common/src/main/java/com/yunbao/common/bean/OpenAdModel.java @@ -17,14 +17,17 @@ public class OpenAdModel extends BaseModel { public static final int MODEL_SQUARE = 1;//正方形 public static final int MODEL_RECTANGLE = 2;//长方形 public static final int MODEL_BOTTOM = 3;//底部 + public static final int SHOW_DEF = 1;//1. 杀死程序后弹出; + public static final int SHOW_DIY = 2;//2. 自定义时间:自上次弹出弹窗后,00:00小时(范围:00:01小时-48:00小时)后再弹出(到时间后也需满足触发条件再弹出); + public static final int SHOW_ONE = 3;//3. 仅弹出一次; @SerializedName("id") private int id; @SerializedName("popup_location") private int type = TYPE_HOME; @SerializedName("activity_url") - private String url; + private String url;//点击跳转url @SerializedName("image_url") - private String imageUrl; + private String imageUrl;//图片url @SerializedName("display_time") private int showTime; //持续展示时间 @SerializedName("delay_show_time") @@ -37,11 +40,48 @@ public class OpenAdModel extends BaseModel { private String endTime;//活动结束时间 @SerializedName("popup_permission") private int permission; + @SerializedName("popup_frequency") + private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次 + @SerializedName("popup_frequency_time") + private String section = "0";// SHOW_DEF = 2 public OpenAdModel() { } + public static OpenAdModel createTestData() { + OpenAdModel model = new OpenAdModel(); + model.id=3; + model.type=1; + model.url = "/h5/GuildTournament/20230821/rank.html"; + model.imageUrl = "https://ceshi.yaoulive.com/data/upload/20230913/1694589490.png"; + model.showTime = 10; + model.delayShowTime = 0; + model.model = MODEL_SQUARE; + model.startTime = "2019-01-01 00:00:00"; + model.endTime = "2029-01-01 00:00:00"; + model.permission = 4; + model.showModel = SHOW_DIY; + model.section = "5"; + return model; + } + + public int getShowModel() { + return showModel; + } + + public void setShowModel(int showModel) { + this.showModel = showModel; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + public int getType() { return type; } 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 7d64a092c..19e366823 100644 --- a/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java +++ b/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java @@ -11,6 +11,8 @@ import com.yunbao.common.dialog.OpenAdBottomDialogPopup; import com.yunbao.common.dialog.OpenAdCenterDialogPopup; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.SpUtil; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import java.util.ArrayList; @@ -93,6 +95,18 @@ public class OpenAdManager { if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) { continue; } + if (model.getShowModel() == OpenAdModel.SHOW_ONE) { + if (SpUtil.getInstance().getBooleanValue("open_ad_popup_" + model.getId())) { + continue; + } + SpUtil.getInstance().setBooleanValue("open_ad_popup_" + model.getId(), true); + } + if (model.getShowModel() == OpenAdModel.SHOW_DIY) { + String value = SpUtil.getStringValue("open_ad_popup_time_" + model.getId()); + if (!StringUtil.isEmpty(value) && System.currentTimeMillis() < Long.parseLong(value)) { + continue; + } + } if (runnableMap.containsKey(model.getId())) { AdRunnable runnable = runnableMap.get(model.getId()); if (runnable != null) { @@ -166,6 +180,10 @@ public class OpenAdManager { return; } showMap.put(model.getId(), true); + 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); + } if (model.getModel() == OpenAdModel.MODEL_BOTTOM) { new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> { }).showDialog(); From 3396ca63d0dd08f0e777c148042925490e1960e9 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 7 Dec 2023 13:17:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/manager/IMLoginManager.java | 2 +- common/src/main/res/values-en-rUS/string.xml | 6 +++--- common/src/main/res/values-zh-rHK/strings.xml | 6 +++--- common/src/main/res/values-zh-rTW/strings.xml | 6 +++--- common/src/main/res/values-zh/strings.xml | 6 +++--- common/src/main/res/values/strings.xml | 6 +++--- .../yunbao/live/activity/LiveAudienceActivity.java | 1 + .../yunbao/live/views/LiveAudienceViewHolder.java | 12 +++++++++--- .../com/yunbao/live/views/LiveRoomViewHolder.java | 1 + main/src/main/res/layout/view_homemain.xml | 1 + .../src/main/res/layout/view_search_results_item.xml | 4 ++-- 11 files changed, 30 insertions(+), 21 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 90e1fbda8..7920c8b1c 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -58,7 +58,7 @@ public class IMLoginManager extends BaseCacheManager { } public boolean getRedPoint() { - return !TextUtils.isEmpty(getString("RedPoint")) && !TextUtils.equals(getString("RedPoint"), "1"); + return !TextUtils.isEmpty(getString("RedPoint")) || !TextUtils.equals(getString("RedPoint"), "1"); } public void setQuickGiftIfFirst() { put("quick_gift_if_first", "1"); diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 56358e6b1..2bab89497 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1390,8 +1390,8 @@ Limited ride And limited avatar frame Exchange quantity: Need %s Exchange&Usage Rules: - ·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; - ·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; - ·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities. + 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; + 3.Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities. diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 1c9c00ff1..20f17754b 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1387,7 +1387,7 @@ 兌換數量: 需要 %s 兌換&使用規則: - ·1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - ·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊。 + 1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 99a35ce6f..f14c42b6d 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1386,7 +1386,7 @@ 兌換數量: 需要 %s 兌換&使用規則: - ·1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - ·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊。 + 1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 9bcf8c8e3..68ced0bf7 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1386,8 +1386,8 @@ 兌換數量: 需要 %s 兌換&使用規則: - ·1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - ·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 + 1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + 2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + 3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 9b648b88d..b8c3434d1 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1393,7 +1393,7 @@ Limited ride And limited avatar frame Exchange quantity: Need %s Exchange&Usage Rules: - ·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; - ·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; - ·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities. + 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; + 3.Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities. diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index d7c139793..4084f182c 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1874,6 +1874,7 @@ public class LiveAudienceActivity extends LiveActivity { if (manager == null || manager.mLiveAudienceViewHolder == null || manager.mLiveAudienceViewHolder.mRedPointPrivilege == null) { return; } + manager.mLiveAudienceViewHolder.setShowCrownRed(isShow); if (isShow) { manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.VISIBLE); } else { diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 176e4a70f..12ab63efc 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -364,7 +364,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { } mQuickGiftRemainingQuantity = mQuickGiftRemainingQuantity - 1; quick_gift_remaining_quantity.setText(String.valueOf(mQuickGiftRemainingQuantity)); - MobclickAgent.onEvent(mContext, "small_pd_gifts", "连点"+quickGiftingIndex); + MobclickAgent.onEvent(mContext, "small_pd_gifts", "连点" + quickGiftingIndex); } } }); @@ -401,7 +401,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { if (!(quickGiftContDown > 0 && quickGiftContDown < 120)) { quickGiftHandler.postDelayed(quickGiftRunnable, 1000); } - }else { + } else { circleProgress.setCurrent(2); time_text.setVisibility(View.GONE); } @@ -720,6 +720,12 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); } + private boolean mIsShow; + + public void setShowCrownRed(boolean isShow) { + mIsShow = isShow; + } + /** * 身份特权 */ @@ -732,7 +738,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { // fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveRoleDialogFragment"); new XPopup.Builder(mContext) .enableDrag(false) - .asCustom(new LiveNewRolePopup(mContext, mRedPointPrivilege.getVisibility() == View.VISIBLE)) + .asCustom(new LiveNewRolePopup(mContext, mIsShow)) .show(); mRedPointPrivilege.setVisibility(View.GONE); } 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 96c65ea14..61f54a739 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -714,6 +714,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis combo_layout.setVisibility(View.GONE); if (IMLoginManager.get(mContext).getQuickGiftIfFirst()) { quick_gift_reminder.setVisibility(View.VISIBLE); + IMLoginManager.get(mContext).setQuickGiftIfFirst(); } else { quick_gift_reminder.setVisibility(View.GONE); } diff --git a/main/src/main/res/layout/view_homemain.xml b/main/src/main/res/layout/view_homemain.xml index 981e0b6f7..34c8f2fc1 100644 --- a/main/src/main/res/layout/view_homemain.xml +++ b/main/src/main/res/layout/view_homemain.xml @@ -9,6 +9,7 @@ diff --git a/main/src/main/res/layout/view_search_results_item.xml b/main/src/main/res/layout/view_search_results_item.xml index aab38cf7e..48e508b79 100644 --- a/main/src/main/res/layout/view_search_results_item.xml +++ b/main/src/main/res/layout/view_search_results_item.xml @@ -76,9 +76,9 @@ From 6347473d0ce3a40b34ace85f6321231775fb0b08 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 7 Dec 2023 13:24:41 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/src/main/res/layout/view_homemain.xml | 1 - main/src/main/res/layout/view_main_home_live.xml | 6 +++--- main/src/main/res/layout/view_main_home_live_recom.xml | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/main/res/layout/view_homemain.xml b/main/src/main/res/layout/view_homemain.xml index 34c8f2fc1..981e0b6f7 100644 --- a/main/src/main/res/layout/view_homemain.xml +++ b/main/src/main/res/layout/view_homemain.xml @@ -9,7 +9,6 @@ diff --git a/main/src/main/res/layout/view_main_home_live.xml b/main/src/main/res/layout/view_main_home_live.xml index a8350a20c..c98693050 100644 --- a/main/src/main/res/layout/view_main_home_live.xml +++ b/main/src/main/res/layout/view_main_home_live.xml @@ -1,6 +1,5 @@ @@ -9,14 +8,15 @@ android:id="@+id/classRecyclerView_top" android:layout_width="match_parent" android:layout_height="wrap_content" - android:overScrollMode="never"/> + android:overScrollMode="never" /> + android:layout_marginRight="10dp" + android:layout_marginBottom="55dp" /> \ No newline at end of file From 32d0fe497dcd407c40c77ae35dae124ccf162d7b Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 7 Dec 2023 16:29:28 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/views/InteractionGamesChildViewHolder.java | 2 +- live/src/main/res/layout/view_live_audience.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java index 8d1dde931..c989802b0 100644 --- a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java @@ -34,7 +34,7 @@ public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder { funGameName.setText(model.getTitle()); - if (!TextUtils.isEmpty(model.getSudGameIsNew())||TextUtils.equals(model.getSudGameIsNew(),"1")){ + if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")){ itemView.findViewById(R.id.icon_new_game).setVisibility(View.VISIBLE); }else { itemView.findViewById(R.id.icon_new_game).setVisibility(View.GONE); diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index 2309da2b0..37024e358 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -454,8 +454,8 @@ Date: Thu, 7 Dec 2023 17:31:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/main/activity/GoogleFragment.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/activity/GoogleFragment.java b/main/src/main/java/com/yunbao/main/activity/GoogleFragment.java index b368c8dad..9b03293ea 100644 --- a/main/src/main/java/com/yunbao/main/activity/GoogleFragment.java +++ b/main/src/main/java/com/yunbao/main/activity/GoogleFragment.java @@ -17,6 +17,8 @@ import android.webkit.WebView; import androidx.fragment.app.Fragment; import com.facebook.appevents.AppEventsConstants; +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GoogleApiAvailability; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.GoogleUtils; @@ -40,6 +42,8 @@ public class GoogleFragment extends Fragment { GoogleUtils googleUtils; + boolean isGoogleService = true; + public GoogleFragment() { } @@ -59,13 +63,20 @@ public class GoogleFragment extends Fragment { rlWebview = (WebView) view.findViewById(R.id.rlWebview); Log.e("ttt", url); rlWebview.loadUrl(url); - initGooglePay(); - new Thread() { - @Override - public void run() { - adid = googleUtils.getAdid(); - } - }.start(); + + // 验证是否已在此设备上安装并启用Google Play服务,以及此设备上安装的旧版本是否为此客户端所需的版本 + int code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getActivity()); + if (code == ConnectionResult.SUCCESS) { + isGoogleService = true; + // 支持Google服务 + initGooglePay(); + new Thread() { + @Override + public void run() { + adid = googleUtils.getAdid(); + } + }.start(); + } WebSettings webSettings = rlWebview.getSettings(); webSettings.setDomStorageEnabled(true);