新增短剧页面的开播提醒浮窗
This commit is contained in:
parent
6f71a825b5
commit
df735af252
@ -10,25 +10,35 @@ import androidx.fragment.app.FragmentTransaction;
|
|||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
|
import com.yunbao.main.dialog.AnchorStartLiveNotifyDialog;
|
||||||
import com.yunbao.main.fragment.MainHomeCommunityVideoFragment;
|
import com.yunbao.main.fragment.MainHomeCommunityVideoFragment;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短剧
|
* 短剧
|
||||||
*/
|
*/
|
||||||
@Route(path = RouteUtil.PATH_COMMUNITY_Activity)
|
@Route(path = RouteUtil.PATH_COMMUNITY_Activity)
|
||||||
public class MainHomeCommunityActivity extends AbsActivity {
|
public class MainHomeCommunityActivity extends AbsActivity {
|
||||||
|
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.activity_main_home_community;
|
return R.layout.activity_main_home_community;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
|
|
||||||
@ -49,6 +59,28 @@ public class MainHomeCommunityActivity extends AbsActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onNotifyAnchorLive(AnchorStartLiveBean bean) {
|
||||||
|
if (!IMLoginManager.get(mContext).isLiveNotifySettings()) return;
|
||||||
|
|
||||||
|
if (startListNotifyList.isEmpty()) {
|
||||||
|
startListNotifyList.add(bean);
|
||||||
|
notifyLiveFlot();
|
||||||
|
} else {
|
||||||
|
startListNotifyList.add(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void notifyLiveFlot() {
|
||||||
|
if (startListNotifyList.iterator().hasNext()) {
|
||||||
|
AnchorStartLiveBean bean = startListNotifyList.iterator().next();
|
||||||
|
new AnchorStartLiveNotifyDialog(mContext, bean).setOnDismissListener(dialog -> {
|
||||||
|
startListNotifyList.remove(bean);
|
||||||
|
if (startListNotifyList.iterator().hasNext()) {
|
||||||
|
notifyLiveFlot();
|
||||||
|
}
|
||||||
|
}).showDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user