FileDocCategorySizeDatePackage
ViewFlipperActivity.javaAPI DocAndroid 5.1 API2304Thu Mar 12 22:22:44 GMT 2015com.android.test.hwui

ViewFlipperActivity

public class ViewFlipperActivity extends android.app.Activity

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        final LayoutInflater inflater = getLayoutInflater();
        final View widget = inflater.inflate(R.layout.widget, null);
        widget.setLayoutParams(new FrameLayout.LayoutParams(180, 180, Gravity.CENTER));
        
        ViewFlipper flipper = (ViewFlipper) widget.findViewById(R.id.flipper);
        
        View view = inflater.inflate(R.layout.flipper_item, flipper, false);
        flipper.addView(view);
        ((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset1);
        ((TextView) view.findViewById(R.id.widget_text)).setText("This is a long line of text, " 
                + "enjoy the wrapping and drawing");

        view = inflater.inflate(R.layout.flipper_item, flipper, false);
        flipper.addView(view);
        ((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset3);
        ((TextView) view.findViewById(R.id.widget_text)).setText("Another very long line of text, " 
                + "enjoy the wrapping and drawing");

        FrameLayout layout = new FrameLayout(this);
        layout.addView(widget);
        
        setContentView(layout);