append the megapixels to the resolution
This commit is contained in:
parent
5a04995b77
commit
60f2cf9e1a
|
@ -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()
|
||||
|
|
|
@ -65,7 +65,8 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo
|
|||
val items = ArrayList<RadioItem>(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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue