I have a gallery in my app. My photos are from the internet, so they are added dynamically. My gallery doesn't crop them to all be a perfect square. I would like to do this just to make my gallery look better. I tried this in my XML;
ImageView
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="15dp"
android:adjustViewBounds="true"
android:scaleType="centerCrop"/>
But because I am adding the image dynamically and not from src
in xml, this wont work. Anyone know how to do this another way? I cant find anything on how to do it when added dynamically. Thanks in advance.