0

I want to change my application icon color dynamically according to the events such as holi,deepawali.....etc.whether it is possible to change application icon color or not?

  • http://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android This will solve your query. – Kushal Mar 30 '15 at 11:37

3 Answers3

0

Please check Here

You can achieve this using <activity-alies>

Steps : For short guide

  1. Define alies for differenct icons i.e. Holi, Diwali

  2. Programmatically set any one enabled

For detailed answer, check above link

Community
  • 1
  • 1
Kushal
  • 8,100
  • 9
  • 63
  • 82
0

You must first integrate the dynamic color into the application, and then set the background color of the application icon to ?attr/background_color

MainActivity.java

DynamicColors.applyToActivitiesIfAvailable(this.getApplication());

style.xml

<style name="AppTheme" parent="Theme.Material3.DynamicColors.Light">

res/mipmap/your_logo.xml

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="?attr/colorSecondaryContainer" />
    <foreground android:drawable="@drawable/logo_foreground" />
</adaptive-icon>

logo_foreground.xml

android:tint="?attr/colorSecondary"

Hope this helps you

Mohamed Rahal
  • 61
  • 1
  • 3
-2

You will have to put an updated version of the app in play store with updated icon during festival.

pvn
  • 2,016
  • 19
  • 33
  • Then user have to update their application version on each festival – Kushal Mar 30 '15 at 11:40
  • Yes you can't change the app icon in any other way since its used by application launcher to display all apps. – pvn Mar 30 '15 at 11:54
  • Please check http://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android .. You can change the app icon – Kushal Mar 30 '15 at 11:57