boes-matt / Sunrise

Respect the aspect ratio when loading images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sunrise

Sunrise is an "app snippet" that demonstrates loading images in a manner that respects the image's aspect ratio.

It uses Square's Picasso library. Comments on StackOverflow complain of Picasso's fit() function not working properly.

I show how to use it, employing a custom view AspectRatioImageView to extend ImageView and override the onMeasure method.

The app also demonstrates the use of horizontal scroll views to wrap landscape photos.

Code links

MainActivity

AspectRatioImageView

activity_main.xml

About

Respect the aspect ratio when loading images


Languages

Language:Java 85.8%Language:Groovy 14.2%