Skip to content
Snippets Groups Projects
Commit be871af5 authored by liuminghua's avatar liuminghua Committed by Changzhi Deng
Browse files

Trebuchet: Customize default icon of browser.

We add this to control the default icon of browser.Change the icon
according to the overlay when launcher load all the apps.

Change-Id: I396edd79bbe9d4511296647c4f9346d11261ead5
parent 279fd237
No related tags found
No related merge requests found
res/drawable-hdpi/customize_browser_icon.png

7.64 KiB

res/drawable-mdpi/customize_browser_icon.png

4.11 KiB

res/drawable-xhdpi/customize_browser_icon.png

12.2 KiB

......@@ -339,6 +339,12 @@ public class IconCache {
}
}
private Bitmap getCustomizedIcon(){
Resources res = mContext.getResources();
Bitmap bitmap = BitmapFactory.decodeResource(res, R.drawable.customize_browser_icon);
return bitmap;
}
public Bitmap getIcon(ComponentName component, LauncherActivityInfoCompat info,
HashMap<Object, CharSequence> labelCache) {
return getIcon(component, info, labelCache, false);
......@@ -410,8 +416,20 @@ public class IconCache {
}
entry.contentDescription = mUserManager.getBadgedLabelForUser(entry.title, user);
entry.icon = Utilities.createIconBitmap(
info.getBadgedIcon(mIconDpi), mContext, unreadNum, newDownload);
if (info.getComponentName().toString().trim().contains("com.android.chrome")
&& mContext.getResources().getBoolean(com.android.internal.
R.bool.config_regional_customize_default_browser_icon)) {
String customizedTitle = mContext.getResources().getString(
com.android.internal.
R.string.config_regional_customize_default_browser_title);
if (customizedTitle != null && customizedTitle != "") {
entry.title = customizedTitle;
}
entry.icon = getCustomizedIcon();
} else {
entry.icon = Utilities.createIconBitmap(
info.getBadgedIcon(mIconDpi), mContext, unreadNum, newDownload);
}
} else {
entry.title = "";
Bitmap preloaded = getPreloadedIcon(componentName, user);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment