I have certain picture links in an array and I am displaying it by creating an ImageView for each picture in an array and placing it in a LinearLayout. This seems to work if there is only one or two picture in the array, but pictures are cutting off when there are more than two pictures. In addition, I also want to display images in their original sizes.
XML Code:
<LinearLayout
android:id="@+id/child_2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="3dp"
android:orientation="horizontal"
android:layout_below="@+id/child_2_4">
</LinearLayout>
MainActivity.java Code:
LinearLayout layout = (LinearLayout) findViewById(R.id.child_2_5);
for(int i=0; i<values1.length; i++) {
ImageView image = new ImageView(this);
image.setLayoutParams(new android.view.ViewGroup.LayoutParams(450,450));
Glide.with(Main2Activity.this).load(values1[i]).into(image); // I am using Glide to display images
layout.addView(image);
}
Here values1 = [https://drive.google.com/uc?export=view&id=0B6uiOVPlyIu-dnlFdTlZQ1lFNDA, https://drive.google.com/uc?export=view&id=0B6uiOVPlyIu-bUI1ZV9wY0R3cTQ, https://drive.google.com/uc?export=view&id=0B6uiOVPlyIu-WFpXeWVlZ01zX2c]
As you can see edges are cutting and pictures are not in this original size.