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) {