ananas/app/src/main/java/dev/jdtech/jellyfin/utils/AppPreferences.kt
maulik9898 7d9857d3ce
Improve player gestures and add pinch to zoom (#74)
* implemented pan/panStop on a GestureListener to detect the entry location and exclude top status bar area.

* remember last brightness set for players [ Exoplayer , MPV]

* Pinch to zoom and auto rotate feature for Exoplayer

* Only save the brightness when the overlay disappears instead of on every scroll

Also clean up some files

* removed unnecessary configChanges from Manifest

Co-authored-by: Jarne Demeulemeester <jarnedemeulemeester@gmail.com>
2022-01-08 18:04:28 +01:00

24 lines
629 B
Kotlin

package dev.jdtech.jellyfin.utils
import android.content.SharedPreferences
import android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE
import androidx.core.content.edit
import javax.inject.Inject
class AppPreferences
@Inject
constructor(
private val sharedPreferences: SharedPreferences
) {
var playerBrightness: Float
get() = sharedPreferences.getFloat(
Constants.PREF_PLAYER_BRIGHTNESS,
BRIGHTNESS_OVERRIDE_NONE
)
set(value) {
sharedPreferences.edit {
putFloat(Constants.PREF_PLAYER_BRIGHTNESS, value)
}
}
}