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

AlphaLayersActivity

public class AlphaLayersActivity extends android.app.Activity

Fields Summary
private static final String
LOG_TAG
Constructors Summary
Methods Summary
static intdipToPx(android.content.Context c, int dip)

        return (int) (c.getResources().getDisplayMetrics().density * dip + 0.5f);
    
protected voidonCreate(android.os.Bundle savedInstanceState)


    
        
        super.onCreate(savedInstanceState);

        DirtyBitmapView container = new DirtyBitmapView(this);

        ColorView color = new ColorView(this);
        container.addView(color, new DirtyBitmapView.LayoutParams(
                dipToPx(this, 100), dipToPx(this, 100), Gravity.CENTER));

        AlphaAnimation a = new AlphaAnimation(1.0f, 0.0f);
        a.setDuration(2000);
        a.setRepeatCount(Animation.INFINITE);
        a.setRepeatMode(Animation.REVERSE);
        color.startAnimation(a);

        setContentView(container);