diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 5fef9054c..0b160c191 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -11,6 +11,8 @@ import android.net.Uri import android.os.Build import android.os.Build.VERSION.SDK_INT import android.os.Bundle +import android.os.Handler +import android.os.Looper import android.os.PowerManager import android.support.v4.media.session.MediaSessionCompat import android.text.Html @@ -847,21 +849,30 @@ class PlayerFragment : Fragment() { val seekIncrement = PreferenceHelper.getString(requireContext(), "seek_increment", "5")?.toLong()!! * 1000 - playerBinding.rewindFL.setOnClickListener( + binding.rewindFL.setOnClickListener( DoubleClickListener( callback = object : DoubleClickListener.Callback { override fun doubleClicked() { + binding.rewindBTN.visibility = View.VISIBLE exoPlayer.seekTo(exoPlayer.currentPosition - seekIncrement) + Handler(Looper.getMainLooper()).postDelayed({ + binding.rewindBTN.visibility = View.INVISIBLE + }, 500) } } ) ) - playerBinding.forwardFL.setOnClickListener( + + binding.forwardFL.setOnClickListener( DoubleClickListener( callback = object : DoubleClickListener.Callback { override fun doubleClicked() { + binding.forwardBTN.visibility = View.VISIBLE exoPlayer.seekTo(exoPlayer.currentPosition + seekIncrement) + Handler(Looper.getMainLooper()).postDelayed({ + binding.forwardBTN.visibility = View.INVISIBLE + }, 500) } } ) diff --git a/app/src/main/res/drawable/ic_forward.xml b/app/src/main/res/drawable/ic_forward.xml new file mode 100644 index 000000000..8108f0bc6 --- /dev/null +++ b/app/src/main/res/drawable/ic_forward.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_rewind.xml b/app/src/main/res/drawable/ic_rewind.xml new file mode 100644 index 000000000..54921898a --- /dev/null +++ b/app/src/main/res/drawable/ic_rewind.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/exo_styled_player_control_view.xml b/app/src/main/res/layout/exo_styled_player_control_view.xml index 8a1f8c1bc..059fb7020 100644 --- a/app/src/main/res/layout/exo_styled_player_control_view.xml +++ b/app/src/main/res/layout/exo_styled_player_control_view.xml @@ -170,7 +170,6 @@ android:id="@+id/progress_bar" android:layout_width="match_parent" android:layout_height="15dp" - android:layout_above="@id/exo_basic_controls" android:layout_gravity="bottom" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" @@ -207,53 +206,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" - android:background="@android:color/transparent" android:clipToPadding="false" android:gravity="center" android:padding="@dimen/exo_styled_controls_padding"> - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index 57588ced3..a477eaf32 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -362,7 +362,47 @@ app:layout_constraintBottom_toBottomOf="@id/main_container" app:layout_constraintStart_toStartOf="@id/main_container" app:layout_constraintTop_toTopOf="@id/main_container" - app:show_buffering="always" /> + app:show_buffering="always" > + + + + + + + + + + + + + +