`
yelinsen05
  • 浏览: 493724 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Android Launcher2 allapps.rs

阅读更多
Android 3.0中有个一个
/packages/apps/Launcher2/src/com/android/launcher2/allapps.rs
文件!
此文件在
/packages/apps/Launcher2/src/com/android/launcher2/AllApps3D.java
中被引用

public static class RolloRS {
 public void init(Resources res, int width, int height) {
            mRes = res;
            mWidth = width;
            mHeight = height;
            mScript = new ScriptC_allapps(sRS, mRes, R.raw.allapps);

            initProgramVertex();
            initProgramFragment();
            initProgramStore();
            initGl();
            initData();

            mScript.bind_gIcons(mAllocIcons);
            mScript.bind_gLabels(mAllocLabels);
            sRS.bindRootScript(mScript);
        }

R.raw.allapps就是对allapps.rs的引用!



    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
        //long startTime = SystemClock.uptimeMillis();

        super.surfaceChanged(holder, format, w, h);

        if (mSurrendered) return;

        mHaveSurface = true;

        if (sRollo == null) {
            sRollo = new RolloRS(this);
            sRollo.init(getResources(), w, h);
            if (mAllAppsList != null) {
                sRollo.setApps(mAllAppsList);
            }
            if (mShouldGainFocus) {
                gainFocus();
                mShouldGainFocus = false;
            }
        } else if (sRollo.mInitialize) {
            sRollo.initGl();
            sRollo.mInitialize = false;
        }

        initTouchState(w, h);

        sRollo.dirtyCheck();
        sRollo.resize(w, h);

        Log.d(TAG, "sc " + sRS);
        if (sRS != null) {
            mMessageProc = new AAMessage();
            sRS.setMessageHandler(mMessageProc);
        }

        //long endTime = SystemClock.uptimeMillis();
        //Log.d(TAG, "surfaceChanged took " + (endTime-startTime) + "ms");
    }


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics