feat(YouTube - Playback speed): Show current playback speed on player speed dialog button (#5607)

Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
MarcaD 2025-08-09 04:27:52 +03:00 committed by GitHub
parent 9c0638d128
commit 30176a3318
38 changed files with 780 additions and 774 deletions

View file

@ -1,28 +0,0 @@
<!--
https://github.com/google/material-design-icons/blob/9beae745bb758f3ad56654fb377ea5cf62be4915/symbols/android/slow_motion_video/materialsymbolsoutlined/slow_motion_video_wght200gradN25_24px.xml
Changes made: Icon has been resized.
Copyright 2022 Google
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M 6.0798492,16.70271 Q 5.3667836,15.77782 4.9972798,14.87317 4.6275665,13.96852 4.5,12.83942 h 0.7949215 q 0.1275665,0.9249 0.4677271,1.7656 0.3401706,0.8407 0.8797497,1.53346 z M 4.5,11.16058 Q 4.6373409,10.04469 5.002167,9.14154 5.3667836,8.2386 6.0798492,7.3137 L 6.6423983,7.87793 Q 6.1028192,8.5707 5.7626486,9.40308 5.422488,10.23568 5.2949215,11.16058 Z M 11.110466,19.5 Q 9.8992727,19.32286 9.0431213,18.95346 8.1871793,18.58406 7.2572507,17.89299 l 0.5627586,-0.57382 q 0.6818173,0.52458 1.5126748,0.89527 0.8308479,0.37047 1.7777819,0.49836 z M 7.8625281,6.66442 7.2899951,6.09059 Q 8.2197042,5.39953 9.0758557,5.03823 9.9320071,4.67714 11.152995,4.5 V 5.2872 Q 10.19861,5.41509 9.3677624,5.77746 8.5371243,6.13983 7.8625281,6.66442 Z M 10.32873,14.97101 V 9.02899 L 14.953488,12 Z M 12.827456,19.5 v -0.7872 q 2.53571,-0.36237 4.211668,-2.26097 1.675948,-1.89882 1.675948,-4.45183 0,-2.55301 -1.675948,-4.45183 Q 15.363166,5.64957 12.827456,5.2872 V 4.5 Q 15.70589,4.80844 17.60294,6.95069 19.5,9.09294 19.5,12 q 0,2.8964 -1.89706,5.04398 -1.89705,2.14758 -4.775484,2.45602 z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M2.61759,5 C2.15666,5,1.76994,5.15234,1.46134,5.46094 C1.15275,5.76953,1.00041,6.15625,1.00041,6.61719 L1.00041,17.3828 C1.00041,17.8438,1.15275,18.2305,1.46134,18.5391 C1.76994,18.8477,2.15666,19,2.61759,19 L21.3824,19 C21.8433,19,22.2301,18.8477,22.5387,18.5391 C22.8473,18.2305,22.9996,17.8438,22.9996,17.3829 L22.9996,6.61719 C22.9996,6.15625,22.8473,5.76953,22.5387,5.46094 C22.2301,5.15234,21.8433,5,21.3824,5 Z M2.00041,6 L2.00041,6.61719 C2.00041,6.4375,2.059,6.28906,2.17228,6.17188 C2.28947,6.05859,2.43791,6,2.61759,6 L21.3824,6 C21.5621,6,21.7105,6.05859,21.8277,6.17188 C21.941,6.28907,21.9996,6.4375,21.9996,6.61719 L21.9996,17.3828 C21.9996,17.5625,21.941,17.7109,21.8277,17.8281 C21.7105,17.9414,21.5621,18,21.3824,18 L2.61759,18 C2.43791,18,2.28947,17.9414,2.17228,17.8281 C2.059,17.7109,2.00041,17.3828,2.00041,17.3828 L2.00041,17.3828 L2.00041,6.6172 Z" />
</vector>

View file

@ -6,23 +6,38 @@
android:layout_height="wrap_content"
android:layoutDirection="ltr">
<com.google.android.libraries.youtube.common.ui.TouchImageView
android:id="@+id/revanced_playback_speed_dialog_button"
style="@style/YouTubePlayerButton"
<FrameLayout
android:id="@+id/revanced_playback_speed_dialog_button_container"
android:layout_width="48.0dip"
android:layout_height="60.0dip"
android:paddingTop="6.0dp"
android:paddingBottom="0dp"
android:scaleType="center"
android:src="@drawable/revanced_playback_speed_dialog_button"
yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container"
yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button" />
yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button">
<View
android:id="@+id/revanced_playback_speed_dialog_button_placeholder"
android:layout_width="48.0dip"
android:layout_height="60.0dip"
android:visibility="gone"
yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container"
yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button" />
<com.google.android.libraries.youtube.common.ui.TouchImageView
android:id="@+id/revanced_playback_speed_dialog_button"
style="@style/YouTubePlayerButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:longClickable="false"
android:paddingTop="6.0dp"
android:paddingBottom="0dp"
android:scaleType="center"
android:src="@drawable/revanced_playback_speed_dialog_button_rectangle" />
<TextView
android:id="@+id/revanced_playback_speed_dialog_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-condensed"
android:paddingTop="5.5dp"
android:textColor="@android:color/white"
android:textSize="10dp" />
<View
android:id="@+id/revanced_playback_speed_dialog_button_placeholder"
android:layout_width="48.0dip"
android:layout_height="60.0dip"
android:visibility="gone" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>