8

Retain image aspect ratio in app widget GridView

view full story
linux-howto

http://stackoverflow.com – I'm working on an application that has several application widgets, and some of them are using a GridView to display their content. The content is a bunch of movie cover art images, and I'd like to retain the original aspect ratio of the images. Alternatively, I'm looking for a way to declare an aspect ratio for the images. It's important that the images still fit the width of the GridView when the user changes the size of the app widget, however. Since it's not possible to use sub-classes of ImageView when dealing with RemoteViews, that's out of the question. I'm currently using ScaleType.C (HowTos)