From 60f2cf9e1adf020bd9b614fde900973b1b88b83d Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Mar 2017 22:50:22 +0100 Subject: [PATCH] append the megapixels to the resolution --- .../com/simplemobiletools/camera/activities/MainActivity.kt | 6 +----- .../camera/dialogs/ChangeResolutionDialog.kt | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt index 74694e02..8bf400e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt @@ -447,11 +447,7 @@ class MainActivity : SimpleActivity(), SensorEventListener, PreviewListener, Pho } private fun resumeCameraItems() { - val cnt = Camera.getNumberOfCameras() - if (cnt == 1) { - toggle_camera.beInvisible() - } - + toggle_camera.beVisibleIf(Camera.getNumberOfCameras() > 1) if (mPreview?.setCamera(mCurrCameraId) == true) { hideNavigationBarIcons() checkFlash() diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt index 0fcfdaf7..e0996428 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt @@ -65,7 +65,8 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo val items = ArrayList(resolutions.size) val sorted = resolutions.sortedByDescending { it.width * it.height } sorted.forEachIndexed { index, size -> - items.add(RadioItem(index, "${size.width} x ${size.height}")) + val megapixels = String.format("%.1f", (size.width * size.height.toFloat()) / 1000000) + items.add(RadioItem(index, "${size.width} x ${size.height} ($megapixels MP)")) } return items }