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/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index e5f1dd1c1..e9c2814d8 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -511,6 +511,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene findViewById(R.id.banner_click).setVisibility(View.GONE); isfloatBannernet = false; } + mViewHolders[index].onResume(); }); //获取指导员账号 ConversationIMListManager.get(this).getUserInstructor(this); @@ -860,7 +861,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene NoviceInstructorManager.get(mContext).getNoviceInstructor(); NoviceInstructorManager.get(mContext).checktHomeZdyPop(); initAnchorRecommendBanner(); - OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false); } /** 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;