From 2779fedc3b48a4fba068114c3908ab0b7f834f10 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 19 Aug 2022 10:32:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=8A=96=E6=97=B6=E9=97=B4=E6=94=B9?= =?UTF-8?q?=E6=88=900.5=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/dialog/LiveTotalDialog.java | 18 ++++++++++++++++++ .../common/views/FunGamesViewHolder.java | 1 + .../views/weight/ViewClicksAntiShake.java | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/LiveTotalDialog.java b/common/src/main/java/com/yunbao/common/dialog/LiveTotalDialog.java index e8a4a4d0d..86d877872 100644 --- a/common/src/main/java/com/yunbao/common/dialog/LiveTotalDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/LiveTotalDialog.java @@ -18,6 +18,9 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + import java.util.List; /** @@ -45,6 +48,7 @@ public class LiveTotalDialog extends AbsDialogFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); + Bus.getOn(this); funGamesList = (RecyclerView) findViewById(R.id.fun_games_list); gamesAdapter = new FunGamesAdapter(); funGamesList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); @@ -116,4 +120,18 @@ public class LiveTotalDialog extends AbsDialogFragment { window.setAttributes(params); } + @Override + public void onDestroy() { + super.onDestroy(); + Bus.getOff(this); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onOpenDrawer(LiveAudienceEvent event) { + switch (event.getType()) { + case CURRENT_ACTIVITY: + dismiss(); + break; + } + } } diff --git a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java index 2142d9f11..7614cff7f 100644 --- a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java @@ -39,4 +39,5 @@ public class FunGamesViewHolder extends RecyclerView.ViewHolder { .setModel(model)); }); } + } diff --git a/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java b/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java index 09d20d132..26f39e708 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java +++ b/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java @@ -24,7 +24,7 @@ public class ViewClicksAntiShake { */ public static void clicksAntiShake(View view, ViewClicksCallBack callBack) { RxView.clicks(view) - .throttleFirst(2, TimeUnit.SECONDS) + .throttleFirst(500, TimeUnit.MILLISECONDS) .subscribe(new Observer() { @Override public void onSubscribe(Disposable d) {