append the megapixels to the resolution

This commit is contained in:
tibbi 2017-03-21 22:50:22 +01:00
parent 5a04995b77
commit 60f2cf9e1a
2 changed files with 3 additions and 6 deletions

View File

@ -447,11 +447,7 @@ class MainActivity : SimpleActivity(), SensorEventListener, PreviewListener, Pho
} }
private fun resumeCameraItems() { private fun resumeCameraItems() {
val cnt = Camera.getNumberOfCameras() toggle_camera.beVisibleIf(Camera.getNumberOfCameras() > 1)
if (cnt == 1) {
toggle_camera.beInvisible()
}
if (mPreview?.setCamera(mCurrCameraId) == true) { if (mPreview?.setCamera(mCurrCameraId) == true) {
hideNavigationBarIcons() hideNavigationBarIcons()
checkFlash() checkFlash()

View File

@ -65,7 +65,8 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo
val items = ArrayList<RadioItem>(resolutions.size) val items = ArrayList<RadioItem>(resolutions.size)
val sorted = resolutions.sortedByDescending { it.width * it.height } val sorted = resolutions.sortedByDescending { it.width * it.height }
sorted.forEachIndexed { index, size -> 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 return items
} }