-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Pre-submission checklist
- I am submitting a bug report, not a feature request.
- I have searched for similar issues, but did not find any matches.
Description
I used to have (and in fact still do) several 2x1 (width 2, height 1) Target widgets. Today I accidentally resized one, and I am now unable to bring it back to 2x1, even though it allows me to set it to 1x2 (width 1, height 2). Creating a new target widget only allows for 1x2, and it's also marked as such in the widget select screen (see screenshots below).
In addition -- and the reason I reported this as a bug and not a feature request -- the widget is unreadable as 1x2 (see attached screenshot) but looks fine as 2x1.
Steps to reproduce
- Long press the home screen and select "Add widget"
- Select "Habits" and the "Target" widget
- Place it on the home screen and try to resize it to 2x1
Alternatively, if the Target widget is already on the home screen:
- Long press the widget
- Try to resize it by dragging the borders
System information
- Phone: Samsung S23
- Phone Operating System: Android 14, One UI 6.1
- App version: 2.2.1
Additional details
I found a few related discussions and a closed issue:
- Bring back smaller streaks widgets #1625
- widget size: reduce minimum vertical dimension #2096
- minimum widget sizes #835
- Allow widgets to resize to 1x1 #797
- Loop 2.3.0 - 1x1 Checkmark Widget #2164
- Widget size change disfunction #930
In summary, it seems that:
- The widgets were initially designed with a minimum size limit (2x2?) because the content would have been to difficult to see otherwise (at least on old phones with small screen resolution);
- Samsung One UI didn't respect the minimum size limit and allowed users to set smaller sizes, and this worked fine for several widgets despite the restrictions (probably on phones with higher screen resolution);
- At some point, Samsung started respecting the minimum size limit, forcing the users to have bigger widgets (unless they had already set them to a smaller size before the update);
- In minimum widget sizes #835 (comment) @iSoron seems to agree on removing the size limits.
I'm not familiar with Android development, but by looking at the code and the changes in #1514 I noticed that:
- The Checkmark widget (which allows 1x1) has
minHeight/minWidthof40dp:
uhabits/uhabits-android/src/main/res/xml/widget_checkmark_info.xml
Lines 21 to 23 in 107c898
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minHeight="40dp" android:minWidth="40dp" - The Target widget has
minHeight/minWidth/minResizeHeight/minResizeWidthof80dp(seemingly implying 2x2):
uhabits/uhabits-android/src/main/res/xml/widget_target_info.xml
Lines 21 to 25 in 107c898
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minHeight="80dp" android:minWidth="80dp" android:minResizeWidth="80dp" android:minResizeHeight="80dp" - The
targetCellWidth/targetCellHeightare not set (not sure if they are useful though); - Despite both sizes being set to
80dp, the OS shows the size as 1x2, even though the initial intention seems to have been having 2x2 as minimum size.
Note that this likely applies to other widgets as well -- I only tested it with the Target widget and since I has some "old" widgets still set to 2x1 I can confirm that the widget works fine as 2x1 (something I can't confirm for the other widgets -- but see e.g. #1625 for the Streak widget).
In addition, if updating the minHeight/minResizeHeight to 40dp is enough to fix the issue, I can create a PR to do that, but I won't be able to test it locally.
Screenshots
This shows two "old" 2x1 widgets on the left, and a "new" 1x2 widget on the right:

This shows the widget selection screen, with the Target widget marked as 1x2:

TL;DR
The devs wanted to set the minimum widget size to 2x2, the users wanted to (and could) set it to 2x1/1x1 (and it worked fine), Samsung now wants to force them to use 1x2 as minimum size (which doesn't quite work).
Removing the minimum size limit should make everyone happy.