修改守护问题,添加全服通知功能

This commit is contained in:
18401019693 2024-04-03 16:05:53 +08:00
parent cd3feebb94
commit 0d7bdce4f0
22 changed files with 710 additions and 91 deletions

View File

@ -68,6 +68,7 @@ public class GuardUpgradePopup extends CenterPopupView {
} else {
hintStringBuffer.append("Your guardian level has reached level ")
.append(mUpgradesModel.getLevel())
.append(" You can receive the following rewards")
;
}
leave_hint.setText(hintStringBuffer.toString());

View File

@ -0,0 +1,227 @@
package com.yunbao.common.event;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.bean.BaseModel;
import java.util.List;
public class AllServerNotifyFFGGGDJANEvent extends BaseModel {
@SerializedName("_method_")
private String method;
@SerializedName("action")
private String action;
@SerializedName("msg_cn")
private String msgCn;
@SerializedName("msg_en")
private String msgEn;
@SerializedName("uid")
private String uid;
@SerializedName("liveuid")
private String liveuid;
@SerializedName("background_image")
private String backgroundImage;
@SerializedName("style")
private List<StyleDTO> style;
@SerializedName("jump_type")
private String jumpType;
@SerializedName("link")
private String link;
@SerializedName("button_image")
private String buttonImage;
@SerializedName("button_msg_cn")
private String buttonMsgCn;
@SerializedName("button_msg_en")
private String buttonMsgEn;
@SerializedName("button_style")
private List<ButtonStyleDTO> buttonStyle;
@SerializedName("h5_type")
private String h5Type;
public String getH5Type() {
return h5Type;
}
public AllServerNotifyFFGGGDJANEvent setH5Type(String h5Type) {
this.h5Type = h5Type;
return this;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getMsgCn() {
return msgCn;
}
public void setMsgCn(String msgCn) {
this.msgCn = msgCn;
}
public String getMsgEn() {
return msgEn;
}
public void setMsgEn(String msgEn) {
this.msgEn = msgEn;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getLiveuid() {
return liveuid;
}
public void setLiveuid(String liveuid) {
this.liveuid = liveuid;
}
public String getBackgroundImage() {
return backgroundImage;
}
public void setBackgroundImage(String backgroundImage) {
this.backgroundImage = backgroundImage;
}
public List<StyleDTO> getStyle() {
return style;
}
public void setStyle(List<StyleDTO> style) {
this.style = style;
}
public String getJumpType() {
return jumpType;
}
public void setJumpType(String jumpType) {
this.jumpType = jumpType;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getButtonImage() {
return buttonImage;
}
public void setButtonImage(String buttonImage) {
this.buttonImage = buttonImage;
}
public String getButtonMsgCn() {
return buttonMsgCn;
}
public void setButtonMsgCn(String buttonMsgCn) {
this.buttonMsgCn = buttonMsgCn;
}
public String getButtonMsgEn() {
return buttonMsgEn;
}
public void setButtonMsgEn(String buttonMsgEn) {
this.buttonMsgEn = buttonMsgEn;
}
public List<ButtonStyleDTO> getButtonStyle() {
return buttonStyle;
}
public void setButtonStyle(List<ButtonStyleDTO> buttonStyle) {
this.buttonStyle = buttonStyle;
}
public static class StyleDTO {
@SerializedName("str_cn")
private String strCn;
@SerializedName("str_en")
private String strEn;
@SerializedName("colour")
private String colour;
public String getStrCn() {
return strCn;
}
public void setStrCn(String strCn) {
this.strCn = strCn;
}
public String getStrEn() {
return strEn;
}
public void setStrEn(String strEn) {
this.strEn = strEn;
}
public String getColour() {
return colour;
}
public void setColour(String colour) {
this.colour = colour;
}
}
public static class ButtonStyleDTO {
@SerializedName("str_cn")
private String strCn;
@SerializedName("str_en")
private String strEn;
@SerializedName("colour")
private String colour;
public String getStrCn() {
return strCn;
}
public void setStrCn(String strCn) {
this.strCn = strCn;
}
public String getStrEn() {
return strEn;
}
public void setStrEn(String strEn) {
this.strEn = strEn;
}
public String getColour() {
return colour;
}
public void setColour(String colour) {
this.colour = colour;
}
}
}

View File

@ -48,17 +48,24 @@
<LinearLayout
android:id="@+id/rewards_line1"
android:layout_width="wrap_content"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_ssssbbbbbsd">
<ImageView
android:id="@+id/rewards_img1"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitXY" />
</FrameLayout>
<TextView
android:id="@+id/rewards_text1"
@ -66,6 +73,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center"
android:maxLines="2"
android:text="獎勵名稱"
android:textColor="#FF8503"
android:textSize="14sp" />
@ -73,7 +81,7 @@
<LinearLayout
android:id="@+id/rewards_line2"
android:layout_width="wrap_content"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="32dp"
@ -81,11 +89,17 @@
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_ssssbbbbbsd">
<ImageView
android:id="@+id/rewards_img2"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitXY" />
</FrameLayout>
<TextView
android:id="@+id/rewards_text2"
@ -93,6 +107,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center"
android:maxLines="2"
android:text="獎勵名稱"
android:textColor="#FF8503"
android:textSize="14sp" />
@ -100,17 +115,23 @@
<LinearLayout
android:id="@+id/rewards_line3"
android:layout_width="wrap_content"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_ssssbbbbbsd">
<ImageView
android:id="@+id/rewards_img3"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitXY" />
</FrameLayout>
<TextView
android:id="@+id/rewards_text3"
@ -118,6 +139,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center"
android:maxLines="2"
android:text="獎勵名稱"
android:textColor="#FF8503"
android:textSize="14sp" />
@ -132,21 +154,23 @@
android:layout_marginEnd="13dp"
android:layout_marginBottom="38dp">
<Button
<TextView
android:id="@+id/view_grade"
android:layout_width="94dp"
android:layout_height="36dp"
android:background="@drawable/button_guard_upgrade"
android:gravity="center"
android:text="@string/view_grade"
android:textColor="#893D0D"
android:textSize="14sp" />
<Button
<TextView
android:id="@+id/confirm"
android:layout_width="94dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:background="@drawable/button_guard_upgrade"
android:gravity="center"
android:text="@string/to_receive"
android:textColor="#893D0D"
android:textSize="14sp" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -170,7 +170,7 @@
<string name="guard_my">My</string>
<string name="theguardianof">Become the guardian of %s</string>
<string name="favoriteanchor">Open a guard for your favorite anchor</string>
<string name="guardiandate">The guardian date expires at: %s</string>
<string name="guardiandate">Guardianship date is up to: %s</string>
<string name="get">GET</string>
<string name="only_one">Only one can be given away~</string>
<string name="guard_guard">Guard</string>
@ -1457,7 +1457,7 @@ Limited ride And limited avatar frame</string>
<string name="guardian_privilege">Guardianship privileges</string>
<string name="be_their_exclusive_guardian">Be the anchors guardian</string>
<string name="not_yet_open">Not opened</string>
<string name="tas_guardian_group">guardian group</string>
<string name="tas_guardian_group">Guardian group ></string>
<string name="open_the_kings_guard">Activate King Guardian</string>
<string name="open_the_start_guard">Activate Star Guardian</string>
<string name="open_the_god_guard">Activate God Guardian</string>

View File

@ -170,7 +170,7 @@
<string name="guard_my">My</string>
<string name="theguardianof">Become the guardian of %s</string>
<string name="favoriteanchor">Open a guard for your favorite anchor</string>
<string name="guardiandate">The guardian date expires at: %s</string>
<string name="guardiandate">Guardianship date is up to: %s</string>
<string name="get">GET</string>
<string name="only_one">Only one can be given away~</string>
<string name="guard_guard">Guard</string>
@ -1460,7 +1460,7 @@ Limited ride And limited avatar frame</string>
<string name="guardian_privilege">Guardianship privileges</string>
<string name="be_their_exclusive_guardian">Be the anchors guardian</string>
<string name="not_yet_open">Not opened</string>
<string name="tas_guardian_group">guardian group</string>
<string name="tas_guardian_group">Guardian group ></string>
<string name="open_the_kings_guard">Activate King Guardian</string>
<string name="open_the_start_guard">Activate Star Guardian</string>
<string name="open_the_god_guard">Activate God Guardian</string>

View File

@ -62,6 +62,7 @@ import com.yunbao.common.dialog.LiveChargeDialogFragment;
import com.yunbao.common.dialog.SlideSettingsDialog;
import com.yunbao.common.dialog.SudGameListPopup;
import com.yunbao.common.dialog.YoursystemisolderDialog;
import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.event.GiftWallIlluminateEvent;
@ -1954,6 +1955,13 @@ public class LiveAudienceActivity extends LiveActivity {
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onAllServerNotifyFFGGGDJANEvent(AllServerNotifyFFGGGDJANEvent event) {
if (manager != null) {
manager.showAllServerNotifyFFGGGD(event);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSendMoneyLongEndEvent(SendMoneyLongEndEvent sendMoneyLongModel) {
Log.e("DateRemindModel", sendMoneyLongModel.toString());

View File

@ -310,6 +310,16 @@ public class ZhuangBanActivity extends AbsActivity {
context.startActivity(intent);
}
public static void forwardqeqweqq(Context context, String url, int isLive) {
Intent intent = new Intent(context, ZhuangBanActivity.class);
Log.i("tag", url);
intent.putExtra(Constants.URL, url);
intent.putExtra("title", "");
intent.putExtra("isLive", isLive);
context.startActivity(intent);
}
public static void forward(Context context, String url, int isLive) {
forward(context, url, true, isLive);
}

View File

@ -5,6 +5,7 @@ import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent;
/**
* Created by cxf on 2017/8/22.
@ -66,6 +67,16 @@ public class LiveReceiveGiftBean extends BaseModel {
private String msg;
private String msg_en;
private String guard_type;
private AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent;
public AllServerNotifyFFGGGDJANEvent getNotifyFFGGGDJANEvent() {
return notifyFFGGGDJANEvent;
}
public LiveReceiveGiftBean setNotifyFFGGGDJANEvent(AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent) {
this.notifyFFGGGDJANEvent = notifyFFGGGDJANEvent;
return this;
}
public String getMsg() {
return msg;

View File

@ -36,6 +36,17 @@ public class NewAllServerNotifyGuardEvent extends BaseModel {
private String msgCn;
@SerializedName("msg_en")
private String msgEn;
@SerializedName("is_onlookers")
private String isOnlookers ;
public String getIsOnlookers() {
return isOnlookers;
}
public NewAllServerNotifyGuardEvent setIsOnlookers(String isOnlookers) {
this.isOnlookers = isOnlookers;
return this;
}
public String getMethod() {
return method;

View File

@ -197,6 +197,13 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
ImgLoader.display(getContext(), guardBannerModel.getGuardOpen(), guardOpen);
ImgLoader.display(getContext(), guardBannerModel.getUserAvatar(), userAvatar);
ImgLoader.display(getContext(), guardBannerModel.getLiveAvatar(), liveAvatar);
ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.tas_guardian_group), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new LiveGuardDialog(mContext, false, mLiveUid, mStream).showDialog();
dismiss();
}
});
}

View File

@ -825,6 +825,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
giftSendLayout.setVisibility(View.VISIBLE);
mBtnSendGroup.removeCallbacks(newLianSongRunnable);
getCoin();
if (liveGiftModel!=null){
LiveNetManager.get(mContext)
.getGiftNamingInfo(liveGiftModel.getId() + "", new com.yunbao.common.http.base.HttpCallback<GiftNamingInfoModel>() {
@Override
@ -872,6 +873,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
});
}
}
/**
* 关于点击礼物分类的通知
*/

View File

@ -204,38 +204,37 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
guardianTask.setVisibility(GONE);
myGraudGrade.setVisibility(GONE);
btnGuardOpen.setText(WordUtil.isNewZh() ? "開通守護" : "Open Guard");
guard_hint.setText(WordUtil.getNewString(R.string.guardian_for_your_favorite_anchor));
guard_hint.setText(WordUtil.isNewZh()?"快為您喜歡的主播開通守護吧!":"Turn on the guard for your favorite anchor!");
} else {
if (data.getGuardType() == 0) {
guardianTask.setVisibility(GONE);
myGraudGrade.setVisibility(GONE);
btnGuardOpen.setText(WordUtil.isNewZh() ? "開通守護" : "Open Guard");
guard_hint.setText(WordUtil.getNewString(R.string.guardian_for_your_favorite_anchor));
guard_hint.setText(WordUtil.isNewZh()?"快為您喜歡的主播開通守護吧!":"Turn on the guard for your favorite anchor!");
} else {
guardianTask.setVisibility(VISIBLE);
myGraudGrade.setVisibility(VISIBLE);
btnGuardOpen.setText(WordUtil.isNewZh() ? "續費守護" : "Renewal Guard");
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(WordUtil.isNewZh() ? "您是當前主播的" : "You are the current anchor's ")
.append("");
stringBuffer.append(WordUtil.isNewZh() ? "您是當前主播的" : "You are the ");
switch (data.getGuardType()) {
case 1:
stringBuffer.append(WordUtil.isNewZh() ? "星之守護" : "Star Guardian")
.append("");
stringBuffer.append(WordUtil.isNewZh() ? "星之守護" : "star guardian")
.append(" of the current streamer");
guard_hint.setText(stringBuffer.toString());
break;
case 2:
stringBuffer.append(WordUtil.isNewZh() ? "王之守護" : "King Guardian")
.append("");
stringBuffer.append(WordUtil.isNewZh() ? "王之守護" : "king guardian")
.append(" of the current streamer");
guard_hint.setText(stringBuffer.toString());
break;
case 3:
stringBuffer.append(WordUtil.isNewZh() ? "神之守護" : "God Guardian")
.append("");
stringBuffer.append(WordUtil.isNewZh() ? "神之守護" : "god guardian")
.append(" of the current streamer");
guard_hint.setText(stringBuffer.toString());
break;
default:
guard_hint.setText(WordUtil.getNewString(R.string.guardian_for_your_favorite_anchor));
guard_hint.setText(WordUtil.isNewZh()?"快為您喜歡的主播開通守護吧!":"Turn on the guard for your favorite anchor!");
break;
}
}
@ -244,8 +243,14 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
if (data.getEndtime() == 0) {
guard_time.setVisibility(GONE);
} else {
StringBuffer stringBuffer = new StringBuffer();
if (WordUtil.isNewZh()) {
stringBuffer.append("守護日期截止到 ").append(TimeUtils.getDateToString(data.getEndtime() * 1000, "yyyy-MM-dd"));
} else {
stringBuffer.append("Guardianship date is up to ").append(TimeUtils.getDateToString(data.getEndtime() * 1000, "yyyy-MM-dd"));
}
guard_time.setText(String.format(WordUtil.getNewString(R.string.guardiandate), TimeUtils.getDateToString(data.getEndtime() * 1000, "yyyy-MM-dd")));
guard_time.setText(stringBuffer.toString());
}
}
@ -339,9 +344,35 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
userNickname.setText(guardUserModel.getUserNicename());
weekContribution.setText(WordUtil.getNewString(R.string.this_week_contribution) + " " + guardUserModel.getContribute());
userSex.setImageResource(CommonIconUtil.getSexIcon(guardUserModel.getSex()));
ImgLoader.display(mContext, guardUserModel.getGuardImg(), tagKing);
guardLevel.setText(String.valueOf(guardUserModel.getGuardLevel()));
ImgLoader.display(mContext, guardUserModel.getAvatar(), guardIcon);
giftSvga.setImageResource(R.mipmap.guardian_img_wings_p);
if (TextUtils.equals(guardUserModel.getGuardLevelCard(), "0")) {
switch (guardUserModel.getGuardType()) {
case 1:
ImgLoader.display(mContext, R.mipmap.tag_start_hui, tagKing);
break;
case 2:
ImgLoader.display(mContext, R.mipmap.tag_king_hui, tagKing);
break;
case 3:
ImgLoader.display(mContext, R.mipmap.tag_god_hui, tagKing);
break;
}
} else {
switch (guardUserModel.getGuardType()) {
case 1:
ImgLoader.display(mContext, R.mipmap.tag_start, tagKing);
break;
case 2:
ImgLoader.display(mContext, R.mipmap.tag_king, tagKing);
break;
case 3:
ImgLoader.display(mContext, R.mipmap.tag_god, tagKing);
break;
}
}
}
}

View File

@ -4,15 +4,20 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
@ -38,8 +43,10 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
@ -49,6 +56,7 @@ import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.GiftCacheUtil;
import com.yunbao.common.utils.HtmlTagHandler;
@ -59,11 +67,14 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.NewAllServerNotifyGuardEvent;
import com.yunbao.live.custom.FrameImageView;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.utils.AllMsgTextRender;
import com.yunbao.live.utils.LiveIconUtil;
@ -127,8 +138,10 @@ public class LiveGiftAnimPresenter {
private ObjectAnimator mGifGiftTipHideAnimatorAllServer;
private ObjectAnimator mGifGiftTipShowAnimatorBuyGuard;
private ObjectAnimator mGifGiftTipShowAnimatorBuyGuardNew;
private ObjectAnimator mGifGiftTipShowAnimatorfull_service_notice_new;
private ObjectAnimator mGifGiftTipHideAnimatorBuyGuard;
private ObjectAnimator mGifGiftTipHideAnimatorBuyGuardNew;
private ObjectAnimator mGifGiftTipHideAnimatorfull_service_notice_new;
private ObjectAnimator mGifGiftTipShowAnimatorBuyZuoji;
private ObjectAnimator mGifGiftTipHideAnimatorBuyZuoji;
@ -167,6 +180,8 @@ public class LiveGiftAnimPresenter {
private static final int WHAT_BUY_VIP_2 = -14;
private static final int WHAT_BUY_GUARD_NEW_1 = -15;
private static final int WHAT_BUY_GUARD_NEW_2 = -16;
private static final int full_service_notice_new_1 = -17;
private static final int full_service_notice_new_2 = -18;
private boolean mShowGif;
private boolean mShowBuyGuard;
private boolean mShowAllServer;
@ -257,6 +272,12 @@ public class LiveGiftAnimPresenter {
ivGuardType = v.findViewById(R.id.ivGuardType);
mFrameImageView = (FrameImageView) v.findViewById(R.id.all_frame_img);
full_service_notice_new = v.findViewById(R.id.full_service_notice_new);
full_service_notice_new_bg = v.findViewById(R.id.full_service_notice_new_bg);
full_service_notice_new_text = v.findViewById(R.id.full_service_notice_new_text);
iv_look_full_service_notice_new = v.findViewById(R.id.iv_look_full_service_notice_new);
iv_look_full_service_notice_new3 = v.findViewById(R.id.iv_look_full_service_notice_new3);
iv_look_full_service_notice_new2 = v.findViewById(R.id.iv_look_full_service_notice_new2);
mIvLookClick();
mIvLookBuyGuardClick();
@ -264,6 +285,7 @@ public class LiveGiftAnimPresenter {
mIvLookBuyLiangNameClick();
mIvLookBuyVipClick();
onmIvLookBuyGuardNew();
oniv_look_full_service_notice_new();
setGitTipAnimator1();
setGitTipAnimatorAllServer();
setGitTipAnimatorBuyGuard();
@ -271,7 +293,7 @@ public class LiveGiftAnimPresenter {
setGitTipAnimatorBuyLiangName();
setGitTipAnimatorBuyVip();
setGitTipAnimatorBuyGuardNew();
setGitTipAnimatormGifGiftTipShowAnimatorfull_service_notice_new();
mSendString = "送了";
mLiveGiftViewHolders = new LiveGiftViewHolder[2];
mLiveGiftViewHolders[0] = new LiveGiftViewHolder(context, (ViewGroup) v.findViewById(R.id.gift_group_2));
@ -550,6 +572,39 @@ public class LiveGiftAnimPresenter {
});
}
private void setGitTipAnimatormGifGiftTipShowAnimatorfull_service_notice_new() {
mDp500 = DpUtil.dp2px(500);
mGifGiftTipShowAnimatorfull_service_notice_new = ObjectAnimator.ofFloat(full_service_notice_new, "translationX", mDp500, 0);
mGifGiftTipShowAnimatorfull_service_notice_new.setDuration(2000);
mGifGiftTipShowAnimatorfull_service_notice_new.setInterpolator(new LinearInterpolator());
mGifGiftTipShowAnimatorfull_service_notice_new.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (mHandler != null) {
mHandler.sendEmptyMessageDelayed(full_service_notice_new_1, 5000);
}
}
});
mDp10 = DpUtil.dp2px(10);
mGifGiftTipHideAnimatorfull_service_notice_new = ObjectAnimator.ofFloat(full_service_notice_new, "translationX", 0);
mGifGiftTipHideAnimatorfull_service_notice_new.setDuration(3000);
mGifGiftTipHideAnimatorfull_service_notice_new.setInterpolator(new AccelerateDecelerateInterpolator());
mGifGiftTipHideAnimatorfull_service_notice_new.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
full_service_notice_new.setAlpha(1 - animation.getAnimatedFraction());
}
});
mGifGiftTipHideAnimatorfull_service_notice_new.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (mHandler != null) {
mHandler.sendEmptyMessageDelayed(full_service_notice_new_2, 100);
}
}
});
}
private void setGitTipAnimatorBuyZuoji() {
mDp500 = DpUtil.dp2px(500);
mGifGiftTipShowAnimatorBuyZuoji = ObjectAnimator.ofFloat(mGifGiftTipGroupBuyZuoji, "translationX", mDp500, 0);
@ -766,6 +821,9 @@ public class LiveGiftAnimPresenter {
} else if (msg.what == WHAT_BUY_GUARD_NEW_1) {
mGifGiftTipHideAnimatorBuyGuardNew.setFloatValues(0, -mDp10 - mGifGiftTipGroupBuyGuardNew.getWidth());
mGifGiftTipHideAnimatorBuyGuardNew.start();
} else if (msg.what == full_service_notice_new_1) {
mGifGiftTipHideAnimatorfull_service_notice_new.setFloatValues(0, -mDp10 - full_service_notice_new.getWidth());
mGifGiftTipHideAnimatorfull_service_notice_new.start();
} else if (msg.what == WHAT_BUY_GUARD_2) {
mShowAllServer = false;
heightOffsetArr[index4Guard] = 0;
@ -780,6 +838,13 @@ public class LiveGiftAnimPresenter {
if (bean != null) {
chooseInto(bean);
}
} else if (msg.what == full_service_notice_new_2) {
mShowAllServer = false;
heightOffsetArr[index4Guard] = 0;
LiveReceiveGiftBean bean = mGifAll.poll();
if (bean != null) {
chooseInto(bean);
}
} else if (msg.what == WHAT_BUY_ZUOJI_1) {
mGifGiftTipHideAnimatorBuyZuoji.setFloatValues(0, -mDp10 - mGifGiftTipGroupBuyZuoji.getWidth());
mGifGiftTipHideAnimatorBuyZuoji.start();
@ -839,6 +904,8 @@ public class LiveGiftAnimPresenter {
showSystAnim(bean);
} else if (action == 90) {
showBuyGuardGiftAnimNew(notifyGuardEvent);
} else if (action == 91) {
showAllServerNotifyFFGGGD(bean.getNotifyFFGGGDJANEvent());
}
}
@ -1024,6 +1091,87 @@ public class LiveGiftAnimPresenter {
}
}
View full_service_notice_new;
ImageView full_service_notice_new_bg;
TextView full_service_notice_new_text;
TextView iv_look_full_service_notice_new;
AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent;
View iv_look_full_service_notice_new3;
ImageView iv_look_full_service_notice_new2;
public void showAllServerNotifyFFGGGD(AllServerNotifyFFGGGDJANEvent event) {
if (TextUtils.isEmpty(event.getBackgroundImage())) return;
mRoomNum = event.getLiveuid();
if (mShowAllServer) {
if (mGifAll != null) {
LiveReceiveGiftBean bean = new LiveReceiveGiftBean();
bean.setSendtype(91);
bean.setNotifyFFGGGDJANEvent(event);
mGifAll.offer(bean);
}
} else {
notifyFFGGGDJANEvent = event;
mShowAllServer = true;
index4Guard = getFirstIndexOfValue(heightOffsetArr, 0);
if (index4Guard >= 0) {
heightOffsetArr[index4Guard] = 1;
int y;
y = index4Guard * 60;
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) full_service_notice_new.getLayoutParams();
params.topMargin = DpUtil.dp2px(y);
full_service_notice_new.setLayoutParams(params);
}
full_service_notice_new.setAlpha(1f);
full_service_notice_new.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, event.getBackgroundImage(), full_service_notice_new_bg);
SpannableStringBuilder builder = new SpannableStringBuilder();
String msgN = WordUtil.isNewZh() ? event.getMsgCn() : event.getMsgEn();
builder.append(msgN);
for (AllServerNotifyFFGGGDJANEvent.StyleDTO dto : event.getStyle()) {
String textMsg = WordUtil.isNewZh() ? dto.getStrCn() : dto.getStrEn();
int unameIndexOf = msgN.indexOf(textMsg);
int unameSize = textMsg.length();
builder.setSpan(new ForegroundColorSpan(Color.parseColor(dto.getColour())), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
if (!TextUtils.isEmpty(event.getButtonImage())) {
ImgLoader.display(mContext, event.getButtonImage(), iv_look_full_service_notice_new2);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
String buttonString = WordUtil.isNewZh() ? event.getButtonMsgCn() : event.getButtonMsgEn();
stringBuilder.append(buttonString);
try {
for (AllServerNotifyFFGGGDJANEvent.ButtonStyleDTO dto : event.getButtonStyle()) {
String textMsg = WordUtil.isNewZh() ? dto.getStrCn() : dto.getStrEn();
int unameIndexOf = buttonString.indexOf(textMsg);
int unameSize = textMsg.length();
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(dto.getColour())), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
} catch (Exception e) {
iv_look_full_service_notice_new.setText(buttonString);
}
iv_look_full_service_notice_new.setText(stringBuilder);
} else {
iv_look_full_service_notice_new3.setVisibility(View.GONE);
iv_look_full_service_notice_new3.setVisibility(View.VISIBLE);
}
full_service_notice_new_text.postDelayed(new Runnable() {
@Override
public void run() {
if (full_service_notice_new_text != null) {
full_service_notice_new_text.setSelected(true);
full_service_notice_new_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
full_service_notice_new_text.requestFocus();
full_service_notice_new_text.setText(builder);
}
}
}, 500);
mGifGiftTipShowAnimatorfull_service_notice_new.start();
}
}
View mGifGiftTipGroupBuyGuardNew;
LinearLayout guardAllServerNotifyBg;
TextView mGifGiftTipBuyGuardNew;
@ -1076,7 +1224,7 @@ public class LiveGiftAnimPresenter {
break;
}
if (TextUtils.equals(mLiveUid, event.getLiveuid())) {
if (!TextUtils.isEmpty(event.getIsOnlookers()) && TextUtils.equals("0", event.getIsOnlookers())) {
mIvLookBuyGuardNew.setVisibility(View.GONE);
} else {
mIvLookBuyGuardNew.setVisibility(View.VISIBLE);
@ -1111,6 +1259,45 @@ public class LiveGiftAnimPresenter {
});
}
private void oniv_look_full_service_notice_new() {
ViewClicksAntiShake.clicksAntiShake(iv_look_full_service_notice_new, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
String jumpType = notifyFFGGGDJANEvent.getJumpType();
if (TextUtils.equals(jumpType, "1")) {
changeLiveRoom();
} else if (TextUtils.equals(jumpType, "2")) {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
if (!TextUtils.isEmpty(notifyFFGGGDJANEvent.getLink())) {
StringBuffer htmlUrl = new StringBuffer();
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(notifyFFGGGDJANEvent.getLink())
.append(notifyFFGGGDJANEvent.getLink().contains("?") ? "&uid=" : "?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken())
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
if (!TextUtils.isEmpty(notifyFFGGGDJANEvent.getH5Type())) {
if (TextUtils.equals(notifyFFGGGDJANEvent.getH5Type(), "1")) {
Bundle bundle = new Bundle();
bundle.putString("url", htmlUrl.toString());
bundle.putInt("height", DeviceUtils.getScreenHeight((Activity) mContext) / 5 * 3);
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
fragment.setArguments(bundle);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
} else if (TextUtils.equals(notifyFFGGGDJANEvent.getH5Type(), "2")) {
ZhuangBanActivity.forwardqeqweqq(mContext, htmlUrl.toString(), 1);
}
}
}
}
}
});
}
//购买守护 全服通知
public void showBuyGuardGiftAnim(LiveReceiveGiftBean bean) {
if (bean.ismTypeBuyGuard()) {
@ -1662,6 +1849,12 @@ public class LiveGiftAnimPresenter {
if (mGifGiftTipHideAnimatorBuyGuardNew != null) {
mGifGiftTipHideAnimatorBuyGuardNew.cancel();
}
if (mGifGiftTipHideAnimatorfull_service_notice_new != null) {
mGifGiftTipHideAnimatorfull_service_notice_new.cancel();
}
if (mGifGiftTipShowAnimatorfull_service_notice_new != null) {
mGifGiftTipShowAnimatorfull_service_notice_new.cancel();
}
if (mGifGiftTipShowAnimatorBuyZuoji != null) {
mGifGiftTipShowAnimatorBuyZuoji.cancel();

View File

@ -38,6 +38,7 @@ import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.WishModel;
import com.yunbao.common.bean.XydCompleteModel;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent;
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
import com.yunbao.common.event.GiftWallIlluminateEvent;
import com.yunbao.common.event.QuickGiftingEvent;
@ -444,6 +445,9 @@ public class SocketRyClient {
NewAllServerNotifyGuardEvent notifyGuardEvent = GsonUtils.fromJson(map.toString(), NewAllServerNotifyGuardEvent.class);
Bus.get().post(notifyGuardEvent);
buyGuardInSameRoom(map);
}else if (action2==91){
AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent = GsonUtils.fromJson(map.toString(), AllServerNotifyFFGGGDJANEvent.class);
Bus.get().post(notifyFFGGGDJANEvent);
}
break;
case Constants.SOCKET_SEND_BARRAGE://发弹幕
@ -821,6 +825,8 @@ public class SocketRyClient {
}
private void buyGuardInSameRoom(JSONObject map) {
if (TextUtils.isEmpty(map.getString("ancherName")) || TextUtils.isEmpty(map.getString("uname")))
return;
String guardName = WordUtil.isNewZh() ? "星之守護" : "Star Guardian";
switch (map.getIntValue("guard_type")) {
case 1:

View File

@ -99,6 +99,7 @@ import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.WishModel;
import com.yunbao.common.bean.XydCompleteModel;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent;
import com.yunbao.common.event.AnchorInfoEvent;
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
import com.yunbao.common.event.LiveRoomChangeEvent;
@ -628,11 +629,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
public void guardSpecialEffect(LiveReceiveGiftBean liveReceiveGiftBean) {
LiveChatBean chatBean = new LiveChatBean();
chatBean.setContent(
(WordUtil.isNewZh() ? liveReceiveGiftBean.getMsg() : liveReceiveGiftBean.getMsg_en()));
chatBean.setType(LiveChatBean.SYSTEM);
mLiveChatAdapter.insertItem(chatBean);
// LiveChatBean chatBean = new LiveChatBean();
// chatBean.setContent(
// (WordUtil.isNewZh() ? liveReceiveGiftBean.getMsg() : liveReceiveGiftBean.getMsg_en()));
// chatBean.setType(LiveChatBean.SYSTEM);
// mLiveChatAdapter.insertItem(chatBean);
Log.e("guardSpecialEffect", "msg" + liveReceiveGiftBean.getMsg() + "msg-en" + liveReceiveGiftBean.getMsg_en() + "guard_type" + liveReceiveGiftBean.getGuard_type());
if (mLiveGiftAnimPresenter == null) {
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
@ -3971,6 +3972,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
public void showAllServerNotifyFFGGGD(AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent) {
if (mLiveGiftAnimPresenter == null) {
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
}
mLiveGiftAnimPresenter.setLiveUidStream(mLiveUid, mStream);
mLiveGiftAnimPresenter.showAllServerNotifyFFGGGD(notifyFFGGGDJANEvent);
}
//全服通知 购买坐骑
public void showBuyZuojiMessage(LiveReceiveGiftBean bean) {
if (mLiveGiftAnimPresenter == null) {

View File

@ -51,6 +51,7 @@ import com.yunbao.common.bean.WishModel;
import com.yunbao.common.bean.XydCompleteModel;
import com.yunbao.common.custom.MyViewPager;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.event.HideShowEvent;
import com.yunbao.common.event.LiveFloatEvent;
@ -1309,6 +1310,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
public void showAllServerNotifyFFGGGD(AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showAllServerNotifyFFGGGD(notifyFFGGGDJANEvent);
}
}
@Override
public void onBuyZuoji(LiveReceiveGiftBean bean) {
if (mLiveRoomViewHolder != null) {

View File

@ -75,6 +75,7 @@
</FrameLayout>
<TextView
android:id="@+id/tas_guardian_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"

View File

@ -9,7 +9,7 @@
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:scaleType="fitXY"
android:src="@mipmap/dialog_live_buy_guard_bg" />
<LinearLayout

View File

@ -208,9 +208,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="18dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:gravity="start"
android:text="@string/guardian_for_your_favorite_anchor"
android:textColor="@color/white"
android:textSize="12sp" />
@ -220,10 +220,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="18dp"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:gravity="start"
android:text="@string/guardian_for_your_favorite_anchor"
android:textColor="@color/white"
android:textSize="11sp" />

View File

@ -1180,8 +1180,8 @@
android:layout_gravity="center"
android:layout_weight="1"
android:focusable="true"
android:gravity="center"
android:focusableInTouchMode="true"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingStart="100dp"
android:paddingEnd="6dp"
@ -1197,9 +1197,9 @@
android:layout_height="20dp"
android:layout_marginEnd="20dp"
android:background="@mipmap/btn_king_guard_onlookers"
android:clickable="true"
android:gravity="center"
android:text="@string/onlookers"
android:clickable="true"
android:textColor="@color/white"
android:textSize="12sp" />
@ -1207,6 +1207,76 @@
</FrameLayout>
<FrameLayout
android:id="@+id/full_service_notice_new"
android:layout_width="match_parent"
android:layout_height="51dp"
android:translationX="500dp"
android:visibility="invisible">
<ImageView
android:id="@+id/full_service_notice_new_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="13dp"
android:layout_marginEnd="7dp"
android:scaleType="fitXY"
android:src="@mipmap/background_full_service_notice_new" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="9dp"
android:layout_marginTop="3dp"
android:layout_marginRight="9dp"
android:gravity="center|left"
android:orientation="horizontal">
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/full_service_notice_new_text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="67dp"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="字文文字文字文字文字fdsfsdfdsfdsfsdfdsfsdf文字文字"
android:textColor="#fff"
android:textSize="13sp" />
<FrameLayout
android:id="@+id/iv_look_full_service_notice_new3"
android:layout_width="56dp"
android:layout_height="30dp"
android:layout_marginEnd="5dp">
<ImageView
android:id="@+id/iv_look_full_service_notice_new2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<TextView
android:id="@+id/iv_look_full_service_notice_new"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:gravity="center"
android:textSize="12sp" />
</FrameLayout>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/gif_gift_tip_group_buy_zuoji"
android:layout_width="wrap_content"

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB