use of com.github.ignition.support.images.remote.RemoteImageLoader in project ignition by mttkay.
the class RemoteImageView method initialize.
private void initialize(Context context, String imageUrl, Drawable progressDrawable, Drawable errorDrawable, boolean autoLoad, AttributeSet attributes) {
this.imageUrl = imageUrl;
this.autoLoad = autoLoad;
this.progressDrawable = progressDrawable;
this.errorDrawable = errorDrawable;
if (sharedImageLoader == null) {
this.imageLoader = new RemoteImageLoader(context);
} else {
this.imageLoader = sharedImageLoader;
}
progressViewContainer = new FrameLayout(getContext());
progressViewContainer.addView(buildProgressSpinnerView(getContext()));
if (autoLoad) {
loadImage();
} else {
showProgressView(false);
}
}
use of com.github.ignition.support.images.remote.RemoteImageLoader in project ignition by mttkay.
the class RemoteImageGalleryActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.remote_image_gallery_sample);
RemoteImageView.setSharedImageLoader(new RemoteImageLoader(this));
Gallery gallery = (Gallery) findViewById(R.id.gallery);
gallery.setAdapter(new RemoteImageGalleryAdapter(this, Arrays.asList(imageUrls)) {
@Override
protected void onGetView(int position, RemoteImageView remoteImageView, ViewGroup remoteImageViewContainer, ViewGroup parent) {
// just to illustrate how you can adjust aspects of the rendered images here
remoteImageView.setScaleType(ScaleType.CENTER_CROP);
remoteImageViewContainer.setBackgroundResource(android.R.drawable.gallery_thumb);
int padding = IgnitedScreens.dipToPx(parent.getContext(), 15);
remoteImageViewContainer.setPadding(padding, padding, padding, padding);
}
});
}
Aggregations