Android Launcher 1:1分屏 桌面1比1分屏

桌面一比一分屏

系统固定1比1 分屏

frameworks/base/core/res/res/values/config.xml
frameworks/base/core/res/res/values-sw600dp/config.xml

<!-- 默认值是1  按拖动比例分屏,修改为2固定1比1分屏 -->
<integer name="config_dockedStackDividerSnapMode">2</integer>

Launcher支持1:1分屏

修改文件路径
frameworks/base/services/core/java/com/android/server/wm/TaskStack.java

添加代码段1

private final boolean HOME_ONE_ONE_SPLIT = true;

修改代码段1

Task findHomeTask() {
	// add for home 1:1 split
	if (HOME_ONE_ONE_SPLIT) {
		return null;
	}
	// end
    if (!isActivityTypeHome() || mChildren.isEmpty()) {
        return null;
    }
    return mChildren.get(mChildren.size() - 1);
}

修改代码段2

getStackDockedModeBoundsLocked 方法中
        // When the home stack is resizable, should always have the same stack and task bounds
        if (isActivityTypeHome() && !HOME_ONE_ONE_SPLIT) { // modifyed for home 1:1 split
            final Task homeTask = findHomeTask();
            // ...
}

修改代码段3

setTouchExcludeRegion 方法中

    if (!HOME_ONE_ONE_SPLIT && task.isActivityTypeHome() && isMinimizedDockAndHomeStackResizable()) { // modifyed for home 1:1 split
        mDisplayContent.getBounds(mTmpRect);
    } else {
        task.getDimBounds(mTmpRect);
    }

posted @ 2022-03-12 22:04  xiaomodecnblogs  阅读(226)  评论(0编辑  收藏  举报