I created a nice widet for my app. It just displays a list of items downloaded from a server. Well, to be precise, it only looks like a list, since ListView in RemoteViews is not supported in older android versions (which I want to support).
I want my widget to show a list of up-to-date items and I want these items to take all available widget space. To better show my problem, lest's assume WLOG that I want a widget with the TV schedule of selected programme. Knowing that:
- Downloading from server is costly
- WLOG we can assume that there are Aleph zero items on server that I can download
- The TV schedule may change, so we don't want to download schedule for a whole month, but at most half of a day
- The first item displayed will contain show currently being broadcasted
How I can ensure that there will be no empty space at the bottom of the widget if the user will resize it to make it larger? I searched SO and it seems that when user will change widget size (on ICS or custom launcher - GO Launcher EX allows it) it will be impossible (Correct me if I'm wrong) to get widget's new dimensions.
But I don't really need them! I would like to know how many items will fit in the widget and calculating this from widget's size is just one of the methods.
So, I'm asking you if it's possible to, for example, receive notification if a remote view will become visible, or create custom view for use in RemoteViews which would somehow allow me to estimate the number of visible items.
If it won't be possible, I will just have to use some reasonable defaults, but it would be nice to know how many rows I can show.