Skip to content

Android custom view for displaying set of an arbitrary images as a grid

Notifications You must be signed in to change notification settings

amagda/GridImageView

Repository files navigation

GridImageView

Android custom view for displaying set of an arbitrary images as a grid.

Image loading based on the third party library Picasso

Usage

XML

<com.amagda.android.sample.GridImageView
            android:layout_width="200dp"
            android:layout_height="200dp"
            app:padding_btw_images="2dp"
            app:shape_mode="circle" />
Properties

You may use the following properties in your XML to customize your GridImageView.

  • app:padding_btw_images (dimension) -> default 0dp
  • app:shape_mode (rectangle or circle) -> default rectangle

Java

GridImageView gridImageView = (GridImageView) findViewById(R.id.grid_image_view);
gridImageView.setPaddingBetweenImages(getResources().getDimensionPixelOffset(R.dimen.padding_btw_images));
gridImageView.setShapeMode(GridImageView.CIRCLE_SHAPE_MODE);
gridImageView.setImagePaths(
    "http://x.annihil.us/u/prod/marvel/i/mg/9/80/537ba5b368b7d.jpg",
    "http://i.annihil.us/u/prod/marvel/i/mg/c/60/55b6a28ef24fa.jpg",
    "http://x.annihil.us/u/prod/marvel/i/mg/6/60/538cd3628a05e.jpg",
    "http://x.annihil.us/u/prod/marvel/i/mg/7/10/537bc71e9286f.jpg");

About

Android custom view for displaying set of an arbitrary images as a grid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages