当前位置:网站首页>Launcher app prediction
Launcher app prediction
2022-08-04 12:28:00 【纵容_伊人倩影】
15、launcher应用列表界面最上面一行应用推荐
现象:
Android S上,更新同年四月份gms包后,launcher应用列表上方多出一行图标。
{相册、时钟、比机、Gmail、YouTube、设置}
通过studio自带的Layout Inspector查看,这一部分界面属于all_apps_header。也就是应用列表的头信息布局中。
相关代码:
launcher view层:
多出的一行应用:Launcher\quickstep\src\com\android\launcher3\appprediction\PredictionRowView.java这里面初始化最上面一行图标,可以设置图标文字颜色。
分割线:Launcher\quickstep\src\com\android\launcher3\appprediction\AppsDividerView.java这里面设置分割线的颜色
多嘴一句,应用列表图标适配器:Launcher\src\com\android\launcher3\allapps\AllAppsGridAdapter.java 这里面标准的adapter,包含多类
型,根据不同类型显示不同的内容。onCreateViewHolder、onBindViewHolder初始化图标view、设置应用列表图标文字颜色等等。
launcher model层:
Launcher\quickstep\src\com\android\launcher3\model\QuickstepModelDelegate.java注册registerPredictor监听,有更新回调时调用PredictionUpdateTask更新数据
Launcher\quickstep\src\com\android\launcher3\model\PredictionUpdateTask.java更新数据、更新界面信息。
framework层:—没用太深入的研究,简单看看
AppPredictionManager、AppPredictionManagerService.java 和其它功能类似,分为manager和service2部分,通过aidl通讯。service负责数据更新和回调。
SystemServer.java中判断是否配置相关config,来启动对应的service。
config相关:
<!-- The package name for the system's app prediction service. This service must be trusted, as it can be activated without explicit consent of the user. Example: "com.android.intelligence/.AppPredictionService"
-->
<string name="config_defaultAppPredictionService" translatable="false"></string>
gms包:
新增应用:AndroidSystemIntelligence_Features.apk 包名:com.google.android.as
新增覆盖:GmsConfigOverlayASI,包名:com.google.android.overlay.gmsconfig.asi,rro技术覆盖framework下面的config文件配置。
string name="config_defaultAppPredictionService" translatable="false">com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiPredictionService</string>
========================================================================================================================================
接上篇15,重新写了一篇
https://blog.csdn.net/a396604593/article/details/123487805
本文主要补充说明一下prediction。
prediction的类型:
目前有主菜单应用、hotseat应用、widget三种
Launcher端相关的类:
Launcher\quickstep\src\com\android\launcher3\uioverrides\PredictedAppIcon.java
Launcher\quickstep\src\com\android\launcher3\uioverrides\PredictedAppIconInflater.java
Launcher\quickstep\src\com\android\launcher3\appprediction\PredictionRowView.java
Launcher\quickstep\src\com\android\launcher3\model\PredictionUpdateTask.java
Launcher\quickstep\src\com\android\launcher3\hybridhotseat\HotseatPredictionController.java
Launcher\quickstep\src\com\android\launcher3\hybridhotseat\HotseatPredictionModel.java
Launcher\quickstep\src\com\android\launcher3\model\WidgetsPredictionUpdateTask.java
未完待续
边栏推荐
猜你喜欢

LeetCode Daily Question (858. Mirror Reflection)

高速电路PCB布局布线参考

集群监控——Zabbix

MySQL - Explain explanation

Shell loop statement (for, while, until)

推荐一款优秀的通用管理后台

【微信小程序】信息管理与信息系统专业社会实习制作项目--垃圾指纹

Small program on how to play in the construction of e-government service platform value

程序猿七夕礼物-如何30分钟给女友快速搭建专属语聊房

电源测试之输出动态响应(Output Dynamic Response Test)
随机推荐
树莓派入门
Flutter 使用 json_serializable 解析 JSON 支持泛型
Flutter使用 json_serializable 解析 JSON 最佳方案
动规(18)-并查集基础题——团伙
Cache character stream
yolo系列的head模块
MySQL - Explain详解
LeetCode每日一题(858. Mirror Reflection)
常用代码模板1——基础语法
基于BiLSTM的回归预测方法
Diffusion Models:生成扩散模型
两个数组中用第二个数组的Value对比换第一个数组中的Key
Flutter强大的下拉筛选菜单gzx_dropdown_menu
"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist
两年独立开发经验程序员告诉我们赚钱的经验(听听真正赚到钱的高手做法)
新SCADA 系统:集成边缘计算、MQTT 和云平台
Share | technology integration electronic fence function of scheduling system
MySQL - Explain explanation
用VbScript控制光驱
Js获取当前页面url参数