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