Change the default system application icon

I came across a launcher application called Nova Launcher , which provides the ability to change the appearance of system applications to another icon pack, below is a screenshot from nova launcher.

shcreenshot from nova launcher

When I select stock jellybean, it will replace the system application icon with the jellbean icon pack icon.

I want to implement the same functionality in my launcher application, I'm Google, but I did not find anything related, I need a guide and suggestion.

I tried installing Example-theme by simply changing the name of the package, but it gives me the power to close com.mypackagename not found .

Primary activity @

 private static final String ACTION_APPLY_ICON_THEME = "com.mypackage.launcher.APPLY_ICON_THEME"; private static final String NOVA_PACKAGE = "com.mypackage.launcher"; private static final String EXTRA_ICON_THEME_PACKAGE = "com.mypackage.launcher.extra.ICON_THEME_PACKAGE"; // private static final String ACTION_APPLY_ICON_THEME = "com.teslacoilsw.launcher.APPLY_ICON_THEME"; // private static final String NOVA_PACKAGE = "com.teslacoilsw.launcher"; // private static final String EXTRA_ICON_THEME_PACKAGE = "com.teslacoilsw.launcher.extra.ICON_THEME_PACKAGE"; 

I'm just looking for a way that I have to control or code inside my own launcher in order to install themes like nova launcher.

The links below help me create themes for launching, but have not found a way to install / apply to my launchpad.

Launcher Tutorial

Example topic

Your suggestion is noticeable.

+4
source share
1 answer

Mr. Robin is right. You can do it manually.

Put your entire custom icon in the drop-down folder with a specific name, for example icon_appname.png ..

icon_contacts.png, icon_camera.png, icon_settings.png, icon_phone.png, icon_email.png ... etc.

or you can also save images as a package name, just like icon_com_android_camera.png ... etc.

Just set the condition to GetView in the adapter class.

  if(User selected default theme) { //use default icon from system } else { String appname = here is app name; String appPackageName = here is app package name; // You can use appname or appPackageName as per your drawable name. int intResource = getResources().getIdentifier("icon_" + appname.toLowerCase(), "drawable", getPackageName()); if(intResNormal!=0) holder.txtTitle.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(intResource), null, null); else //use default icon when no resource found } 

Note: If you follow the package name, be sure to replace "_" with ".

+4
source

Source: https://habr.com/ru/post/1501045/


All Articles