心愿单修改

This commit is contained in:
18401019693 2023-04-08 16:42:43 +08:00
parent b44524b25f
commit 28ef982b74
8 changed files with 39 additions and 56 deletions

View File

@ -1,6 +1,5 @@
package com.yunbao.common.bean; package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
public class XydCompleteModel extends BaseModel { public class XydCompleteModel extends BaseModel {
@ -64,6 +63,17 @@ public class XydCompleteModel extends BaseModel {
private String equipment; private String equipment;
@SerializedName("bubble") @SerializedName("bubble")
private String bubble; private String bubble;
@SerializedName("xydgiftname")
private String xydgiftname;
public String getXydgiftname() {
return xydgiftname;
}
public XydCompleteModel setXydgiftname(String xydgiftname) {
this.xydgiftname = xydgiftname;
return this;
}
public String getMethod() { public String getMethod() {
return method; return method;

View File

@ -1309,7 +1309,7 @@ public class LiveAudienceActivity extends LiveActivity {
break; break;
case XYD_COMPLETE: case XYD_COMPLETE:
if (manager != null) { if (manager != null) {
manager.showXydComplete(event.getXydCompleteModel()); manager.showXydComplete(event.getXydCompleteModel(), event.getLiveReceiveGiftBean());
} }
break; break;

View File

@ -11,6 +11,7 @@ import com.yunbao.common.bean.WishModel;
import com.yunbao.common.bean.XydCompleteModel; import com.yunbao.common.bean.XydCompleteModel;
import com.yunbao.common.event.CustomFullServiceNotifyEvent; import com.yunbao.common.event.CustomFullServiceNotifyEvent;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.OpenParametersModel; import com.yunbao.live.bean.OpenParametersModel;
public class LiveAudienceEvent extends BaseModel { public class LiveAudienceEvent extends BaseModel {
@ -39,6 +40,16 @@ public class LiveAudienceEvent extends BaseModel {
private String uname; private String uname;
private WishModel wishListProgress; private WishModel wishListProgress;
private XydCompleteModel xydCompleteModel; private XydCompleteModel xydCompleteModel;
private LiveReceiveGiftBean liveReceiveGiftBean;
public LiveReceiveGiftBean getLiveReceiveGiftBean() {
return liveReceiveGiftBean;
}
public LiveAudienceEvent setLiveReceiveGiftBean(LiveReceiveGiftBean liveReceiveGiftBean) {
this.liveReceiveGiftBean = liveReceiveGiftBean;
return this;
}
public XydCompleteModel getXydCompleteModel() { public XydCompleteModel getXydCompleteModel() {
return xydCompleteModel; return xydCompleteModel;

View File

@ -287,7 +287,7 @@ public class LiveGiftAnimPresenter {
} }
public ConcurrentLinkedQueue<LiveReceiveGiftBean> getmQueue() { public ConcurrentLinkedQueue<LiveReceiveGiftBean> getmQueue() {
return mQueue; return mGifQueue;
} }
private void downLoadIconGifCallback() { private void downLoadIconGifCallback() {
@ -1074,7 +1074,7 @@ public class LiveGiftAnimPresenter {
/** /**
* 显示gif礼物 比如油纸伞 * 显示gif礼物 比如油纸伞
*/ */
private void showGifGift(final LiveReceiveGiftBean bean) { public void showGifGift(final LiveReceiveGiftBean bean) {
String url = bean.getGifUrl(); String url = bean.getGifUrl();

View File

@ -602,7 +602,8 @@ public class SocketRyClient {
XydCompleteModel xydCompleteModel = GsonUtils.fromJson(map.toString(), XydCompleteModel.class); XydCompleteModel xydCompleteModel = GsonUtils.fromJson(map.toString(), XydCompleteModel.class);
EventBus.getDefault().post(new LiveAudienceEvent() EventBus.getDefault().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.XYD_COMPLETE) .setType(LiveAudienceEvent.LiveAudienceType.XYD_COMPLETE)
.setXydCompleteModel(xydCompleteModel)); .setXydCompleteModel(xydCompleteModel)
.setLiveReceiveGiftBean(JSON.parseObject(map.toString(), LiveReceiveGiftBean.class)));
break; break;
case Constants.WISH_LIST_PROGRESS: case Constants.WISH_LIST_PROGRESS:
StringBuffer conString = new StringBuffer(); StringBuffer conString = new StringBuffer();

View File

@ -353,7 +353,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private ImageView mAnchorSayHide; private ImageView mAnchorSayHide;
//----!主播说组件---// //----!主播说组件---//
private Banner topBanner1;//心愿单&联系方式 private Banner topBanner1;//心愿单&联系方式
private SVGAImageView xydSvg;
public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow; public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow;
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
@ -580,17 +579,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
private Runnable xydCompleteRunnable = new Runnable() {
@Override
public void run() {
xydSvg.setVisibility(View.GONE);
if (xydCompleteModels.size() > 0)
showXydComplete(xydCompleteModels.get(0), true);
}
};
List<XydCompleteModel> xydCompleteModels = new ArrayList<>(); List<XydCompleteModel> xydCompleteModels = new ArrayList<>();
public synchronized void showXydComplete(XydCompleteModel model, boolean isRunble) { public synchronized void showXydComplete(XydCompleteModel model, boolean isRunble, LiveReceiveGiftBean liveReceiveGiftBean) {
if (model.getLiveId().equals(mLiveUid)) { if (model.getLiveId().equals(mLiveUid)) {
if (!isRunble) { if (!isRunble) {
@ -598,43 +589,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
bean.setContent(model.getMsg()); bean.setContent(model.getMsg());
bean.setUserNiceName(model.getUserName()); bean.setUserNiceName(model.getUserName());
bean.setAtUserName(model.getGiftname()) bean.setAtUserName(model.getXydgiftname())
.setLevel(model.getLevel()); .setLevel(model.getLevel());
bean.setType(LiveChatBean.XYD_COMPLETE); bean.setType(LiveChatBean.XYD_COMPLETE);
mLiveChatAdapter.insertItem(bean); mLiveChatAdapter.insertItem(bean);
xydCompleteModels.add(model); xydCompleteModels.add(model);
} }
if (mLiveGiftAnimPresenter == null) {
if (mLiveGiftAnimPresenter != null && mLiveGiftAnimPresenter.getmQueue().size() > 0) { mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
new Handler().postDelayed(xydCompleteRunnable, 1000);
} else {
try {
xydSvg.setLoops(1);
xydSvg.setVisibility(View.VISIBLE);
new SVGAParser(Contexts).parse(new URL(model.getSvg()), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
xydSvg.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(xydSvg);
} }
liveReceiveGiftBean.setGiftId(liveReceiveGiftBean.getGiftName());
mLiveGiftAnimPresenter.showGifGift(liveReceiveGiftBean);
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
if (xydCompleteModels.size() > 0) {
xydCompleteModels.remove(0);
new Handler().postDelayed(xydCompleteRunnable, 1000);
}
}
} }
} }
@ -1422,7 +1388,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1);
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1);
xydSvg = (SVGAImageView) findViewById(R.id.xyd_svg);
} }
/** /**

View File

@ -1980,9 +1980,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
} }
public void showXydComplete(XydCompleteModel model) { public void showXydComplete(XydCompleteModel model, LiveReceiveGiftBean liveReceiveGiftBean) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showXydComplete(model, false); mLiveRoomViewHolder.showXydComplete(model, false,liveReceiveGiftBean);
} }
} }
} }

View File

@ -701,8 +701,8 @@
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="76dp" android:layout_height="76dp"
android:layout_below="@+id/live_rank_pk" android:layout_below="@+id/live_rank_pk"
android:layout_marginTop="20dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="20dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
app:delay_time="5000" app:delay_time="5000"
app:indicator_height="8dp" app:indicator_height="8dp"
@ -2355,12 +2355,6 @@
android:layout_marginTop="60dp" android:layout_marginTop="60dp"
android:visibility="gone" /> android:visibility="gone" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/xyd_svg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:visibility="gone" />
<com.opensource.svgaplayer.SVGAImageView <com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga_new_user_gif" android:id="@+id/svga_new_user_gif"
@ -2391,4 +2385,6 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginTop="80dp" android:layout_marginTop="80dp"
app:autoPlay="true" /> app:autoPlay="true" />
</RelativeLayout> </RelativeLayout>