Browse Source

Change fast play speed SeekBar resolution to 0.1x

merge-requests/2271/head
Kerry Shen 1 year ago
parent
commit
a09d5a9105
  1. 2
      application/tools/src/main/java/org/videolan/tools/Settings.kt
  2. 6
      application/vlc-android/res/xml/preferences_video_controls.xml
  3. 2
      application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt
  4. 6
      application/vlc-android/src/org/videolan/vlc/util/VersionMigration.kt

2
application/tools/src/main/java/org/videolan/tools/Settings.kt

@ -62,7 +62,7 @@ object Settings : SingletonHolder<SharedPreferences, Context>({ init(it.applicat
incognitoMode = prefs.getBoolean(KEY_INCOGNITO, false)
safeMode = prefs.getBoolean(KEY_SAFE_MODE, false) && prefs.getString(KEY_SAFE_MODE_PIN, "")?.isNotBlank() == true
remoteAccessEnabled.postValue(prefs.getBoolean(KEY_ENABLE_REMOTE_ACCESS, false))
fastplaySpeed = prefs.getInt(FASTPLAY_SPEED, 8) * 0.25f
fastplaySpeed = prefs.getInt(FASTPLAY_SPEED, 20) / 10f
return prefs
}

6
application/vlc-android/res/xml/preferences_video_controls.xml

@ -106,14 +106,14 @@
app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<SeekBarPreference
android:defaultValue="8"
android:defaultValue="20"
android:dependency="enable_fastplay"
android:key="fastplay_speed"
android:max="32"
android:max="80"
android:summary="%s"
android:title="@string/fastplay_speed_title"
app:iconSpaceReserved="false"
app:min="5"
app:min="11"
app:seekBarIncrement="1"
app:singleLineTitle="false"
app:updatesContinuously="true" />

2
application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt

@ -132,7 +132,7 @@ class PreferencesVideoControls : BasePreferenceFragment(), SharedPreferences.OnS
Settings.videoDoubleTapJumpDelay = sharedPreferences.getInt(KEY_VIDEO_DOUBLE_TAP_JUMP_DELAY, 20)
}
FASTPLAY_SPEED -> {
Settings.fastplaySpeed = sharedPreferences.getInt(FASTPLAY_SPEED, 8) * 0.25f
Settings.fastplaySpeed = sharedPreferences.getInt(FASTPLAY_SPEED, 20) / 10f
updateFastplaySpeedSummary()
}
}

6
application/vlc-android/src/org/videolan/vlc/util/VersionMigration.kt

@ -406,10 +406,10 @@ object VersionMigration {
settings.edit(true) {
putInt("fastplay_speed", settings.getString("fastplay_speed", "2")
?.toFloat()
?.div(0.25f)
?.times(10)
?.toInt()
?.coerceInOrDefault(5, 32, 8)
?: 8)
?.coerceInOrDefault(11, 80, 20)
?: 20)
}
}
}

Loading…
Cancel
Save