mirror of
https://github.com/FossifyOrg/Camera.git
synced 2026-06-13 02:26:40 -04:00
remember if the last used camera was the front or the back one
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user