Remove "loop none" option (#276)

This commit is contained in:
vfsfitvnm 2022-09-04 20:45:41 +02:00
parent e38443c617
commit 45235acd5d
5 changed files with 30 additions and 92 deletions

View file

@ -194,7 +194,10 @@ class PlayerService : InvincibleService(), Player.Listener, PlaybackStatsListene
.setUsePlatformDiagnostics(false) .setUsePlatformDiagnostics(false)
.build() .build()
player.repeatMode = preferences.getInt(repeatModeKey, Player.REPEAT_MODE_OFF) player.repeatMode = when (preferences.getInt(repeatModeKey, Player.REPEAT_MODE_ALL)) {
Player.REPEAT_MODE_ONE -> Player.REPEAT_MODE_ONE
else -> Player.REPEAT_MODE_ALL
}
player.skipSilenceEnabled = preferences.getBoolean(skipSilenceKey, false) player.skipSilenceEnabled = preferences.getBoolean(skipSilenceKey, false)
player.addListener(this) player.addListener(this)
player.addAnalyticsListener(PlaybackStatsListener(false, this)) player.addAnalyticsListener(PlaybackStatsListener(false, this))

View file

@ -249,29 +249,21 @@ fun Controls(
) )
Image( Image(
painter = painterResource( painter = painterResource(R.drawable.infinite),
if (repeatMode == Player.REPEAT_MODE_ONE) {
R.drawable.repeat_one
} else {
R.drawable.repeat
}
),
contentDescription = null, contentDescription = null,
colorFilter = ColorFilter.tint( colorFilter = ColorFilter.tint(
if (repeatMode == Player.REPEAT_MODE_OFF) { if (repeatMode == Player.REPEAT_MODE_ONE) {
colorPalette.textDisabled
} else {
colorPalette.text colorPalette.text
} else {
colorPalette.textDisabled
} }
), ),
modifier = Modifier modifier = Modifier
.clickable { .clickable {
binder.player.repeatMode binder.player.repeatMode = when (binder.player.repeatMode) {
.plus(2) Player.REPEAT_MODE_ONE -> Player.REPEAT_MODE_ALL
.mod(3) else -> Player.REPEAT_MODE_ONE
.let { }
binder.player.repeatMode = it
}
} }
.weight(1f) .weight(1f)
.size(24.dp) .size(24.dp)

View file

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M256,256s-48,-96 -126,-96c-54.12,0 -98,43 -98,96s43.88,96 98,96c30,0 56.45,-13.18 78,-32"
android:strokeWidth="36"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M256,256s48,96 126,96c54.12,0 98,-43 98,-96s-43.88,-96 -98,-96c-29.37,0 -56.66,13.75 -78,32"
android:strokeWidth="36"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
</vector>

View file

@ -1,34 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M320,120l48,48l-48,48"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M352,168H144a80.24,80.24 0,0 0,-80 80v16"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M192,392l-48,-48l48,-48"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M160,344H368a80.24,80.24 0,0 0,80 -80V248"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
</vector>

View file

@ -1,41 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M320,120l48,48l-48,48"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M352,168H144a80.24,80.24 0,0 0,-80 80v16"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M192,392l-48,-48l48,-48"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M160,344H353.113"
android:strokeLineJoin="round"
android:strokeWidth="32"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="m446.293,243.326 l-48.027,30.375v0l44.094,-21.604v95.885H448V248v0,-2.322 -2.352z"
android:strokeLineJoin="round"
android:strokeWidth="28.021"
android:fillColor="#ff0000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>