Merge pull request #4833 from vkay94/youtube-rewind-forward
YouTube's Fast Forward/Rewind behavior
This commit is contained in:
commit
2886bc3b01
12 changed files with 643 additions and 144 deletions
11
app/src/main/res/drawable/ic_play_seek_triangle.xml
Normal file
11
app/src/main/res/drawable/ic_play_seek_triangle.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="16dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M3,2 L22,12 L3,22 Z" />
|
||||
|
||||
</vector>
|
||||
|
|
@ -54,11 +54,21 @@
|
|||
tools:ignore="ContentDescription"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/playbackControlsShadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignBottom="@+id/playbackControlRoot"
|
||||
android:background="@color/video_overlay_color"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- transparent background is needed for selectableItemBackgroundBorderless to work -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/playbackControlRoot"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/video_overlay_color"
|
||||
android:background="@color/transparent_background_color"
|
||||
android:fitsSystemWindows="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
|
@ -469,8 +479,8 @@
|
|||
android:padding="@dimen/player_main_buttons_padding"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
app:tint="@color/white"
|
||||
app:srcCompat="@drawable/ic_fullscreen"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription,RtlHardcoded"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
|
@ -493,8 +503,8 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:scaleType="fitCenter"
|
||||
app:tint="@color/white"
|
||||
app:srcCompat="@drawable/ic_previous"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
|
|
@ -505,8 +515,8 @@
|
|||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:scaleType="fitCenter"
|
||||
app:tint="@color/white"
|
||||
app:srcCompat="@drawable/ic_pause"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
|
|
@ -519,8 +529,8 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:scaleType="fitCenter"
|
||||
app:tint="@color/white"
|
||||
app:srcCompat="@drawable/ic_next"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -572,8 +582,8 @@
|
|||
android:focusable="true"
|
||||
android:padding="10dp"
|
||||
android:scaleType="fitXY"
|
||||
app:tint="@color/white"
|
||||
app:srcCompat="@drawable/ic_close" />
|
||||
app:srcCompat="@drawable/ic_close"
|
||||
app:tint="@color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/repeatButton"
|
||||
|
|
@ -637,24 +647,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/controlAnimationView"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/background_oval_black_transparent"
|
||||
android:padding="15dp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_fast_rewind"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_panel"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -754,4 +746,11 @@
|
|||
android:textColor="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<org.schabi.newpipe.views.player.PlayerFastSeekOverlay
|
||||
android:id="@+id/fast_seek_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:visibility="invisible" /> <!-- Required for the first appearance fading correctly -->
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -54,11 +54,21 @@
|
|||
tools:ignore="ContentDescription"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/playbackControlsShadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_alignBottom="@+id/playbackControlRoot"
|
||||
android:background="@color/video_overlay_color"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- transparent background is needed for selectableItemBackgroundBorderless to work -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/playbackControlRoot"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/video_overlay_color"
|
||||
android:background="@color/transparent_background_color"
|
||||
android:fitsSystemWindows="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
|
@ -633,24 +643,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/controlAnimationView"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/background_oval_black_transparent"
|
||||
android:padding="15dp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_fast_rewind"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_panel"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -751,4 +743,11 @@
|
|||
android:textColor="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<org.schabi.newpipe.views.player.PlayerFastSeekOverlay
|
||||
android:id="@+id/fast_seek_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:visibility="invisible" /> <!-- Required for the first appearance fading correctly -->
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
27
app/src/main/res/layout/player_fast_seek_overlay.xml
Normal file
27
app/src/main/res/layout/player_fast_seek_overlay.xml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?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"
|
||||
android:id="@+id/root_constraint_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.schabi.newpipe.views.player.CircleClipTapView
|
||||
android:id="@+id/circle_clip_tap_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:focusable="false" />
|
||||
|
||||
<org.schabi.newpipe.views.player.SecondsView
|
||||
android:id="@+id/seconds_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_default="percent"
|
||||
app:layout_constraintWidth_percent="0.5" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
51
app/src/main/res/layout/player_fast_seek_seconds_view.xml
Normal file
51
app/src/main/res/layout/player_fast_seek_seconds_view.xml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge 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"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:layout_height="wrap_content"
|
||||
tools:layout_width="match_parent"
|
||||
tools:orientation="vertical"
|
||||
tools:parentTag="android.widget.LinearLayout">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/triangle_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/icon_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_play_seek_triangle"
|
||||
tools:alpha="0.18" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/icon_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_play_seek_triangle"
|
||||
tools:alpha="0.5" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/icon_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_play_seek_triangle"
|
||||
tools:alpha="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_seconds"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
tools:text="20 seconds" />
|
||||
|
||||
</merge>
|
||||
Loading…
Add table
Add a link
Reference in a new issue