expo-modules-core 1.12.9 → 1.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 1.12.10 — 2024-05-09
14
+
15
+ ### 🎉 New features
16
+
17
+ - Added `onKeyDown` and `onKeyLongPress` to `ReactActivityHandler` on Android. ([#28684](https://github.com/expo/expo/pull/28684) by [@lukmccall](https://github.com/lukmccall))
18
+
13
19
  ## 1.12.9 — 2024-05-06
14
20
 
15
21
  _This version does not introduce any user-facing changes._
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '1.12.9'
4
+ version = '1.12.10'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -63,7 +63,7 @@ android {
63
63
  defaultConfig {
64
64
  consumerProguardFiles 'proguard-rules.pro'
65
65
  versionCode 1
66
- versionName "1.12.9"
66
+ versionName "1.12.10"
67
67
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
68
68
 
69
69
  testInstrumentationRunner "expo.modules.TestRunner"
@@ -7,7 +7,6 @@ import android.view.ViewGroup;
7
7
  import com.facebook.react.ReactActivity;
8
8
  import com.facebook.react.ReactActivityDelegate;
9
9
  import com.facebook.react.ReactNativeHost;
10
- import com.facebook.react.ReactRootView;
11
10
 
12
11
  import androidx.annotation.Nullable;
13
12
 
@@ -19,6 +18,7 @@ public interface ReactActivityHandler {
19
18
  /**
20
19
  * Gives modules a chance to create a ViewGroup that is used as a container for the ReactRootView,
21
20
  * which is added as a child to the container if non-null.
21
+ *
22
22
  * @return a ViewGroup to be used as a container, or null if no container is needed
23
23
  */
24
24
  @Nullable
@@ -38,8 +38,33 @@ public interface ReactActivityHandler {
38
38
  return false;
39
39
  }
40
40
 
41
+ /**
42
+ * Gives modules a chance to respond to `onKeyDown` events. Every listener will receive this
43
+ * callback, but the delegate will not receive the event unless if any of the listeners consume it
44
+ * (i.e. return `true` from this method).
45
+ * `ReactActivityDelegateWrapper.onKeyDown` will return `true` if any module returns `true`.
46
+ *
47
+ * @return true if this module wants to return `true` from `ReactActivityDelegateWrapper.onKeyDown`
48
+ */
49
+ default boolean onKeyDown(int keyCode, @Nullable KeyEvent event) {
50
+ return false;
51
+ }
52
+
53
+ /**
54
+ * Gives modules a chance to respond to `onKeyLongPress` events. Every listener will receive this
55
+ * callback, but the delegate will not receive the event unless if any of the listeners consume it
56
+ * (i.e. return `true` from this method).
57
+ * `ReactActivityDelegateWrapper.onKeyLongPress` will return `true` if any module returns `true`.
58
+ *
59
+ * @return true if this module wants to return `true` from `ReactActivityDelegateWrapper.onKeyLongPress`
60
+ */
61
+ default boolean onKeyLongPress(int keyCode, @Nullable KeyEvent event) {
62
+ return false;
63
+ }
64
+
41
65
  /**
42
66
  * Gives modules a chance to override the wrapped ReactActivityDelegate instance.
67
+ *
43
68
  * @return a new ReactActivityDelegate instance, or null if not to override
44
69
  */
45
70
  @Nullable
@@ -56,6 +81,7 @@ public interface ReactActivityHandler {
56
81
  default DelayLoadAppHandler getDelayLoadAppHandler(ReactActivity activity, ReactNativeHost reactNativeHost) {
57
82
  return null;
58
83
  }
84
+
59
85
  interface DelayLoadAppHandler {
60
86
  void whenReady(Runnable runnable);
61
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "1.12.9",
3
+ "version": "1.12.10",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -44,5 +44,5 @@
44
44
  "@testing-library/react-hooks": "^7.0.1",
45
45
  "expo-module-scripts": "^3.0.0"
46
46
  },
47
- "gitHead": "7995f30a8d2af4836f3aef9fe322e9403fc23d34"
47
+ "gitHead": "9c05bec11c7f5b031d1b9b0ebee78c3b71a7e11d"
48
48
  }