Incorrect widget pixel dimensions reported by MS Launcher

%3CLINGO-SUB%20id%3D%22lingo-sub-1317759%22%20slang%3D%22en-US%22%3EIncorrect%20widget%20pixel%20dimensions%20reported%20by%20MS%20Launcher%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1317759%22%20slang%3D%22en-US%22%3E%3CDIV%3EI%20am%20the%20developer%20of%20an%20app%20that%20relies%20on%20getting%20accurate%20pixel%20dimensions%20for%20its%26nbsp%3B%3CEM%3Ewidget%3C%2FEM%3E%2C%20so%20that%20it%20can%20render%20a%20bitmap%20that%20will%20fit%20exactly%20inside%20it...%20for%20both%20portrait%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CI%3Eand%3C%2FI%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Elandscape%20home%20screen%20orientations.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EBut%20in%20MS%20Launcher%20the%20pixel%20dimensions%20being%20reported%20don't%20match%20the%20actual%20widget%20bounds...%20by%20quite%20some%20way.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI've%20created%20a%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fbitbucket.org%2Fdrmrbrewer%2Fmy-test-application%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esample%20app%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20demonstrate%20this.%26nbsp%3B%20After%20installation%3A%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E(1)%20orient%20phone%20in%20portrait%20orientation%3C%2FDIV%3E%3CDIV%3E(2)%20place%20a%20widget%20on%20the%20home%20screen...%20just%20hit%20ADD%20WIDGET%20in%20the%20config%20activity%20without%20changing%20anything%3C%2FDIV%3E%3CDIV%3E(3)%20hit%20UPDATE%20on%20the%20widget%20to%20draw%20a%20green%20bitmap%20that%20should%20(in%20theory)%20fill%20the%20widget%20bounds%20perfectly%3C%2FDIV%3E%3CDIV%3E(4)%20now%20rotate%20the%20home%20screen%20to%20landscape%20orientation%20(if%20this%20is%20possible%20in%20MS%20Launcher%3F)%3C%2FDIV%3E%3CDIV%3E(5)%20hit%20UPDATE%20on%20the%20widget%20to%20redraw%20the%20green%20bitmap%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EOn%20my%20device%20the%20green%20bitmap%20does%20not%20fill%20the%20widget%20very%20well...%20see%20screenshot%20below.%26nbsp%3B%20The%20screenshot%20shows%20blue-coloured%20gaps%20top%20and%20bottom...%20the%20green%20bitmap%20doesn't%20fit%20the%20widget%20outline...%20nowhere%20near.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SmartSelect_20200418-094820_Microsoft%20Launcher.jpg%22%20style%3D%22width%3A%20293px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F185140i69E72D084BF3550E%2Fimage-dimensions%2F293x270%3Fv%3D1.0%22%20width%3D%22293%22%20height%3D%22270%22%20title%3D%22SmartSelect_20200418-094820_Microsoft%20Launcher.jpg%22%20alt%3D%22SmartSelect_20200418-094820_Microsoft%20Launcher.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThe%20key%20function%20in%20the%20code%20to%20get%20the%20widget%20dimensions%20is%26nbsp%3B%3CFONT%20face%3D%22monospace%22%3EMyAppWidget.getWidgetDimensionsInDp()%3C%2FFONT%3E.%26nbsp%3B%20%26nbsp%3BThe%20method%20used%20to%20get%20the%20widget%20dimensions%20is%20referenced%20in%20there.%26nbsp%3B%20My%20understanding%20is%20that%20the%20method%20is%20not%20entirely%20%22official%22%2C%20but%20this%20method%20does%20work%20well%20in%20the%20majority%20of%20other%20launchers.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EIt%20would%20be%20great%20if%20this%20could%20be%20fixed%20in%20MS%20Launcher%2C%20so%20that%20the%20AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH%20etc%20values%20properly%20reflect%20the%20actual%20widget%20dimensions...%20for%20both%20landscape%20and%20portrait%20home%20screen%20orientations.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThanks.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1338308%22%20slang%3D%22en-US%22%3ERe%3A%20Incorrect%20widget%20pixel%20dimensions%20reported%20by%20MS%20Launcher%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1338308%22%20slang%3D%22en-US%22%3EIs%20there%20anyone%20here%3F%20Should%20I%20be%20reporting%20this%20sort%20of%20stuff%20elsewhere%3F%3C%2FLINGO-BODY%3E
Highlighted
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.
 
Thanks.
2 Replies
Highlighted
Is there anyone here? Should I be reporting this sort of stuff elsewhere?
Highlighted
Hi, thanks for your feedback! We will look at it.