Last active
January 21, 2019 13:19
-
-
Save Bradleycorn/94a7e8875adbc0875043f3065fc4fb5e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MainActivity : AppCompatActivity() { | |
lateinit var orientationListener: OrientationEventListener | |
override fun onCreate(savedInstanceState: Bundle?) { | |
orientationListener = object: OrientationEventListener(this) { | |
override fun onOrientationChanged(orientation: Int) { | |
viewModel.onOrientationChange(orientation, resources.configuration.orientation) | |
} | |
}.apply { disable() } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment