diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ffccb1b..1a19ce3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -23,7 +23,7 @@ android:hardwareAccelerated="true" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustNothing"> with TickerProviderStateMixin { final session = appState.session!; // guaranteed non‑null now final controller = _scaffoldKey.currentState!.showBottomSheet( - (ctx) => MeasuredSheet( - onHeightChanged: (height) { - setState(() { - _addSheetHeight = height; - }); - }, - child: AddNodeSheet(session: session), + (ctx) => Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard + ), + child: MeasuredSheet( + onHeightChanged: (height) { + setState(() { + _addSheetHeight = height + MediaQuery.of(context).padding.bottom; + }); + }, + child: AddNodeSheet(session: session), + ), ), ); @@ -140,19 +145,24 @@ class _HomeScreenState extends State with TickerProviderStateMixin { if (!mounted) return; final controller = _scaffoldKey.currentState!.showBottomSheet( - (ctx) => MeasuredSheet( - onHeightChanged: (height) { - setState(() { - _editSheetHeight = height; - // Clear transition flag and reset tag sheet height once edit sheet starts sizing - if (height > 0 && _transitioningToEdit) { - _transitioningToEdit = false; - _tagSheetHeight = 0.0; // Now safe to reset - _selectedNodeId = null; // Clear selection when moving to edit - } - }); - }, - child: EditNodeSheet(session: session), + (ctx) => Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard + ), + child: MeasuredSheet( + onHeightChanged: (height) { + setState(() { + _editSheetHeight = height + MediaQuery.of(context).padding.bottom; + // Clear transition flag and reset tag sheet height once edit sheet starts sizing + if (height > 0 && _transitioningToEdit) { + _transitioningToEdit = false; + _tagSheetHeight = 0.0; // Now safe to reset + _selectedNodeId = null; // Clear selection when moving to edit + } + }); + }, + child: EditNodeSheet(session: session), + ), ), ); @@ -168,15 +178,20 @@ class _HomeScreenState extends State with TickerProviderStateMixin { void _openNavigationSheet() { final controller = _scaffoldKey.currentState!.showBottomSheet( - (ctx) => MeasuredSheet( - onHeightChanged: (height) { - setState(() { - _navigationSheetHeight = height; - }); - }, - child: NavigationSheet( - onStartRoute: _onStartRoute, - onResumeRoute: _onResumeRoute, + (ctx) => Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard + ), + child: MeasuredSheet( + onHeightChanged: (height) { + setState(() { + _navigationSheetHeight = height + MediaQuery.of(context).padding.bottom; + }); + }, + child: NavigationSheet( + onStartRoute: _onStartRoute, + onResumeRoute: _onResumeRoute, + ), ), ), ); @@ -392,19 +407,24 @@ class _HomeScreenState extends State with TickerProviderStateMixin { } final controller = _scaffoldKey.currentState!.showBottomSheet( - (ctx) => MeasuredSheet( - onHeightChanged: (height) { - setState(() { - _tagSheetHeight = height; - }); - }, - child: NodeTagSheet( - node: node, - onEditPressed: () { - final appState = context.read(); - appState.startEditSession(node); - // This will trigger _openEditNodeSheet via the existing auto-show logic + (ctx) => Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom, // Only safe area, no keyboard + ), + child: MeasuredSheet( + onHeightChanged: (height) { + setState(() { + _tagSheetHeight = height + MediaQuery.of(context).padding.bottom; + }); }, + child: NodeTagSheet( + node: node, + onEditPressed: () { + final appState = context.read(); + appState.startEditSession(node); + // This will trigger _openEditNodeSheet via the existing auto-show logic + }, + ), ), ), ); diff --git a/lib/widgets/add_node_sheet.dart b/lib/widgets/add_node_sheet.dart index 219a2d6..f9eae80 100644 --- a/lib/widgets/add_node_sheet.dart +++ b/lib/widgets/add_node_sheet.dart @@ -51,10 +51,7 @@ class AddNodeSheet extends StatelessWidget { } } - return Padding( - padding: - EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), - child: Column( + return Column( mainAxisSize: MainAxisSize.min, children: [ const SizedBox(height: 12), @@ -192,7 +189,6 @@ class AddNodeSheet extends StatelessWidget { ), const SizedBox(height: 20), ], - ), ); }, ); diff --git a/lib/widgets/edit_node_sheet.dart b/lib/widgets/edit_node_sheet.dart index 54ea91d..132e732 100644 --- a/lib/widgets/edit_node_sheet.dart +++ b/lib/widgets/edit_node_sheet.dart @@ -53,10 +53,7 @@ class EditNodeSheet extends StatelessWidget { } } - return Padding( - padding: - EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), - child: Column( + return Column( mainAxisSize: MainAxisSize.min, children: [ const SizedBox(height: 12), @@ -199,7 +196,6 @@ class EditNodeSheet extends StatelessWidget { ), const SizedBox(height: 20), ], - ), ); }, ); diff --git a/lib/widgets/map_view.dart b/lib/widgets/map_view.dart index 93d6942..1acac3a 100644 --- a/lib/widgets/map_view.dart +++ b/lib/widgets/map_view.dart @@ -525,13 +525,16 @@ class MapViewState extends State { ), // All map overlays (mode indicator, zoom, attribution, add pin) - MapOverlays( - mapController: _controller.mapController, - uploadMode: appState.uploadMode, - session: session, - editSession: editSession, - attribution: appState.selectedTileType?.attribution, - onSearchPressed: widget.onSearchPressed, + MediaQuery( + data: MediaQuery.of(context).copyWith(viewInsets: EdgeInsets.zero), + child: MapOverlays( + mapController: _controller.mapController, + uploadMode: appState.uploadMode, + session: session, + editSession: editSession, + attribution: appState.selectedTileType?.attribution, + onSearchPressed: widget.onSearchPressed, + ), ), // Network status indicator (top-left) - conditionally shown