Skip to content

Commit 3590bb2

Browse files
author
poolsoft
committed
Fix: Dock Layout Toggle button now correctly opens/closes widget panel
1 parent 06bf2c9 commit 3590bb2

2 files changed

Lines changed: 22 additions & 15 deletions

File tree

OsmAnd/src-carlauncher/java/net/osmand/plus/activities/MapActivity.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,15 @@ private void applyWidgetPanelState() {
824824

825825
@Override
826826
public void onLayoutModeToggle() {
827-
// Cycle: 0 (Normal) -> 1 (Widget Hidden) -> 2 (Full Screen) -> 0
828-
layoutMode = (layoutMode + 1) % 2;
827+
// Toggle Logic: Normal (0) <-> Full Screen (2)
828+
if (layoutMode == 0) {
829+
layoutMode = 2;
830+
isWidgetPanelOpen = false;
831+
} else {
832+
layoutMode = 0;
833+
isWidgetPanelOpen = true;
834+
}
835+
829836
updateLayoutMode();
830837
}
831838

OsmAnd/src-carlauncher/res/layout/activity_car_launcher.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@
2222
app:layout_constraintEnd_toStartOf="@+id/widget_panel"
2323
android:elevation="4dp"/>
2424

25-
<!-- WIDGET PANEL CONTAINER (Drawer) -->
26-
<FrameLayout
27-
android:id="@+id/widget_panel"
28-
android:layout_width="350dp"
29-
android:layout_height="0dp"
30-
android:background="#111111"
31-
android:layout_marginTop="0dp"
32-
android:elevation="20dp"
33-
android:visibility="gone"
34-
app:layout_constraintTop_toTopOf="parent"
35-
app:layout_constraintBottom_toBottomOf="parent"
36-
app:layout_constraintEnd_toEndOf="parent" />
37-
3825
<!-- WIDGET HANDLE (External Floater) -->
3926
<ImageButton
4027
android:id="@+id/widget_handle"
@@ -50,6 +37,19 @@
5037
app:layout_constraintEnd_toEndOf="parent"
5138
app:layout_constraintVertical_bias="0.5" />
5239

40+
<!-- WIDGET PANEL CONTAINER (Drawer) -->
41+
<FrameLayout
42+
android:id="@+id/widget_panel"
43+
android:layout_width="350dp"
44+
android:layout_height="0dp"
45+
android:background="#111111"
46+
android:layout_marginTop="0dp"
47+
android:elevation="20dp"
48+
android:visibility="gone"
49+
app:layout_constraintTop_toTopOf="parent"
50+
app:layout_constraintBottom_toBottomOf="parent"
51+
app:layout_constraintEnd_toEndOf="parent" />
52+
5353
<!-- APP DOCK (Bottom Nav Bar Style) -->
5454
<FrameLayout
5555
android:id="@+id/app_dock"

0 commit comments

Comments
 (0)