Six widgets, each with minimal settings, styled with M3 Expressive shapes and Material You colours, and sized proportionally to the placed widget (SizeMode.Exact + LocalSize): - Analog clock (new): nine faces on MaterialShapes dials (Round, Numeral, Day, Cookie, Sunny, Scallop, Clover, Square, Petal) with per-face hands, a seconds dot and Google-Clock-style orbiting date on some faces, and a day/date pill on others. Style picker previews inflate the real views. - Digital clock: rebuilt as RemoteViews faces (Classic, Thin, Bold, Pill, Stacked) shared by the widget and its config previews; world clocks are opt-in and only on the card faces. - Next alarm and Timers: shape badges, icon buttons, proportional readouts; a lone timer on a tall widget gets a stacked layout. - Stopwatch (new): large readout with play/pause pill and lap/reset. - Quick timer (new): a Scallop that is a timer of its own — tap to start a transient timer of its configured duration, tap again to reset/stop. Colours resolve in the launcher (widget_* palette resources, GlanceTheme's dynamic colours) so widgets follow day/night and the wallpaper. Data widgets collect their flows inside the composition so a live Glance session never shows stale state, chronometer bases use elapsedRealtime, and config activities close cleanly on an invalid widget id.
33 lines
1.2 KiB
XML
33 lines
1.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- One world-clock row on the surface card: the city, then its own `TextClock`
|
|
(its zone set at runtime). Sized by `ui/widget/DigitalFaces.kt`. -->
|
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
android:id="@+id/widget_digital_city_name"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:ellipsize="end"
|
|
android:fontFamily="sans-serif-medium"
|
|
android:includeFontPadding="false"
|
|
android:maxLines="1"
|
|
android:textColor="@color/widget_on_surface_variant"
|
|
android:textSize="14sp" />
|
|
|
|
<TextClock
|
|
android:id="@+id/widget_digital_city_time"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:fontFamily="sans-serif-medium"
|
|
android:includeFontPadding="false"
|
|
android:maxLines="1"
|
|
android:textColor="@color/widget_on_surface"
|
|
android:textSize="14sp" />
|
|
|
|
</LinearLayout>
|