Incorrect widget pixel dimensions reported by MS Launcher

New Contributor
I am the developer of an app that relies on getting accurate pixel dimensions for its widget, so that it can render a bitmap that will fit exactly inside it... for both portrait and landscape home screen orientations.
But in MS Launcher the pixel dimensions being reported don't match the actual widget bounds... by quite some way.
I've created a sample app to demonstrate this.  After installation:
(1) orient phone in portrait orientation
(2) place a widget on the home screen... just hit ADD WIDGET in the config activity without changing anything
(3) hit UPDATE on the widget to draw a green bitmap that should (in theory) fill the widget bounds perfectly
(4) now rotate the home screen to landscape orientation (if this is possible in MS Launcher?)
(5) hit UPDATE on the widget to redraw the green bitmap
On my device the green bitmap does not fill the widget very well... see screenshot below.  The screenshot shows blue-coloured gaps top and bottom... the green bitmap doesn't fit the widget outline... nowhere near.
SmartSelect_20200418-094820_Microsoft Launcher.jpg
The key function in the code to get the widget dimensions is MyAppWidget.getWidgetDimensionsInDp().   The method used to get the widget dimensions is referenced in there.  My understanding is that the method is not entirely "official", but this method does work well in the majority of other launchers.
It would be great if this could be fixed in MS Launcher, so that the AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH etc values properly reflect the actual widget dimensions... for both landscape and portrait home screen orientations.
2 Replies
Is there anyone here? Should I be reporting this sort of stuff elsewhere?
Hi, thanks for your feedback! We will look at it.