diff --git a/app/src/main/java/com/yizhuan/erban/avroom/activity/AVRoomActivity.java b/app/src/main/java/com/yizhuan/erban/avroom/activity/AVRoomActivity.java index 78cbc3be2..630bbd6eb 100644 --- a/app/src/main/java/com/yizhuan/erban/avroom/activity/AVRoomActivity.java +++ b/app/src/main/java/com/yizhuan/erban/avroom/activity/AVRoomActivity.java @@ -24,6 +24,7 @@ import android.view.View; import android.view.ViewStub; import android.view.WindowManager; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -67,6 +68,7 @@ import com.yizhuan.erban.home.dialog.HelloMessageDialog; import com.yizhuan.erban.ui.patriarch.help.LimitEnterRoomHelper; import com.yizhuan.erban.ui.user.UserInfoActivity; import com.yizhuan.erban.ui.utils.ImageLoadUtils; +import com.yizhuan.erban.ui.webview.CommonWebViewActivity; import com.yizhuan.erban.ui.widget.LoadingDialog; import com.yizhuan.erban.ui.widget.NobleOpenNoticeView; import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftDialog; @@ -111,6 +113,7 @@ import com.yizhuan.xchat_android_core.room.bean.RoomInfo; import com.yizhuan.xchat_android_core.room.bean.RoomModeType; import com.yizhuan.xchat_android_core.room.dragonball.DragonBallModel; import com.yizhuan.xchat_android_core.room.event.FinishAvRoomEvent; +import com.yizhuan.xchat_android_core.room.event.RoomTaskTipsEvent; import com.yizhuan.xchat_android_core.room.pk.event.PKStateEvent; import com.yizhuan.xchat_android_core.statistic.StatisticManager; import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol; @@ -175,6 +178,9 @@ public class AVRoomActivity extends BaseMvpActivity llTaskTips.setVisibility(View.GONE), 3000); + TextView tvMsg = llTaskTips.findViewById(R.id.tv_tips_text); + tvMsg.setText(event.getTaskCompleteMsg()); + llTaskTips.setOnClickListener(v -> { + llTaskTips.setVisibility(View.GONE); + CommonWebViewActivity.start(this, event.getTaskUrl()); + }); + } + public Single giveUpDragonBar() { return DragonBallModel.get() .clearDragonBar() diff --git a/app/src/main/java/com/yizhuan/erban/home/fragment/MeFragment.kt b/app/src/main/java/com/yizhuan/erban/home/fragment/MeFragment.kt index e4ba9680b..a4061c40b 100644 --- a/app/src/main/java/com/yizhuan/erban/home/fragment/MeFragment.kt +++ b/app/src/main/java/com/yizhuan/erban/home/fragment/MeFragment.kt @@ -61,6 +61,7 @@ import com.yizhuan.xchat_android_core.user.UserModel import com.yizhuan.xchat_android_core.user.bean.UserInfo import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils +import com.yizhuan.xchat_android_core.utils.LogUtils import com.yizhuan.xchat_android_core.utils.StarUtils import com.yizhuan.xchat_android_library.rxbus.RxBusHelper import com.yizhuan.xchat_android_library.utils.FormatUtils @@ -305,6 +306,7 @@ class MeFragment : BaseFragment(), View.OnClickListener { super.onResume() initUserDate() requestUpdateUserInfo() + LogUtils.d("onResume") } private fun initUserDate() { diff --git a/app/src/main/res/drawable/shape_room_task_tips.xml b/app/src/main/res/drawable/shape_room_task_tips.xml new file mode 100644 index 000000000..95c9548c5 --- /dev/null +++ b/app/src/main/res/drawable/shape_room_task_tips.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/app/src/main/res/layout/activity_chat_room.xml b/app/src/main/res/layout/activity_chat_room.xml index eef75406c..ab16f473f 100644 --- a/app/src/main/res/layout/activity_chat_room.xml +++ b/app/src/main/res/layout/activity_chat_room.xml @@ -30,10 +30,12 @@ android:layout="@layout/room_noble_open_viewstub_layout" /> + android:id="@+id/vs_task_tips" + android:layout_width="wrap_content" + android:layout_height="20dp" + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="150dp" + android:layout="@layout/layout_vs_task_tips" + /> \ No newline at end of file diff --git a/app/src/main/res/layout/layout_vs_task_tips.xml b/app/src/main/res/layout/layout_vs_task_tips.xml new file mode 100644 index 000000000..0d8f529e8 --- /dev/null +++ b/app/src/main/res/layout/layout_vs_task_tips.xml @@ -0,0 +1,31 @@ + + + + + + + + \ No newline at end of file diff --git a/core/src/main/java/com/yizhuan/xchat_android_core/im/custom/bean/CustomAttachment.java b/core/src/main/java/com/yizhuan/xchat_android_core/im/custom/bean/CustomAttachment.java index c84d1f065..8024fbbdb 100644 --- a/core/src/main/java/com/yizhuan/xchat_android_core/im/custom/bean/CustomAttachment.java +++ b/core/src/main/java/com/yizhuan/xchat_android_core/im/custom/bean/CustomAttachment.java @@ -384,6 +384,9 @@ public class CustomAttachment implements MsgAttachment { public static final int CUSTOM_MSG_ROOM_RANK = 91; public static final int CUSTOM_MSG_SUB_ROOM_RANK_TOP = 911; + + public static final int CUSTOM_MSG_ROOM_TASK_TIPS = 92; + public static final int CUSTOM_MSG_SUB_ROOM_TASK_TIPS = 921; /** * 自定义消息附件的类型,根据该字段区分不同的自定义消息 */ diff --git a/core/src/main/java/com/yizhuan/xchat_android_core/manager/IMSystemMsgManager.java b/core/src/main/java/com/yizhuan/xchat_android_core/manager/IMSystemMsgManager.java index 614700842..d0874c392 100644 --- a/core/src/main/java/com/yizhuan/xchat_android_core/manager/IMSystemMsgManager.java +++ b/core/src/main/java/com/yizhuan/xchat_android_core/manager/IMSystemMsgManager.java @@ -39,6 +39,7 @@ import com.yizhuan.xchat_android_core.pay.event.ChargeCustomNotificationEvent; import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent; import com.yizhuan.xchat_android_core.pay.event.FirstRechargeEvent; import com.yizhuan.xchat_android_core.pay.event.NewUserChargeEvent; +import com.yizhuan.xchat_android_core.room.event.RoomTaskTipsEvent; import com.yizhuan.xchat_android_core.statistic.StatisticManager; import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol; import com.yizhuan.xchat_android_core.user.UserModel; @@ -56,6 +57,8 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_VISITOR; import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_WORLD_DYNAMIC; import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_MINI_WORLD; +import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_TASK_TIPS; +import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_TASK_TIPS; import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_VISITOR_UNREAD; import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VIP; import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VIP_SELF_OPEN; @@ -303,7 +306,7 @@ public class IMSystemMsgManager { event.setChargeProdTitle(firstChargeGoods.getChargeProdTitle()); event.setFirstChargeRewardList(firstChargeGoods.getFirstChargeRewardList()); EventBus.getDefault().post(event); - }else if (subType == CustomAttachment.CUSTOM_MSG_SUB_NEW_USER_CHARGE_PRIZE){ + } else if (subType == CustomAttachment.CUSTOM_MSG_SUB_NEW_USER_CHARGE_PRIZE) { FirstChargeGoods firstChargeGoods = data.toJavaObject(FirstChargeGoods.class); NewUserChargeEvent event = new NewUserChargeEvent(); event.setChargeProdTitle(firstChargeGoods.getChargeProdTitle()); @@ -329,6 +332,11 @@ public class IMSystemMsgManager { EventBus.getDefault().postSticky(new VisitorUnreadCountEvent(visitNum)); } break; + case CUSTOM_MSG_ROOM_TASK_TIPS: + if (subType == CUSTOM_MSG_SUB_ROOM_TASK_TIPS) { + EventBus.getDefault().post(data.toJavaObject(RoomTaskTipsEvent.class)); + } + break; default: break; } diff --git a/core/src/main/java/com/yizhuan/xchat_android_core/room/event/RoomTaskTipsEvent.java b/core/src/main/java/com/yizhuan/xchat_android_core/room/event/RoomTaskTipsEvent.java new file mode 100644 index 000000000..113aa2b16 --- /dev/null +++ b/core/src/main/java/com/yizhuan/xchat_android_core/room/event/RoomTaskTipsEvent.java @@ -0,0 +1,9 @@ +package com.yizhuan.xchat_android_core.room.event; + +import lombok.Data; + +@Data +public class RoomTaskTipsEvent { + private String taskCompleteMsg; + private String taskUrl; +}