FileDocCategorySizeDatePackage
MutateDrawable.javaAPI DocAndroid 5.1 API1566Thu Mar 12 22:22:12 GMT 2015android.view

MutateDrawable

public class MutateDrawable extends android.app.Activity

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

        super.onCreate(savedInstanceState);

        LinearLayout layout = new LinearLayout(this);

        Button ok = new Button(this);
        ok.setId(R.id.a);
        ok.setBackgroundDrawable(getResources().getDrawable(
                R.drawable.sym_now_playing_skip_forward_1));

        Button cancel = new Button(this);
        cancel.setId(R.id.b);
        cancel.setBackgroundDrawable(getResources().getDrawable(
                R.drawable.sym_now_playing_skip_forward_1));

        layout.addView(ok);
        layout.addView(cancel);

        ok.getBackground().mutate().setAlpha(127);

        setContentView(layout);