Skip to content

Commit

Permalink
removed material dependecy and only use foundation, updated to use co…
Browse files Browse the repository at this point in the history
…lor.unsecified icon.
  • Loading branch information
Gurupreet committed Feb 22, 2021
1 parent 0b7f52c commit 7e046a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FontAwesomeComposeLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
dependencies {
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.guru.fontawesomecomposelib

import androidx.compose.foundation.text.BasicText
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -30,23 +29,19 @@ fun FaIcon(
faIcon: FaIconType,
modifier: Modifier = Modifier,
size: TextUnit = 24.sp,
tint: Color = MaterialTheme.colors.onSurface
tint: Color = Color.Unspecified
) {
val faFont = remember(faIcon) { getFontFamily(faIcon) }

val faTextStyle =
remember(faIcon) {
TextStyle(
color = tint,
fontFamily = faFont,
fontFamily = getFontFamily(faIcon),
fontSize = size
)
}

val codePoint = remember(faIcon) { faIcon.src.codePointToString() }

BasicText(
text = codePoint,
text = faIcon.src.codePointToString(),
modifier = modifier,
style = faTextStyle,
)
Expand Down

0 comments on commit 7e046a9

Please sign in to comment.