From 8e4482cf3ba59055a25bd582916fc2d227041401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez?= <30648939+malopezr7@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:07:03 +0100 Subject: [PATCH] fix(dev): open the Android dev menu in apps with an AppCompat theme BottomSheetDialog takes its sheet style from the theme's bottomSheetDialogTheme. An AppCompat theme doesn't set it, so Material falls back to a sheet with a plain color background, and the cast to MaterialShapeDrawable in DevSheet throws when the sheet is laid out. Build the dialog on Material 3, as the tab bar already does. --- .../android/src/main/java/com/margelo/nitro/dev/DevSheet.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nitro-ui-dev/android/src/main/java/com/margelo/nitro/dev/DevSheet.kt b/packages/nitro-ui-dev/android/src/main/java/com/margelo/nitro/dev/DevSheet.kt index 445777e6d..41cc13c9d 100644 --- a/packages/nitro-ui-dev/android/src/main/java/com/margelo/nitro/dev/DevSheet.kt +++ b/packages/nitro-ui-dev/android/src/main/java/com/margelo/nitro/dev/DevSheet.kt @@ -2,6 +2,7 @@ package com.margelo.nitro.dev import android.app.Activity import android.content.res.ColorStateList +import android.view.ContextThemeWrapper import android.view.Gravity import android.view.View import android.view.ViewGroup @@ -15,7 +16,9 @@ import com.google.android.material.shape.MaterialShapeDrawable /** A sheet in its own window that opens at half height, and the user drags it up to fill the screen. */ internal class DevSheet(activity: Activity, style: DevStyle, content: View, private val onDismiss: () -> Unit) { - private val dialog = BottomSheetDialog(activity) + // Material only gives the sheet a shaped background under a Material theme, and the app's theme may be AppCompat. + private val dialog = + BottomSheetDialog(ContextThemeWrapper(activity, com.google.android.material.R.style.Theme_Material3_DayNight_NoActionBar)) private var isClosed = false init {