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 1519f5387..c9d2cd4a1 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -455,6 +455,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene if (index == 0) { isfloatBannernet = true; initAnchorRecommendBanner(); + } else if (index == 2) { + floatBanner.setVisibility(View.GONE); + findViewById(R.id.banner_click).setVisibility(View.GONE); + isfloatBannernet = false; + if (mainMessageViewHolder != null) + mainMessageViewHolder.onResume(); } else { floatBanner.setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE); 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 95dcf48f8..091d25bcc 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java @@ -99,6 +99,12 @@ public class MainMessageViewHolder extends AbsMainViewHolder { return R.layout.view_main_message; } + @Override + public void onResume() { + super.onResume(); + initData(); + } + @Override public void init() { EventBus.getDefault().register(this); @@ -113,7 +119,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder { imgNewsInteraction = (ImageView) findViewById(R.id.img_news_interaction); imgNewsOnline = (ImageView) findViewById(R.id.img_news_online); netHandler = new Handler(); - initData(); + } @Override @@ -179,27 +185,28 @@ public class MainMessageViewHolder extends AbsMainViewHolder { @Override public void run() { netHandler.post(imUserInfoRunnable); + if (IMLoginManager.get(mContext).hintChat()) { + container.setVisibility(View.GONE); + ltNodataMsg.setVisibility(View.VISIBLE); + } else { + container.setVisibility(View.VISIBLE); + ltNodataMsg.setVisibility(View.GONE); + //展示会话列表 + conversationListFragment = new ConversationListFragment(); + FragmentManager manager = ((FragmentActivity) mContext).getSupportFragmentManager(); + FragmentTransaction transaction = manager.beginTransaction(); + transaction.replace(R.id.container, conversationListFragment); + transaction.commit(); + //自定义空数据背景View + conversationListFragment.setEmptyView(com.yunbao.live.R.layout.view_layout_msg); + //刷新列表内用户信息 + ConversationIMListManager.get(mContext).addUserInfoProvider(); + } + //获取一下系统通知 + MessageIMManager.get(mContext).getSystemMessages(); } }); - if (IMLoginManager.get(mContext).hintChat()) { - container.setVisibility(View.GONE); - ltNodataMsg.setVisibility(View.VISIBLE); - } else { - container.setVisibility(View.VISIBLE); - ltNodataMsg.setVisibility(View.GONE); - //展示会话列表 - conversationListFragment = new ConversationListFragment(); - FragmentManager manager = ((FragmentActivity) mContext).getSupportFragmentManager(); - FragmentTransaction transaction = manager.beginTransaction(); - transaction.replace(R.id.container, conversationListFragment); - transaction.commit(); - //自定义空数据背景View - conversationListFragment.setEmptyView(com.yunbao.live.R.layout.view_layout_msg); - //刷新列表内用户信息 - ConversationIMListManager.get(mContext).addUserInfoProvider(); - } - //获取一下系统通知 - MessageIMManager.get(mContext).getSystemMessages(); + }