Launcher3 Hotseat布局

当我们修改完LCD竖屏横用之后会出现一个问题,那就是Hotseat的布局不会跟随着变化,当竖屏的时候默认就会在下面,但是我们竖屏横用之后Hotseat布局依然是在右边没有随之实现水平排列下面我们就来实现这个功能。


1 、修改packages/apps/launcher3\src\main\res\values\config.xml

false

2 、修改packages\apps\launcher3\src\com\android\launcher3\Hotseat.java
    protected void onFinishInflate() {
        super.onFinishInflate();
        LauncherAppState app = LauncherAppState.getInstance();
        DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();

        mAllAppsButtonRank = grid.hotseatAllAppsRank;
        mContent = (CellLayout) findViewById(R.id.layout);
		//判断设备是横向还是纵向类型,决定横向还是纵向布局热键
        if (grid.isLandscape && !grid.isLargeTablet()) {
        //    mContent.setGridSize(1, (int) grid.numHotseatIcons);
		// 替换成水平布局
			mContent.setGridSize((int) grid.numHotseatIcons, 1);
        } else {
            mContent.setGridSize((int) grid.numHotseatIcons, 1);
        }
        mContent.setIsHotseat(true);

        Log.i(TAG, "onFinishInflate,(int) grid.numHotseatIcons: " + (int) grid.numHotseatIcons);

        resetLayout();
    }

这里网上看到一个修改屏蔽开机小提示的分享出来packages\apps\launcher3\src\com\android\launcher3\LauncherClings.java

private static final boolean DISABLE_CLINGS = true;

还有隐藏搜索引擎栏

修改packages\apps\launcher3\src\com\android\launcher3\Launcher.java

 private void setupViews() {
    ...
     mSearchDropTargetBar = (SearchDropTargetBar)
            mDragLayer.findViewById(R.id.search_drop_target_bar);
    //隐藏首页搜索栏
    mSearchDropTargetBar.setVisibility(View.GONE);
    ....
    }




你可能感兴趣的:(Android)