feat(widget): Add ANC control widget

New home-screen widget that toggles AirPods ANC modes (Off / ANC / Transparency / Adaptive) directly, with six adaptive layouts that pick based on widget size (QUAD_CORNERS, ROW_ICONS, COLUMN_ICONS, GRID_2X2, ROW, COLUMN). Consolidated battery+ANC configuration into a single ViewModel that detects widget type from AppWidgetManager. ACTIVE state uses Material3 secondaryContainer/onSecondaryContainer for guaranteed contrast. Includes live config preview, preview subtitle, stale-selection guard, device-label toggle, and aligned icons with the app's AncModeSelector.
This commit is contained in:
darken
2026-04-17 20:10:48 +02:00
committed by Matthias Urhahn
parent bba9155573
commit 86b685f28b
19 changed files with 1434 additions and 27 deletions
+11
View File
@@ -101,6 +101,17 @@
android:resource="@xml/battery_widget_info" />
</receiver>
<receiver
android:name=".main.ui.widget.AncWidgetProvider"
android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/anc_widget_info" />
</receiver>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"