mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
store/restore last used camera lens
This commit is contained in:
@ -2,6 +2,7 @@ package com.simplemobiletools.camera.helpers
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import androidx.camera.core.CameraSelector
|
||||
import com.simplemobiletools.commons.helpers.BaseConfig
|
||||
import java.io.File
|
||||
|
||||
@ -37,6 +38,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
get() = prefs.getString(LAST_USED_CAMERA, "0")!!
|
||||
set(cameraId) = prefs.edit().putString(LAST_USED_CAMERA, cameraId).apply()
|
||||
|
||||
var lastUsedCameraLens: Int
|
||||
get() = prefs.getInt(LAST_USED_CAMERA_LENS, CameraSelector.LENS_FACING_BACK)
|
||||
set(lens) = prefs.edit().putInt(LAST_USED_CAMERA_LENS, lens).apply()
|
||||
|
||||
var initPhotoMode: Boolean
|
||||
get() = prefs.getBoolean(INIT_PHOTO_MODE, true)
|
||||
set(initPhotoMode) = prefs.edit().putBoolean(INIT_PHOTO_MODE, initPhotoMode).apply()
|
||||
|
Reference in New Issue
Block a user