-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump react native to 0.73.6 * iOS changes * Fix gallery * Fix test * Add missing patch * Unify react native navigation patch * Update the rest of libraries * iOS updates * Update mattermost libraries * Fix tests and final bumps * iOS podfile update * Update android locks * Revert webrtc update because it was messing with the tests * Update podfile for webrtc
- Loading branch information
Showing
57 changed files
with
4,480 additions
and
4,541 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
sh ./scripts/pre-commit.sh |
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
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
63 changes: 0 additions & 63 deletions
63
android/app/src/debug/java/com/mattermost/flipper/ReactNativeFlipper.java
This file was deleted.
Oops, something went wrong.
106 changes: 0 additions & 106 deletions
106
android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
android/app/src/main/java/com/mattermost/rnbeta/MainActivity.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.mattermost.rnbeta | ||
|
||
import android.os.Bundle | ||
|
||
import android.view.KeyEvent | ||
import android.content.res.Configuration | ||
|
||
import com.facebook.react.ReactActivityDelegate | ||
import com.reactnativenavigation.NavigationActivity | ||
import com.github.emilioicai.hwkeyboardevent.HWKeyboardEventModule | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint | ||
import com.facebook.react.defaults.DefaultReactActivityDelegate | ||
|
||
class MainActivity : NavigationActivity() { | ||
private var HWKeyboardConnected = false | ||
private val foldableObserver = FoldableObserver.getInstance(this) | ||
|
||
/** | ||
* Returns the name of the main component registered from JavaScript. This is used to schedule | ||
* rendering of the component. | ||
*/ | ||
override fun getMainComponentName(): String = "Mattermost" | ||
|
||
/** | ||
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] | ||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled] | ||
*/ | ||
override fun createReactActivityDelegate(): ReactActivityDelegate = | ||
DefaultReactActivityDelegate(this, mainComponentName, DefaultNewArchitectureEntryPoint.fabricEnabled) | ||
|
||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(null) | ||
setContentView(R.layout.launch_screen) | ||
setHWKeyboardConnected() | ||
foldableObserver.onCreate() | ||
} | ||
|
||
override fun onStart() { | ||
super.onStart() | ||
foldableObserver.onStart() | ||
} | ||
|
||
override fun onStop() { | ||
super.onStop() | ||
foldableObserver.onStop() | ||
} | ||
|
||
override fun onConfigurationChanged(newConfig: Configuration) { | ||
super.onConfigurationChanged(newConfig) | ||
if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) { | ||
HWKeyboardConnected = true | ||
} else if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) { | ||
HWKeyboardConnected = false | ||
} | ||
} | ||
|
||
override fun onWindowFocusChanged(hasFocus: Boolean) { | ||
super.onWindowFocusChanged(hasFocus) | ||
reactGateway.onWindowFocusChanged(hasFocus) | ||
} | ||
|
||
/* | ||
https://mattermost.atlassian.net/browse/MM-10601 | ||
Required by react-native-hw-keyboard-event | ||
(https://github.com/emilioicai/react-native-hw-keyboard-event) | ||
*/ | ||
override fun dispatchKeyEvent(event: KeyEvent): Boolean { | ||
if (HWKeyboardConnected) { | ||
val keyCode = event.keyCode | ||
val keyAction = event.action | ||
if (keyAction == KeyEvent.ACTION_UP) { | ||
if (keyCode == KeyEvent.KEYCODE_ENTER) { | ||
val keyPressed = if (event.isShiftPressed) "shift-enter" else "enter" | ||
HWKeyboardEventModule.getInstance().keyPressed(keyPressed) | ||
return true | ||
} else if (keyCode == KeyEvent.KEYCODE_K && event.isCtrlPressed) { | ||
HWKeyboardEventModule.getInstance().keyPressed("find-channels") | ||
return true | ||
} | ||
} | ||
} | ||
return super.dispatchKeyEvent(event) | ||
} | ||
|
||
private fun setHWKeyboardConnected() { | ||
HWKeyboardConnected = getResources().configuration.keyboard == Configuration.KEYBOARD_QWERTY | ||
} | ||
} |
Oops, something went wrong.