forked from Ivasoft/mattermost-mobile
Refactor gallery gestures (#8752)
This commit is contained in:
@@ -14,6 +14,7 @@ import expo.modules.ReactActivityDelegateWrapper
|
||||
class MainActivity : NavigationActivity() {
|
||||
private var HWKeyboardConnected = false
|
||||
private val foldableObserver = FoldableObserver.getInstance(this)
|
||||
private var lastOrientation: Int = Configuration.ORIENTATION_UNDEFINED
|
||||
|
||||
/**
|
||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
||||
@@ -34,6 +35,7 @@ class MainActivity : NavigationActivity() {
|
||||
super.onCreate(null)
|
||||
setContentView(R.layout.launch_screen)
|
||||
setHWKeyboardConnected()
|
||||
lastOrientation = this.resources.configuration.orientation
|
||||
foldableObserver.onCreate()
|
||||
}
|
||||
|
||||
@@ -54,6 +56,11 @@ class MainActivity : NavigationActivity() {
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
val newOrientation = newConfig.orientation
|
||||
if (newOrientation != lastOrientation) {
|
||||
lastOrientation = newOrientation
|
||||
foldableObserver.handleWindowLayoutInfo()
|
||||
}
|
||||
if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
|
||||
HWKeyboardConnected = true
|
||||
} else if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
|
||||
|
||||
Reference in New Issue
Block a user