mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
add a new max photo resolution limit of 2 mpx
This commit is contained in:
@ -127,17 +127,36 @@ class SettingsActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
private fun setupMaxPhotoResolution() {
|
||||
settings_max_photo_resolution.setSelection(mConfig.maxPhotoResolution)
|
||||
settings_max_photo_resolution.setSelection(getMaxPhotoSelection())
|
||||
settings_max_photo_resolution.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||
}
|
||||
|
||||
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
|
||||
mConfig.maxPhotoResolution = settings_max_photo_resolution.selectedItemPosition
|
||||
mConfig.maxPhotoResolution = getMaxPhotoPx(settings_max_photo_resolution.selectedItemPosition)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getMaxPhotoSelection(): Int {
|
||||
val maxRes = mConfig.maxPhotoResolution
|
||||
return when (maxRes) {
|
||||
3000000 -> 0
|
||||
6000000 -> 1
|
||||
9000000 -> 2
|
||||
else -> 3
|
||||
}
|
||||
}
|
||||
|
||||
private fun getMaxPhotoPx(index: Int): Int {
|
||||
return when (index) {
|
||||
0 -> 3000000
|
||||
1 -> 6000000
|
||||
2 -> 9000000
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupMaxVideoResolution() {
|
||||
settings_max_video_resolution.setSelection(mConfig.maxVideoResolution)
|
||||
settings_max_video_resolution.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
|
Reference in New Issue
Block a user