create a helper function for getting the proper camera impl

This commit is contained in:
tibbi
2018-05-27 23:35:40 +02:00
parent 3e6aab0cb5
commit 2cdae95de8
9 changed files with 49 additions and 51 deletions

View File

@ -1,8 +1,8 @@
package com.simplemobiletools.camera.helpers
import android.content.Context
import android.hardware.Camera
import android.os.Environment
import com.simplemobiletools.camera.extensions.getMyCamera
import com.simplemobiletools.commons.helpers.BaseConfig
import java.io.File
@ -47,7 +47,7 @@ class Config(context: Context) : BaseConfig(context) {
set(flipPhotos) = prefs.edit().putBoolean(FLIP_PHOTOS, flipPhotos).apply()
var lastUsedCamera: Int
get() = prefs.getInt(LAST_USED_CAMERA, Camera.CameraInfo.CAMERA_FACING_BACK)
get() = prefs.getInt(LAST_USED_CAMERA, context.getMyCamera().getBackCameraId())
set(cameraId) = prefs.edit().putInt(LAST_USED_CAMERA, cameraId).apply()
var flashlightState: Int