Android15 launcher3

修改布局查看device_profiles.xml ,根据不同的网格数加载

java 复制代码
packages/apps/Launcher3/res/xml/device_profiles.xml

<grid-option
    launcher:name="6_by_5"
    launcher:numRows="5"
    launcher:numColumns="6"
    launcher:numSearchContainerColumns="3"
    launcher:numExtendedHotseatIcons="6"
    launcher:numFolderRows="3"
    launcher:numFolderColumns="3"
    launcher:numHotseatIcons="6"
    launcher:numAllAppsColumns="6"
    launcher:isScalable="true"
    launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_6_5"
    launcher:devicePaddingId="@xml/paddings_6x5"
    launcher:dbFile="launcher_6_by_5.db"
    launcher:defaultLayoutId="@xml/default_workspace_6x5"
    launcher:deviceCategory="tablet" >

注意device下查看是否有相同的文件

如果需要显示 6*5 的布局需要将这个grid-option 对齐其他地方的文件,不然会不起作用。


上面的属性如 numRows numColumns 在attrs.xml定义  
packages/apps/Launcher3/res/values/attrs.xml
查看 <declare-styleable name="GridDisplayOption">



需要添加6列的Hotseat 不起作用,查看log发现LoaderCursor 有输出error
packages/apps/Launcher3/src/com/android/launcher3/model/LoaderCursor.java
if (item.screenId >= mIDP.numDatabaseHotseatIcons) {

    Log.e(TAG, "Error loading shortcut " + item
            + " into hotseat position screenId=" + item.screenId
            + ", position out of bounds: (0 to " + (mIDP.numDatabaseHotseatIcons - 1)
            + ")");
    return false;
}

//mIDP.numDatabaseHotseatIcons  这个位置一直输出 4,最后只加载4个图标,反追查搜索numDatabaseHotseatIcons 找到位置  InvariantDeviceProfile.java 



追查实例化过程可以查看 numDatabaseHotseatIcons 
packages/apps/Launcher3/src/com/android/launcher3/InvariantDeviceProfile.java
查看实例化方法 initGrid 和 GridOption

AllApp界面拦截apk

packages/apps/Launcher3/src/com/android/launcher3/model/LoaderTask.java

private List<LauncherActivityInfo> loadAllApps() {

......

for (int i = 0; i < apps.size(); i++) {

LauncherActivityInfo app = apps.get(i);

//add

if("com.xxx.packges".equals(apps.get(i).getApplicationInfo().packageName)) {

continue;

}

//add end

......

AppInfo appInfo = new AppInfo(app, mUserCache.getUserInfo(user),

ApiWrapper.INSTANCE.get(mApp.getContext()), mPmHelper, quietMode);

if (Flags.enableSupportForArchiving() && app.getApplicationInfo().isArchived) {

相关推荐
Y40900118 分钟前
数据库基础知识——聚合函数、分组查询
android·数据库
没有了遇见5 小时前
Android 原生定位(替代高德 / 百度等三方定位)<终极版本>
android
2501_916008896 小时前
iOS 抓包工具有哪些?全面盘点主流工具与功能对比分析
android·ios·小程序·https·uni-app·iphone·webview
2501_915921436 小时前
iOS混淆工具实战 视频流媒体类 App 的版权与播放安全保护
android·ios·小程序·https·uni-app·iphone·webview
CYRUS_STUDIO6 小时前
LLVM 全面解析:NDK 为什么离不开它?如何亲手编译调试 clang
android·编译器·llvm
CYRUS_STUDIO7 小时前
静态分析神器 + 动态调试利器:IDA Pro × Frida 混合调试实战
android·逆向
g_i_a_o_giao9 小时前
Android8 binder源码学习分析笔记(一)
android·java·笔记·学习·binder·安卓源码分析
翻滚丷大头鱼9 小时前
android 四大组件—BroadcastReceiver
android
人生游戏牛马NPC1号10 小时前
学习 Android (二十) 学习 OpenCV (五)
android·opencv·学习
2501_9160088910 小时前
uni-app iOS 日志与崩溃分析全流程 多工具协作的实战指南
android·ios·小程序·https·uni-app·iphone·webview