• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            life02

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              197 隨筆 :: 3 文章 :: 37 評論 :: 0 Trackbacks
            http://blog.csdn.net/the01hierarch/article/details/7631081
            1.左滑切換到顯示所有apps

            PageView.java
            ->onTouchEvent->case MotionEvent.ACTION_UP->if (mTouchState == TOUCH_STATE_SCROLLING)->else { snapToDestination();->后添加

            if(((isSignificantMove && deltaX > 0 && !isFling) ||
                                        (isFling 
            && velocityX > 0)) && mCurrentPage == 0)
                                {
                                    snapToLeftDestination();
                                }

            并在Workspace.java中重寫函數

                
            protected void snapToLeftDestination() {
                    mLauncher.showAllApps(
            true);
                }


            2.靜態添加屏幕和屏幕上的快捷鍵

            http:
            //blog.csdn.net/the01hierarch/article/details/7641521

            android1.6的版本有3個屏 需要把它改為5個屏 需要修改的地方 如下 

            1、Launcher.java

            Java代碼  收藏代碼

                
            static final int SCREEN_COUNT = 5;  
                
            static final int DEFAULT_SCREN = 2;  



            2、launcher.xml

            Java代碼  收藏代碼

                
            <com.lp.launcher.Workspace  
                        android:id
            ="@+id/workspace"  
                        android:layout_width
            ="fill_parent"  
                        android:layout_height
            ="fill_parent"  
                  
                        launcher:defaultScreen
            ="2">//從0開始  
                  
                        
            <include android:id="@+id/cell1" layout="@layout/workspace_screen" />  
                        
            <include android:id="@+id/cell2" layout="@layout/workspace_screen" />  
                        
            <include android:id="@+id/cell3" layout="@layout/workspace_screen" />  
                        
            <include android:id="@+id/cell4" layout="@layout/workspace_screen" />  
                        
            <include android:id="@+id/cell5" layout="@layout/workspace_screen" />  
                  
                
            </com.lp.launcher.Workspace>  



            defaultScreen 修改為2 然后 加兩個
            <include />

            然后 修改默認顯示的屏 

            3、Workspace.java

            修改構造方法里面的
            Java代碼  收藏代碼

                mDefaultScreen 
            = a.getInt(R.styleable.Workspace_defaultScreen, 2);//從0開始  



            這時 基本上已經可以顯示5個屏幕了 默認的屏也是第三個屏了 但是進去后 默認顯示的屏什么也沒有 我們需要把組建都挪到默認屏上去

            4、default_workspace.xml

            修改所有的 launcher:screen 為 
            2  

            Java代碼  收藏代碼

                launcher:screen
            ="2"  



            3.桌面最下方顯示3個指定快捷方式

            方法一:在launcher.xml中刪除    

            <include
                    android:id
            ="@+id/hotseat"
                    android:layout_width
            ="match_parent"
                    android:layout_height
            ="@dimen/button_bar_height_plus_padding"
                    android:layout_gravity
            ="bottom"
                    layout
            ="@layout/hotseat"/>

            并添加相應的按鈕

            方法二:修改default_workspace.xml

            方法三:如果是定死熱鍵,不可改變的話不推薦

            重寫LauncherModel
            ->loadWorkspace中獲得的數據方法,其中sWorkspaceItems.add(info);就是添加快捷方式(包括桌面widget和下面的熱鍵)

            在Hotseat
            ->resetLayout->刪除mContent.addViewToCellLayout(allAppsButton, -10new CellLayout.LayoutParams(x,y,1,1), true);




            4.動態添加屏幕

            在launcher.java中添加兩個按鍵事件
            ---------之后可以將這兩個按鈕作為appwidget加到默認的桌面上,和launcher交互用動態(內部注冊)廣播

                
            public void addScreen(View view)
                {
                    LayoutInflater  mInflater 
            = LayoutInflater.from(this);
                    CellLayout mCelllayout 
            =(CellLayout)mInflater.inflate(R.layout.workspace_screen,null);
                    mWorkspace.addView(mCelllayout);
                    mWorkspace.requestLayout();
                }

                
                
            public void removeScreen(View view)
                {
                    
            int currentPage = mWorkspace.getCurrentPage();
                    
            int countPage = mWorkspace.getChildCount();
                    
            if(countPage > 1)
                    {
                        
            if(currentPage == (countPage - 1))
                        {
                            currentPage
            --;
                        }
                        mWorkspace.removeViewAt(countPage 
            - 1);
                    }
                    mWorkspace.requestLayout();
                    mWorkspace.snapToPage(currentPage);
                }
            posted on 2012-07-26 16:29 life02 閱讀(533) 評論(0)  編輯 收藏 引用 所屬分類: Android開發
            久久99热这里只有精品国产| 性做久久久久久久| 精品国产一区二区三区久久| 亚洲国产精品无码久久98| 亚洲AV无码1区2区久久 | av国内精品久久久久影院| 亚洲va久久久噜噜噜久久| 久久亚洲精品国产精品| 久久精品国产亚洲沈樵| 亚洲国产精品成人AV无码久久综合影院 | 久久久久亚洲精品日久生情| 久久久精品人妻一区二区三区蜜桃| 久久久久亚洲AV无码永不| 国产高清国内精品福利99久久| 久久精品不卡| 国内精品伊人久久久久av一坑 | 国产精品内射久久久久欢欢| 久久久久久久久久久| 亚洲综合婷婷久久| 久久综合九色综合网站| 久久久艹| 久久香蕉一级毛片| 久久久久久夜精品精品免费啦| 久久免费视频一区| 嫩草影院久久国产精品| 久久综合给合久久狠狠狠97色69| 成人亚洲欧美久久久久| 久久精品人人槡人妻人人玩AV | 亚洲人AV永久一区二区三区久久| 97久久天天综合色天天综合色hd| 久久人人爽人人人人片av| 久久人人爽人人爽人人片AV麻豆 | 亚洲精品视频久久久| 久久亚洲国产精品一区二区| 久久棈精品久久久久久噜噜| 亚洲?V乱码久久精品蜜桃| 久久久久99精品成人片牛牛影视| 久久综合中文字幕| 国产午夜久久影院| 国产精品熟女福利久久AV| 91麻豆精品国产91久久久久久|