feat: give window closing its own Pencereler tab

The window switch sat on the Upload Service page, which implied a relationship
that does not exist: closing windows needs no ABRP token, no GPS, no upload
interval, and runs in its own service whether or not uploading is on. It is now
a sixth page of the pager, between Araç and Wi-Fi.

Splitting it in two while it moved, because the new page has room the card did
not: the switch and status stay together, and the event log gets its own card,
monospaced and no longer capped at four lines.

setOffscreenPageLimit switches from a hardcoded 4 to panes.length - 1. It was
already one short of the page count and would have gone stale again here.
refreshWindowClose runs on the two-second tick and dereferences views on a page
that may not be on screen, so the pager must not be free to detach them.

Six tabs share the bar where five did. Widget.EV.NavTab already autosizes down
to a 12sp floor, so the labels shrink rather than truncate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
TCFDONMEZ
2026-09-25 14:01:57 +03:00
co-authored by Claude Opus 5
parent 444732438d
commit 322ebcc4c0
7 changed files with 136 additions and 61 deletions
+10
View File
@@ -72,6 +72,16 @@
android:text="@string/tab_vehicle"
app:icon="@drawable/ic_tab_vehicle" />
<com.google.android.material.button.MaterialButton
android:id="@+id/tabWindows"
style="@style/Widget.EV.NavTab"
android:layout_width="0dp"
android:layout_height="64dp"
android:layout_weight="1"
android:layout_marginEnd="@dimen/spacing_sm"
android:text="@string/tab_windows"
app:icon="@drawable/ic_tab_windows" />
<com.google.android.material.button.MaterialButton
android:id="@+id/tabWifi"
style="@style/Widget.EV.NavTab"
-48
View File
@@ -12,54 +12,6 @@
android:orientation="vertical"
android:padding="@dimen/spacing_lg">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_md"
app:cardBackgroundColor="@color/ev_surface"
app:cardCornerRadius="@dimen/ev_corner"
app:strokeColor="@color/ev_outline"
app:strokeWidth="1dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/spacing_lg">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/window_close_switch"
style="@style/Widget.EV.Switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/touch_target"
android:text="@string/window_close_title" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/window_close_hint"
android:textAppearance="@style/Text.EV.Secondary" />
<TextView
android:id="@+id/window_close_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_sm"
android:text="@string/window_close_stopped"
android:textAppearance="@style/Text.EV.Body" />
<TextView
android:id="@+id/window_close_log"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_sm"
android:maxLines="4"
android:textAppearance="@style/Text.EV.Secondary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Service control card -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
+92
View File
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Windows page of the main pager. See pane_abrp.xml for how the pages are held.
Its own page rather than a card on the Service one: this feature writes to the car and
shares nothing with ABRP uploading — no token, no GPS, no interval. Sitting under
"Upload Service" implied a dependency that does not exist. -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/spacing_lg">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_md"
app:cardBackgroundColor="@color/ev_surface"
app:cardCornerRadius="@dimen/ev_corner"
app:strokeColor="@color/ev_outline"
app:strokeWidth="1dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/spacing_lg">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/window_close_switch"
style="@style/Widget.EV.Switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/touch_target"
android:text="@string/window_close_title" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/window_close_hint"
android:textAppearance="@style/Text.EV.Secondary" />
<TextView
android:id="@+id/window_close_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_sm"
android:text="@string/window_close_stopped"
android:textAppearance="@style/Text.EV.Body" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Event log. Its own card here, where there is room for more than the four lines
it had to fit in beside the upload settings. -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/ev_surface"
app:cardCornerRadius="@dimen/ev_corner"
app:strokeColor="@color/ev_outline"
app:strokeWidth="1dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/spacing_lg">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/window_close_log_title"
android:textAppearance="@style/Text.EV.Body" />
<TextView
android:id="@+id/window_close_log"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_sm"
android:fontFamily="monospace"
android:textAppearance="@style/Text.EV.Secondary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</ScrollView>