Commit c5f0fcc8 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais

Fix TV audio player play state and animation

parent 6bc0a7b8
{
"version": 1,
"layers": {
"vectorLayer": {
"id": "112",
"name": "vector",
"type": "vector",
"width": 36,
"height": 36,
"children": [
{
"id": "2079",
"name": "group",
"type": "group",
"pivotX": 18,
"pivotY": 18,
"children": [
{
"id": "187",
"name": "path_1",
"type": "path",
"pathData": "M 8.326 3.883 C 7.581 3.928 7 4.545 7 5.291 L 7 18 L 30.896 18.5 C 31.126 17.896 30.939 17.162 30.314 16.787 L 9.137 4.08 C 8.893 3.934 8.61 3.866 8.326 3.883 Z M 7 18 L 7 30.705 C 6.999 31.803 8.195 32.482 9.137 31.918 L 30.314 19.209 C 30.937 18.835 31.125 18.104 30.898 17.5 Z",
"fillColor": "#000",
"strokeWidth": 1
}
]
}
]
},
"hiddenLayerIds": []
},
"timeline": {
"animation": {
"id": "81",
"name": "anim",
"duration": 300,
"blocks": [
{
"id": "241",
"layerId": "187",
"propertyName": "pathData",
"startTime": 0,
"endTime": 300,
"interpolator": "FAST_OUT_SLOW_IN",
"type": "path",
"fromValue": "M 8.326 3.883 C 7.581 3.928 7 4.545 7 5.291 C 7 9.527 7 13.764 7 18 L 29.313 18.467 C 29.841 18.478 30.368 18.489 30.896 18.5 C 31.126 17.896 30.939 17.162 30.314 16.787 C 29.881 16.527 29.448 16.267 29.015 16.007 C 23.259 12.554 17.504 9.101 11.749 5.648 L 9.137 4.08 C 8.893 3.934 8.61 3.866 8.326 3.883 C 8.326 3.883 8.326 3.883 8.326 3.883 M 7 18 C 7 21.162 7 24.324 7 27.486 C 7 28.559 7 29.632 7 30.705 C 6.999 31.803 8.195 32.482 9.137 31.918 L 12.189 30.086 C 17.734 26.759 23.278 23.432 28.822 20.104 C 29.319 19.806 29.817 19.507 30.314 19.209 C 30.937 18.835 31.125 18.104 30.898 17.5 C 30.017 17.518 29.135 17.537 28.254 17.555 L 26.309 17.596 C 19.873 17.731 13.436 17.865 7 18",
"toValue": "M 6 12 C 6 12.795 6.316 13.559 6.879 14.121 C 7.441 14.684 8.205 15 9 15 L 27 15 C 27.795 15 28.559 14.684 29.121 14.121 C 29.684 13.559 30 12.795 30 12 C 30 11.205 29.684 10.441 29.121 9.879 C 28.559 9.316 27.795 9 27 9 L 9 9 C 8.205 9 7.441 9.316 6.879 9.879 C 6.316 10.441 6 11.205 6 12 M 6.879 21.879 C 6.316 22.441 6 23.205 6 24 C 6 24.795 6.316 25.559 6.879 26.121 C 7.441 26.684 8.205 27 9 27 L 27 27 C 27.795 27 28.559 26.684 29.121 26.121 C 29.684 25.559 30 24.795 30 24 C 30 23.205 29.684 22.441 29.121 21.879 C 28.559 21.316 27.795 21 27 21 L 9 21 C 8.205 21 7.441 21.316 6.879 21.879"
},
{
"id": "2080",
"layerId": "2079",
"propertyName": "rotation",
"startTime": 0,
"endTime": 300,
"interpolator": "FAST_OUT_SLOW_IN",
"type": "number",
"fromValue": 0,
"toValue": 90
}
]
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@color/orange200transparent"/>
<item android:state_selected="true" android:color="@color/orange200transparent"/>
<item android:state_pressed="true" android:color="@color/orange200transparent"/>
<item android:color="@color/grey200"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@color/orange500focus"/>
<item android:state_selected="true" android:color="@color/orange500focus"/>
<item android:state_pressed="true" android:color="@color/orange500focus"/>
<item android:color="@color/transparent"/>
</selector>
\ No newline at end of file
......@@ -13,10 +13,9 @@
android:pivotY="18">
<path
android:name="path_1"
android:pathData="M 6.66 3.001 C 6.66 3.001 6.66 3.001 6.66 3.001 C 5.869 3.049 5.251 3.705 5.251 4.498 C 5.251 8.922 5.251 13.347 5.251 17.771 L 18 17.907 C 22.249 17.952 26.499 17.998 30.748 18.043 C 30.763 17.531 30.521 17.012 30.021 16.712 C 27.521 15.212 25.021 13.712 22.521 12.212 C 20.021 10.712 17.521 9.212 15.021 7.712 L 7.522 3.212 C 7.262 3.057 6.962 2.983 6.66 3.001 M 5.251 24.634 C 5.251 26.922 5.251 29.209 5.251 31.497 C 5.25 32.663 6.521 33.385 7.522 32.786 C 9.397 31.661 11.271 30.536 13.146 29.411 L 18.771 26.035 C 20.646 24.91 22.521 23.785 24.396 22.66 C 26.271 21.534 28.146 20.409 30.021 19.284 C 30.491 19.001 30.734 18.525 30.748 18.043 C 26.499 17.998 22.249 17.952 18 17.907 L 5.251 17.771 C 5.251 20.059 5.251 22.346 5.251 24.634"
android:pathData="M 6 12 C 6 12.795 6.316 13.559 6.879 14.121 C 7.441 14.684 8.205 15 9 15 L 27 15 C 27.795 15 28.559 14.684 29.121 14.121 C 29.684 13.559 30 12.795 30 12 C 30 11.205 29.684 10.441 29.121 9.879 C 28.559 9.316 27.795 9 27 9 L 9 9 C 8.205 9 7.441 9.316 6.879 9.879 C 6.316 10.441 6 11.205 6 12 M 6.879 21.879 C 6.316 22.441 6 23.205 6 24 C 6 24.795 6.316 25.559 6.879 26.121 C 7.441 26.684 8.205 27 9 27 L 27 27 C 27.795 27 28.559 26.684 29.121 26.121 C 29.684 25.559 30 24.795 30 24 C 30 23.205 29.684 22.441 29.121 21.879 C 28.559 21.316 27.795 21 27 21 L 9 21 C 8.205 21 7.441 21.316 6.879 21.879"
android:fillColor="?attr/player_icon_color"
android:strokeWidth="1"
android:fillType="evenOdd" />
android:strokeWidth="1"/>
</group>
</vector>
</aapt:attr>
......@@ -26,8 +25,8 @@
android:propertyName="pathData"
android:duration="300"
android:repeatCount="0"
android:valueFrom="M 6.879 9.879 C 6.316 10.441 6 11.205 6 12 C 6 12.795 6.316 13.559 6.879 14.121 C 7.441 14.684 8.205 15 9 15 L 27 15 C 27.795 15 28.559 14.684 29.121 14.121 C 29.684 13.559 30 12.795 30 12 C 30 11.205 29.684 10.441 29.121 9.879 C 28.559 9.316 27.795 9 27 9 L 9 9 C 8.205 9 7.441 9.316 6.879 9.879 M 6.879 21.879 C 6.316 22.441 6 23.205 6 24 C 6 24.795 6.316 25.559 6.879 26.121 C 7.441 26.684 8.205 27 9 27 L 27 27 C 27.795 27 28.559 26.684 29.121 26.121 C 29.684 25.559 30 24.795 30 24 C 30 23.205 29.684 22.441 29.121 21.879 C 28.559 21.316 27.795 21 27 21 L 9 21 C 8.205 21 7.441 21.316 6.879 21.879"
android:valueTo="M 6.66 3.001 C 6.66 3.001 6.66 3.001 6.66 3.001 C 5.869 3.049 5.251 3.705 5.251 4.498 C 5.251 8.922 5.251 13.347 5.251 17.771 L 18 17.907 C 22.249 17.952 26.499 17.998 30.748 18.043 C 30.763 17.531 30.521 17.012 30.021 16.712 C 27.521 15.212 25.021 13.712 22.521 12.212 C 20.021 10.712 17.521 9.212 15.021 7.712 L 7.522 3.212 C 7.262 3.057 6.962 2.983 6.66 3.001 M 5.251 24.634 C 5.251 26.922 5.251 29.209 5.251 31.497 C 5.25 32.663 6.521 33.385 7.522 32.786 C 9.397 31.661 11.271 30.536 13.146 29.411 L 18.771 26.035 C 20.646 24.91 22.521 23.785 24.396 22.66 C 26.271 21.534 28.146 20.409 30.021 19.284 C 30.491 19.001 30.734 18.525 30.748 18.043 C 26.499 17.998 22.249 17.952 18 17.907 L 5.251 17.771 C 5.251 20.059 5.251 22.346 5.251 24.634"
android:valueFrom="M 6 12 C 6 12.795 6.316 13.559 6.879 14.121 C 7.441 14.684 8.205 15 9 15 L 27 15 C 27.795 15 28.559 14.684 29.121 14.121 C 29.684 13.559 30 12.795 30 12 C 30 11.205 29.684 10.441 29.121 9.879 C 28.559 9.316 27.795 9 27 9 L 9 9 C 8.205 9 7.441 9.316 6.879 9.879 C 6.316 10.441 6 11.205 6 12 M 6.879 21.879 C 6.316 22.441 6 23.205 6 24 C 6 24.795 6.316 25.559 6.879 26.121 C 7.441 26.684 8.205 27 9 27 L 27 27 C 27.795 27 28.559 26.684 29.121 26.121 C 29.684 25.559 30 24.795 30 24 C 30 23.205 29.684 22.441 29.121 21.879 C 28.559 21.316 27.795 21 27 21 L 9 21 C 8.205 21 7.441 21.316 6.879 21.879"
android:valueTo="M 8.326 3.883 C 7.581 3.928 7 4.545 7 5.291 C 7 9.527 7 13.764 7 18 L 29.313 18.467 C 29.841 18.478 30.368 18.489 30.896 18.5 C 31.126 17.896 30.939 17.162 30.314 16.787 C 29.881 16.527 29.448 16.267 29.015 16.007 C 23.259 12.554 17.504 9.101 11.749 5.648 L 9.137 4.08 C 8.893 3.934 8.61 3.866 8.326 3.883 C 8.326 3.883 8.326 3.883 8.326 3.883 M 7 18 C 7 21.162 7 24.324 7 27.486 C 7 28.559 7 29.632 7 30.705 C 6.999 31.803 8.195 32.482 9.137 31.918 L 12.189 30.086 C 17.734 26.759 23.278 23.432 28.822 20.104 C 29.319 19.806 29.817 19.507 30.314 19.209 C 30.937 18.835 31.125 18.104 30.898 17.5 C 30.017 17.518 29.135 17.537 28.254 17.555 L 26.309 17.596 C 19.873 17.731 13.436 17.865 7 18"
android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in" />
</aapt:attr>
......
......@@ -13,22 +13,21 @@
android:pivotY="18">
<path
android:name="path_1"
android:pathData="M 24 30 C 23.205 30 22.441 29.684 21.879 29.121 C 21.316 28.559 21 27.795 21 27 L 21 9 C 21 8.205 21.316 7.441 21.879 6.879 C 22.441 6.316 23.205 6 24 6 C 24.795 6 25.559 6.316 26.121 6.879 C 26.684 7.441 27 8.205 27 9 L 27 27 C 27 27.795 26.684 28.559 26.121 29.121 C 25.559 29.684 24.795 30 24 30 M 12 30 C 11.205 30 10.441 29.684 9.879 29.121 C 9.316 28.559 9 27.795 9 27 L 9 9 C 9 8.205 9.316 7.441 9.879 6.879 C 10.441 6.316 11.205 6 12 6 C 12.795 6 13.559 6.316 14.121 6.879 C 14.684 7.441 15 8.205 15 9 L 15 27 C 15 27.795 14.684 28.559 14.121 29.121 C 13.559 29.684 12.795 30 12 30"
android:pathData="M 8.326 3.883 C 7.581 3.928 7 4.545 7 5.291 L 7 18 L 30.896 18.5 C 31.126 17.896 30.939 17.162 30.314 16.787 L 9.137 4.08 C 8.893 3.934 8.61 3.866 8.326 3.883 Z M 7 18 L 7 30.705 C 6.999 31.803 8.195 32.482 9.137 31.918 L 30.314 19.209 C 30.937 18.835 31.125 18.104 30.898 17.5 Z"
android:fillColor="?attr/player_icon_color"
android:strokeWidth="1"
android:fillType="evenOdd" />
android:strokeWidth="1"/>
</group>
</vector>
</aapt:attr>
<target android:name="path_1">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="pathData"
android:duration="300"
android:valueFrom="M 6.66 3.001 C 6.66 3.001 6.66 3.001 6.66 3.001 C 5.869 3.049 5.251 3.705 5.251 4.498 C 5.251 8.922 5.251 13.347 5.251 17.771 L 18 17.907 C 22.249 17.952 26.499 17.998 30.748 18.043 C 30.763 17.531 30.521 17.012 30.021 16.712 C 27.521 15.212 25.021 13.712 22.521 12.212 C 20.021 10.712 17.521 9.212 15.021 7.712 L 7.522 3.212 C 7.262 3.057 6.962 2.983 6.66 3.001 M 5.251 24.634 C 5.251 26.922 5.251 29.209 5.251 31.497 C 5.25 32.663 6.521 33.385 7.522 32.786 C 9.397 31.661 11.271 30.536 13.146 29.411 L 18.771 26.035 C 20.646 24.91 22.521 23.785 24.396 22.66 C 26.271 21.534 28.146 20.409 30.021 19.284 C 30.491 19.001 30.734 18.525 30.748 18.043 C 26.499 17.998 22.249 17.952 18 17.907 L 5.251 17.771 C 5.251 20.059 5.251 22.346 5.251 24.634"
android:valueTo="M 6.879 9.879 C 6.316 10.441 6 11.205 6 12 C 6 12.795 6.316 13.559 6.879 14.121 C 7.441 14.684 8.205 15 9 15 L 27 15 C 27.795 15 28.559 14.684 29.121 14.121 C 29.684 13.559 30 12.795 30 12 C 30 11.205 29.684 10.441 29.121 9.879 C 28.559 9.316 27.795 9 27 9 L 9 9 C 8.205 9 7.441 9.316 6.879 9.879 M 6.879 21.879 C 6.316 22.441 6 23.205 6 24 C 6 24.795 6.316 25.559 6.879 26.121 C 7.441 26.684 8.205 27 9 27 L 27 27 C 27.795 27 28.559 26.684 29.121 26.121 C 29.684 25.559 30 24.795 30 24 C 30 23.205 29.684 22.441 29.121 21.879 C 28.559 21.316 27.795 21 27 21 L 9 21 C 8.205 21 7.441 21.316 6.879 21.879"
android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in" />
android:propertyName="pathData"
android:duration="300"
android:valueFrom="M 8.326 3.883 C 7.581 3.928 7 4.545 7 5.291 C 7 9.527 7 13.764 7 18 L 29.313 18.467 C 29.841 18.478 30.368 18.489 30.896 18.5 C 31.126 17.896 30.939 17.162 30.314 16.787 C 29.881 16.527 29.448 16.267 29.015 16.007 C 23.259 12.554 17.504 9.101 11.749 5.648 L 9.137 4.08 C 8.893 3.934 8.61 3.866 8.326 3.883 C 8.326 3.883 8.326 3.883 8.326 3.883 M 7 18 C 7 21.162 7 24.324 7 27.486 C 7 28.559 7 29.632 7 30.705 C 6.999 31.803 8.195 32.482 9.137 31.918 L 12.189 30.086 C 17.734 26.759 23.278 23.432 28.822 20.104 C 29.319 19.806 29.817 19.507 30.314 19.209 C 30.937 18.835 31.125 18.104 30.898 17.5 C 30.017 17.518 29.135 17.537 28.254 17.555 L 26.309 17.596 C 19.873 17.731 13.436 17.865 7 18"
android:valueTo="M 6 12 C 6 12.795 6.316 13.559 6.879 14.121 C 7.441 14.684 8.205 15 9 15 L 27 15 C 27.795 15 28.559 14.684 29.121 14.121 C 29.684 13.559 30 12.795 30 12 C 30 11.205 29.684 10.441 29.121 9.879 C 28.559 9.316 27.795 9 27 9 L 9 9 C 8.205 9 7.441 9.316 6.879 9.879 C 6.316 10.441 6 11.205 6 12 M 6.879 21.879 C 6.316 22.441 6 23.205 6 24 C 6 24.795 6.316 25.559 6.879 26.121 C 7.441 26.684 8.205 27 9 27 L 27 27 C 27.795 27 28.559 26.684 29.121 26.121 C 29.684 25.559 30 24.795 30 24 C 30 23.205 29.684 22.441 29.121 21.879 C 28.559 21.316 27.795 21 27 21 L 9 21 C 8.205 21 7.441 21.316 6.879 21.879"
android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="group">
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="15.1181097"
android:fillColor="@color/player_circle_background_tv"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:strokeLineCap="butt"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6.668,5.5 L5.5,6.6426l4.1895,4.1894 1.168,-1.1425zM13.2695,6.6426 L14.7168,8.0898 4.7891,18.0176 4.332,18.4746 5.4746,19.6426 5.957,19.1602 15.8594,9.2323 17.332,10.705v-4.0625zM13.1426,14.2852 L11.9746,15.4277 14.7422,18.1698 13.2695,19.6425L18.5,19.6425v-4.0625l-1.4473,1.4473z"
android:strokeWidth="0.40625"
android:fillColor="@color/orange500"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:fillAlpha="1"/>
</vector>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background"
android:gravity="center_vertical|fill_horizontal">
<shape android:shape="rectangle">
<corners android:radius="1dp"/>
<size android:height="2dp"/>
<solid android:color="@color/audio_tv_progressbar_background"/>
</shape>
</item>
<!-- Define the progress properties like start color, end color etc -->
<item
android:id="@android:id/progress"
android:gravity="center">
android:id="@android:id/progress"
android:gravity="center">
<clip>
<shape>
<shape android:shape="rectangle">
<corners android:radius="1dp"/>
<size android:height="2dp"/>
<solid android:color="@color/orange500" />
</shape>
</clip>
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="progress"
type="androidx.lifecycle.LiveData&lt;org.videolan.vlc.viewmodels.PlaybackProgress>" />
name="progress"
type="androidx.lifecycle.LiveData&lt;org.videolan.vlc.viewmodels.PlaybackProgress>"/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/background"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/background"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/album_cover"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/half_default_margin"
android:scaleType="fitCenter"
android:src="@drawable/ic_no_artwork_big"
app:layout_constraintBottom_toTopOf="@+id/media_title"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/playlist"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread" />
android:id="@+id/album_cover"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/half_default_margin"
android:scaleType="fitCenter"
android:src="@drawable/ic_no_artwork_big"
app:layout_constraintBottom_toTopOf="@+id/media_title"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/playlist"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread"/>
<TextView
android:id="@+id/media_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title"
app:layout_constraintBottom_toTopOf="@+id/media_artist"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/playlist"
app:layout_constraintTop_toBottomOf="@+id/album_cover"
tools:text="Title" />
android:id="@+id/media_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title"
app:layout_constraintBottom_toTopOf="@+id/media_artist"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/playlist"
app:layout_constraintTop_toBottomOf="@+id/album_cover"
tools:text="Title"
android:layout_marginTop="4dp"/>
<TextView
android:id="@+id/media_artist"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Subtitle"
app:layout_constraintBottom_toTopOf="@+id/media_progress"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/playlist"
app:layout_constraintTop_toBottomOf="@+id/media_title"
tools:text="Artist" />
android:id="@+id/media_artist"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Subtitle"
app:layout_constraintBottom_toTopOf="@+id/media_progress"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/playlist"
app:layout_constraintTop_toBottomOf="@+id/media_title"
tools:text="Artist"
android:layout_marginBottom="4dp"/>
<TextView
android:id="@+id/media_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{progress.timeText}"
app:layout_constraintBottom_toBottomOf="@+id/media_progress"
app:layout_constraintLeft_toLeftOf="@+id/album_cover"
app:layout_constraintRight_toLeftOf="@+id/media_progress"
app:layout_constraintTop_toTopOf="@+id/media_progress"
tools:text="0:30" />
android:id="@+id/media_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{progress.timeText}"
app:layout_constraintBottom_toBottomOf="@+id/media_progress"
app:layout_constraintLeft_toLeftOf="@+id/album_cover"
app:layout_constraintRight_toLeftOf="@+id/media_progress"
app:layout_constraintTop_toTopOf="@+id/media_progress"
tools:text="0:30"
android:layout_marginLeft="16dp"/>
<ProgressBar
android:id="@+id/media_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_margin="@dimen/half_default_margin"
android:background="@drawable/background_item"
android:focusable="true"
android:indeterminate="false"
android:layoutDirection="ltr"
android:max="@{(int)progress.length}"
android:nextFocusUp="@+id/playlist"
android:nextFocusDown="@+id/button_play"
android:progress="@{(int)progress.time}"
android:progressDrawable="@drawable/tv_audioprogressbar"
app:layout_constraintBottom_toTopOf="@+id/button_play"
app:layout_constraintLeft_toRightOf="@+id/media_time"
app:layout_constraintRight_toLeftOf="@+id/media_length"
app:layout_constraintTop_toBottomOf="@+id/media_artist" />
android:id="@+id/media_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_margin="@dimen/half_default_margin"
android:background="@drawable/background_item"
android:focusable="true"
android:indeterminate="false"
android:layoutDirection="ltr"
android:max="@{(int)progress.length}"
android:nextFocusUp="@+id/playlist"
android:nextFocusDown="@+id/button_play"
android:secondaryProgress="0"
android:progress="@{(int)progress.time}"
android:progressDrawable="@drawable/tv_audioprogressbar"
app:layout_constraintBottom_toTopOf="@+id/button_play"
app:layout_constraintLeft_toRightOf="@+id/media_time"
app:layout_constraintRight_toLeftOf="@+id/media_length"
app:layout_constraintTop_toBottomOf="@+id/media_artist"/>
<TextView
android:id="@+id/media_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{progress.lengthText}"
app:layout_constraintBottom_toBottomOf="@+id/media_progress"
app:layout_constraintLeft_toRightOf="@+id/media_progress"
app:layout_constraintRight_toRightOf="@+id/album_cover"
app:layout_constraintTop_toTopOf="@+id/media_progress"
tools:text="3:52" />
android:id="@+id/media_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{progress.lengthText}"
app:layout_constraintBottom_toBottomOf="@+id/media_progress"
app:layout_constraintLeft_toRightOf="@+id/media_progress"
app:layout_constraintRight_toRightOf="@+id/album_cover"
app:layout_constraintTop_toTopOf="@+id/media_progress"
tools:text="3:52"
app:layout_constraintEnd_toStartOf="@+id/playlist"
android:layout_marginEnd="16dp"/>
<ImageView
android:id="@+id/button_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusDown="@+id/playlist"
android:onClick="onClick"
android:src="@drawable/ic_repeat_w"
app:layout_constraintBottom_toBottomOf="@+id/button_previous"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintLeft_toLeftOf="@+id/album_cover"
app:layout_constraintRight_toLeftOf="@+id/button_previous"
app:layout_constraintTop_toTopOf="@+id/button_previous"
tools:src="@drawable/ic_repeat" />
android:id="@+id/button_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusDown="@+id/playlist"
android:background="@drawable/ic_circle_audio_player"
android:onClick="onClick"
android:padding="8dp"
android:src="@drawable/ic_repeat_normal_w"
app:layout_constraintBottom_toBottomOf="@+id/button_previous"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintLeft_toLeftOf="@+id/album_cover"
app:layout_constraintRight_toLeftOf="@+id/button_previous"
app:layout_constraintTop_toTopOf="@+id/button_previous"
tools:src="@drawable/ic_repeat"/>
<ImageView
android:id="@+id/button_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusDown="@+id/playlist"
android:onClick="onClick"
android:src="@drawable/ic_previous_w"
app:layout_constraintBottom_toBottomOf="@+id/button_play"
app:layout_constraintLeft_toRightOf="@+id/button_repeat"
app:layout_constraintRight_toLeftOf="@+id/button_play"
app:layout_constraintTop_toTopOf="@+id/button_play"
tools:src="@drawable/ic_previous" />
android:id="@+id/button_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:padding="8dp"
android:nextFocusDown="@+id/playlist"
android:background="@drawable/ic_circle_audio_player"
android:onClick="onClick"
android:src="@drawable/ic_previous_normal_w"
app:layout_constraintBottom_toBottomOf="@+id/button_play"
app:layout_constraintLeft_toRightOf="@+id/button_repeat"
app:layout_constraintRight_toLeftOf="@+id/button_play"
app:layout_constraintTop_toTopOf="@+id/button_play"
tools:src="@drawable/ic_previous"/>
<ImageView
android:id="@+id/button_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusDown="@+id/playlist"
android:onClick="onClick"
app:layout_constraintBottom_toBottomOf="@+id/button_next"
app:layout_constraintLeft_toRightOf="@+id/button_previous"
app:layout_constraintRight_toLeftOf="@+id/button_next"
app:layout_constraintTop_toTopOf="@+id/button_next"
tools:src="@drawable/ic_play">
<requestFocus />
android:id="@+id/button_play"
android:layout_width="64dp"
android:layout_height="64dp"
android:padding="8dp"
android:clickable="true"
android:focusable="true"
android:nextFocusDown="@+id/playlist"
android:background="@drawable/ic_circle_audio_player"
android:onClick="onClick"
app:layout_constraintBottom_toBottomOf="@+id/button_next"
app:layout_constraintLeft_toRightOf="@+id/button_previous"
app:layout_constraintRight_toLeftOf="@+id/button_next"
app:layout_constraintTop_toTopOf="@+id/button_next"
tools:src="@drawable/ic_play"
>
<requestFocus/>
</ImageView>
<ImageView
android:id="@+id/button_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusDown="@+id/playlist"
android:onClick="onClick"
android:src="@drawable/ic_next_w"
app:layout_constraintBottom_toBottomOf="@+id/button_shuffle"
app:layout_constraintLeft_toRightOf="@+id/button_play"
app:layout_constraintRight_toLeftOf="@+id/button_shuffle"
app:layout_constraintTop_toTopOf="@+id/button_shuffle"
tools:src="@drawable/ic_next" />
android:id="@+id/button_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:padding="8dp"
android:nextFocusDown="@+id/playlist"
android:background="@drawable/ic_circle_audio_player"
android:onClick="onClick"
android:src="@drawable/ic_next_normal_w"
app:layout_constraintBottom_toBottomOf="@+id/button_shuffle"
app:layout_constraintLeft_toRightOf="@+id/button_play"
app:layout_constraintRight_toLeftOf="@+id/button_shuffle"
app:layout_constraintTop_toTopOf="@+id/button_shuffle"
tools:src="@drawable/ic_next"/>
<ImageView
android:id="@+id/button_shuffle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:nextFocusRight="@id/playlist"
android:nextFocusDown="@+id/button_shuffle"
android:onClick="onClick"
android:src="@drawable/ic_shuffle_w"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/button_next"
app:layout_constraintRight_toRightOf="@+id/album_cover"
app:layout_constraintTop_toBottomOf="@+id/media_progress"
tools:src="@drawable/ic_shuffle" />
android:id="@+id/button_shuffle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:padding="8dp"
android:nextFocusRight="@id/playlist"
android:nextFocusDown="@+id/button_shuffle"
android:background="@drawable/ic_circle_audio_player"
android:onClick="onClick"
app:srcCompat="@drawable/ic_shuffle_normal_w"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/button_next"
app:layout_constraintRight_toRightOf="@+id/album_cover"
app:layout_constraintTop_toBottomOf="@+id/media_progress"
tools:src="@drawable/ic_shuffle"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"/>
<!-- Playlist -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playlist"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/half_default_margin"
android:nextFocusLeft="@+id/button_play"
android:nextFocusRight="@+id/playlist"
android:nextFocusUp="@+id/playlist"
android:nextFocusDown="@+id/playlist"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/album_cover"
app:layout_constraintRight_toRightOf="@+id/background"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/playlist"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/half_default_margin"
android:nextFocusLeft="@+id/button_play"
android:nextFocusRight="@+id/playlist"
android:nextFocusUp="@+id/playlist"
android:nextFocusDown="@+id/playlist"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/album_cover"
app:layout_constraintRight_toRightOf="@+id/background"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
......@@ -120,7 +120,7 @@ class AudioPlayerActivity : BaseTvActivity() {
binding.buttonShuffle.setImageResource(if (shuffling)
R.drawable.ic_shuffle_on
else
R.drawable.ic_shuffle_w)
R.drawable.ic_shuffle_normal_w)
if (mw == null || TextUtils.equals(currentCoverArt, mw.artworkMrl)) return
currentCoverArt = mw.artworkMrl
updateBackground()
......@@ -243,15 +243,15 @@ class AudioPlayerActivity : BaseTvActivity() {
when (model.repeatType) {
REPEAT_NONE -> {
model.repeatType = REPEAT_ALL
binding.buttonRepeat.setImageResource(R.drawable.ic_repeat_all)
binding.buttonRepeat.setImageResource(R.drawable.ic_repeat_normal_o)
}
REPEAT_ALL -> {
model.repeatType = REPEAT_ONE
binding.buttonRepeat.setImageResource(R.drawable.ic_repeat_one)
binding.buttonRepeat.setImageResource(R.drawable.ic_repeat_one_pressed)
}
REPEAT_ONE -> {
model.repeatType = REPEAT_NONE
binding.buttonRepeat.setImageResource(R.drawable.ic_repeat_w)
binding.buttonRepeat.setImageResource(R.drawable.ic_repeat_normal_w)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment