Making a 4x4 widget that uses all available space
So after reviewing the guidelines on the developer's guide, I see that a safe 4x4 widget will have a size of 294 x 294 dp. However, on my test device which has a 480x800 screen, it fills it horizontally in portrait but not vertically. The widget that I'm making is intended to fill an开发者_Python百科 entire homescreen, by user request. Of course I know that you cannot entirely fullscreen a widget, but it's supposed to fill up the better part of the 4x4 tiles. As of now, though, it falls short vertically.
What is the best way to make it fill that space? Is there some sort of check that I should do in the actual provider and resize something accordingly?
The widget that I'm making is intended to fill an entire homescreen, by user request.
That is not possible, sorry.
What is the best way to make it fill that space?
Try an app widget with a different aspect ratio (e.g., 4x6 in portrait). Off the cuff, I am guessing that the aspect ratio is being maintained, and you are being constrained along the short dimension.
Is there some sort of check that I should do in the actual provider and resize something accordingly?
You cannot "resize something" on the fly. On Android 3.1, you can create app widgets that the user can resize, though this is mostly for app widgets using GridView
or ListView
.
精彩评论