From 3bf2b73549862ae014aa2b46f8c1b903d8f435d6 Mon Sep 17 00:00:00 2001 From: Sad Ellie Date: Thu, 9 Feb 2023 19:29:40 +0400 Subject: [PATCH] Added icon for epoch shortcut --- .../unitto/feature/epoch/navigation/EpochNavigation.kt | 2 ++ .../epoch/src/main/res/drawable/ic_shortcut_epoch.xml | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 feature/epoch/src/main/res/drawable/ic_shortcut_epoch.xml diff --git a/feature/epoch/src/main/java/com/sadellie/unitto/feature/epoch/navigation/EpochNavigation.kt b/feature/epoch/src/main/java/com/sadellie/unitto/feature/epoch/navigation/EpochNavigation.kt index c348d2f9..c8409a63 100644 --- a/feature/epoch/src/main/java/com/sadellie/unitto/feature/epoch/navigation/EpochNavigation.kt +++ b/feature/epoch/src/main/java/com/sadellie/unitto/feature/epoch/navigation/EpochNavigation.kt @@ -22,6 +22,7 @@ import android.content.Intent import android.net.Uri import androidx.core.content.pm.ShortcutInfoCompat import androidx.core.content.pm.ShortcutManagerCompat +import androidx.core.graphics.drawable.IconCompat import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable @@ -36,6 +37,7 @@ fun NavController.navigateToEpoch() { .Builder(context, epochRoute) .setShortLabel(context.getString(R.string.epoch_converter)) .setLongLabel(context.getString(R.string.epoch_converter)) + .setIcon(IconCompat.createWithResource(context, R.drawable.ic_shortcut_epoch)) .setIntent( Intent( Intent.ACTION_VIEW, diff --git a/feature/epoch/src/main/res/drawable/ic_shortcut_epoch.xml b/feature/epoch/src/main/res/drawable/ic_shortcut_epoch.xml new file mode 100644 index 00000000..6b8e9b46 --- /dev/null +++ b/feature/epoch/src/main/res/drawable/ic_shortcut_epoch.xml @@ -0,0 +1,10 @@ + + + +