File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed
font_awesome/src/main/java/lazycoder21/droid/compose Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fun CircularFontAwesomeIcon(
4242 )
4343
4444 BasicText (
45- text = icon.icon ,
45+ text = icon.src ,
4646 modifier = modifier
4747 .wrapContentWidth()
4848 .clip(CircleShape )
Original file line number Diff line number Diff line change 11package lazycoder21.droid.compose
22
3- sealed class FaIcon (val src : Int ) {
4- data class Solid (private val icon : Int ) : FaIcon(icon)
5- data class Regular (private val icon : Int ) : FaIcon(icon)
6- data class Brand (private val icon : Int ) : FaIcon(icon)
3+ sealed class FaIcon (val src : String ) {
4+ data class Solid (private val icon : String ) : FaIcon(icon) {
5+ constructor (intIcon: Int ) : this (intIcon.asString)
6+ }
7+
8+ data class Regular (private val icon : String ) : FaIcon(icon) {
9+ constructor (intIcon: Int ) : this (intIcon.asString)
10+ }
11+
12+ data class Brand (private val icon : String ) : FaIcon(icon) {
13+ constructor (intIcon: Int ) : this (intIcon.asString)
14+ }
15+
16+ companion object {
17+ private val Int .asString get() = toChar().toString()
18+ }
719}
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import androidx.compose.foundation.text.BasicText
44import androidx.compose.runtime.Composable
55import androidx.compose.ui.Modifier
66import androidx.compose.ui.graphics.Color
7- import androidx.compose.ui.platform.LocalConfiguration
87import androidx.compose.ui.text.TextStyle
98import androidx.compose.ui.unit.Dp
109import androidx.compose.ui.unit.dp
@@ -37,7 +36,7 @@ fun FontAwesomeIcon(
3736 )
3837
3938 BasicText (
40- text = faIcon.icon ,
39+ text = faIcon.src ,
4140 modifier = modifier,
4241 style = faTextStyle,
4342 )
Original file line number Diff line number Diff line change @@ -30,5 +30,3 @@ val Dp.scaleIndependentFontSize: TextUnit
3030 val materialIconOffset = 3 .dp
3131 return ((this - materialIconOffset).value / scaleFactor).sp
3232 }
33-
34- val FaIcon .icon get() = this .src.toChar().toString()
You can’t perform that action at this time.
0 commit comments