当前位置: 首页 > news >正文

Lineageos 22.1(Android 15)Launcer简单调整初始化配置

一、前言

Launcer的初始化配置主要在如下的xml文件夹下,默认读取的5x5
在这里插入图片描述
这里我们把device_profiles调整一下,然后新建一个default_workspace_my.xml作为我们自己的配置就行。

二、配置

注意Lineageos 的Launcer是在lineageos/packages/apps/Trebuchet这个目录下面,和原生aosp有点差别。
简单调整
device_profiles.xml,

 <grid-option
        launcher:name="5_by_5"
        launcher:numRows="5"
        launcher:numColumns="6"
        launcher:numFolderRows="4"
        launcher:numFolderColumns="4"
        launcher:numHotseatIcons="5"
        launcher:numExtendedHotseatIcons="6"
        launcher:dbFile="launcher.db"
        launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_split"
        launcher:defaultLayoutId="@xml/default_workspace_my"
        launcher:deviceCategory="phone|multi_display" >

        <display-option
            launcher:name="Large Phone"
            launcher:minWidthDps="406"
            launcher:minHeightDps="694"
            launcher:iconImageSize="56"
            launcher:iconTextSize="12.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
            launcher:name="Large Phone Split Display"
            launcher:minWidthDps="406"
            launcher:minHeightDps="694"
            launcher:iconImageSize="56"
            launcher:iconTextSize="12.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
            launcher:name="Shorter Stubby"
            launcher:minWidthDps="255"
            launcher:minHeightDps="400"
            launcher:iconImageSize="48"
            launcher:iconTextSize="12.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

    </grid-option>

就调整了两行代码

  launcher:numColumns="6"
  launcher:defaultLayoutId="@xml/default_workspace_my"

然后是 default_workspace_my.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">

    <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
    <!-- Dialer, Messaging, Contacts, Browser, Camera -->
    <resolve
        launcher:container="-101"
        launcher:screen="0"
        launcher:x="0"
        launcher:y="0" >
        <favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
        <favorite launcher:uri="tel:123" />
        <favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
    </resolve>

    <resolve
        launcher:container="-101"
        launcher:screen="1"
        launcher:x="1"
        launcher:y="0" >
        <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
        <favorite launcher:uri="sms:" />
        <favorite launcher:uri="smsto:" />
        <favorite launcher:uri="mms:" />
        <favorite launcher:uri="mmsto:" />
    </resolve>

    <resolve
        launcher:container="-101"
        launcher:screen="2"
        launcher:x="2"
        launcher:y="0" >
        <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_CONTACTS;end" />
    </resolve>

    <resolve
        launcher:container="-101"
        launcher:screen="3"
        launcher:x="3"
        launcher:y="0" >
        <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_BROWSER;end" />
        <favorite launcher:uri="http://www.example.com/" />
    </resolve>

    <resolve
        launcher:container="-101"
        launcher:screen="4"
        launcher:x="4"
        launcher:y="0" >
        <favorite launcher:uri="#Intent;action=android.media.action.STILL_IMAGE_CAMERA;end" />
        <favorite launcher:uri="#Intent;action=android.intent.action.CAMERA_BUTTON;end" />
    </resolve>

    <!-- Screen 0 -->
<!--    <appwidget-->
<!--        launcher:packageName="com.google.android.googlequicksearchbox"-->
<!--        launcher:className="com.google.android.googlequicksearchbox.SearchWidgetProvider"-->
<!--        launcher:screen="0"-->
<!--        launcher:x="0"-->
<!--        launcher:y="0"-->
<!--        launcher:spanX="5"-->
<!--        launcher:spanY="1" />-->

    <appwidget
        launcher:packageName="com.android.deskclock"
        launcher:className="com.android.alarmclock.DigitalAppWidgetProvider"
        launcher:screen="0"
        launcher:x="0"
        launcher:y="1"
        launcher:spanX="6"
        launcher:spanY="2" />

    <!-- Google Folder -->
    <!-- Google, Gmail, Maps, YouTube, Drive, YouTube Music, Play Movies, Duo, Photos -->
    <folder
        launcher:title="@string/google_folder_title"
        launcher:screen="0"
        launcher:x="0"
        launcher:y="4">
        <favorite
            launcher:packageName="com.google.android.googlequicksearchbox"
            launcher:className="com.google.android.googlequicksearchbox.SearchActivity"/>
        <favorite
            launcher:packageName="com.google.android.gm"
            launcher:className="com.google.android.gm.ConversationListActivityGmail"/>
        <favorite
            launcher:packageName="com.google.android.apps.maps"
            launcher:className="com.google.android.maps.MapsActivity"/>
        <favorite
            launcher:packageName="com.google.android.youtube"
            launcher:className="com.google.android.youtube.app.honeycomb.Shell$HomeActivity"/>
        <favorite
            launcher:packageName="com.google.android.apps.docs"
            launcher:className="com.google.android.apps.docs.app.NewMainProxyActivity"/>
        <favorite
            launcher:packageName="com.google.android.apps.youtube.music"
            launcher:className="com.google.android.apps.youtube.music.activities.MusicActivity"/>
        <favorite
            launcher:packageName="com.google.android.videos"
            launcher:className="com.google.android.youtube.videos.EntryPoint"/>
        <favorite
            launcher:packageName="com.google.android.apps.tachyon"
            launcher:className="com.google.android.apps.tachyon.MainActivity"/>
        <favorite
            launcher:packageName="com.google.android.apps.photos"
            launcher:className="com.google.android.apps.photos.home.HomeActivity"/>
    </folder>

    <favorite
        launcher:screen="0"
        launcher:x="4"
        launcher:y="4"
        launcher:packageName="com.android.vending"
        launcher:className="com.android.vending.AssetBrowserActivity"/>

    <!-- Screen 1 -->
<!--    <appwidget-->
<!--        launcher:packageName="org.lineageos.twelve"-->
<!--        launcher:className="org.lineageos.twelve.ui.widgets.NowPlayingAppWidgetProvider"-->
<!--        launcher:screen="1"-->
<!--        launcher:x="0"-->
<!--        launcher:y="0"-->
<!--        launcher:spanX="5"-->
<!--        launcher:spanY="1" />-->

    <resolve
        launcher:screen="1"
        launcher:x="0"
        launcher:y="-1" >
        <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_EMAIL;end" />
        <favorite launcher:uri="mailto:" />
    </resolve>

    <resolve
        launcher:screen="1"
        launcher:x="1"
        launcher:y="-1" >
        <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_GALLERY;end" />
        <favorite launcher:uri="#Intent;type=images/*;end" />
    </resolve>

    <favorite
        launcher:packageName="org.lineageos.twelve"
        launcher:className="org.lineageos.twelve.MainActivity"
        launcher:screen="1"
        launcher:x="2"
        launcher:y="-1" />

    <favorite
        launcher:packageName="com.android.settings"
        launcher:className="com.android.settings.Settings"
        launcher:screen="1"
        launcher:x="3"
        launcher:y="-1" />

</favorites>

这里也调整了几个地方,把时钟弄成了6x2,然后移除了第二屏的音乐widget。
最后我们编译一下

make -j13 TrebuchetQuickStep  

这里更新直接安装apk就行,但是因为Launcer只有第一次会读取xml并保存到数据库,所以要删除db

adb root;adb remount
adb shell rm /data/data/com.android.launcher3/databases/launcher.db
adb reboot

重启后第二屏幕的music没有了,然后列数也变成了6列。

在这里插入图片描述

http://www.dtcms.com/a/30927.html

相关文章:

  • Qt学习(六) 软件启动界面 ,注册表使用 ,QT绘图, 视图和窗口绘图,Graphics View绘图框架:简易CAD
  • 数据库索引:缺点与类型全解析
  • CSS 布局技术深度解析:从传统到现代的核心布局方案
  • Arm64架构CentOS7服务器搭建Fabric环境
  • RPC:分布式系统的通信桥梁
  • 毕业项目推荐:基于yolov8/yolov5/yolo11的番茄成熟度检测识别系统(python+卷积神经网络)
  • 华为S系列交换机安全加固解决方案
  • Secured Finance携手Axelar及Squid提升流动性,迎接USDFC主网
  • 宇树科技13家核心零部件供应商梳理!
  • chmod命令修改rwxr-x---只读权限为rwxr-xr-x
  • C语言学习【1】C语言关于寄存器的封装
  • 数字化营销时代,我们需要有哪些思维?
  • 深入理解指针(六)
  • 深度学习-6.用于计算机视觉的深度学习
  • CPU封装形式解析:从传统到先进封装的技术演进
  • hotkey的学习
  • 深度学习在图像识别中的应用-以花卉分类系统为例
  • Microsoft 365 Copilot中使用人数最多的是哪些应用
  • 聊聊 FocusSearch/focus_mcp_sql:Text2SQL 的新玩法
  • Word文档中插入的图片不能完整显示
  • LeetCode 热题 100_搜索二维矩阵(64_74_中等_C++)(二分查找)(暴力破解法;Z字形查找;一次二分查找)
  • 第8章:LangChain检索增强生成RAG--2.4Advanced RAG【高级RAG】
  • windows怎样查看系统信息(处理器等)
  • QSplashScreen --软件启动前的交互
  • 头像壁纸小程序源码,壁纸取图小程序源码系统
  • 【matlab代码】基于故障概率加权与多模态滤波的AUV多源融合导航
  • 如何有效利用MYSQL的连接数
  • cline通过硅基流动平台接入DeepSeek-R1模型接入指南
  • Windows 下如何对 node/vue 进行多版本管理?
  • 【后端基础】布隆过滤器原理