直播间UI调整,修改悬浮

This commit is contained in:
18401019693
2022-10-26 15:28:03 +08:00
parent af7a8965a7
commit 787d50c5b4
11 changed files with 52 additions and 89 deletions

View File

@@ -628,22 +628,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.initHourRankList();
}
mLiveRoomViewHolder.startAnchorLight();
//心愿单
LiveHttpUtil.getWishList(mLiveUid, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (info.length > 0) {
String json = info[0];
WishlistModel model = GsonUtils.fromJson(json, WishlistModel.class);
if (mLiveRoomViewHolder != null && model != null) {
mLiveRoomViewHolder.initWishList(model.getWishlist());
}
}
}
@Override
public void onFinish() {
}
});
}
if (mLiveAnchorViewHolder == null) {
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);

View File

@@ -387,32 +387,9 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
LiveRoomViewHolder.insertChat(lvBean2, 1);
}
}, 10000);//3秒后执行Runnable中的run方法
getNewPeopleInfo(false);
}
public void getNewPeopleInfo(boolean show) {
API.get().pdLiveApi(mContext)
.getNewPeopleInfo()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(stringResponseModel -> {
NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo();
if (peopleInfo.getIsShow()) {
liveNewPeople.setVisibility(View.VISIBLE);
if (peopleInfo.getLink().startsWith("http")) {
newPeopleUrl = peopleInfo.getLink() + "?";
} else {
newPeopleUrl = CommonAppConfig.HOST + "/" + peopleInfo.getLink();
}
setUserPreferentialRedDot(peopleInfo.getShowRed() == 1);
if (show) {
openNewPeopleDialog();
}
} else {
liveNewPeople.setVisibility(View.GONE);
}
}, Throwable::printStackTrace).isDisposed();
}
@Override
public void onClick(View v) {
@@ -448,7 +425,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
*/
public void openNewPeopleDialog() {
if (newPeopleUrl == null) {
getNewPeopleInfo(true);
// getNewPeopleInfo(true);
return;
}
Bundle bundle = new Bundle();

View File

@@ -1463,16 +1463,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param giftCount 礼物数量
*/
public void updataWishList(String giftId, int giftCount) {
for (WishlistItemModel model : wishlist) {
if (TextUtils.equals(giftId, model.getLid())) {
int number = Integer.parseInt(model.getWishlistProgress()) + giftCount;
model.setWishlistProgress(String.valueOf(number));
if (!(mContext instanceof LiveAudienceActivity)){
for (WishlistItemModel model : wishlist) {
if (TextUtils.equals(giftId, model.getLid())) {
int number = Integer.parseInt(model.getWishlistProgress()) + giftCount;
model.setWishlistProgress(String.valueOf(number));
}
}
if (wishListLayout != null) {
wishListLayout.removeAllViews();
}
initWishList(wishlist);
}
if (wishListLayout != null) {
wishListLayout.removeAllViews();
}
initWishList(wishlist);
}
//点击头像

View File

@@ -117,7 +117,7 @@
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentBottom="true">
@@ -237,7 +237,7 @@
android:src="@mipmap/icon_live_red_pack"
android:visibility="gone" />
<!--聊天-->
<LinearLayout
android:id="@+id/message_layout"
android:layout_width="84dp"
@@ -288,13 +288,12 @@
</LinearLayout>
<!--消息中心-->
<RelativeLayout
android:id="@+id/msg_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/message_layout">
android:layout_marginStart="9dp">
<RelativeLayout
android:id="@+id/rt_msg"
@@ -341,42 +340,25 @@
android:visibility="invisible" />
</RelativeLayout>
<!--普通工具合集-->
<ImageView
android:id="@+id/total_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/msg_view"
android:layout_marginStart="13dp"
android:padding="5dp"
android:src="@mipmap/live_icon_more" />
<ImageView
android:id="@+id/gift_image"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:layout_marginBottom="5dp"
android:src="@mipmap/live_lw" />
<ImageView
android:id="@+id/live_new_people1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/gift_image"
android:padding="4dp"
android:src="@mipmap/live_icon_newpeople_en"
android:visibility="gone" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<!--新人特惠-->
<RelativeLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/gift_image"
android:layout_marginEnd="13dp"
android:visibility="gone"
android:padding="4dp">
<ImageView
@@ -397,7 +379,17 @@
android:background="@drawable/background_ff5075"
android:visibility="invisible" />
</RelativeLayout>
</RelativeLayout>
<!--礼物-->
<ImageView
android:id="@+id/gift_image"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="5dp"
android:src="@mipmap/live_lw" />
</LinearLayout>
<com.opensource.svgaplayer.SVGAImageView

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB