Skip to content

fix: shorten android 10 home-screen widgets#994

Merged
ovitrif merged 3 commits into
masterfrom
fix/widget-os-height-android-30
Jun 5, 2026
Merged

fix: shorten android 10 home-screen widgets#994
ovitrif merged 3 commits into
masterfrom
fix/widget-os-height-android-30

Conversation

@jvsena42
Copy link
Copy Markdown
Member

@jvsena42 jvsena42 commented Jun 5, 2026

This PR fixes home-screen (OS) widgets rendering too tall on Android 10 and 11.

Description

On API < 31 the launcher ignores targetCellHeight and maxResizeHeight and derives the widget container height from minHeight. The shared 110dp floor sits exactly on the 2-cell boundary (the 70n-30 cell-rounding rule), so launcher padding can round it up to 3 cells — making the blocks, news, price and weather widgets taller than on newer Android versions and in the in-app preview.

  • Lowers the pre-31 height floor (appwidget_min_height / appwidget_min_resize_height) to 90dp so it stays comfortably inside 2 cells.
  • Adds values-v31/dimens.xml restoring the original 110dp for API 31+, so Android 12+ behavior is unchanged (it still uses targetCellHeight / maxResizeHeight). Blocks' maxResizeHeight resolves to 110dp there too.

No provider XML or Kotlin changes are needed — all home-screen widgets reference these dimens. Facts is unaffected (fixed 40dp / 1-cell height). Verified on an API 29 device: blocks and news now render at ~2 cells, matching Android 13.

Preview

before.mp4
after.mp4

QA Notes

Manual Tests

  • 1. Android 10/11 → add Blocks widget to home screen: renders at ~2 cells, matching Android 13.
  • 2. Android 10/11 → add News widget: renders at ~2 cells, not over-tall.
  • 3a. Android 10/11 → add Price widget: ~2 cells.
    • 3b. Android 10/11 → add Weather widget: ~2 cells.
  • 4. regression: Android 12+ → add Blocks/News/Price/Weather: unchanged size.
  • 5. regression: Android 12+ → resize Blocks widget: max height still capped as before.

Automated Checks

  • N/A — resource-only change (dimens + new values-v31 qualifier); just compile and just lint pass, no unit-test coverage affected.

@jvsena42 jvsena42 self-assigned this Jun 5, 2026
@jvsena42 jvsena42 requested a review from ovitrif June 5, 2026 14:34
@jvsena42 jvsena42 added this to the 2.4.0 milestone Jun 5, 2026
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tAck

@ovitrif ovitrif merged commit acf3b1f into master Jun 5, 2026
17 checks passed
@ovitrif ovitrif deleted the fix/widget-os-height-android-30 branch June 5, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants