Skip to content

Commit

Permalink
Address deprecations in Compose app code.
Browse files Browse the repository at this point in the history
  • Loading branch information
christiandeange committed Mar 22, 2024
1 parent 2bf0d63 commit d844efd
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class ComposePostScreen(

CircularProgressIndicator(
modifier = Modifier.height(24.dp),
progress = progress,
progress = { progress },
strokeWidth = lerpDp(
start = 8.dp,
stop = 24.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -79,7 +79,7 @@ class NotificationsScreen(
state = state,
) {
stickyHeader {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)
}

items(notifications) { notification ->
Expand All @@ -106,7 +106,7 @@ class NotificationsScreen(
}
}
if (notification.content != null) {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -155,7 +155,7 @@ class ProfileScreen(
SystemInsets {
OverImageIconButton(onClick = onExit) {
Icon(
painter = rememberVectorPainter(Icons.Default.ArrowBack),
painter = rememberVectorPainter(Icons.AutoMirrored.Filled.ArrowBack),
contentDescription = "Back",
)
}
Expand Down Expand Up @@ -254,7 +254,7 @@ class ProfileScreen(

items(items = feed) { post ->
key(post) {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)

TimelinePostItem(
now = now,
Expand All @@ -268,7 +268,7 @@ class ProfileScreen(
}

item {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ExitToApp
import androidx.compose.material.icons.automirrored.filled.ExitToApp
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -56,7 +56,7 @@ class SettingsScreen(
) { contentPadding ->
Column(Modifier.padding(contentPadding).fillMaxSize()) {
SettingsRow(
icon = rememberVectorPainter(Icons.Default.ExitToApp).stable,
icon = rememberVectorPainter(Icons.AutoMirrored.Filled.ExitToApp).stable,
text = "Sign Out",
onClick = onSignOut,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -86,7 +86,7 @@ class ThreadScreen(
navigationIcon = {
IconButton(onClick = onExit) {
Icon(
painter = rememberVectorPainter(Icons.Default.ArrowBack),
painter = rememberVectorPainter(Icons.AutoMirrored.Filled.ArrowBack),
contentDescription = "Back",
)
}
Expand All @@ -111,7 +111,7 @@ class ThreadScreen(
) {
@OptIn(ExperimentalFoundationApi::class)
stickyHeader {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)
}

itemsIndexed(thread.parents) { i, parentPost ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material3.Button
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.Divider
import androidx.compose.material3.FabPosition
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -151,7 +151,7 @@ class TimelineScreen(
) {
items(items = timeline) { post ->
key(post) {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)

TimelinePostItem(
now = now,
Expand All @@ -165,7 +165,7 @@ class TimelineScreen(
}

item {
Divider(thickness = Dp.Hairline)
HorizontalDivider(thickness = Dp.Hairline)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -65,7 +65,7 @@ fun ThreadPostItem(

Column {
if (post.hasInteractions()) {
Divider(thickness = 1.dp)
HorizontalDivider(thickness = 1.dp)

Box(modifier = Modifier.padding(start = 80.dp)) {
PostStatistics(
Expand All @@ -75,7 +75,7 @@ fun ThreadPostItem(
}
}

Divider(thickness = 1.dp)
HorizontalDivider(thickness = 1.dp)

Box(modifier = Modifier.padding(start = 80.dp, top = 8.dp, bottom = 8.dp)) {
PostActions(
Expand All @@ -89,7 +89,7 @@ fun ThreadPostItem(
)
}

Divider(thickness = 1.dp)
HorizontalDivider(thickness = 1.dp)
}
}
}
Expand Down

0 comments on commit d844efd

Please sign in to comment.