Skip to content

Instantly share code, notes, and snippets.

View janishar's full-sized avatar
🚀
I help developers become better coders

Janishar Ali janishar

🚀
I help developers become better coders
View GitHub Profile
<com.mindorks.placeholderview.PlaceHolderView
android:id="@+id/galleryView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
@Animate(Animation.ENTER_LEFT_DESC)
@NonReusable
@Layout(R.layout.gallery_item_big)
public class ImageTypeBig {
@View(R.id.imageView)
private ImageView imageView;
private String mUlr;
private Context mContext;
PlaceHolderView mGalleryView = (PlaceHolderView)findViewById(R.id.galleryView);
mGalleryView
.addView(new ImageTypeBig(this.getApplicationContext(), mGalleryView, url1));
.addView(new ImageTypeBig(this.getApplicationContext(), mGalleryView, url2));
.addView(new ImageTypeBig(this.getApplicationContext(), mGalleryView, url3));
.addView(new ImageTypeBig(this.getApplicationContext(), mGalleryView, url4));
// If customisation is Required then use Builder with the PlaceHolderView
placeHolderView.getBuilder()
.setHasFixedSize(false)
.setItemViewCacheSize(10)
.setLayoutManager(new GridLayoutManager(this, 3));
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.mindorks.placeholderview.PlaceHolderView
android:id="@+id/galleryView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@Animate(Animation.CARD_LEFT_IN_DESC)
@NonReusable
@Layout(R.layout.gallery_item)
public class GalleryItem {
@View(R.id.imageView)
private ImageView imageView;
private Drawable mDrawable;
android {
...
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
res.srcDirs = ['src/main/res', 'src/main/res/drawable']
}
}
}