From 9cd8af6d78c775a1d7e1838f942ac40490cc530c Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 28 Jun 2024 10:32:50 -0500 Subject: [PATCH] Fix icons --- app/proguard.pro | 2 +- .../java/org/tasks/compose/edit/TagsRow.kt | 6 +- .../kotlin/org/tasks/themes/TasksIcons.kt | 62 ++++++------------- 3 files changed, 23 insertions(+), 47 deletions(-) diff --git a/app/proguard.pro b/app/proguard.pro index f7a1e2d78..04260d133 100644 --- a/app/proguard.pro +++ b/app/proguard.pro @@ -56,4 +56,4 @@ -dontwarn org.json.JSONString # material icons --keep class androidx.compose.material.icons.outlined.** +-keep class androidx.compose.material.icons.outlined.** { *; } diff --git a/app/src/main/java/org/tasks/compose/edit/TagsRow.kt b/app/src/main/java/org/tasks/compose/edit/TagsRow.kt index 330f428f4..7e00e9228 100644 --- a/app/src/main/java/org/tasks/compose/edit/TagsRow.kt +++ b/app/src/main/java/org/tasks/compose/edit/TagsRow.kt @@ -2,8 +2,6 @@ package org.tasks.compose.edit import android.content.res.Configuration import androidx.compose.foundation.layout.padding -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.outlined.Home import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -75,7 +73,7 @@ fun SingleTag() { tags = listOf( TagData( name = "Home", - icon = Icons.Outlined.Home.name, + icon = "home", color = ColorProvider.BLUE_500 ) ), @@ -113,7 +111,7 @@ fun TagWithReallyLongName() { tags = listOf( TagData( name = "This is a tag with a really really long name", - icon = Icons.Outlined.Home.name, + icon = "home", color = ColorProvider.BLUE_500 ) ), diff --git a/kmp/src/commonMain/kotlin/org/tasks/themes/TasksIcons.kt b/kmp/src/commonMain/kotlin/org/tasks/themes/TasksIcons.kt index 16d2676eb..ba1f2ecea 100644 --- a/kmp/src/commonMain/kotlin/org/tasks/themes/TasksIcons.kt +++ b/kmp/src/commonMain/kotlin/org/tasks/themes/TasksIcons.kt @@ -1,46 +1,24 @@ package org.tasks.themes -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.outlined.Add -import androidx.compose.material.icons.outlined.AllInbox -import androidx.compose.material.icons.outlined.Clear -import androidx.compose.material.icons.outlined.Cloud -import androidx.compose.material.icons.outlined.CloudOff -import androidx.compose.material.icons.outlined.Delete -import androidx.compose.material.icons.outlined.Edit -import androidx.compose.material.icons.outlined.FilterList -import androidx.compose.material.icons.outlined.History -import androidx.compose.material.icons.outlined.KeyboardArrowDown -import androidx.compose.material.icons.outlined.KeyboardArrowUp -import androidx.compose.material.icons.outlined.Label -import androidx.compose.material.icons.outlined.LabelOff -import androidx.compose.material.icons.outlined.List -import androidx.compose.material.icons.outlined.Notifications -import androidx.compose.material.icons.outlined.PendingActions -import androidx.compose.material.icons.outlined.Place -import androidx.compose.material.icons.outlined.Snooze -import androidx.compose.material.icons.outlined.Timer -import androidx.compose.material.icons.outlined.Today - object TasksIcons { - val LABEL by lazy { Icons.Outlined.Label.name } - val FILTER_LIST by lazy { Icons.Outlined.FilterList.name } - val CLOUD by lazy { Icons.Outlined.Cloud.name } - val ALL_INBOX by lazy { Icons.Outlined.AllInbox.name } - val LABEL_OFF by lazy { Icons.Outlined.LabelOff.name } - val HISTORY by lazy { Icons.Outlined.History.name } - val TODAY by lazy { Icons.Outlined.Today.name } - val LIST by lazy { Icons.Outlined.List.name } - val PLACE by lazy { Icons.Outlined.Place.name } - val CLOUD_OFF by lazy { Icons.Outlined.CloudOff.name } - val CLEAR by lazy { Icons.Outlined.Clear.name } - val ADD by lazy { Icons.Outlined.Add.name } - val EDIT by lazy { Icons.Outlined.Edit.name } - val DELETE by lazy { Icons.Outlined.Delete.name } - val NOTIFICATIONS by lazy { Icons.Outlined.Notifications.name } - val PENDING_ACTIONS by lazy { Icons.Outlined.PendingActions.name } - val KEYBOARD_ARROW_UP by lazy { Icons.Outlined.KeyboardArrowUp.name } - val KEYBOARD_ARROW_DOWN by lazy { Icons.Outlined.KeyboardArrowDown.name } - val SNOOZE by lazy { Icons.Outlined.Snooze.name } - val TIMER by lazy { Icons.Outlined.Timer.name } + const val LABEL = "label" + const val FILTER_LIST = "filter_list" + const val CLOUD = "cloud" + const val ALL_INBOX = "all_inbox" + const val LABEL_OFF = "label_off" + const val HISTORY = "history" + const val TODAY = "today" + const val LIST = "list" + const val PLACE = "place" + const val CLOUD_OFF = "cloud_off" + const val CLEAR = "clear" + const val ADD = "add" + const val EDIT = "edit" + const val DELETE = "delete" + const val NOTIFICATIONS = "notifications" + const val PENDING_ACTIONS = "pending_actions" + const val KEYBOARD_ARROW_UP = "keyboard_arrow_up" + const val KEYBOARD_ARROW_DOWN = "keyboard_arrow_down" + const val SNOOZE = "snooze" + const val TIMER = "timer" }