Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Android Launcher 如何去掉主菜單,所有應用擺在桌面,類似小米桌面

Android Launcher 如何去掉主菜單,所有應用擺在桌面,類似小米桌面

編輯:關於Android編程

 

 

Launcher3/src/com/android/launcher3/ 1. AppsCustomizePagedView.java public static boolean DISABLE_ALL_APPS = true; //mtk modify 2. AppsCustomizePagedView.java
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
LauncherLog.d(TAG, onMeasure mIsInEditMode = + mIsInEditMode + widthMeasureSpec + + heightMeasureSpec
+ + width + + height);
if (!isDataReady()) {
LauncherLog.d(TAG, onMeasure DISABLE_ALL_APPS is + DISABLE_ALL_APPS
+ !mApps.isEmpty() is + !mApps.isEmpty()
+ !mWidgets.isEmpty() + !mWidgets.isEmpty());
if ((DISABLE_ALL_APPS || (!mApps.isEmpty() && mAppsHasSet)) && !mWidgets.isEmpty()) { //mtk modify
setDataIsReady();
setMeasuredDimension(width, height);
onDataReady(width, height);
}
} super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} 3.Launcher.java private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded,
final AppsCustomizePagedView.ContentType contentType) {
......
// Shrink workspaces away if going to AppsCustomize from workspace
Animator workspaceAnim =
mWorkspace.getChangeStateAnimation(Workspace.State.SMALL, animated);
//if (!AppsCustomizePagedView.DISABLE_ALL_APPS) { //mtk modify
// Set the content type for the all apps space
mAppsCustomizeTabHost.setContentTypeImmediate(contentType);
//} //mtk modify
......
}
4. default_workspace.xml文件(這個文件很多路徑有,請確保修改到正確的文件,例如)mediatek/operator/有) 這個文件會配置hotseat的圖標,默認不會配置screen為2的位置,這是原來的allapp button,做了此客制化後就需要配置screen2,而不能配置screen 4,因此,請對應修改原來4個hotseat圖標的screen id,從0到3.

 

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved