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

TextGammaActivity

public class TextGammaActivity extends android.app.Activity

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

        super.onCreate(savedInstanceState);

        final LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);

        final GammaTextView gamma = new GammaTextView(this);
        layout.addView(gamma, new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT
        ));

        setContentView(layout);

        layout.post(new Runnable() {
            public void run() {
                Bitmap b = Bitmap.createBitmap(gamma.getWidth(), gamma.getHeight(),
                        Bitmap.Config.ARGB_8888);
                Canvas c = new Canvas(b);
                c.drawColor(0, PorterDuff.Mode.CLEAR);
                gamma.draw(c);

                ImageView image = new ImageView(TextGammaActivity.this);
                image.setImageBitmap(b);

                layout.addView(image, new LinearLayout.LayoutParams(
                        LinearLayout.LayoutParams.WRAP_CONTENT,
                        LinearLayout.LayoutParams.WRAP_CONTENT
                ));

                startActivity(new Intent(TextGammaActivity.this, SubGammaActivity.class));
            }
        });

        getWindow().setBackgroundDrawable(new ColorDrawable(0xffffffff));