1:修改全部任务显示添加角标
This commit is contained in:
@@ -118,6 +118,7 @@ import com.xscm.moduleutil.bean.RoomMessageEvent.T
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent.text
|
||||
import com.xscm.moduleutil.bean.RoomSettingEvent
|
||||
import com.xscm.moduleutil.bean.RoomSingleton
|
||||
import com.xscm.moduleutil.bean.TasksMessage
|
||||
import com.xscm.moduleutil.bean.UserInfo
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean
|
||||
import com.xscm.moduleutil.bean.XLHBean
|
||||
@@ -152,6 +153,7 @@ import com.xscm.moduleutil.event.SurfaceEvent
|
||||
import com.xscm.moduleutil.event.UnreadCountEvent
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.http.RetrofitClient.TasksMessageListener
|
||||
import com.xscm.moduleutil.interfaces.OnMusicItemClickListener
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton.OnMessageReceivedListener
|
||||
@@ -241,6 +243,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
private var appStateListener: AppStateListener? = null
|
||||
|
||||
private var qxRedPacketManager: QXRedPacketManager? = null
|
||||
|
||||
//用户列表用
|
||||
private var mOnlineBean: RoomOnline? = null
|
||||
|
||||
@@ -343,6 +346,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
preloadFloatingViews()
|
||||
|
||||
initPublicScreenFragment()
|
||||
|
||||
RetrofitClient.getInstance().setTasksMessageListener(TasksMessageListener { result: Int ->
|
||||
LogUtils.e("tasksMessageListener", result)
|
||||
getTasksMessageService(result)
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@@ -1011,6 +1019,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
MvpPre?.roomRedPackets(roomId)
|
||||
|
||||
|
||||
Observable.timer(1000, TimeUnit.MILLISECONDS).observeOn(
|
||||
AndroidSchedulers.mainThread()
|
||||
).subscribe { aLong: Long? ->
|
||||
@@ -3783,6 +3792,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// AgoraManager.getInstance()
|
||||
// .joinRoom(SpUtil.getRtmToken(), roomId, SpUtil.getUserId(), false, false);
|
||||
// MvpPre?.postRoomInfo(roomId)
|
||||
MvpPre?.getTasksMessage()
|
||||
}
|
||||
|
||||
fun refreshRoomInfo(roomId: String) {
|
||||
@@ -3823,7 +3833,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO: 根据返回的在线列表获取对应的值,查看是否有在线用户
|
||||
override fun getRoomOnline(onlineBean: RoomOnline?) {
|
||||
if (onlineBean != null) {
|
||||
@@ -4100,6 +4109,26 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTasksMessage(data: TasksMessage?) {
|
||||
if (data != null) {
|
||||
mBinding?.tvTaskMessage?.text = "+" + data.num
|
||||
if (data.num == 0) {
|
||||
mBinding?.tvTaskMessage?.visibility = View.GONE
|
||||
} else {
|
||||
mBinding?.tvTaskMessage?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getTasksMessageService(number: Int) {
|
||||
mBinding?.tvTaskMessage?.text = "+" + number
|
||||
if (number == 0) {
|
||||
mBinding?.tvTaskMessage?.visibility = View.GONE
|
||||
} else {
|
||||
mBinding?.tvTaskMessage?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
private fun queren1(nickname: String) {
|
||||
// 创建并显示确认对话框
|
||||
ConfirmDialog(
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
@@ -52,6 +53,8 @@ public class RoomContacts {
|
||||
void findRoom();
|
||||
|
||||
void roomRedPackets(List<RedPacketInfo> list);
|
||||
|
||||
void getTasksMessage(TasksMessage data);
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
@@ -93,5 +96,7 @@ public class RoomContacts {
|
||||
void auctionDelay(String auctionId);
|
||||
|
||||
void roomRedPackets(String roomId);
|
||||
|
||||
void getTasksMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.EMMessageInfo;
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||
@@ -763,6 +764,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTasksMessage(TasksMessage data) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getVoiceStatus(RoomAuction.AuctionUserBean auctionUserBean, List<RoomAuction.AuctionListBean> auctionListBeans, String user_id) {
|
||||
boolean haveMe = false;
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.xscm.moduleutil.bean.MusicSongBean;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
@@ -1132,4 +1133,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTasksMessage(TasksMessage data) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.xscm.modulemain.activity.room.contacts.RoomContacts;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
@@ -462,4 +463,22 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTasksMessage() {
|
||||
api.getTasksMessage(new BaseObserver<TasksMessage>(){
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(TasksMessage s) {
|
||||
if (MvpRef==null)
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
MvpRef.get().getTasksMessage(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user