直播间UI调整

This commit is contained in:
18401019693 2022-10-26 14:45:39 +08:00
parent d8d29dd2ad
commit af7a8965a7
10 changed files with 109 additions and 28 deletions

View File

@ -23,6 +23,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.UserBean;
@ -40,7 +41,6 @@ import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum;
import com.yunbao.live.R;
import com.yunbao.live.bean.GuardUserBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.live.bean.LiveBuyGuardMsgBean;
import com.yunbao.live.bean.LiveChatBean;
import com.yunbao.live.bean.LiveDanMuBean;
@ -1245,7 +1245,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
/**
* 打开观看列表弹窗
*/
public void openUserMoreListWindow(int i, boolean isOnly) {
public void openUserMoreListWindow(int i, boolean isOnly, boolean noble) {
if (outRankHideFirst) {
//获取隐身的用户的ID
@ -1261,6 +1261,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", i + "");
bundle.putBoolean("only", isOnly);
bundle.putBoolean("noble", noble);
bundle.putString("outRankHide", GsonUtils.toJson(outRankHide));
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
@ -1281,6 +1282,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", i + "");
bundle.putBoolean("only", isOnly);
bundle.putBoolean("noble", noble);
bundle.putString("outRankHide", GsonUtils.toJson(outRankHide));
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");

View File

@ -52,6 +52,12 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
private Drawable mGuardDrawable2;
private LiveUserMoreDialogFragment fragments;
private List<String> outRankHide = new ArrayList<>();
private boolean noble = false;
public UserMoreInfoAdapter setNoble(boolean noble) {
this.noble = noble;
return this;
}
public UserMoreInfoAdapter(Context context, LiveUserMoreDialogFragment fragment) {
super(context);
@ -149,14 +155,17 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
// title1.setText(R.string.noble);
// title1.setVisibility(View.VISIBLE);
// }
if (position == num && type.equals("1")) {
if (!noble && position == num && type.equals("1")) {
title.setText(R.string.live_audience);
title.setVisibility(View.VISIBLE);
}
mIcon.setImageBitmap(null);
ivIcon.setVisibility(View.GONE);
if (noble) {
ivIcon.setVisibility(View.VISIBLE);
}
mIcon.setImageBitmap(null);
tvName.setVisibility(View.GONE);
tvName.setTextSize(12);
tvName.setTextColor(mContext.getResources().getColor(R.color.white));
@ -254,7 +263,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
gift_svga.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(gift_svga,false);
SVGAViewUtils.playEndClear(gift_svga, false);
}
@Override

View File

@ -67,7 +67,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
private RelativeLayout bottom_msg;//底部信息的布局在榜单列表下不需要显示底部信息
private String Tips = "1";
private String type = "guanzhong";
private boolean isOnly;
private boolean isOnly, noble;
ImageView no_more;
private List<String> outRankHide = new ArrayList<>();
@ -112,6 +112,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
mLiveUid = bundle.getString(Constants.LIVE_UID);
stream = bundle.getString(Constants.STREAM);
isOnly = bundle.getBoolean("only", false);
noble = bundle.getBoolean("noble", false);
String outRankHideString = bundle.getString("outRankHide");
outRankHide = GsonUtils.fromJson(outRankHideString, new TypeToken<List<String>>() {
}.getType());
@ -269,9 +270,16 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
List<LiveUserGiftBean> userGiftBeans = JSON.parseArray(json.getString("userlist"), LiveUserGiftBean.class);
List<LiveUserGiftBean> data = new ArrayList<>();
for (LiveUserGiftBean model : userGiftBeans) {
if (TextUtils.equals(model.getNoble_id(), "0")) {
data.add(model);
if (noble) {
if (!TextUtils.equals(model.getNoble_id(), "0")) {
data.add(model);
}
} else {
if (TextUtils.equals(model.getNoble_id(), "0")) {
data.add(model);
}
}
}
Log.i("tag222", "ssss");
if (data.size() > 0 && pg == 1) {
@ -319,11 +327,19 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
}
});
mRefreshView.initData();
if (isOnly) {
if (noble) {
tabs.setVisibility(View.GONE);
title.setVisibility(View.GONE);
title.setVisibility(View.VISIBLE);
title.setText(R.string.noble);
userMoreInfoAdapter.setNoble(true);
} else {
if (isOnly) {
tabs.setVisibility(View.GONE);
title.setVisibility(View.GONE);
}
}
}
@Override

View File

@ -882,6 +882,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
findViewById(R.id.btn_votes).setOnClickListener(this);
findViewById(R.id.btn_medal_rank).setOnClickListener(this);
findViewById(R.id.btn_noble).setOnClickListener(this);
findViewById(R.id.noble_seat).setOnClickListener(this);
userMore.setOnClickListener(this);
userGuard.setOnClickListener(this);
@ -1186,7 +1187,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append("&anchorUid=")
.append(mLiveUid)
.append("&t=")
.append(System.currentTimeMillis());
.append(System.currentTimeMillis())
.append("&g=Appapi&m=Wish&a=index");
}
if (TextUtils.equals(type, "1")) {
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
@ -1265,7 +1267,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
showBanner();
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
}
}
@ -1346,11 +1348,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
TextView wishIndex = wish.findViewById(R.id.wish_index);
ImgLoader.display(mContext, wishlist.get(i).getWishlistIcon(), wishPic);
wishIndex.setText(wishlist.get(i).getWishlistNumP());
if(wishListFlipper!=null) {
if (wishListFlipper != null) {
wishListFlipper.addView(wish);
}
}
if(wishListFlipper!=null) {
if (wishListFlipper != null) {
wishListFlipper.startFlipping();
}
});
@ -1901,10 +1903,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} else if (i == R.id.btn_prize_pool_level) {
((LiveActivity) mContext).openPrizePoolWindow();
} else if (i == R.id.user_more) {
((LiveActivity) mContext).openUserMoreListWindow(1, false);
((LiveActivity) mContext).openUserMoreListWindow(1, false, false);
} else if (i == R.id.hot_btn) {
((LiveActivity) mContext).openUserMoreListWindow(1, false);
((LiveActivity) mContext).openUserMoreListWindow(1, false, false);
} else if (i == R.id.noble_seat) {
((LiveActivity) mContext).openUserMoreListWindow(1, false, true);
} else if (i == R.id.btn_close) {
close();
//小屏
@ -2799,9 +2803,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 切换美颜UI
*/
public void changeFaceUnityView() {
// faceUnityView.setVisibility(faceUnityView.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
// faceUnityView.setVisibility(faceUnityView.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
LiveFaceUnityDialogFragment fragment = new LiveFaceUnityDialogFragment(mContext);
fragment.setManager(manager);
fragment.setManager(manager);
fragment.show(((LiveActivity) mContext).getSupportFragmentManager(), "faceUi");
}

View File

@ -279,7 +279,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
String json = info[0];
WishlistModel model = GsonUtils.fromJson(json, WishlistModel.class);
if (mLiveRoomViewHolder != null && model != null) {
mLiveRoomViewHolder.initWishList(model.getWishlist());
// mLiveRoomViewHolder.initWishList(model.getWishlist());
}

View File

@ -175,11 +175,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginEnd="25dp"
android:layout_gravity="center"
android:layout_marginTop="25dp"
android:layout_marginEnd="25dp"
android:paddingLeft="13dp"
android:text="主播"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:textSize="10sp" />

View File

@ -355,6 +355,7 @@
android:id="@+id/wish_list_layout"
android:layout_width="80dp"
android:layout_height="21dp"
android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginStart="10dp"
android:layout_toRightOf="@id/live_wks_layout"
@ -363,7 +364,7 @@
android:orientation="horizontal"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:visibility="visible">
android:visibility="gone">
<ImageView
android:layout_width="14dp"
@ -381,6 +382,18 @@
android:outAnimation="@anim/anim_marquee_out" />
</LinearLayout>
<LinearLayout
android:id="@+id/noble_seat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginStart="10dp"
android:visibility="visible"
android:layout_toEndOf="@id/live_wks_layout">
<include layout="@layout/view_noble_seat" />
</LinearLayout>
<!--粉丝团-->
<LinearLayout
android:id="@+id/fans_btn"
@ -667,8 +680,8 @@
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="0dp"
android:visibility="gone"
android:background="@drawable/bg_live_room_msg">
android:background="@drawable/bg_live_room_msg"
android:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/room_msg_user"
@ -2125,7 +2138,7 @@
<LinearLayout
android:layout_width="match_parent"
android:visibility="visible"
android:layout_height="30dp"></LinearLayout>
android:layout_height="30dp"
android:visibility="visible"></LinearLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:id="@+id/wish_list_layout"
android:layout_width="80dp"
android:layout_height="21dp"
android:background="@drawable/bg_live_item"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:visibility="visible">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@mipmap/live_icon_seat" />
<TextView
android:id="@+id/wish_list"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:gravity="center"
android:textColor="#FFFFFF"
android:text="@string/noble_seat"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -24,4 +24,5 @@
<string name="fingers_slide" translatable="false">手指上滑,取消發送</string>
<string name="release_cancel_send" translatable="false">松開取消發送</string>
<string name="more_than" translatable="false">已超过10秒未识别到录音</string>
<string name="noble_seat" translatable="false">貴族坐席</string>
</resources>