Search in sources :

Example 1 with RemoteImageGalleryAdapter

use of com.github.ignition.core.adapters.RemoteImageGalleryAdapter 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

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