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

LooperAcceleration

public class LooperAcceleration extends android.app.Activity

Fields Summary
static final boolean
INCLUDE_WEBVIEW
Constructors Summary
Methods Summary
private android.view.ViewmakeView()

        LinearLayout layout = new LinearLayout(this);
        layout.addView(new IsAcceleratedView(this), LayoutParams.MATCH_PARENT, 60);

        if (INCLUDE_WEBVIEW) {
            WebView wv = new WebView(this);
            wv.setWebViewClient(new WebViewClient());
            wv.setWebChromeClient(new WebChromeClient());
            wv.loadUrl("http://www.webkit.org/blog-files/3d-transforms/poster-circle.html");
            layout.addView(wv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        }
        return layout;
    
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        setContentView(makeView());

        new Thread() {
            @Override
            public void run() {
                Looper.prepare();
                final Context context = LooperAcceleration.this;
                Dialog dlg = new Dialog(context);
                dlg.addContentView(makeView(), new LayoutParams(300, 400));
                dlg.setCancelable(true);
                dlg.setCanceledOnTouchOutside(true);
                dlg.setOnDismissListener(new DialogInterface.OnDismissListener() {
                    @Override
                    public void onDismiss(DialogInterface dialog) {
                        Looper.myLooper().quit();
                    }
                });
                dlg.setTitle("Not Looper.getMainLooper() check");
                dlg.show();
                Looper.loop();
            }
        }.start();