直播结束,悬浮窗

This commit is contained in:
18401019693 2022-10-17 16:00:27 +08:00
parent 09f74c3881
commit 5bf95c28d2
2 changed files with 33 additions and 20 deletions

View File

@ -455,6 +455,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (index == 0) { if (index == 0) {
isfloatBannernet = true; isfloatBannernet = true;
initAnchorRecommendBanner(); 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 { } else {
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE);

View File

@ -99,6 +99,12 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
return R.layout.view_main_message; return R.layout.view_main_message;
} }
@Override
public void onResume() {
super.onResume();
initData();
}
@Override @Override
public void init() { public void init() {
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
@ -113,7 +119,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
imgNewsInteraction = (ImageView) findViewById(R.id.img_news_interaction); imgNewsInteraction = (ImageView) findViewById(R.id.img_news_interaction);
imgNewsOnline = (ImageView) findViewById(R.id.img_news_online); imgNewsOnline = (ImageView) findViewById(R.id.img_news_online);
netHandler = new Handler(); netHandler = new Handler();
initData();
} }
@Override @Override
@ -179,27 +185,28 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
@Override @Override
public void run() { public void run() {
netHandler.post(imUserInfoRunnable); 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();
} }