Example usage for android.widget ImageSwitcher ImageSwitcher

List of usage examples for android.widget ImageSwitcher ImageSwitcher

Introduction

In this page you can find the example usage for android.widget ImageSwitcher ImageSwitcher.

Prototype

public ImageSwitcher(Context context) 

Source Link

Document

Creates a new empty ImageSwitcher.

Usage

From source file:at.wada811.imageslider.ImageSliderFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mImageSwitcher = new ImageSwitcher(getActivity());
    mImageSwitcher.setFactory(new ViewFactory() {
        @Override/*  w  w  w .j ava 2 s.  c  om*/
        public View makeView() {
            return new ImageView(getActivity());
        }
    });
    mImageSwitcher.setOnTouchListener(mSwipeTouchListener);
    setImageBitmap(BitmapUtils.createBitmapFromResource(getActivity(), R.drawable.ic_launcher));
    return mImageSwitcher;
}