Skip to content

Commit

Permalink
* Fixes: Icon tint color on action button
Browse files Browse the repository at this point in the history
  • Loading branch information
AjeshRPai committed Sep 27, 2023
1 parent 55f751a commit 315661a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -281,7 +282,10 @@ fun ShortcutStateRow(
contentScale = ContentScale.Fit,
modifier = Modifier
.size(24.dp)
.padding(1.dp)
.padding(1.dp),
colorFilter = if (state.disableTint) null
else ColorFilter.tint(MaterialTheme.colors.onSurface)

)
Spacer(Modifier.width(8.dp))
Text(
Expand All @@ -302,8 +306,8 @@ fun ShortcutStateRow(
val icon = if (state.isActive) R.drawable.ic_personalization_quick_link_remove_circle
else R.drawable.ic_personalization_shortcuts_plus_circle

val iconTint = if (state.isActive) Color(0xFF008710)
else Color(0xFFD63638)
val iconTint = if (state.isActive) Color(0xFFD63638)
else Color(0xFF008710)

Icon(
painter = painterResource(id = icon),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class ShortcutsPersonalizationViewModelSlice @Inject constructor(
return listItems.map { listItem ->
ShortcutsState(
icon = listItem.primaryIcon,
label = listItem.primaryText as UiString.UiStringRes
label = listItem.primaryText as UiString.UiStringRes,
disableTint = listItem.disablePrimaryIconTint
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ import org.wordpress.android.ui.utils.UiString
data class ShortcutsState(
@DrawableRes val icon: Int,
val label: UiString.UiStringRes,
val isActive: Boolean = false
val isActive: Boolean = false,
val disableTint : Boolean = false
)

0 comments on commit 315661a

Please sign in to comment.