mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-08 23:18:17 -07:00
fix(widget): refine layouts and progress UX across sizes
Compact (4×1)
- Reduce root vertical padding so the 4×1 cell yields ~56dp of content height.
- Make album art a true square (50×50dp) and center vertically; keeps edges
clear of rounded corners.
- Tighten timing block: 2dp progress bar; 10sp labels with no extra font
padding; prevents elapsed/total text from slipping below the background.
- Wrap album art in a 50×50dp FrameLayout with a new 6dp-radius background
drawable; soft corners while remaining visually smaller than the widget body.
- Mirror the same structure in the preview layout so Studio preview matches
on-device rendering.
(app/src/main/res/layout/widget_layout_compact.xml,
app/src/main/res/drawable/widget_album_art_bg.xml)
Large Short (4×2)
- Wrap album art in a fixed 90dp square container and enforce a true square
crop via centerCrop.
- Tighten vertical spacing: thinner progress bar, closer timing row, controls
shifted down for better balance.
- Keep album/timing text to the left of the controls but retune spacing so the
stack stays fully inside the widget bounds.
Large (4×3 and up)
- Restructure to a vertical stack: header row (album art + text), full-width
progress bar, timing row, primary controls, then secondary controls.
- Lock album art to a 150dp square; progress bar spans the widget beneath the
header to match the new visual hierarchy.
Based-on: cd28ee0764
Co-authored-by: The Firehawk <firehawk@opayq.net>
Co-Authored-By: Mücahit Kaya <kaya-mucahit@outlook.com>
Co-Authored-By: Firehawk <firehawk@opayq.net>
This commit is contained in:
parent
b79cfa4af0
commit
35af1f9038
17 changed files with 964 additions and 149 deletions
|
|
@ -4,6 +4,7 @@ import android.content.ComponentName;
|
|||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.media3.common.Player;
|
||||
import androidx.media3.session.MediaController;
|
||||
import androidx.media3.session.SessionToken;
|
||||
|
||||
|
|
@ -34,7 +35,23 @@ public final class WidgetActions {
|
|||
case WidgetProvider.ACT_PREV:
|
||||
c.seekToPrevious();
|
||||
break;
|
||||
case WidgetProvider.ACT_TOGGLE_SHUFFLE:
|
||||
c.setShuffleModeEnabled(!c.getShuffleModeEnabled());
|
||||
break;
|
||||
case WidgetProvider.ACT_CYCLE_REPEAT:
|
||||
int repeatMode = c.getRepeatMode();
|
||||
int nextMode;
|
||||
if (repeatMode == Player.REPEAT_MODE_OFF) {
|
||||
nextMode = Player.REPEAT_MODE_ALL;
|
||||
} else if (repeatMode == Player.REPEAT_MODE_ALL) {
|
||||
nextMode = Player.REPEAT_MODE_ONE;
|
||||
} else {
|
||||
nextMode = Player.REPEAT_MODE_OFF;
|
||||
}
|
||||
c.setRepeatMode(nextMode);
|
||||
break;
|
||||
}
|
||||
WidgetUpdateManager.refreshFromController(ctx);
|
||||
c.release();
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
Log.e("TempoWidget", "dispatch failed", e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue