I begin to understand how it works.
The widget size (how many cells will be used) is based on the minWidth and minHeight attributes of the <widget>_info.xml. These values are derived from the Base Panel size.
The real size of the widget can be independent of this minimum values. That means it is possible to use another size for the Base Panel.
I have tried to use -2,-2 for the Panel size (this means "fill_parent"). Then I get a 1x1 widget. The launcher I use (Go Launcher) allows to resize widgets. I could resize the widget and the panel automatically resizes too. This is great.
What does this all mean?
To be free in designing widgets and to allow them adopt to other screen sizes (like switching between portrait and landscape) we need a possibility to change size and position of the widget elements.
My suggestions:
1. Add two parameters for minWidth and minHeight to ConfigureHomeWidget() function. Nice would be if it is possible to specify them as 4x1 etc. and B4A calculates the dp values itself with the given formula.
Example: ConfigureHomeWidget("L4x1", 4, 1, "rv", 60, "AHWeather 4x1")
2. Add a function to determine the real size of the widget container to the RemoteView object. I think this should be possible somehow?
3. Add functions to get and set position and dimension of widget elements to the RemoteView object so we can programatically set new size and position for our items on the widget.
Erel, what do you think? This shouldn't be too hard to add.