remember if the last used camera was the front or the back one

This commit is contained in:
tibbi
2016-10-10 19:14:41 +02:00
parent c2e16dcd56
commit 126e626a9c
8 changed files with 14 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package com.simplemobiletools.camera;
import android.content.Context;
import android.content.SharedPreferences;
import android.hardware.Camera;
public class Config {
private SharedPreferences mPrefs;
@@ -69,4 +70,12 @@ public class Config {
public void setIsSoundEnabled(boolean enabled) {
mPrefs.edit().putBoolean(Constants.SOUND, enabled).apply();
}
public int getLastUsedCamera() {
return mPrefs.getInt(Constants.LAST_USED_CAMERA, Camera.CameraInfo.CAMERA_FACING_BACK);
}
public void setLastUsedCamera(int cameraId) {
mPrefs.edit().putInt(Constants.LAST_USED_CAMERA, cameraId).apply();
}
}