提交主播投票功能
This commit is contained in:
12
live/src/main/res/anim/view_live_anchor_vote_in.xml
Normal file
12
live/src/main/res/anim/view_live_anchor_vote_in.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromXDelta="100%"
|
||||
android:toXDelta="0" />
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="0"
|
||||
android:toAlpha="1" />
|
||||
</set>
|
||||
12
live/src/main/res/anim/view_live_anchor_vote_out.xml
Normal file
12
live/src/main/res/anim/view_live_anchor_vote_out.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromXDelta="0"
|
||||
android:toXDelta="100%" />
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="1"
|
||||
android:toAlpha="0.2" />
|
||||
</set>
|
||||
9
live/src/main/res/drawable/background_292929.xml
Normal file
9
live/src/main/res/drawable/background_292929.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp" />
|
||||
<solid android:color="#292929" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
live/src/main/res/drawable/background_cc000.xml
Normal file
9
live/src/main/res/drawable/background_cc000.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="15dp" />
|
||||
<solid android:color="#cc000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#cc000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
10
live/src/main/res/drawable/bg_live_room_vote_hide.xml
Normal file
10
live/src/main/res/drawable/bg_live_room_vote_hide.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="9dp" android:height="22dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffff2b75" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff6170ff" android:endColor="#ff7cd6ff" android:angle="45" />
|
||||
<corners android:topLeftRadius="5dp" android:topRightRadius="5dp" android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
36
live/src/main/res/drawable/live_room_qa_progress.xml
Normal file
36
live/src/main/res/drawable/live_room_qa_progress.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!--背景色从左到右色值,渐变-->
|
||||
<item android:id="@android:id/background">
|
||||
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:centerColor="#7CD6FF"
|
||||
android:endColor="#6170FF"
|
||||
android:startColor="#6170FF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--进度条从左到右色值,渐变-->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip
|
||||
>
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners
|
||||
android:bottomLeftRadius="5dp"
|
||||
android:radius="5dp"
|
||||
android:topLeftRadius="5dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#FF35BF"
|
||||
android:startColor="#FD2F5A" />
|
||||
</shape>
|
||||
</scale>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -69,7 +69,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_live_ready_btn2"
|
||||
android:text="保存"
|
||||
android:text="@string/save"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
115
live/src/main/res/layout/dialog_live_anchor_create_qa.xml
Normal file
115
live/src/main/res/layout/dialog_live_anchor_create_qa.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/border_translucent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_question"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/background_292929"
|
||||
android:ems="10"
|
||||
android:gravity="top"
|
||||
android:hint="@string/dialog_anchor_create_qa_question"
|
||||
android:inputType="text|textMultiLine"
|
||||
android:maxLength="33"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="11dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/editTextText">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_answer1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/background_292929"
|
||||
android:maxLength="8"
|
||||
android:ems="33"
|
||||
android:gravity="center|start"
|
||||
android:hint="@string/dialog_anchor_create_qa_answer"
|
||||
android:inputType="text"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_answer2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="1"
|
||||
android:maxLength="8"
|
||||
android:background="@drawable/background_292929"
|
||||
android:ems="33"
|
||||
android:gravity="center|start"
|
||||
android:hint="@string/dialog_anchor_create_qa_answer"
|
||||
android:inputType="text"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/bg_live_ready_btn2"
|
||||
android:text="@string/dialog_anchor_create_qa_submit"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="@drawable/bg_dialog_unfollow_cancel"
|
||||
android:text="@string/dialog_anchor_create_qa_cancel"
|
||||
android:textColor="#FFC300"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
138
live/src/main/res/layout/sim_live_room_vote.xml
Normal file
138
live/src/main/res/layout/sim_live_room_vote.xml
Normal file
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/live_room_vote"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@drawable/background_cc000"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/vote_hide">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
tools:text="主播的這個舞蹈你 喜歡嗎"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/vote_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:max="20"
|
||||
android:progress="10"
|
||||
android:progressDrawable="@drawable/live_room_qa_progress"
|
||||
android:rotationY="180" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vote_sub1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
tools:text="喜欢"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFF" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vote_sub2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
tools:text="不喜欢"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/vote_close"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/live_close"
|
||||
tools:layout_editor_absoluteY="93dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/vote_hide"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:rotationY="180"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/icon_back" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/vote_show"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_live_vote_cc000"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@mipmap/icon_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_live_room_vote_hide"
|
||||
android:ems="1"
|
||||
android:lineSpacingMultiplier='0.8'
|
||||
android:paddingStart="1.5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="1.5dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@string/live_vote_hide_text"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="6sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1303,7 +1303,13 @@
|
||||
android:layout_marginBottom="-30dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/vote_layout"
|
||||
layout="@layout/sim_live_room_vote"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_pk_top"
|
||||
|
||||
Reference in New Issue
Block a user