Skip to content

Commit cfc9d58

Browse files
committedSep 23, 2019
Use named parameters for text - fixes breaking change from most recent version of Compose
Change-Id: Iabea632db3d310bf474f042c8ead21401bceed1c
1 parent ca3f038 commit cfc9d58

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed
 

‎JetNews/app/src/main/java/com/example/jetnews/ui/HomeScreen.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fun HomeScreen(icons: Icons, openDrawer: () -> Unit) {
7272
private fun HomeScreenTopSection(post: Post) {
7373
Padding(top = 16.dp, left = 16.dp, right = 16.dp) {
7474
Opacity(0.87f) {
75-
Text("Top stories for you", +themeTextStyle { subtitle1 })
75+
Text(text = "Top stories for you", style = +themeTextStyle { subtitle1 })
7676
}
7777
}
7878
// Normally this BaseButton would fit into the PostTutorial() function
@@ -99,9 +99,10 @@ private fun HomeScreenSimpleSection(posts: List<Post>, icons: Icons) {
9999
private fun HomeScreenPopularSection(posts: List<Post>, icons: Icons) {
100100
Padding(16.dp) {
101101
Opacity(0.87f) {
102-
Text("Popular on Jetnews", +themeTextStyle { subtitle1 })
102+
Text(text = "Popular on Jetnews", style = +themeTextStyle { subtitle1 })
103103
}
104104
}
105+
105106
Row(
106107
mainAxisAlignment = MainAxisAlignment.Start,
107108
crossAxisAlignment = CrossAxisAlignment.Start

‎JetNews/app/src/main/java/com/example/jetnews/ui/PostCardTop.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ fun PostCardTop(post: Post) {
5555
}
5656
HeightSpacer(16.dp)
5757
Opacity(0.87f) {
58-
Text(post.title, +themeTextStyle { h6 })
58+
Text(post.title, style = +themeTextStyle { h6 })
5959
}
6060
Opacity(0.87f) {
61-
Text(post.metadata.author.name, +themeTextStyle { body2 })
61+
Text(post.metadata.author.name, style = +themeTextStyle { body2 })
6262
}
6363
Opacity(0.6f) {
6464
Text("${post.metadata.date} - ${post.metadata.readTimeMinutes} min read",
65-
+themeTextStyle { body2 })
65+
style = +themeTextStyle { body2 })
6666
}
6767
}
6868
}

‎JetNews/app/src/main/java/com/example/jetnews/ui/PostCardYourNetwork.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ fun PostCardPopular(post: Post, icons: Icons) {
6464
}
6565
}
6666
Opacity(0.87f) {
67-
Text(post.metadata.author.name, +themeTextStyle { body2 })
67+
Text(post.metadata.author.name, style = +themeTextStyle { body2 })
6868
}
6969
Opacity(0.6f) {
7070
Text("${post.metadata.date} - ${post.metadata.readTimeMinutes} min read",
71-
+themeTextStyle { body2 })
71+
style = +themeTextStyle { body2 })
7272
}
7373
}
7474
}

‎JetNews/app/src/main/java/com/example/jetnews/ui/PostCards.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ fun AuthorAndReadTime(post: Post) {
4343
Opacity(0.6f) {
4444
FlexRow {
4545
flexible(1f) {
46-
Text(post.metadata.author.name, +themeTextStyle { body2 })
46+
Text(post.metadata.author.name, style = +themeTextStyle { body2 })
4747
}
4848
inflexible {
49-
Text(" - ${post.metadata.readTimeMinutes} min read", +themeTextStyle { body2 })
49+
Text(" - ${post.metadata.readTimeMinutes} min read", style = +themeTextStyle { body2 })
5050
}
5151
}
5252
}
@@ -126,7 +126,7 @@ fun PostCardHistory(post: Post, icons: Icons) {
126126
mainAxisSize = LayoutSize.Expand
127127
) {
128128
Opacity(0.38f) {
129-
Text("BASED ON YOUR HISTORY", +themeTextStyle { overline })
129+
Text("BASED ON YOUR HISTORY", style = +themeTextStyle { overline })
130130
}
131131
PostTitle(post = post)
132132
AuthorAndReadTime(post)

0 commit comments

Comments
 (0)
Please sign in to comment.