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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.app.Activity;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
|
||||
@@ -23,6 +24,8 @@ public final class MeConacts {
|
||||
void wallet(WalletBean walletBean);
|
||||
|
||||
void setBanners(List<BannerModel> bannerModels);
|
||||
|
||||
void getTasksMessage(TasksMessage data);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
@@ -40,6 +43,8 @@ public final class MeConacts {
|
||||
|
||||
|
||||
void wallet();
|
||||
|
||||
void getTasksMessage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.xscm.modulemain.activity.user.presenter.MePresenter;
|
||||
import com.xscm.modulemain.activity.WebViewActivity;
|
||||
import com.xscm.modulemain.dialog.UserNetWorthDialog;
|
||||
import com.xscm.moduleutil.base.WebUrlConstants;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.ShineTextView;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
@@ -170,6 +171,7 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
||||
MvpPre.getMyInfo();
|
||||
MvpPre.wallet();
|
||||
MvpPre.getBanners("6");
|
||||
MvpPre.getTasksMessage();
|
||||
// MvpPre.getMemberList(SpUtils.getUserId(), 1);
|
||||
}
|
||||
|
||||
@@ -180,9 +182,6 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
||||
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
|
||||
|
||||
|
||||
if (id == R.id.ll_visit) {
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_VISIT).navigation();
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.C0104);
|
||||
@@ -410,6 +409,19 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
||||
mBinding.banner.setBannerData(R.layout.index_image_banner, bannerModels);
|
||||
}
|
||||
|
||||
// TODO: 2025/12/16 任务未领取个数
|
||||
@Override
|
||||
public void getTasksMessage(TasksMessage data) {
|
||||
if (data!=null){
|
||||
mBinding.tvDailyMessage.setText("+"+data.getNum());
|
||||
if (data.getNum()==0){
|
||||
mBinding.tvDailyMessage.setVisibility(View.GONE);
|
||||
}else {
|
||||
mBinding.tvDailyMessage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void copyUserId(CharSequence content) {
|
||||
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
|
||||
import com.xscm.modulemain.activity.user.conacts.MeConacts;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.TasksMessage;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
@@ -186,6 +187,25 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
|
||||
});
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getBanners(String s) {
|
||||
// Type listType = new TypeToken<List<BannerModel>>() {}.getType();
|
||||
// List<BannerModel> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtils.getHomeBanner(), listType);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.xscm.modulemain.databinding.FragmentRoomOnlineDialogBinding;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
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;
|
||||
@@ -386,4 +387,9 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTasksMessage(TasksMessage data) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
|
||||
</com.xscm.moduleutil.widget.DropRedView>
|
||||
|
||||
<!-- 每日任务-->
|
||||
<com.xscm.moduleutil.widget.DropDayTaskView
|
||||
android:id="@+id/cl_day_task"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -97,12 +97,39 @@
|
||||
tools:visibility="visible">
|
||||
<!-- android:background="@mipmap/room_xsb"-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_day_task"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/day_task" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_day_task"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/day_task" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_task_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/im_day_task"
|
||||
android:layout_marginStart="-30dp"
|
||||
android:background="@drawable/ease_bg_msg_count"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingTop="1.5dp"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
tools:text="+99"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</com.xscm.moduleutil.widget.DropDayTaskView>
|
||||
|
||||
@@ -801,9 +801,6 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -841,11 +838,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:flexWrap="wrap"
|
||||
app:alignContent="flex_start"
|
||||
app:alignItems="stretch"
|
||||
app:justifyContent="flex_start"
|
||||
app:flexDirection="row"
|
||||
app:alignContent="flex_start">
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/iv_hb"
|
||||
@@ -855,8 +852,8 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_flexGrow="1"
|
||||
app:layout_flexBasisPercent="25%">
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
@@ -880,8 +877,8 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_flexGrow="1"
|
||||
app:layout_flexBasisPercent="25%">
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
@@ -898,7 +895,6 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/me_daily"
|
||||
android:layout_width="0dp"
|
||||
@@ -908,13 +904,38 @@
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
app:layout_flexGrow="1"
|
||||
app:layout_flexBasisPercent="25%">
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/me_test" />
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-3dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/me_test" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_daily_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_25"
|
||||
android:background="@drawable/ease_bg_msg_count"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingTop="1.5dp"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
tools:text="+99"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -934,8 +955,8 @@
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_flexGrow="1"
|
||||
app:layout_flexBasisPercent="25%">
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
@@ -1043,9 +1064,9 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible"
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1"
|
||||
android:visibility="invisible">
|
||||
app:layout_flexGrow="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
@@ -1070,7 +1091,7 @@
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible"
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1"/>
|
||||
app:layout_flexGrow="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@@ -1080,8 +1101,8 @@
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible"
|
||||
app:layout_flexGrow="1"
|
||||
app:layout_flexBasisPercent="25%"/>
|
||||
app:layout_flexBasisPercent="25%"
|
||||
app:layout_flexGrow="1" />
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user