From 3689a3a29dca76fcb9bfb30d13b586cab9da2064 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 11 Oct 2022 16:22:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8UI=E9=87=8D?= =?UTF-8?q?=E5=8F=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveRoomViewHolder.java | 17 +++++-- live/src/main/res/layout/view_live_room.xml | 51 ++++++++++--------- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index e0a85ef77..ac098ad44 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -277,7 +277,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private List mBannerList1 = new ArrayList<>(); private List mBannerList2 = new ArrayList<>(); private List mBannerList3 = new ArrayList<>(); - private LinearLayout btn_event2; + private LinearLayout btn_event2, btn_event3; private ImageView imgEvent; private View btnEvent; private View btnEvent3; @@ -627,6 +627,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis btnEvent3 = findViewById(R.id.btn_event3); imgEvent = (ImageView) findViewById(R.id.img_event); btn_event2 = (LinearLayout) findViewById(R.id.btn_event2); + btn_event3 = (LinearLayout) findViewById(R.id.btn_event3); mBanner1 = (Banner) findViewById(R.id.banner1); time = (TextView) findViewById(R.id.time); mBanner2 = (Banner) findViewById(R.id.banner2); @@ -1032,12 +1033,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mBannerList2 = new ArrayList<>(); } else { for (BannerBean bean : mBannerList2) { - if (bean.isStart()){ + if (bean.isStart()) { star = true; bean.setModel(data); } } - if (!star){ + if (!star) { BannerBean bannerBean = new BannerBean(); bannerBean.setStart(true); bannerBean.setModel(data); @@ -1057,6 +1058,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis return; } btn_event2.setVisibility(View.VISIBLE); + if (btn_event3.getVisibility() == View.VISIBLE) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) btn_event3.getLayoutParams(); + layoutParams.bottomMargin = DpUtil.dp2px(150); + btn_event3.setLayoutParams(layoutParams); + } if (mBannerList2.size() == 1) { mBanner2.setAutoPlay(false) .setPages(mBannerList2, new CustomViewHolder()) @@ -2880,6 +2886,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null || bean1 == null) { return; } + if (btn_event2.getVisibility() == View.VISIBLE) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) btn_event3.getLayoutParams(); + layoutParams.bottomMargin = DpUtil.dp2px(150); + btn_event3.setLayoutParams(layoutParams); + } mBanner3.setAutoPlay(true) .setPages(mBannerList3, new Banner3CustomViewHolder()) .setDelayTime(3000) diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index fab7f84b1..7a65a0988 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -42,30 +42,6 @@ - - - - - + + + + + + \ No newline at end of file