当前位置:网站首页>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
未完待续
边栏推荐
- 接入华为游戏防沉迷,点击防沉迷弹窗后游戏闪退
- "Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist
- 【软考 系统架构设计师】软件架构设计② 软件架构风格
- 【PHP实现微信公众平台开发—基础篇】第2章 微信公众账号及申请流程详解
- Oracle 19c 单实例 19.3.0 升级到19.11.0 详细教程
- 十一、网络规划设计
- 聪明的儿子处理婆媳关系的方法(处理婆媳关系的方法)
- #夏日挑战赛#OpenHarmony 给你的输入法加点彩—星球崛起
- Redis (1) installation and configuration
- 划重点!2022面试必刷461道大厂架构面试真题汇总+面经+简历模板
猜你喜欢
他是“中台”之父,凭一个概念为阿里狂赚百亿
Access Huawei game anti-addiction, click the anti-addiction pop-up window, the game crashes
ShanDong Multi-University Training #4 A、B、C、G
What is DevOps?Enough to read this one!
炫酷又高效的数据可视化大屏,做起来真的没那么难!丨极客星球
【HMS core】【FAQ】Account Kit、MDM能力、push Kit典型问题合集6
MySQL - Explain详解
开发小程序插件如何实现盈利?
1314元的七夕礼盒,收割了多少直男?
【VSCode】一文详解vscode下安装vim后无法使用Ctrl+CV复制粘贴 使用Vim插件的配置记录
随机推荐
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
String是引用类型
MOSFET米勒平台(Miller Plateau)
244页pdf!《2022 中国云计算生态蓝皮书》发布
抽奖/秒杀/竞价/评分/权威/投票,技术教你用合适的方法做好活动
MATLAB——图像分块
广告电商系统开发之订单处理
“蔚来杯“2022牛客暑期多校训练营5 B、C、F、G、H、K
程序猿七夕礼物-如何30分钟给女朋友快速搭建专属语聊房
ES 节点2G内存分析
鲜花“刺客”收割七夕
获取本机IP地址的脚本
Cache character stream
5 cloud security management strategies enterprises should implement
Yolov5 test and train own dataset
ShanDong Multi-University Training #4 A、B、C、G
动规(16)-并查集基础题——格子游戏
Hands-on Deep Learning_LeNet
业务中我们如何更新缓存?Redis
backbone核心详解系列——RepVGG