I've programmed Android for a while, but this really puzzles me.
So I have a simple appwidget with a textview. I simply want the text font size inside that textview to scale up/down if the user resizes the widget so as to make the text larger if the app is resized. I have tried several solutions but everything fails:
It's not possible to automatically scale the text of a TextView based on parent size. A workaround would be to override the
onDraw method of the TextView and implement the scaling manually.
As for the appwidgets: You can't retrieve a resizable appwidget's current size because they are intended for use with
GridView containers. These containers will manage the scaling and spacing of content automatically and will make themselves scrollable if the content can't fit in the appwidget's current size.
If you're not using a
ListView or a
GridView it seems to me the best way to "scale" the components of a appwidget is the method you already mentioned: Use different non-resizeable appwidgets.