Skip to content

Commit

Permalink
Push react native to 0.73.6 (#7863)
Browse files Browse the repository at this point in the history
* 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
larkox authored Apr 22, 2024
1 parent ca7915e commit 9d1030a
Show file tree
Hide file tree
Showing 57 changed files with 4,480 additions and 4,541 deletions.
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

sh ./scripts/pre-commit.sh
9 changes: 2 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: 'kotlin-android'

/**
* This is the configuration block to customize your React Native Android app.
Expand Down Expand Up @@ -190,13 +190,8 @@ repositories {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
Expand Down
2 changes: 0 additions & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
Expand Down

This file was deleted.

106 changes: 0 additions & 106 deletions android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java

This file was deleted.

89 changes: 89 additions & 0 deletions android/app/src/main/java/com/mattermost/rnbeta/MainActivity.kt
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
}
}
Loading

0 comments on commit 9d1030a

Please sign in to comment.