当前位置:网站首页>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
未完待续
边栏推荐
- 【VSCode】一文详解vscode下安装vim后无法使用Ctrl+CV复制粘贴 使用Vim插件的配置记录
- 开发小程序插件如何实现盈利?
- Yolov5 测试和训练自己的数据集
- 推荐一款优秀的通用管理后台
- Focusing on data sources, data quality and model performance to build a credit profile of small and micro enterprises
- Cache character stream
- Diffusion Models:生成扩散模型
- 用VbScript控制光驱
- Small program on how to play in the construction of e-government service platform value
- matlab串口读写
猜你喜欢

How to develop small program plug-ins to achieve profitability?

免费翻译软件哪个好用

项目里的各种配置,你都了解吗?

Redis (1) installation and configuration

backbone核心详解系列——RepVGG

UMA & Hong Kong Polytechnic & Ali propose SP-ViT to learn 2D space prior knowledge for visual Transformer!

break与continue超详解!!!

分布式链路追踪Jaeger + 微服务Pig在Rainbond上的实践分享

干货丨数学规划视角下的分货优化解题思路

如何让 WPF 程序更好地适配 UI 自动化
随机推荐
Tarjan 求有向图的强连通分量
绩效考核带给员工的不能只是压力
聪明的儿子处理婆媳关系的方法(处理婆媳关系的方法)
论文翻译:2022_Time-Frequency Attention for Monaural Speech Enhancement
Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes
他是“中台”之父,凭一个概念为阿里狂赚百亿
MySQL - Explain explanation
“蔚来杯“2022牛客暑期多校训练营2 G、J、K
手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果
免费翻译软件哪个好用
WPF---Grid布局讲解
大神们都在用的神器,你和大神只差一个它!!
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
Neck modules of the yolo series
【HMS core】【FAQ】Account Kit、MDM能力、push Kit典型问题合集6
break与continue超详解!!!
面试官:连 INSERT INTO SET 都不知道怎么用,你这3年都干些什么了?
【PHP实现微信公众平台开发—基础篇】第2章 微信公众账号及申请流程详解
考研概率论与数理统计(知识点梳理)
"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist