Search in sources :

Example 1 with RemoteImageLoader

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);
    }
}
Also used : FrameLayout(android.widget.FrameLayout) RemoteImageLoader(com.github.ignition.support.images.remote.RemoteImageLoader)

Example 2 with RemoteImageLoader

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);
        }
    });
}
Also used : RemoteImageGalleryAdapter(com.github.ignition.core.adapters.RemoteImageGalleryAdapter) RemoteImageView(com.github.ignition.core.widgets.RemoteImageView) ViewGroup(android.view.ViewGroup) Gallery(android.widget.Gallery) RemoteImageLoader(com.github.ignition.support.images.remote.RemoteImageLoader)

Aggregations

RemoteImageLoader (com.github.ignition.support.images.remote.RemoteImageLoader)2 ViewGroup (android.view.ViewGroup)1 FrameLayout (android.widget.FrameLayout)1 Gallery (android.widget.Gallery)1 RemoteImageGalleryAdapter (com.github.ignition.core.adapters.RemoteImageGalleryAdapter)1 RemoteImageView (com.github.ignition.core.widgets.RemoteImageView)1