Skip to content

Instantly share code, notes, and snippets.

@itome
Created December 3, 2018 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itome/c4678134d8ca6b7f07eb3aa4e8eb777b to your computer and use it in GitHub Desktop.
Save itome/c4678134d8ca6b7f07eb3aa4e8eb777b to your computer and use it in GitHub Desktop.
private fun rotateTextureView() {
val orientation = getApplicationOrientation()
val viewWidth = textureView.width
val viewHeight = textureView.height
val matrix = Matrix()
matrix.postRotate(- orientation.toFloat(), viewWidth * 0.5F, viewHeight * 0.5F)
textureView.setTransform(matrix)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment