Skip to content

Commit 3b5d8fc

Browse files
committed
build: fix
1 parent ce795db commit 3b5d8fc

File tree

7 files changed

+26
-42
lines changed

7 files changed

+26
-42
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
1515
## Supported HTML tags
1616

17-
| Tag | Description |
18-
|-----|------------|
19-
| `<b>` | Bold text |
20-
| `<i>` | Italic text |
21-
| `<strike>` | Strikethrough text |
22-
| `<u>` | Underlined text |
23-
| `<a href="...">` | Clickable link |
24-
| `<span style="color: #0000FF">` | Colored text |
25-
| `<span style="color: red">` | Colored text |
26-
| `<font color="#FF0000">` | Colored text |
27-
| `<font color="red">` | Colored text |
17+
| Tag | Description |
18+
|------------------------------------|------------|
19+
| `<b>` | Bold text |
20+
| `<i>` | Italic text |
21+
| `<strike>` | Strikethrough text |
22+
| `<u>` | Underlined text |
23+
| `<a href="...">` | Clickable link |
24+
| `<span style="color: #0000FF">` | Colored text |
25+
| `<span style="color: rgb(r,g,b)">` | Colored text |
26+
| `<font color="#FF0000">` | Colored text |
27+
| `<font color="rgb(r,g,b)">` | Colored text |
2828

2929

3030
## MaterialTheme colors in HtmlText

example/build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ kotlin {
1111
dependencies {
1212
implementation(libs.androidx.activity.compose)
1313
implementation(libs.androidx.core.ktx)
14+
implementation(libs.androidx.appcompat)
15+
implementation(libs.androidx.appcompat)
16+
implementation("com.google.android.material:material:1.10.0")
1417

1518
implementation(compose.runtime)
1619
implementation(compose.foundation)
@@ -24,10 +27,10 @@ kotlin {
2427
}
2528

2629
android {
27-
namespace = "de.charlex.compose.cache.example"
30+
namespace = "de.charlex.compose.htmltext.example"
2831

2932
defaultConfig {
30-
applicationId = "de.charlex.compose.cache.example"
33+
applicationId = "de.charlex.compose.htmltext.example"
3134
versionCode = 1
3235
versionName = "1.0"
3336
}

example/src/androidMain/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
android:supportsRtl="true"
1010
android:theme="@style/Theme.HtmlText">
1111
<activity
12-
android:name=".MainActivity"
1312
android:exported="true"
14-
android:label="@string/app_name"
15-
android:theme="@style/Theme.HtmlText.NoActionBar">
13+
android:name=".MainActivity"
14+
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
15+
>
1616
<intent-filter>
1717
<action android:name="android.intent.action.MAIN" />
1818

example/src/androidMain/kotlin/de/charlex/compose/htmltext/example/MainActivity.kt

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import androidx.compose.ui.Modifier
1313
import androidx.compose.ui.graphics.Color
1414
import androidx.compose.ui.platform.LocalContext
1515
import androidx.compose.ui.tooling.preview.Preview
16-
import HtmlText
1716
import de.charlex.compose.htmltext.example.ui.theme.HtmlTextTheme
17+
import de.charlex.compose.htmltext.material.HtmlText
1818

1919
class MainActivity : ComponentActivity() {
2020
override fun onCreate(savedInstanceState: Bundle?) {
@@ -60,32 +60,15 @@ fun ColorTextBySpan() {
6060

6161
@Composable
6262
fun ColorTextByFont() {
63-
HtmlText(text = "Hello <font color=\"red\">red</font> world")
63+
HtmlText(text = "Hello <font color=\"#FF0000\">red</font> world")
6464
}
6565

6666
@Composable
6767
fun ColorTextWithColorMapping() {
68-
HtmlTextTheme(
69-
darkTheme = false
70-
) {
71-
Surface {
72-
HtmlText(
73-
text = "Hello <font color=\"red\">red</font> world",
74-
colorMapping = mapOf(Color.Red to MaterialTheme.colors.primary)
75-
)
76-
}
77-
}
78-
79-
HtmlTextTheme(
80-
darkTheme = true
81-
) {
82-
Surface {
83-
HtmlText(
84-
text = "Hello <font color=\"red\">red</font> world",
85-
colorMapping = mapOf(Color.Red to MaterialTheme.colors.primary)
86-
)
87-
}
88-
}
68+
HtmlText(
69+
text = "Hello <font color=\"#FF0000\">red</font> world",
70+
colorMapping = mapOf(Color.Red to Color.Green)
71+
)
8972
}
9073

9174
@Preview(showBackground = true)

material-html-text/src/androidMain/kotlin/de/charlex/compose/material/HtmlTextMoved.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import de.charlex.compose.htmltext.material.HtmlText
4040
@Composable
4141
@Deprecated(
4242
message = "Moved to de.charlex.compose.htmltext.material package",
43-
replaceWith = ReplaceWith("HtmlText", "de.charlex.compose.htmltext.material.HtmlText"),
4443
level = DeprecationLevel.ERROR
4544
)
4645
fun HtmlText(

material3-html-text/src/androidMain/kotlin/de/charlex/compose/material3/HtmlTextMoved.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import de.charlex.compose.htmltext.material3.HtmlText
4242
@Composable
4343
@Deprecated(
4444
message = "Moved to de.charlex.compose.htmltext.material3 package",
45-
replaceWith = ReplaceWith("HtmlText", "de.charlex.compose.htmltext.material3.HtmlText"),
4645
level = DeprecationLevel.ERROR
4746
)
4847
fun HtmlText(

0 commit comments

Comments
 (0)