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 3399f1d06..cadd636bd 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -102,6 +102,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Random; import pl.droidsonroids.gif.GifImageView; @@ -834,8 +835,28 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } wishListFlipper.startFlipping(); }); + } - + /** + * 初始化小时榜。 + * 等待接口 + * TextView得独立出来用来替换数字 + */ + protected void initHourRankList(){ + ((Activity)mContext).runOnUiThread(()->{ + ViewFlipper flipper= (ViewFlipper) findViewById(R.id.hour_rank_list); + for (int i = 0; i < 2; i++) { + LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(DpUtil.dp2px(44),DpUtil.dp2px(16)); + View wish = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); + ImageView wishPic = wish.findViewById(R.id.wish_pic); + TextView wishIndex = wish.findViewById(R.id.wish_index); + wishPic.setImageResource(R.drawable.live_tags_hot); + wishPic.setLayoutParams(params); + wishIndex.setText(new Random().nextInt(5000)+""); + flipper.addView(wish); + } + flipper.startFlipping(); + }); } //点击头像 diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index d5a4a3b1a..107cbfe37 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -258,6 +258,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe enterRoom(); } }); + mLiveRoomViewHolder.initHourRankList(); } @Override diff --git a/live/src/main/res/drawable/bg_hour_rank_list.xml b/live/src/main/res/drawable/bg_hour_rank_list.xml new file mode 100644 index 000000000..1306ca2af --- /dev/null +++ b/live/src/main/res/drawable/bg_hour_rank_list.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/live_icon_right_more.png b/live/src/main/res/drawable/live_icon_right_more.png new file mode 100644 index 000000000..b1f82a27c Binary files /dev/null and b/live/src/main/res/drawable/live_icon_right_more.png differ diff --git a/live/src/main/res/drawable/live_tags_hot.png b/live/src/main/res/drawable/live_tags_hot.png new file mode 100644 index 000000000..572dd2a2c Binary files /dev/null and b/live/src/main/res/drawable/live_tags_hot.png differ diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 0be82513e..24b47f66b 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -176,10 +176,52 @@ android:layout_marginBottom="4dp" android:padding="3dp" android:src="@mipmap/icon_live_close_3" /> + + + + + + + + + @@ -483,7 +525,7 @@ android:id="@+id/live_time" android:layout_width="wrap_content" android:layout_height="20dp" - android:layout_below="@id/btn_votes" + android:layout_below="@id/hour_rank_layout" android:layout_marginLeft="10dp" android:layout_marginTop="5dp" android:background="@drawable/bg_live_push_time" @@ -589,7 +631,7 @@ android:id="@+id/btn_red_pack" android:layout_width="40dp" android:layout_height="50dp" - android:layout_below="@id/btn_votes" + android:layout_below="@id/hour_rank_layout" android:layout_alignParentRight="true" android:layout_marginTop="80dp" android:layout_marginRight="10dp" @@ -706,7 +748,7 @@ android:id="@+id/title_container" android:layout_width="match_parent" android:layout_height="26dp" - android:layout_below="@id/btn_votes" + android:layout_below="@id/hour_rank_layout" android:layout_marginLeft="10dp" android:layout_marginTop="10dp" android:layout_marginRight="10dp" /> @@ -715,7 +757,7 @@ android:id="@+id/gif_gift_tip_group" android:layout_width="wrap_content" android:layout_height="26dp" - android:layout_below="@id/btn_votes" + android:layout_below="@id/hour_rank_layout" android:layout_marginLeft="10dp" android:layout_marginTop="10dp" android:layout_marginRight="10dp"