Merge pull request #1824 from GilesMunn/master

Minor visual edits
This commit is contained in:
Bnyro 2022-11-12 19:27:14 +01:00 committed by GitHub
commit b9ca17cd77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 51 additions and 14 deletions

View File

@ -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

View File

@ -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)

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:width="45dp"
android:height="45dp"
android:tint="@android:color/white"
android:viewportWidth="24"
android:viewportHeight="24">

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="1280"
android:viewportHeight="1280">
<path
android:fillColor="#000"
android:pathData="M1130.145 639.54c0-6.202-3.236-11.865-8.358-14.831L225.77 93.247c-15.64-9.168-35.324 2.157-35.324 20.493v229.194c0 8.629 4.584 16.449 11.864 20.762l446.525 255.619c15.91 9.169 15.91 32.358 0 41.525L202.31 916.46c-7.28 4.315-11.864 12.135-11.864 20.763v228.925c0 18.336 19.684 29.93 35.324 20.493l895.747-532.271c5.122-3.236 8.359-8.898 8.359-14.83h0.269Z"
android:strokeWidth="30"
android:strokeColor="#000"/>
<path android:fillColor="#000"
android:pathData="M373.802 625.518c11.325 6.471 11.325 22.92 0 29.391L174.807 769.507c-11.055 6.47-24.807-1.619-24.807-14.561V525.482c0-12.944 13.752-21.033 24.807-14.562l198.995 114.598Z"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:strokeWidth="0.8"
android:strokeColor="@android:color/black"
android:pathData="M11.707,1.707 L7.414,6 11.707,10.293V7A0.292,0.292 0,0 1,12 6.707c3.468,0 6.293,2.825 6.293,6.293 0,3.468 -2.825,6.293 -6.293,6.293 -3.368,0 -6.107,-2.67 -6.264,-6H4.322C4.479,17.416 7.838,20.707 12,20.707 16.262,20.707 19.707,17.262 19.707,13 19.707,8.738 16.262,5.293 12,5.293A0.292,0.292 0,0 1,11.707 5Z" />
</vector>

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:width="45dp"
android:height="45dp"
android:tint="@android:color/white"
android:viewportWidth="24"
android:viewportHeight="24">

View File

@ -34,7 +34,7 @@
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="@android:color/white"
android:textSize="11sp" />
android:textSize="12sp" />
</FrameLayout>
@ -75,7 +75,7 @@
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="@android:color/white"
android:textSize="11sp" />
android:textSize="12sp" />
</FrameLayout>

View File

@ -3,5 +3,6 @@
<drawable name="exo_styled_controls_play">@drawable/ic_play</drawable>
<drawable name="exo_styled_controls_pause">@drawable/ic_pause</drawable>
<drawable name="exo_notification_small_icon">@drawable/ic_launcher_lockscreen</drawable>
</resources>