mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
use constants for the mpx values
This commit is contained in:
@ -64,9 +64,9 @@ public class Config {
|
|||||||
private int getOldDefaultResolution() {
|
private int getOldDefaultResolution() {
|
||||||
final int index = getMaxResolution();
|
final int index = getMaxResolution();
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 1: return 9000000;
|
case 1: return Constants.EIGHT_MPX;
|
||||||
case 2: return 0;
|
case 2: return 0;
|
||||||
default: return 6000000;
|
default: return Constants.FIVE_MPX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,10 @@ public class Constants {
|
|||||||
|
|
||||||
public static final String TREE_URI = "tree_uri";
|
public static final String TREE_URI = "tree_uri";
|
||||||
|
|
||||||
|
public static final int TWO_MPX = 3000000;
|
||||||
|
public static final int FIVE_MPX = 6000000;
|
||||||
|
public static final int EIGHT_MPX = 9000000;
|
||||||
|
|
||||||
// shared preferences
|
// shared preferences
|
||||||
public static final String PREFS_KEY = "Camera";
|
public static final String PREFS_KEY = "Camera";
|
||||||
public static final String IS_FIRST_RUN = "is_first_run";
|
public static final String IS_FIRST_RUN = "is_first_run";
|
||||||
|
@ -10,6 +10,7 @@ import android.view.Menu
|
|||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
|
import com.simplemobiletools.camera.Constants
|
||||||
import com.simplemobiletools.camera.R
|
import com.simplemobiletools.camera.R
|
||||||
import com.simplemobiletools.camera.dialogs.WritePermissionDialog
|
import com.simplemobiletools.camera.dialogs.WritePermissionDialog
|
||||||
import com.simplemobiletools.camera.extensions.needsStupidWritePermissions
|
import com.simplemobiletools.camera.extensions.needsStupidWritePermissions
|
||||||
@ -141,18 +142,18 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
private fun getMaxPhotoSelection(): Int {
|
private fun getMaxPhotoSelection(): Int {
|
||||||
val maxRes = mConfig.maxPhotoResolution
|
val maxRes = mConfig.maxPhotoResolution
|
||||||
return when (maxRes) {
|
return when (maxRes) {
|
||||||
3000000 -> 0
|
Constants.TWO_MPX -> 0
|
||||||
6000000 -> 1
|
Constants.FIVE_MPX -> 1
|
||||||
9000000 -> 2
|
Constants.EIGHT_MPX -> 2
|
||||||
else -> 3
|
else -> 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getMaxPhotoPx(index: Int): Int {
|
private fun getMaxPhotoPx(index: Int): Int {
|
||||||
return when (index) {
|
return when (index) {
|
||||||
0 -> 3000000
|
0 -> Constants.TWO_MPX
|
||||||
1 -> 6000000
|
1 -> Constants.FIVE_MPX
|
||||||
2 -> 9000000
|
2 -> Constants.EIGHT_MPX
|
||||||
else -> 0
|
else -> 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user