Search in sources :

Example 1 with Gallery

use of android.widget.Gallery in project platform_frameworks_base by android.

the class BiDiTestGalleryRtl method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.gallery_rtl, container, false);
    Gallery g = (Gallery) v.findViewById(R.id.galleryview);
    g.setAdapter(new BiDiTestGalleryImages(this.getActivity().getBaseContext()));
    return v;
}
Also used : Gallery(android.widget.Gallery) View(android.view.View)

Example 2 with Gallery

use of android.widget.Gallery in project coursera-android by aporter.

the class GalleryActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Gallery g = (Gallery) findViewById(R.id.gallery);
    // Create a new ImageAdapter and set in as the Adapter for the Gallery
    g.setAdapter(new ImageAdapter(this));
    // Set an setOnItemClickListener on the Gallery
    g.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            // Display a Toast message indicate the selected item
            Toast.makeText(GalleryActivity.this, "" + position, Toast.LENGTH_SHORT).show();
        }
    });
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Gallery(android.widget.Gallery) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 3 with Gallery

use of android.widget.Gallery in project android_frameworks_base by ParanoidAndroid.

the class BiDiTestGalleryLtr method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.gallery_ltr, container, false);
    Gallery g = (Gallery) v.findViewById(R.id.galleryview);
    g.setAdapter(new BiDiTestGalleryImages(this.getActivity().getBaseContext()));
    return v;
}
Also used : Gallery(android.widget.Gallery) View(android.view.View)

Example 4 with Gallery

use of android.widget.Gallery 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)

Example 5 with Gallery

use of android.widget.Gallery in project UltimateAndroid by cymcsg.

the class ImageFilterActivity method LoadImageFilter.

/**
	 * ����ͼƬfilter
	 */
private void LoadImageFilter() {
    Gallery gallery = (Gallery) findViewById(R.id.galleryFilter);
    final ImageFilterAdapter filterAdapter = new ImageFilterAdapter(ImageFilterActivity.this);
    gallery.setAdapter(new ImageFilterAdapter(ImageFilterActivity.this));
    gallery.setSelection(2);
    gallery.setAnimationDuration(3000);
    gallery.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) {
            IImageFilter filter = (IImageFilter) filterAdapter.getItem(position);
            new processImageTask(ImageFilterActivity.this, filter).execute();
        }
    });
}
Also used : IImageFilter(com.marshalchen.common.uimodule.ImageFilter.IImageFilter) Gallery(android.widget.Gallery) AdapterView(android.widget.AdapterView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView)

Aggregations

Gallery (android.widget.Gallery)19 View (android.view.View)15 AdapterView (android.widget.AdapterView)5 ImageView (android.widget.ImageView)5 OnClickListener (android.view.View.OnClickListener)2 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)2 RemoteImageView (com.github.ignition.core.widgets.RemoteImageView)2 ViewGroup (android.view.ViewGroup)1 FrameLayout (android.widget.FrameLayout)1 LayoutParams (android.widget.Gallery.LayoutParams)1 TextView (android.widget.TextView)1 RemoteImageGalleryAdapter (com.github.ignition.core.adapters.RemoteImageGalleryAdapter)1 RemoteImageLoader (com.github.ignition.support.images.remote.RemoteImageLoader)1 IImageFilter (com.marshalchen.common.uimodule.ImageFilter.IImageFilter)1