Skip to content

Commit

Permalink
Merge pull request #3676 from CruGlobal/renovate/androidx.compose.mat…
Browse files Browse the repository at this point in the history
…erial3-material3-1.x

Update dependency androidx.compose.material3:material3 to v1.3.0
  • Loading branch information
frett authored Sep 6, 2024
2 parents bb56757 + 11d48a7 commit 5bb75ed
Show file tree
Hide file tree
Showing 124 changed files with 402 additions and 277 deletions.
2 changes: 1 addition & 1 deletion app/config/ktlint/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<error line="40" column="9" source="compose:vm-injection-check" />
</file>
<file name="src/main/kotlin/org/cru/godtools/ui/languages/downloadable/DownloadableLanguagesLayout.kt">
<error line="59" column="5" source="compose:modifier-missing-check" />
<error line="58" column="5" source="compose:modifier-missing-check" />
</file>
<file name="src/main/kotlin/org/cru/godtools/ui/login/LoginLayout.kt">
<error line="51" column="5" source="compose:modifier-missing-check" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.pluralStringResource
Expand Down Expand Up @@ -66,6 +67,9 @@ private fun ActivityBadge(badge: Badge, modifier: Modifier = Modifier) {

ElevatedCard(
elevation = CardDefaults.elevatedCardElevation(defaultElevation = if (badge.isEarned) 4.dp else 0.dp),
colors = CardDefaults.elevatedCardColors(
containerColor = if (badge.isEarned) Color.Unspecified else Color.Transparent
),
modifier = modifier.size(contentHeight.coerceAtLeast(100.dp))
) {
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MenuDefaults
import androidx.compose.material3.SearchBar
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
Expand All @@ -24,6 +25,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -88,7 +90,7 @@ internal fun LessonLanguageFilter(modifier: Modifier = Modifier, viewModel: Less
modifier = Modifier.sizeIn(maxHeight = DROPDOWN_LESSON_MAX_HEIGHT, maxWidth = DROPDOWN_LESSON_MAX_WIDTH)
) {
stickyHeader {
Surface(color = MaterialTheme.colorScheme.surface) {
Surface(color = MenuDefaults.containerColor) {
val query by viewModel.query.collectAsState("")
SearchBar(
query = query,
Expand Down Expand Up @@ -144,5 +146,6 @@ private fun FilterMenuItem(
) = ListItem(
headlineContent = label,
supportingContent = supportingText?.let { { Text(it) } },
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
modifier = modifier.clickable(onClick = onClick)
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuDefaults
import androidx.compose.material3.SearchBar
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
Expand All @@ -31,6 +33,7 @@ import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.pluralStringResource
Expand Down Expand Up @@ -163,7 +166,7 @@ internal fun LanguageFilter(filters: ToolsScreen.Filters, modifier: Modifier = M
modifier = Modifier.sizeIn(maxHeight = DROPDOWN_MAX_HEIGHT, maxWidth = DROPDOWN_MAX_WIDTH)
) {
stickyHeader {
Surface(color = MaterialTheme.colorScheme.surface) {
Surface(color = MenuDefaults.containerColor) {
SearchBar(
query,
onQueryChange = { eventSink(ToolsScreen.FiltersEvent.UpdateLanguageQuery(it)) },
Expand Down Expand Up @@ -230,5 +233,6 @@ private fun FilterMenuItem(
) = ListItem(
headlineContent = label,
supportingContent = supportingText?.let { { Text(it) } },
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
modifier = modifier.clickable(onClick = onClick)
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ 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.Close
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
Expand All @@ -22,6 +21,7 @@ import androidx.compose.material3.ListItem
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SearchBar
import androidx.compose.material3.Text
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand All @@ -36,7 +36,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import kotlinx.coroutines.NonCancellable
Expand Down Expand Up @@ -152,7 +151,7 @@ private fun LanguageListItem(viewModel: LanguageViewModels.LanguageViewModel, mo
modifier = Modifier
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(bounded = false, radius = Dp.Unspecified),
indication = ripple(bounded = false),
) {
when {
!language.isAdded -> scope.launch(NonCancellable) { viewModel.pin() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import org.cru.godtools.base.ui.theme.GodToolsTheme
Expand Down Expand Up @@ -73,6 +75,8 @@ internal fun LanguageDownloadStatusIndicator(
progress = { progress },
color = MaterialTheme.colorScheme.primary,
strokeWidth = (size / 2) - iconPadding,
trackColor = Color.Transparent,
strokeCap = StrokeCap.Butt,
modifier = Modifier
.padding(iconPadding)
.border(size / 12, MaterialTheme.colorScheme.primary, CircleShape)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import androidx.compose.foundation.layout.height
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Remove
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ProvideTextStyle
import androidx.compose.material3.Text
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.derivedStateOf
Expand Down Expand Up @@ -174,7 +174,7 @@ private fun ToolDetailsAboutAccordionSection(
Icon(
if (expanded) Icons.Filled.Remove else Icons.Filled.Add,
contentDescription = null,
modifier = Modifier.indication(headerInteractions, rememberRipple(bounded = false, radius = 20.dp))
modifier = Modifier.indication(headerInteractions, ripple(bounded = false, radius = 20.dp))
)
}
AnimatedVisibility(visible = expanded) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ internal fun DownloadProgressIndicator(downloadProgress: () -> DownloadProgress?
animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec,
label = "Download Progress",
)
LinearProgressIndicator({ progress }, modifier = modifier)
LinearProgressIndicator(
{ progress },
drawStopIndicator = {},
modifier = modifier
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.LocalMinimumInteractiveComponentEnforcement
import androidx.compose.material3.LocalMinimumInteractiveComponentSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
Expand All @@ -21,7 +20,6 @@ import androidx.compose.ui.unit.dp
import org.cru.godtools.R

@Composable
@OptIn(ExperimentalMaterial3Api::class)
internal fun ToolCardActions(
state: ToolCard.State,
modifier: Modifier = Modifier,
Expand All @@ -33,7 +31,7 @@ internal fun ToolCardActions(
val buttonContentPadding = PaddingValues(horizontal = 4.dp, vertical = 8.dp)
val buttonMinHeight = 30.dp

CompositionLocalProvider(LocalMinimumInteractiveComponentEnforcement provides false) {
CompositionLocalProvider(LocalMinimumInteractiveComponentSize provides buttonMinHeight) {
OutlinedButton(
onClick = { eventSink(ToolCard.Event.OpenToolDetails) },
contentPadding = buttonContentPadding,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5bb75ed

Please sign in to comment.