NTP-1234 | Shivam | Festive App Icon (#14576)

This commit is contained in:
Shivam Goyal
2025-01-17 17:30:23 +05:30
committed by GitHub
parent 27cd6723d4
commit d96ffe717f
23 changed files with 229 additions and 3 deletions

View File

@@ -95,10 +95,49 @@
android:windowSoftInputMode="adjustNothing"
tools:ignore="LockedOrientationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity-alias
android:name=".alias.IconAliasDefault"
android:enabled="true"
android:exported="true"
android:icon="@mipmap/ic_navi_launcher"
android:roundIcon="@mipmap/ic_navi_launcher_round"
android:targetActivity=".home.compose.activity.HomePageActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
android:name=".alias.IconAliasDefaultClone"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_navi_launcher"
android:roundIcon="@mipmap/ic_navi_launcher_round"
android:targetActivity=".home.compose.activity.HomePageActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
android:name=".alias.IconAliasFestive"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_festive_launcher"
android:roundIcon="@mipmap/ic_festive_launcher_round"
android:targetActivity=".home.compose.activity.HomePageActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity
android:name=".nux.ui.NewUserExperienceActivity"
android:exported="false"

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -28,6 +28,7 @@ import com.navi.common.utils.BiometricPromptUtils
import com.navi.common.utils.CommonUtils.isQaRelease
import com.navi.common.utils.Constants.ScreenLockConstants.ENABLED
import com.navi.common.utils.Constants.ScreenLockConstants.IS_SCREEN_LOCK_ENABLED
import com.navi.common.utils.handleLauncherIconAlias
import com.navi.insurance.health.activity.BaseActivity as InsuranceBaseActivity
import com.navi.pay.common.setup.NaviPayManager
import com.naviapp.analytics.utils.NaviAnalytics.Companion.EXTERNAL
@@ -173,6 +174,8 @@ constructor(private val alfredInitializer: AlfredFacade) : ComponentInitializer
eventName = NAVIAPP_BACKGROUND_PUSH,
mapOf("screenName" to screenName),
)
application.handleLauncherIconAlias()
}
}
}

View File

@@ -41,6 +41,7 @@ import com.navi.common.pushnotification.NotificationConstants
import com.navi.common.pushnotification.NotificationReceiverActivity
import com.navi.common.utils.COMMA
import com.navi.common.utils.log
import com.navi.common.utils.setFestiveAppIconEnabledPreference
import com.navi.pay.common.utils.NaviPayNotificationHandler
import com.naviapp.R
import com.naviapp.app.image.ImageLibraryHandler
@@ -226,6 +227,12 @@ class NaviFirebaseMessagingService : FirebaseMessagingService() {
NotificationConstants.UPDATE_REMOTE_CONFIG -> {
FirebaseRemoteConfigHelper.updateRemoteConfigForcefully()
}
NotificationConstants.ACTION_ENABLE_FESTIVE_APP_ICON -> {
setFestiveAppIconEnabledPreference(enabled = true)
}
NotificationConstants.ACTION_DISABLE_FESTIVE_APP_ICON -> {
setFestiveAppIconEnabledPreference(enabled = false)
}
}
NaviTrackEvent.trackEventOnClickStream(
Constants.SILENT_PN_ACTION,

View File

@@ -0,0 +1,43 @@
<!--
~
~ * Copyright © 2025 by Navi Technologies Limited
~ * All rights reserved. Strictly confidential
~
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group
android:scaleX="0.67"
android:scaleY="0.67"
android:translateX="84.48"
android:translateY="84.48">
<path
android:fillColor="#3c0050"
android:pathData="M0,0h512v512h-512z" />
<path
android:fillColor="#22d081"
android:pathData="M250.93,206.33c-5.73,-5.48 -13.35,-8.53 -21.28,-8.53h-113.65v186.2h63v-126h63v105c0,11.6 9.4,21 21,21h42v-112.83c0,-8.41 -3.44,-16.46 -9.52,-22.27l-44.55,-42.57Z" />
<path
android:fillColor="#22d081"
android:pathData="M242,104l0,60.2l93.8,0l0,93.8l60.2,0l0,-154l-154,0z" />
<path
android:fillAlpha="0.7"
android:fillColor="#ff671f"
android:pathData="M512,257.24v56.64c-74.84,17.02 -185.8,102.73 -245.14,126.42 -51.37,20.51 -139.4,34.23 -266.86,-19.45v-53.6c32.9,33.39 135.96,109.96 268.39,50.64 119.67,-53.61 169.13,-135.7 243.61,-160.65Z"
android:strokeAlpha="0.7" />
<path
android:fillAlpha="0.7"
android:fillColor="#fff"
android:pathData="M512,313.88v53.08c-91.2,1.64 -199.41,76.14 -244.04,96.08 -49.64,22.17 -141.56,34.77 -267.96,-11.06v-31.13c127.46,53.68 215.49,39.96 266.86,19.45 59.34,-23.69 170.3,-109.4 245.14,-126.42Z"
android:strokeAlpha="0.7" />
<path
android:fillAlpha="0.7"
android:fillColor="#046a38"
android:pathData="M512,366.96v45.98c-147.56,5.11 -235.17,88.64 -358.05,96.19 -35.79,2.2 -88.29,-0.17 -153.95,-24.06v-33.09c126.4,45.83 218.32,33.23 267.96,11.06 44.63,-19.94 152.84,-94.44 244.04,-96.08Z"
android:strokeAlpha="0.7" />
</group>
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~
~ * Copyright © 2025 by Navi Technologies Limited
~ * All rights reserved. Strictly confidential
~
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_festive_launcher_background"/>
<foreground android:drawable="@drawable/ic_navi_republic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~
~ * Copyright © 2025 by Navi Technologies Limited
~ * All rights reserved. Strictly confidential
~
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_festive_launcher_background" />
<foreground android:drawable="@drawable/ic_navi_republic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~
~ * Copyright © 2025 by Navi Technologies Limited
~ * All rights reserved. Strictly confidential
~
-->
<resources>
<color name="ic_festive_launcher_background">#3C0050</color>
</resources>

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2021-2024 by Navi Technologies Limited
* * Copyright © 2021-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -32,4 +32,5 @@ object CommonPrefConstants {
const val PREVIOUS_LOGGED_IN_EXTERNAL_CUSTOMER_ID = "PREVIOUS_LOGGED_IN_EXTERNAL_CUSTOMER_ID"
const val PREVIOUS_GOOGLE_ADVERTISEMENT_ID = "PREVIOUS_GOOGLE_ADVERTISEMENT_ID"
const val PREVIOUS_APPSFLYER_ID = "PREVIOUS_APPSFLYER_ID"
const val IS_FESTIVE_APP_ICON_ENABLED = "IS_FESTIVE_APP_ICON_ENABLED"
}

View File

@@ -251,6 +251,8 @@ object FirebaseRemoteConfigHelper {
"MONEY_MANAGER_DASHBOARD_SPEND_CATEGORIZATION_TIMEOUT"
const val MM_DARK_MODE_ENABLED = "MM_DARK_MODE_ENABLED"
const val IS_FESTIVE_APP_ICON_ENABLED = "IS_FESTIVE_APP_ICON_ENABLED"
private fun getFirebaseRemoteConfig(): FirebaseRemoteConfig {
val remoteConfig = Firebase.remoteConfig
val configSettings = remoteConfigSettings {

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2020-2024 by Navi Technologies Limited
* * Copyright © 2020-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -55,4 +55,8 @@ object NotificationConstants {
const val MODULE_NAME = "module_name"
const val COLUMN_NAME = "column_name"
const val COMMA_SEPARATED_TABLE_KEYS = "comma_separated_table_keys"
// Festive App Icon
const val ACTION_ENABLE_FESTIVE_APP_ICON = "ACTION_ENABLE_FESTIVE_APP_ICON"
const val ACTION_DISABLE_FESTIVE_APP_ICON = "ACTION_DISABLE_FESTIVE_APP_ICON"
}

View File

@@ -0,0 +1,85 @@
/*
*
* * Copyright © 2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
package com.navi.common.utils
import android.content.ComponentName
import android.content.Context
import android.content.pm.PackageManager
import com.navi.base.sharedpref.CommonPrefConstants
import com.navi.base.sharedpref.PreferenceManager
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
fun setFestiveAppIconEnabledPreference(enabled: Boolean) {
PreferenceManager.setBooleanPreferenceApp(
key = CommonPrefConstants.IS_FESTIVE_APP_ICON_ENABLED,
value = enabled,
)
}
fun Context.handleLauncherIconAlias() {
if (
FirebaseRemoteConfigHelper.getBoolean(
key = FirebaseRemoteConfigHelper.IS_FESTIVE_APP_ICON_ENABLED,
defaultValue = false,
) ||
PreferenceManager.getBooleanPreferenceApp(
key = CommonPrefConstants.IS_FESTIVE_APP_ICON_ENABLED,
defValue = false,
)
) {
enableIconAliasFestive()
disableIconAliasDefault()
disableIconAliasDefaultClone()
} else {
enableIconAliasDefaultClone()
disableIconAliasFestive()
disableIconAliasDefault()
}
}
fun Context.disableIconAliasDefault() {
packageManager.setComponentEnabledSetting(
ComponentName(this, ICON_ALIAS_CLASS_NAME_PREFIX + "IconAliasDefault"),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP,
)
}
fun Context.disableIconAliasDefaultClone() {
packageManager.setComponentEnabledSetting(
ComponentName(this, ICON_ALIAS_CLASS_NAME_PREFIX + "IconAliasDefaultClone"),
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
PackageManager.DONT_KILL_APP,
)
}
fun Context.enableIconAliasDefaultClone() {
packageManager.setComponentEnabledSetting(
ComponentName(this, ICON_ALIAS_CLASS_NAME_PREFIX + "IconAliasDefaultClone"),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP,
)
}
fun Context.disableIconAliasFestive() {
packageManager.setComponentEnabledSetting(
ComponentName(this, ICON_ALIAS_CLASS_NAME_PREFIX + "IconAliasFestive"),
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
PackageManager.DONT_KILL_APP,
)
}
fun Context.enableIconAliasFestive() {
packageManager.setComponentEnabledSetting(
ComponentName(this, ICON_ALIAS_CLASS_NAME_PREFIX + "IconAliasFestive"),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP,
)
}
const val ICON_ALIAS_CLASS_NAME_PREFIX = "com.naviapp.alias."

View File

@@ -654,4 +654,8 @@
<key>MM_DARK_MODE_ENABLED</key>
<value>false</value>
</entry>
<entry>
<key>IS_FESTIVE_APP_ICON_ENABLED</key>
<value>false</value>
</entry>
</defaultsMap>