Created
December 3, 2018 06:25
-
-
Save itome/5dec7688e112d4601deac7bcd9eaa50b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val cameraManager: CameraManager by lazy { | |
getSystemService(Context.CAMERA_SERVICE) as CameraManager | |
} | |
private fun getCameraOrientation(cameraId: String): Int { | |
val characteristic = cameraManager.getCameraCharacteristics(cameraId) | |
return characteristic.get(CameraCharacteristics.SENSOR_ORIENTATION) ?: 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment