update 粉丝团相关
This commit is contained in:
parent
92d4130c45
commit
c53b9a6064
@ -19,6 +19,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.Utils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
@ -34,6 +36,7 @@ import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
@ -44,6 +47,7 @@ import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.socket.SocketReceiveBean;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
@ -201,11 +205,16 @@ public class AppContext extends CommonAppContext {
|
||||
&& (TextUtils.equals("__system__", message.getTargetId())
|
||||
|| ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
|
||||
JSONObject map = received.getMsg().getJSONObject(0);
|
||||
sendStartAnchorLive(map);
|
||||
}
|
||||
//主播页面
|
||||
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||
EventBus.getDefault().post(message);
|
||||
}
|
||||
@ -215,6 +224,14 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void sendStartAnchorLive(JSONObject map) {
|
||||
AnchorStartLiveBean bean = new AnchorStartLiveBean();
|
||||
bean.setAnchorName(map.getString("anchorName"));
|
||||
bean.setRoomId(map.getString("roomid"));
|
||||
bean.setAvatar(map.getString("avatar"));
|
||||
EventBus.getDefault().post(bean);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class AnchorStartLiveBean extends BaseModel{
|
||||
private String anchorName;
|
||||
private String avatar;
|
||||
private String roomId;
|
||||
|
||||
public String getAnchorName() {
|
||||
return anchorName;
|
||||
}
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getRoomId() {
|
||||
return roomId;
|
||||
}
|
||||
|
||||
public void setRoomId(String roomId) {
|
||||
this.roomId = roomId;
|
||||
}
|
||||
}
|
@ -68,6 +68,8 @@ public class UserBean implements Parcelable {
|
||||
private String mRankPkImgUrl;
|
||||
//是否填写完整资料
|
||||
private int user_info_complete;
|
||||
//粉丝团等级
|
||||
private int fansLevel;
|
||||
|
||||
public int getUserInfoComplete() {
|
||||
return user_info_complete;
|
||||
@ -78,6 +80,14 @@ public class UserBean implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getFansLevel() {
|
||||
return fansLevel;
|
||||
}
|
||||
|
||||
public void setFansLevel(int fansLevel) {
|
||||
this.fansLevel = fansLevel;
|
||||
}
|
||||
|
||||
public boolean isRandomPk() {
|
||||
return randomPk;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import androidx.annotation.NonNull;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
|
||||
|
||||
/**
|
||||
* 底部弹窗
|
||||
*/
|
||||
public abstract class AbsDialogPopupWindow extends BottomPopupView {
|
||||
public final Context mContext;
|
||||
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.PositionPopupView;
|
||||
|
||||
/**
|
||||
* 自定义位置弹窗
|
||||
*/
|
||||
public abstract class AbsDialogPositionPopupWindow extends PositionPopupView {
|
||||
public final Context mContext;
|
||||
|
||||
public AbsDialogPositionPopupWindow(@NonNull Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://github.com/li-xiaojun/XPopup/wiki/5.-%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE">参考配置</a>
|
||||
*/
|
||||
public abstract void buildDialog(XPopup.Builder builder);
|
||||
public abstract int bindLayoutId();
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return bindLayoutId();
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
XPopup.Builder builder = new XPopup.Builder(mContext);
|
||||
builder.isDestroyOnDismiss(true);
|
||||
builder.enableDrag(false);
|
||||
buildDialog(builder);
|
||||
builder.asCustom(this).show();
|
||||
}
|
||||
}
|
@ -47,6 +47,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
private final String keyDefaultBubbleUrl = "defaultBubbleUrl";
|
||||
private final String STATUS_ANCHOR_SAY = "anchorSay";
|
||||
private final String STATUS_ANCHOR_CALL = "anchorCallMe";
|
||||
private final String LIVE_NOTIFY_SETTINGS = "liveNotifySettings";//开播通知
|
||||
|
||||
private final String KEY_LANGUAGE = "language";
|
||||
|
||||
@ -354,6 +355,14 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
return getBoolean(GiftEffect, !(Build.VERSION.SDK_INT < Build.VERSION_CODES.O));
|
||||
}
|
||||
|
||||
public void setLiveNotifySettings(boolean isTrue) {
|
||||
put(LIVE_NOTIFY_SETTINGS, isTrue);
|
||||
}
|
||||
|
||||
public boolean isLiveNotifySettings() {
|
||||
return getBoolean(LIVE_NOTIFY_SETTINGS, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新请求管理员身份信息
|
||||
*/
|
||||
|
@ -1251,6 +1251,8 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="red_envelope_released_successfully">Red successfully</string>
|
||||
<string name="me_edit_avatar_system">Select System Avatar</string>
|
||||
<string name="me_edit_avatar_system_tip">This function needs to be used to use it after lv.5, please work hard to upgrade ~</string>
|
||||
|
||||
<string name="main_anchor_live_notify_info">No matter where you are, I am waiting for you in the live broadcast room ~</string>
|
||||
<string name="main_anchor_live_notify_live">Watch</string>
|
||||
<string name="live_notify_settings">LiveNotify</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1246,4 +1246,8 @@
|
||||
<string name="red_envelope_released_successfully">红包发布成功</string>
|
||||
<string name="me_edit_avatar_system">選擇系統頭像</string>
|
||||
<string name="me_edit_avatar_system_tip">該功能需升至Lv.5后使用,請努力升級吧~</string>
|
||||
<string name="main_anchor_live_notify_info">無論你在哪裏,我都在直播間等你~</string>
|
||||
<string name="main_anchor_live_notify_live">围观</string>
|
||||
<string name="live_notify_settings">開播通知</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1245,4 +1245,8 @@
|
||||
<string name="red_envelope_released_successfully">红包发布成功</string>
|
||||
<string name="me_edit_avatar_system">選擇系統頭像</string>
|
||||
<string name="me_edit_avatar_system_tip">該功能需升至Lv.5后使用,請努力升級吧~</string>
|
||||
<string name="main_anchor_live_notify_info">無論你在哪裏,我都在直播間等你~</string>
|
||||
<string name="main_anchor_live_notify_live">围观</string>
|
||||
<string name="live_notify_settings">開播通知</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1246,6 +1246,8 @@
|
||||
<string name="red_envelope_released_successfully">红包发布成功</string>
|
||||
<string name="me_edit_avatar_system">選擇系統頭像</string>
|
||||
<string name="me_edit_avatar_system_tip">該功能需升至Lv.5后使用,請努力升級吧~</string>
|
||||
|
||||
<string name="main_anchor_live_notify_info">無論你在哪裏,我都在直播間等你~</string>
|
||||
<string name="main_anchor_live_notify_live">围观</string>
|
||||
<string name="live_notify_settings">開播通知</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1252,4 +1252,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="red_envelope_released_successfully">>Red successfully</string>
|
||||
<string name="me_edit_avatar_system">Select System Avatar</string>
|
||||
<string name="me_edit_avatar_system_tip">This function needs to be used to use it after lv.5, please work hard to upgrade ~</string>
|
||||
<string name="main_anchor_live_notify_info">No matter where you are, I am waiting for you in the live broadcast room ~</string>
|
||||
<string name="main_anchor_live_notify_live">Watch</string>
|
||||
<string name="live_notify_settings">LiveNotify</string>
|
||||
</resources>
|
||||
|
@ -126,6 +126,7 @@ public class LiveFansFragment extends AbsDialogFragment {
|
||||
} else if (TextUtils.equals(event.getMethod(), "sendFansCard")) {
|
||||
if (LiveRoomViewHolder.mBtnFollow != null && LiveRoomViewHolder.mBtnFollow.getVisibility() == View.VISIBLE) {
|
||||
LiveRoomViewHolder.follow();
|
||||
ToastUtil.show(R.string.live_fans_follow_toast);
|
||||
}
|
||||
//点击 开通粉丝勋章,打开礼物列表送礼物
|
||||
((LiveAudienceActivity) mContext).openGiftWindow(event.getLiveId(), "0");
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
public class LiveFansGroupBuyDialog extends AbsDialogPopupWindow {
|
||||
public LiveFansGroupBuyDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_fans_group_buy;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
public class LiveFansGroupInfoDialog extends AbsDialogPopupWindow {
|
||||
public LiveFansGroupInfoDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_fans_group_info;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
public class LiveFansGroupSendGiftDialog extends AbsDialogPopupWindow {
|
||||
public LiveFansGroupSendGiftDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_fans_group_send;
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.SystemClock;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@ -151,7 +152,6 @@ import com.yunbao.live.dialog.LiveContactDetailsSendGiftDialog;
|
||||
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveGameDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveGiftDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
@ -324,7 +324,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
private View btnEvent;
|
||||
private LinearLayout lt_trickery;
|
||||
private TextView tv_trickery_time;
|
||||
private FrameLayout enterRoomLeave, enterRoomBg;
|
||||
private FrameLayout enterRoomLeave, enterRoomBg, fans_enter_room_leave;
|
||||
private RecyclerView fastMsgRecyclerView;
|
||||
private LiveRoomFastMessageRecyclerViewAdapter fastMessageRecyclerViewAdapter;
|
||||
|
||||
@ -907,6 +907,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
btn_event2 = (LinearLayout) findViewById(R.id.btn_event2);
|
||||
btn_event4 = (LinearLayout) findViewById(R.id.btn_event4);
|
||||
enterRoomLeave = (FrameLayout) findViewById(R.id.enter_room_leave);
|
||||
fans_enter_room_leave = (FrameLayout) findViewById(R.id.fans_enter_room_leave);
|
||||
enterRoomBg = (FrameLayout) findViewById(R.id.enter_room_bg);
|
||||
enterRoomLeave2 = (LinearLayout) findViewById(R.id.enter_room_leave2);
|
||||
mBanner1 = (Banner) findViewById(R.id.banner1);
|
||||
@ -1653,6 +1654,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
updataCleanMic();
|
||||
// initStarChallengeStatus();
|
||||
enterRoomLeave.setVisibility(View.GONE);
|
||||
fans_enter_room_leave.setVisibility(View.GONE);
|
||||
topBanner1.setVisibility(View.GONE);
|
||||
topBanner2.setVisibility(View.GONE);
|
||||
topBanner1.update(mTopBannerList);
|
||||
@ -4829,6 +4831,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mChatRecyclerView.setLayoutParams(params1);
|
||||
|
||||
enterRoomLeave.setLayoutParams(enterRoomParams);
|
||||
fans_enter_room_leave.setLayoutParams(enterRoomParams);
|
||||
|
||||
|
||||
}
|
||||
@ -4841,6 +4844,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
userName.setText(String.format(mContext.getString(R.string.come_hint), model.getUserNiceName()));
|
||||
ImgLoader.display(mContext, model.getAvatar(), imageAvatar);
|
||||
int level = model.getLevel();
|
||||
model.setFansLevel(11);
|
||||
if (model.getFansLevel() > 10) {
|
||||
showFansGroupEnterRoom();
|
||||
return;
|
||||
}
|
||||
if (level < 50) {
|
||||
enterRoomLeave.setBackgroundResource(R.drawable.background_30);
|
||||
enterRoomLeave2.setBackgroundResource(R.drawable.bg_30_leave);
|
||||
@ -4899,6 +4907,69 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
}
|
||||
|
||||
private void showFansGroupEnterRoom() {
|
||||
fans_enter_room_leave.post(() -> {
|
||||
TextView userName = fans_enter_room_leave.findViewById(R.id.user_name);
|
||||
userName.setText(Html.fromHtml(String.format("@<font color='#99D5FF'>%s</font> 粉絲團成員歡迎進房", "测试")));
|
||||
new LoadDian9TuUtil().loadDian9Tu(mContext, fans_enter_room_leave,
|
||||
"https://downs.yaoulive.com/20230322/g5_.9.png"
|
||||
, 1);
|
||||
fans_enter_room_leave.setVisibility(View.VISIBLE);
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(DeviceUtils.getScreenWidth((Activity) mContext), 0, 0, 0);
|
||||
AnimationSet animationSet1 = new AnimationSet(true);
|
||||
animationSet1.addAnimation(animationTranslate);
|
||||
animationSet1.setFillAfter(true);
|
||||
animationSet1.setDuration(500);
|
||||
animationSet1.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
mLiveRoomHandler.postDelayed(() -> hideFansGroupEnter(), 3000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
|
||||
}
|
||||
});
|
||||
fans_enter_room_leave.startAnimation(animationSet1);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏粉丝团入场提示
|
||||
*/
|
||||
public void hideFansGroupEnter() {
|
||||
if (fans_enter_room_leave.getVisibility() == View.GONE) return;
|
||||
TranslateAnimation animationTranslate = new TranslateAnimation(0, -(fans_enter_room_leave.getMeasuredWidth() + DpUtil.dp2px(6)), 0, 0);
|
||||
AnimationSet animationSet1 = new AnimationSet(true);
|
||||
animationSet1.addAnimation(animationTranslate);
|
||||
animationSet1.setFillAfter(true);
|
||||
animationSet1.setDuration(100);
|
||||
animationSet1.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
fans_enter_room_leave.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
|
||||
}
|
||||
});
|
||||
fans_enter_room_leave.startAnimation(animationSet1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏高等级入场提示
|
||||
*/
|
||||
@ -5278,6 +5349,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mLiveGiftAnimPresenter.showSendGiftAnimAllServer2(receiveGiftBean);
|
||||
mLiveGiftAnimPresenter.setLiveUidStream(mLiveUid, mStream);
|
||||
}
|
||||
|
||||
public void sendWelcomeFans() {
|
||||
LiveChatBean chatBean = new LiveChatBean();
|
||||
chatBean.setContent("123123<font color='#FF8E43'>test</font>1243");
|
||||
|
@ -72,7 +72,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/giftInfo"
|
||||
tools:itemCount="3"
|
||||
|
||||
tools:listitem="@layout/item_fens_group_buy_list" />
|
||||
tools:listitem="@layout/item_fans_group_buy_list" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/buy"
|
@ -46,7 +46,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/anchorName"
|
||||
tools:itemCount="4"
|
||||
app:spanCount="3"
|
||||
tools:listitem="@layout/item_fens_group_package_list" />
|
||||
tools:listitem="@layout/item_fans_group_package_list" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/fans_enter_room_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/come_hint"
|
||||
android:textColor="#fff"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</FrameLayout>
|
@ -37,7 +37,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="TextView"
|
||||
android:text="@string/main_anchor_live_notify_info"
|
||||
android:textSize="13sp"
|
||||
android:textColor="#CCFFFFFF"
|
||||
app:layout_constraintStart_toStartOf="@+id/anchorName"
|
||||
@ -52,10 +52,11 @@
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFEF3"
|
||||
android:textSize="12sp"
|
||||
android:text="@string/main_anchor_live_notify_live"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="圍觀" />
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -223,6 +223,15 @@
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginBottom="-350dp"
|
||||
android:visibility="gone" />
|
||||
<include
|
||||
android:id="@+id/fans_enter_room_leave"
|
||||
layout="@layout/view_fans_group_enter_room_leave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/chat_recyclerView"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginBottom="-350dp"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
@ -107,4 +107,5 @@
|
||||
<string name="live_fans_group_info2_text2">2. The final interpretation rights of this gift package belong to PD Live</string>
|
||||
<string name="live_fans_group_info_title">Introduction</string>
|
||||
<string name="live_fans_group_info2_title">Rules</string>
|
||||
<string name="live_fans_follow_toast">Join the fan group and unlock exclusive gifts</string>
|
||||
</resources>
|
@ -105,4 +105,5 @@
|
||||
<string name="live_fans_group_info2_text2">2. 该禮包最終解釋權歸 PD Live 所有</string>
|
||||
<string name="live_fans_group_info_title">禮包介紹</string>
|
||||
<string name="live_fans_group_info2_title">購買規則</string>
|
||||
<string name="live_fans_follow_toast">加入粉絲團,解鎖專屬禮物</string>
|
||||
</resources>
|
||||
|
@ -58,6 +58,7 @@ import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.ChatRemarksBean;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
@ -107,6 +108,7 @@ import com.yunbao.live.utils.LiveStorge;
|
||||
import com.yunbao.live.views.ChatListViewHolder;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.FullAdToBannerTransition;
|
||||
import com.yunbao.main.dialog.AnchorStartLiveNotifyDialog;
|
||||
import com.yunbao.main.dialog.MainStartDialogFragment;
|
||||
import com.yunbao.main.dialog.ReturnUserDialog;
|
||||
import com.yunbao.main.dialog.SigninDialog;
|
||||
@ -194,6 +196,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private boolean isfloatBannernet = true, isFirst = true;
|
||||
|
||||
private View floatRedPacket;
|
||||
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
@ -1019,6 +1022,18 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (isTabClose && isWebClose) {
|
||||
@ -1039,6 +1054,20 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void loadPageData(int position, boolean needlLoadData) {
|
||||
if (mViewHolders == null) {
|
||||
|
@ -66,6 +66,7 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
||||
private Handler mHandler;
|
||||
private SettingAdapter mAdapter;
|
||||
private ImageView studioGiftEffects, studioRideEffects, upSlideSettings, appWindow, systemWindow;
|
||||
private ImageView liveNotifySettings;
|
||||
private boolean giftEffect, mountEffect, slide, isFloat;
|
||||
private TextView systemHit, reward;
|
||||
|
||||
@ -81,6 +82,7 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
||||
studioGiftEffects = findViewById(R.id.studio_gift_effects);
|
||||
studioRideEffects = findViewById(R.id.studio_ride_effects);
|
||||
upSlideSettings = findViewById(R.id.up_slide_settings);
|
||||
liveNotifySettings = findViewById(R.id.live_notify_settings);
|
||||
appWindow = findViewById(R.id.app_window);
|
||||
reward = findViewById(R.id.reward);
|
||||
systemHit = findViewById(R.id.system_hit);
|
||||
@ -237,6 +239,15 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
||||
});
|
||||
}
|
||||
);
|
||||
ViewClicksAntiShake.clicksAntiShake(liveNotifySettings, () -> {
|
||||
boolean isTrue = IMLoginManager.get(mContext).isLiveNotifySettings();
|
||||
if (isTrue) {
|
||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_off, liveNotifySettings);
|
||||
} else {
|
||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, liveNotifySettings);
|
||||
}
|
||||
IMLoginManager.get(mContext).setLiveNotifySettings(!isTrue);
|
||||
});
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(getString(com.yunbao.common.R.string.system_window_hint));
|
||||
String goTo = getString(com.yunbao.common.R.string.to_open_the);
|
||||
int star = builder.length();
|
||||
@ -274,6 +285,11 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
||||
} else {
|
||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, studioRideEffects);
|
||||
}
|
||||
if(IMLoginManager.get(mContext).isLiveNotifySettings()){
|
||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, liveNotifySettings);
|
||||
}else{
|
||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_off, liveNotifySettings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,107 @@
|
||||
package com.yunbao.main.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.enums.PopupAnimation;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.custom.RatioRoundImageView;
|
||||
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
public class AnchorStartLiveNotifyDialog extends AbsDialogPositionPopupWindow {
|
||||
private AnchorStartLiveBean liveBean;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
|
||||
private TextView anchorName;
|
||||
private RatioRoundImageView avatar;
|
||||
|
||||
|
||||
public AnchorStartLiveNotifyDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public AnchorStartLiveNotifyDialog(@NonNull Context context, AnchorStartLiveBean bean) {
|
||||
super(context);
|
||||
this.liveBean = bean;
|
||||
}
|
||||
|
||||
public AnchorStartLiveNotifyDialog setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||
this.onDismissListener = onDismissListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.positionByWindowCenter(true);
|
||||
builder.moveUpToKeyboard(false);
|
||||
builder.dismissOnTouchOutside(false);
|
||||
builder.dismissOnBackPressed(false);
|
||||
builder.isTouchThrough(true);
|
||||
builder.isClickThrough(true);
|
||||
builder.isCenterHorizontal(true);
|
||||
builder.hasShadowBg(false);
|
||||
builder.animationDuration(500);
|
||||
builder.popupAnimation(PopupAnimation.ScaleAlphaFromCenter);
|
||||
builder.offsetY(DpUtil.dp2px(60));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.view_funs_live_anchor_start_notify;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.liveGo).setOnClickListener(v -> {
|
||||
LiveHttpUtil.getLiveInfo(liveBean.getRoomId(), new HttpCallback() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
avatar = findViewById(R.id.avatar);
|
||||
anchorName = findViewById(R.id.anchorName);
|
||||
ImgLoader.display(mContext, liveBean.getAvatar(), avatar);
|
||||
anchorName.setText(liveBean.getAnchorName());
|
||||
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +1,12 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.RedPacketListActivity;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/22.
|
||||
|
@ -368,6 +368,35 @@
|
||||
android:layout_marginEnd="26.33dp"
|
||||
android:src="@mipmap/special_icon_off" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="13.67dp"
|
||||
android:paddingBottom="11dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="25dp"
|
||||
android:text="@string/live_notify_settings"
|
||||
android:textColor="#1E1F20"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/live_notify_settings"
|
||||
android:layout_width="46.67dp"
|
||||
android:layout_height="23.33dp"
|
||||
android:layout_marginEnd="26.33dp"
|
||||
android:src="@mipmap/special_icon_off" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
Loading…
Reference in New Issue
Block a user