add:小时榜UI,接口未接入,功能暂未实现

This commit is contained in:
zlzw 2022-08-24 17:10:50 +08:00
parent 15bb24fa83
commit 55ccb03b4a
6 changed files with 89 additions and 16 deletions

View File

@ -102,6 +102,7 @@ import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Random;
import pl.droidsonroids.gif.GifImageView; import pl.droidsonroids.gif.GifImageView;
@ -834,8 +835,28 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
wishListFlipper.startFlipping(); 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();
});
} }
//点击头像 //点击头像

View File

@ -258,6 +258,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
enterRoom(); enterRoom();
} }
}); });
mLiveRoomViewHolder.initHourRankList();
} }
@Override @Override

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="96dp" android:height="20dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#fffd4444" android:endColor="#ffff673c" android:angle="90" />
<corners android:radius="10dp" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -176,10 +176,52 @@
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:padding="3dp" android:padding="3dp"
android:src="@mipmap/icon_live_close_3" /> android:src="@mipmap/icon_live_close_3" />
<LinearLayout
android:id="@+id/hour_rank_layout"
android:layout_width="wrap_content"
android:layout_height="21dp"
android:layout_below="@id/lin"
android:layout_marginLeft="10dp"
android:layout_marginTop="8dp"
android:background="@drawable/bg_hour_rank_list"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingRight="5dp">
<include
layout="@layout/view_wish_list"
android:layout_width="14dp"
android:layout_weight="0.0"
android:layout_height="14dp"
android:visibility="gone"
android:src="@mipmap/live_icon_wishlist" />
<ViewFlipper
android:id="@+id/hour_rank_list"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginStart="6dp"
android:layout_weight="2"
android:flipInterval="5000"
android:layout_marginEnd="6dp"
android:inAnimation="@anim/anim_marquee_in"
android:outAnimation="@anim/anim_marquee_out"/>
<ImageView
android:layout_width="14dp"
android:layout_gravity="center"
android:layout_height="14dp"
android:src="@drawable/live_icon_right_more" />
</LinearLayout>
<!--贡献-->
<LinearLayout <LinearLayout
android:id="@+id/btn_votes" android:id="@+id/btn_votes"
android:layout_toRightOf="@id/hour_rank_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_below="@id/lin" android:layout_below="@id/lin"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
@ -224,9 +266,9 @@
android:id="@+id/btn_guard" android:id="@+id/btn_guard"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/btn_votes" android:layout_toRightOf="@id/hour_rank_layout"
android:background="@drawable/bg_live_item" android:background="@drawable/bg_live_item"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
@ -260,9 +302,9 @@
android:id="@+id/live_wks_layout" android:id="@+id/live_wks_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/btn_votes" android:layout_toRightOf="@id/hour_rank_layout"
android:background="@drawable/bg_live_item" android:background="@drawable/bg_live_item"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
@ -290,7 +332,7 @@
android:id="@+id/wish_list_layout" android:id="@+id/wish_list_layout"
android:layout_width="90dp" android:layout_width="90dp"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_toRightOf="@id/live_wks_layout" android:layout_toRightOf="@id/live_wks_layout"
android:background="@drawable/bg_live_item" android:background="@drawable/bg_live_item"
@ -322,7 +364,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_below="@id/lin" android:layout_below="@id/lin"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:background="@drawable/bg_live_item" android:background="@drawable/bg_live_item"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
@ -358,7 +400,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_below="@id/lin" android:layout_below="@id/lin"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
@ -397,7 +439,7 @@
android:id="@+id/open_sidebar" android:id="@+id/open_sidebar"
android:layout_width="69dp" android:layout_width="69dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:background="@drawable/bg_live_item_right" android:background="@drawable/bg_live_item_right"
android:clickable="true" android:clickable="true"
@ -425,7 +467,7 @@
android:id="@+id/btn_noble" android:id="@+id/btn_noble"
android:layout_width="45dp" android:layout_width="45dp"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_toRightOf="@id/btn_guard" android:layout_toRightOf="@id/btn_guard"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="5dp" android:paddingRight="5dp"
@ -437,7 +479,7 @@
android:id="@+id/btn_medal_rank" android:id="@+id/btn_medal_rank"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/btn_guard" android:layout_toRightOf="@id/btn_guard"
android:background="@drawable/bg_live_item" android:background="@drawable/bg_live_item"
@ -474,7 +516,7 @@
android:id="@+id/luck_container" android:id="@+id/luck_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignTop="@id/btn_votes" android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_toRightOf="@id/btn_medal_rank" /> android:layout_toRightOf="@id/btn_medal_rank" />
@ -483,7 +525,7 @@
android:id="@+id/live_time" android:id="@+id/live_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_below="@id/btn_votes" android:layout_below="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:background="@drawable/bg_live_push_time" android:background="@drawable/bg_live_push_time"
@ -589,7 +631,7 @@
android:id="@+id/btn_red_pack" android:id="@+id/btn_red_pack"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_below="@id/btn_votes" android:layout_below="@id/hour_rank_layout"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="80dp" android:layout_marginTop="80dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
@ -706,7 +748,7 @@
android:id="@+id/title_container" android:id="@+id/title_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="26dp" android:layout_height="26dp"
android:layout_below="@id/btn_votes" android:layout_below="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="10dp" /> android:layout_marginRight="10dp" />
@ -715,7 +757,7 @@
android:id="@+id/gif_gift_tip_group" android:id="@+id/gif_gift_tip_group"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="26dp" android:layout_height="26dp"
android:layout_below="@id/btn_votes" android:layout_below="@id/hour_rank_layout"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"