launcher3图标icon背景及文字处理
来源:互联网 发布:php 装饰者模式 编辑:程序博客网 时间:2024/06/06 06:46
图标聚焦背景
packages\apps\Launcher3\res\drawable\focusable_view_bg.xml
图标文字背景
packages\apps\Launcher3\src\com\android\launcher3\BubbleTextView.java
packages\apps\Launcher3\src\com\android\launcher3\Utilities.java
static final int[] APP_ICON_BG = {
R.drawable.appsiconbg,
R.drawable.appsiconbg,
R.drawable.appsiconbg,
R.drawable.appsiconbg,
R.drawable.appsiconbg
};
static Bitmap createIconBitmap(Drawable icon, Context context) {
synchronized (sCanvas) {
...
if (debug) {
// draw a big box for the icon for debugging
canvas.drawColor(sColors[sColorIndex]);
if (++sColorIndex >= sColors.length) sColorIndex = 0;
Paint debugPaint = new Paint();
debugPaint.setColor(0xffcccc00);
canvas.drawRect(left, top, left+width, top+height, debugPaint);
}
if (true)
{
int index = new Random(System.currentTimeMillis()).nextInt(5);
//Bitmap backBitmap = BitmapFactory.decodeResource(context.getResources(),APP_ICON_BG[index]);
Bitmap backBitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.appsiconbg);
int backWidth = backBitmap.getWidth();
int backHeight = backBitmap.getHeight();
if(backWidth != sIconWidth || backHeight != sIconHeight)
{
Matrix matrix = new Matrix();
matrix.postScale((float)sIconWidth/backWidth, (float)sIconHeight/backHeight);
canvas.drawBitmap(Bitmap.createBitmap(backBitmap, 0, 0, backWidth, backHeight, matrix, true),0.0f, 0.0f, null);
}else
{
canvas.drawBitmap(backBitmap, 0.0f, 0.0f, null);
}
}
...
// 如果原图标太大,看不到背景,可以把原图标缩小
//icon.setBounds(left, top, left+width, top+height);
icon.setBounds(left+15, top+15, left+width-15, top+height-15);
}
参考http://blog.csdn.net/xuhui_7810/article/details/36901815
- launcher3图标icon背景及文字处理
- launcher3的hotseat的图标文字处理
- 实现BMP转透明背景ICON图标
- 给launcher上的应用图标ICON加上背景框
- 怎样设计透明背景的ICON(网页小图标)?
- 状态栏背景颜色和状态栏图标icon颜色修改
- Launcher3 拖动图标笔记
- ICON图标,
- UITabBar背景、icon图标颜色、被选中背景设置以及隐藏UITabBar的方式
- Launcher3--launcher3 icon以及hotseat size大小修改
- The launcher3 study notes for ICon change
- 修改Launcher3应用Icon的样式
- iOS开发icon图标及载入图各种尺寸
- 设置App icon图标及修改应用程序名
- 设置App icon图标及修改应用程序名
- iOS基础:设置App icon图标及修改应用程序名
- CListCtrl ICon图标模式下,如何让设置背景透明与文字置透明
- 文字处理
- What is inode number?
- ORACLE正则表达式
- XCode快捷键
- 4款食谱有效缓解强迫症
- php curl
- launcher3图标icon背景及文字处理
- [ASP.NET-IX] 控件显示切换 交互数据库
- iOS开发-Objc数据排序,使用block实现
- linux文件系统制作
- 3Sum
- gcc源代码分析,函数声明的类型<tree_list 95608产生的过程
- WV.7-动态链表-删除链表中值为x的结点
- linux lightdm gdm gnome kde等的区别于联系(桌面环境 窗口管理器 显示管理器)
- GT6806的linux系统下自启动配置