Skip to content

Conversation

@coado
Copy link
Contributor

@coado coado commented Sep 2, 2025

Summary:

Following the RFC, this PR adds new DevMenuConfiguration object and extends ReactHost API for passing settings to the particular DevSupportManager. The DevMenuConfiguration includes:

  • isDevMenuEnabled,
  • isShakeGestureEnabled,
  • areKeyboardShortcutsEnabled,

Changelog:

[ANDROID][ADDED] - Add new configuration for RCTDevMenu

Test Plan:

Tested with different configuration on DevMenuConfiguration:

Click to view code
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 2, 2025
@facebook-github-bot facebook-github-bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Sep 2, 2025
@facebook-github-bot
Copy link
Contributor

@coado has imported this pull request. If you are a Meta employee, you can view this in D81684310.

@facebook-github-bot
Copy link
Contributor

@coado has imported this pull request. If you are a Meta employee, you can view this in D81684310.

@coado coado marked this pull request as ready for review September 4, 2025 15:09
Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

coado added a commit to coado/react-native that referenced this pull request Sep 11, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: vzaidman

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D81684310

@facebook-github-bot
Copy link
Contributor

@coado has imported this pull request. If you are a Meta employee, you can view this in D81684310.

coado added a commit to coado/react-native that referenced this pull request Sep 15, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: vzaidman

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Sep 15, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: vzaidman

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Sep 17, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Sep 24, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Sep 29, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Sep 29, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating diff in D81684310.

@coado coado force-pushed the dev-menu-android branch from 417830c to f0b6713 Compare October 1, 2025 09:03
coado added a commit to coado/react-native that referenced this pull request Oct 1, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
@facebook-github-bot
Copy link
Contributor

@coado has exported this pull request. If you are a Meta employee, you can view the originating Diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Oct 6, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
@coado coado force-pushed the dev-menu-android branch from f0b6713 to c25c1bd Compare October 6, 2025 15:50
@meta-codesync
Copy link

meta-codesync bot commented Oct 6, 2025

@coado has exported this pull request. If you are a Meta employee, you can view the originating Diff in D81684310.

coado added a commit to coado/react-native that referenced this pull request Oct 15, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Differential Revision: D81684310

Pulled By: coado
Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

coado added a commit to coado/react-native that referenced this pull request Oct 20, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: cortinico

Differential Revision: D81684310

Pulled By: coado
coado added a commit to coado/react-native that referenced this pull request Oct 20, 2025
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: cortinico

Differential Revision: D81684310

Pulled By: coado
Summary:
Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`


Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: cortinico

Differential Revision: D81684310

Pulled By: coado
@meta-codesync meta-codesync bot closed this in 4ddf2ce Oct 21, 2025
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Oct 21, 2025
@meta-codesync
Copy link

meta-codesync bot commented Oct 21, 2025

@coado merged this pull request in 4ddf2ce.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @coado in 4ddf2ce

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants