Commit 3ecff4d7 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy

Implement new tracks icons + more cleanup

parent d9accbfc
Pipeline #55573 passed with stage
in 3 minutes and 20 seconds
<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="m8,5c-1.108,0 -2,0.892 -2,2v2L4,9v-2l-3,3 3,3v-2h2v3c0,1.108 0.892,2 2,2h3l-0.4844,3.3789c-0.1212,0.4908 0.4793,0.8309 0.8379,0.4746L15,16h1c1.108,0 2,-0.892 2,-2v-3h2v2l3,-3 -3,-3v2h-2v-2c0,-1.108 -0.892,-2 -2,-2zM8,7h1.6504v1.5L8,8.5ZM11,7h5v1.5h-5zM8,9.5h4.5v1.5L8,11ZM14,9.5h2v1.5h-2zM8,12h3.5v1.5L8,13.5ZM13,12h3v1.5h-3z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="1"
android:fillColor="@color/standard_selection_control_normal"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:fillAlpha="1"
android:strokeLineCap="round" />
</vector>
<!--
~ *************************************************************************
~ ic_am_downsub.xml
~ ic_ctx_download.xml
~ **************************************************************************
~ Copyright © 2020 VLC authors and VideoLAN
~ Copyright © 2021 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
......@@ -23,18 +23,15 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="m6,5c-1.108,0 -2,0.892 -2,2v10c0,1.108 0.892,2 2,2h12c1.108,0 2,-0.892 2,-2v-10c0,-1.108 -0.892,-2 -2,-2h-5v3h2l-3,3 -3,-3h2v-3zM6,13h2.5v1.5L6,14.5ZM10,13h8v1.5h-8zM6,15.5h8v1.5L6,17ZM15.5,15.5L18,15.5v1.5h-2.5z"
android:strokeAlpha="1"
android:pathData="M16.5,6C15.6716,6.0001 15.0001,6.6716 15,7.5L15,15.5L12.5,15.5C11.1641,15.5006 10.4952,17.1156 11.4395,18.0605L18.9395,25.5605C19.5253,26.146 20.4747,26.146 21.0605,25.5605L28.5605,18.0605C29.5048,17.1156 28.8359,15.5006 27.5,15.5L25,15.5L25,7.5C24.9999,6.6716 24.3284,6.0001 23.5,6L16.5,6zM18,9L22,9L22,18.5L23.8789,18.5L20,22.3789L16.1211,18.5L18,18.5L18,9zM9.5,29C8.669,29 8,29.669 8,30.5C8,31.331 8.669,32 9.5,32L30.5,32C31.331,32 32,31.331 32,30.5C32,29.669 31.331,29 30.5,29L9.5,29z"
android:strokeLineJoin="round"
android:strokeWidth="1"
android:fillColor="?attr/colorControlNormal"
android:strokeWidth="0.755906"
android:fillColor="#212121"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:fillAlpha="1"
android:strokeLineCap="round" />
android:strokeLineCap="round"/>
</vector>
<!--
~ *************************************************************************
~ ic_downsub_normal_w.xml
~ ic_delay.xml
~ **************************************************************************
~ Copyright © 2020 VLC authors and VideoLAN
~ Copyright © 2021 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
......@@ -23,18 +23,15 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="45dp"
android:height="45dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="24dp"
android:height="24dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="m6,5c-1.108,0 -2,0.892 -2,2v10c0,1.108 0.892,2 2,2h12c1.108,0 2,-0.892 2,-2v-10c0,-1.108 -0.892,-2 -2,-2h-5v3h2l-3,3 -3,-3h2v-3zM6,13h2.5v1.5L6,14.5ZM10,13h8v1.5h-8zM6,15.5h8v1.5L6,17ZM15.5,15.5L18,15.5v1.5h-2.5z"
android:strokeAlpha="1"
android:pathData="m33.1181,2.0057c-0.5952,-0.0598 -1.1158,0.3584 -1.1172,0.9941v3h-8v0.004c-0.3866,-0.0001 -0.7734,0.008 -1.1602,0.0332 -1.1736,0.0756 -2.3454,0.2675 -3.498,0.5762 -9.5795,2.5668 -15.2954,12.4654 -12.7285,22.0449 0.286,1.0667 1.3824,1.6998 2.4492,1.4141 1.0668,-0.2859 1.6998,-1.3824 1.4141,-2.4492 -2.0074,-7.4914 2.4089,-15.1392 9.9004,-17.1465 1.1922,-0.3193 2.4103,-0.4611 3.623,-0.4609v-0.0156h8v3c-0.0002,0.8476 0.9808,1.3073 1.6406,0.7676l6,-5c0.4786,-0.3998 0.4786,-1.1354 0,-1.5352l-6,-5c-0.1585,-0.135 -0.34,-0.207 -0.5234,-0.2266zM24.0009,15.9998c-0.831,0 -1.5,0.669 -1.5,1.5v7.5c0,0.4255 0.1762,0.8076 0.459,1.0801l3.8691,3.8691c0.5876,0.5876 1.5335,0.5876 2.1211,0 0.5876,-0.5876 0.5876,-1.5335 0,-2.1211l-3.4492,-3.4492v-6.8789c0,-0.831 -0.669,-1.5 -1.5,-1.5zM39.4579,17.8592c-0.1754,-0.0001 -0.3501,0.0228 -0.5195,0.0683 -1.0668,0.2859 -1.6998,1.3824 -1.4141,2.4492 2.0074,7.4914 -2.4089,15.1392 -9.9004,17.1465 -1.1922,0.3193 -2.4103,0.4611 -3.623,0.4609v0.0156h-8v-3c0.0002,-0.8476 -0.9808,-1.3073 -1.6406,-0.7676l-6,5c-0.4786,0.3998 -0.4786,1.1354 0,1.5352l6,5c0.6341,0.5399 1.6388,0.08 1.6406,-0.7676v-3h8v-0.0195c1.5599,0.0004 3.1257,-0.1834 4.6582,-0.5938 9.5795,-2.5668 15.2903,-12.4877 12.7285,-22.0449 -0.2341,-0.8736 -1.0253,-1.4814 -1.9297,-1.4824z"
android:strokeLineJoin="round"
android:strokeWidth="1"
android:fillColor="@color/standard_selection"
android:strokeWidth="6.29285"
android:fillColor="@color/standard_selection_control_normal"
android:strokeColor="#00000000"
android:fillType="nonZero"
android:fillAlpha="1"
android:strokeLineCap="round" />
android:strokeLineCap="round"/>
</vector>
<!--
~ *************************************************************************
~ ic_download.xml
~ **************************************************************************
~ Copyright © 2021 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
~ ***************************************************************************
~
~
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z" />
android:pathData="m20,6c-1.1,0 -2,0.9 -2,2v10h-3.1797c-1.78,0 -2.6799,2.1599 -1.4199,3.4199l9.1797,9.1797c0.78,0.78 2.0403,0.78 2.8203,0l9.1797,-9.1797C35.8401,20.1599 34.9597,18 33.1797,18L30,18L30,8C30,6.9 29.1,6 28,6ZM22,10h4v12h2.3398L24,26.3398 19.6602,22L22,22ZM12,36c-1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2h24c1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2z"
android:strokeWidth="2"
android:fillColor="@color/standard_selection_control_normal"/>
</vector>
<!--
~ *************************************************************************
~ ic_subtitle_open_normal_w.xml
~ **************************************************************************
~ Copyright © 2020 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
~ ***************************************************************************
~
~
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillAlpha="1"
android:fillColor="@color/standard_selection"
android:fillType="nonZero"
android:pathData="m5,5c-1.108,0 -1.8178,0.9071 -2,2v1,9c0,1.108 0.892,2 2,2h14c1.108,0 2,-0.892 2,-2v-8c0,-1.108 -0.892,-2 -2,-2h-7l-2,-2zM9,13h2v1.5L9,14.5ZM12.5,13L19,13v1.5h-6.5zM9,15.5h5.5v1.5L9,17ZM16,15.5h3v1.5h-3z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
<!--
~ *************************************************************************
~ ic_subtitledelay_normal.xml
~ ic_subtitles_file.xml
~ **************************************************************************
~ Copyright © 2020 VLC authors and VideoLAN
~ Copyright © 2021 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
......@@ -25,16 +25,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillAlpha="1"
android:fillColor="@color/standard_selection_control_normal"
android:fillType="nonZero"
android:pathData="m8,7c-1.108,0 -2.0752,0.8946 -2,2v5L4,14v-2l-3,3 3,3v-2h2c0,1.108 0.892,2 2,2L15.7845,18 16,18c1.108,0 2,-0.892 2,-2h2v2l3,-3 -3,-3v2h-2v-5c0,-1.108 -0.892,-2 -2,-2zM8,12h2v1.5L8,13.5ZM11.5,12L16,12v1.5h-4.5zM8,14.5h4.5v1.5L8,16ZM14,14.5h2v1.5h-2z"
android:strokeWidth="1"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
android:pathData="M12,4C9.8,4 8,5.8 8,8v32c0,2.2 1.7805,4 3.9805,4L36,44c2.2,0 4,-1.8 4,-4L40,16L28,4ZM12,8L26,8L26,18L36,18L36,40L12,40ZM17.5,27c-0.831,0 -1.5,0.669 -1.5,1.5 0,0.831 0.669,1.5 1.5,1.5h2C20.331,30 21,29.331 21,28.5 21,27.669 20.331,27 19.5,27ZM25.5,27c-0.831,0 -1.5,0.669 -1.5,1.5 0,0.831 0.669,1.5 1.5,1.5h5C31.331,30 32,29.331 32,28.5 32,27.669 31.331,27 30.5,27ZM17.5,33c-0.831,0 -1.5,0.669 -1.5,1.5 0,0.831 0.669,1.5 1.5,1.5h5C23.331,36 24,35.331 24,34.5 24,33.669 23.331,33 22.5,33ZM28.5,33c-0.831,0 -1.5,0.669 -1.5,1.5 0,0.831 0.669,1.5 1.5,1.5h2C31.331,36 32,35.331 32,34.5 32,33.669 31.331,33 30.5,33Z"
android:strokeWidth="2"
android:fillColor="@color/standard_selection_control_normal"/>
</vector>
......@@ -24,7 +24,6 @@
<resources>
<attr name="item_footer" format="reference|color" />
<attr name="background_default" format="reference|color" />
<attr name="header_background" format="reference|color" />
<attr name="bottom_navigation_background" format="reference|color" />
......@@ -70,7 +69,6 @@
<attr name="ic_jumpto_normal_style" format="reference" />
<attr name="ic_chapter_normal_style" format="reference" />
<attr name="ic_equalizer_normal_style" format="reference" />
<attr name="ic_audiodelay" format="reference" />
<attr name="ic_playasaudio_off" format="reference" />
<attr name="ic_playasaudio_on" format="reference" />
<attr name="ic_popup_dim" format="reference" />
......
......@@ -28,10 +28,4 @@
android:title="@string/add_to_playlist"
android:icon="@drawable/ic_am_addtoplaylist"
app:showAsAction="always"/>
<item
android:id="@+id/action_mode_file_subtitles_download"
android:title="@string/download_subtitles"
android:visible="false"
android:icon="@drawable/ic_downsub_w"
app:showAsAction="always"/>
</menu>
\ No newline at end of file
......@@ -41,7 +41,7 @@
<item
android:id="@+id/action_video_download_subtitles"
android:title="@string/download_subtitles"
android:icon="@drawable/ic_am_downsub"
android:icon="@drawable/ic_download"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_remove_from_group"
......
......@@ -92,7 +92,7 @@ class ContextSheet : VLCBottomSheetDialogFragment() {
if (flags and CTX_PLAY_AS_AUDIO != 0L) add(Simple(CTX_PLAY_AS_AUDIO, getString(R.string.play_as_audio), R.drawable.ic_ctx_play_as_audio))
if (flags and CTX_APPEND != 0L) add(Simple(CTX_APPEND, getString(R.string.append), R.drawable.ic_ctx_append))
if (flags and CTX_INFORMATION != 0L) add(Simple(CTX_INFORMATION, getString(R.string.info), R.drawable.ic_ctx_information))
if (flags and CTX_DOWNLOAD_SUBTITLES != 0L) add(Simple(CTX_DOWNLOAD_SUBTITLES, getString(R.string.download_subtitles), R.drawable.ic_ctx_download_subtitles))
if (flags and CTX_DOWNLOAD_SUBTITLES != 0L) add(Simple(CTX_DOWNLOAD_SUBTITLES, getString(R.string.download_subtitles), R.drawable.ic_ctx_download))
if (flags and CTX_PLAY_NEXT != 0L) add(Simple(CTX_PLAY_NEXT, getString(R.string.insert_next), R.drawable.ic_ctx_play_next))
if (flags and CTX_ADD_TO_PLAYLIST != 0L) add(Simple(CTX_ADD_TO_PLAYLIST, getString(R.string.add_to_playlist), R.drawable.ic_ctx_add_to_playlist))
if (flags and CTX_SET_RINGTONE != 0L && AndroidDevices.isPhone) add(Simple(CTX_SET_RINGTONE, getString(R.string.set_song), R.drawable.ic_ctx_set_ringtone))
......
......@@ -131,7 +131,7 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
binding.audioTracks.options.addView(generateSeparator())
binding.audioTracks.options.addView(generateOptionItem(getString(R.string.audio_delay), R.drawable.ic_audiodelay, VideoTrackOption.AUDIO_DELAY))
binding.audioTracks.options.addView(generateOptionItem(getString(R.string.audio_delay), R.drawable.ic_delay, VideoTrackOption.AUDIO_DELAY))
binding.audioTracks.options.addView(generateSeparator(true))
binding.audioTracks.options.setAnimationUpdateListener {
binding.audioTracks.trackMore.rotation = if (binding.audioTracks.options.isCollapsed) 180F - (180F * it) else 180F * it
......@@ -139,9 +139,9 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
binding.subtitleTracks.options.addView(generateSeparator())
binding.subtitleTracks.options.addView(generateOptionItem(getString(R.string.spu_delay), R.drawable.ic_subtitledelay, VideoTrackOption.SUB_DELAY))
binding.subtitleTracks.options.addView(generateOptionItem(getString(R.string.subtitle_select), R.drawable.ic_subtitle_open_w, VideoTrackOption.SUB_PICK))
binding.subtitleTracks.options.addView(generateOptionItem(getString(R.string.download_subtitles), R.drawable.ic_am_downsub, VideoTrackOption.SUB_DOWNLOAD))
binding.subtitleTracks.options.addView(generateOptionItem(getString(R.string.spu_delay), R.drawable.ic_delay, VideoTrackOption.SUB_DELAY))
binding.subtitleTracks.options.addView(generateOptionItem(getString(R.string.subtitle_select), R.drawable.ic_subtitles_file, VideoTrackOption.SUB_PICK))
binding.subtitleTracks.options.addView(generateOptionItem(getString(R.string.download_subtitles), R.drawable.ic_download, VideoTrackOption.SUB_DOWNLOAD))
binding.subtitleTracks.options.addView(generateSeparator(true))
binding.subtitleTracks.options.setAnimationUpdateListener {
binding.subtitleTracks.trackMore.rotation = if (binding.subtitleTracks.options.isCollapsed) 180F - (180F * it) else 180F * it
......
......@@ -46,7 +46,6 @@ private const val ACTION_SPU_DELAY = 3
private const val ID_PLAY_AS_AUDIO = 0L
private const val ID_SLEEP = 1L
private const val ID_JUMP_TO = 2L
private const val ID_AUDIO_DELAY = 3L
private const val ID_CHAPTER_TITLE = 5L
private const val ID_PLAYBACK_SPEED = 6L
private const val ID_EQUALIZER = 7L
......@@ -300,17 +299,6 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
else R.drawable.ic_jumpto_disable))
}
private fun initAudioDelay(binding: PlayerOptionItemBinding) {
val audiodelay = service.audioDelay / 1000L
if (audiodelay == 0L) {
binding.optionTitle.text = null
binding.optionIcon.setImageResource(UiTools.getResourceFromAttribute(activity, R.attr.ic_audiodelay))
} else {
binding.optionTitle.text = String.format("%s ms", audiodelay.toString())
binding.optionIcon.setImageResource(R.drawable.ic_audiodelay_on)
}
}
private fun initRepeat(binding: PlayerOptionItemBinding) {
repeatBinding = binding
AppScope.launch(Dispatchers.Main) {
......@@ -356,7 +344,6 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
option.id == ID_SLEEP -> sleepBinding = holder.binding
option.id == ID_CHAPTER_TITLE -> initChapters(holder.binding)
option.id == ID_PLAYBACK_SPEED -> initPlaybackSpeed(holder.binding)
option.id == ID_AUDIO_DELAY -> initAudioDelay(holder.binding)
option.id == ID_JUMP_TO -> initJumpTo(holder.binding)
}
holder.binding.optionIcon.setImageResource(UiTools.getResourceFromAttribute(activity, option.icon))
......
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