FileDocCategorySizeDatePackage
RsListView.javaAPI DocAndroid 5.1 API2095Thu Mar 12 22:22:44 GMT 2015com.example.android.rs.miscsamples

RsListView

public class RsListView extends android.renderscript.RSSurfaceView

Fields Summary
private android.renderscript.RenderScriptGL
mRS
private RsListRS
mRender
Constructors Summary
public RsListView(android.content.Context context)

        super(context);
        ensureRenderScript();
    
Methods Summary
private voidensureRenderScript()

        if (mRS == null) {
            RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
            mRS = createRenderScriptGL(sc);
            mRender = new RsListRS();
            mRender.init(mRS, getResources());
        }
    
protected voidonAttachedToWindow()

        super.onAttachedToWindow();
        ensureRenderScript();
    
protected voidonDetachedFromWindow()

        mRender = null;
        if (mRS != null) {
            mRS = null;
            destroyRenderScriptGL();
        }
    
public booleanonTouchEvent(android.view.MotionEvent ev)

        boolean ret = false;
        int act = ev.getAction();
        if (act == MotionEvent.ACTION_DOWN) {
            mRender.onActionDown((int)ev.getX(), (int)ev.getY());
            ret = true;
        } else if (act == MotionEvent.ACTION_MOVE) {
            mRender.onActionMove((int)ev.getX(), (int)ev.getY());
            ret = true;
        }

        return ret;