fix: shorten android 10 home-screen widgets#994
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes home-screen (OS) widgets rendering too tall on Android 10 and 11.
Description
On API < 31 the launcher ignores
targetCellHeightandmaxResizeHeightand derives the widget container height fromminHeight. The shared 110dp floor sits exactly on the 2-cell boundary (the70n-30cell-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.appwidget_min_height/appwidget_min_resize_height) to 90dp so it stays comfortably inside 2 cells.values-v31/dimens.xmlrestoring the original 110dp for API 31+, so Android 12+ behavior is unchanged (it still usestargetCellHeight/maxResizeHeight). Blocks'maxResizeHeightresolves 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
regression:Android 12+ → add Blocks/News/Price/Weather: unchanged size.regression:Android 12+ → resize Blocks widget: max height still capped as before.Automated Checks
values-v31qualifier);just compileandjust lintpass, no unit-test coverage affected.