This repository was archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
Setting LineHeight using dp instead of sp breaks vertical spacing #86
Copy link
Copy link
Open
Description
When I
- set
lineHeight to 44dpto for example Headline3 style - update the headline 3 text so it is longer then one line here
The vertical spacing completely breaks - there is a huge (cca 1000dp) line spacing instead of 44dp. Using sp instead of dp fixes the issue.
Patch
Index: sample/src/main/java/com/google/android/material/composethemeadapter/sample/MaterialIntegration.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sample/src/main/java/com/google/android/material/composethemeadapter/sample/MaterialIntegration.kt b/sample/src/main/java/com/google/android/material/composethemeadapter/sample/MaterialIntegration.kt
--- a/sample/src/main/java/com/google/android/material/composethemeadapter/sample/MaterialIntegration.kt (revision 2f8d91620d72d4c7ff464edeb094d04d246b4270)
+++ b/sample/src/main/java/com/google/android/material/composethemeadapter/sample/MaterialIntegration.kt (date 1640865711026)
@@ -130,7 +130,7 @@
style = MaterialTheme.typography.h2
)
Text(
- text = "Headline 3",
+ text = "Headline 3 LONG HEADLINE",
style = MaterialTheme.typography.h3
)
Text(
Index: sample/src/main/res/values/type.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sample/src/main/res/values/type.xml b/sample/src/main/res/values/type.xml
--- a/sample/src/main/res/values/type.xml (revision 2f8d91620d72d4c7ff464edeb094d04d246b4270)
+++ b/sample/src/main/res/values/type.xml (date 1640865736222)
@@ -19,6 +19,7 @@
<style name="TextAppearance.Sample.Headline3"
parent="TextAppearance.MaterialComponents.Headline3">
<item name="fontFamily">@font/dancingscript</item>
+ <item name="lineHeight">44dp</item>
</style>
<!-- Use TextAppearance.AppCompat.Subhead as parent to avoid inheriting letterSpacing -->
Metadata
Metadata
Assignees
Labels
No labels
