diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index da5be8e6f..81b4e6c4b 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -308,6 +308,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { if (!exoPlayer.isPlaying) { // start or go on playing binding.playImageView.setImageResource(R.drawable.ic_pause) + if (exoPlayer.playbackState == Player.STATE_ENDED) { + // restart video if finished + exoPlayer.seekTo(0) + } exoPlayer.play() } else { // pause the video @@ -823,13 +827,20 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { if (binding.player.autoplayEnabled) playNextVideo() } - if (playbackState == Player.STATE_READY) { - // media actually playing - transitioning = false - binding.playImageView.setImageResource(R.drawable.ic_pause) - } else { - // player paused in any state - binding.playImageView.setImageResource(R.drawable.ic_play) + when (playbackState) { + Player.STATE_READY -> { + // media actually playing + transitioning = false + binding.playImageView.setImageResource(R.drawable.ic_pause) + } + Player.STATE_ENDED -> { + // video has finished + binding.playImageView.setImageResource(R.drawable.ic_restart) + } + else -> { + // player in any other state + binding.playImageView.setImageResource(R.drawable.ic_play) + } } // save the watch position when paused diff --git a/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt b/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt index 5320780e5..1c4c85466 100644 --- a/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt +++ b/app/src/main/java/com/github/libretube/workers/NotificationWorker.kt @@ -177,7 +177,7 @@ class NotificationWorker(appContext: Context, parameters: WorkerParameters) : val builder = NotificationCompat.Builder(applicationContext, PUSH_CHANNEL_ID) .setContentTitle(title) .setGroup(group) - .setSmallIcon(R.drawable.ic_notification) + .setSmallIcon(R.drawable.ic_launcher_lockscreen) .setPriority(NotificationCompat.PRIORITY_DEFAULT) // Set the intent that will fire when the user taps the notification .setContentIntent(pendingIntent) diff --git a/app/src/main/res/drawable/ic_forward.xml b/app/src/main/res/drawable/ic_forward.xml index 1f165a420..580ecf823 100644 --- a/app/src/main/res/drawable/ic_forward.xml +++ b/app/src/main/res/drawable/ic_forward.xml @@ -1,6 +1,6 @@ diff --git a/app/src/main/res/drawable/ic_launcher_lockscreen.xml b/app/src/main/res/drawable/ic_launcher_lockscreen.xml new file mode 100644 index 000000000..1c2eb3863 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_lockscreen.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_restart.xml b/app/src/main/res/drawable/ic_restart.xml new file mode 100644 index 000000000..576fccffe --- /dev/null +++ b/app/src/main/res/drawable/ic_restart.xml @@ -0,0 +1,12 @@ + + + diff --git a/app/src/main/res/drawable/ic_rewind.xml b/app/src/main/res/drawable/ic_rewind.xml index 843bba82b..abb2576c5 100644 --- a/app/src/main/res/drawable/ic_rewind.xml +++ b/app/src/main/res/drawable/ic_rewind.xml @@ -1,6 +1,6 @@ diff --git a/app/src/main/res/layout/double_tap_overlay.xml b/app/src/main/res/layout/double_tap_overlay.xml index 717b05544..3f9cab4d3 100644 --- a/app/src/main/res/layout/double_tap_overlay.xml +++ b/app/src/main/res/layout/double_tap_overlay.xml @@ -34,7 +34,7 @@ android:layout_gravity="center" android:layout_marginTop="2dp" android:textColor="@android:color/white" - android:textSize="11sp" /> + android:textSize="12sp" /> @@ -75,7 +75,7 @@ android:layout_gravity="center" android:layout_marginTop="2dp" android:textColor="@android:color/white" - android:textSize="11sp" /> + android:textSize="12sp" /> diff --git a/app/src/main/res/values/drawables.xml b/app/src/main/res/values/drawables.xml index ba8b31ed0..6f99af375 100644 --- a/app/src/main/res/values/drawables.xml +++ b/app/src/main/res/values/drawables.xml @@ -3,5 +3,6 @@ @drawable/ic_play @drawable/ic_pause + @drawable/ic_launcher_lockscreen \ No newline at end of file