Skip to content

Update dependency io.nlopez.compose.rules:detekt to v0.2.1 #1001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ allprojects {
config.from(files("$rootDir/tools/detekt/detekt.yml"))
}
dependencies {
detektPlugins("io.nlopez.compose.rules:detekt:0.1.12")
detektPlugins("io.nlopez.compose.rules:detekt:0.2.1")
}

// KtLint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ fun StaticMapView(
StaticMapPlaceholder(
showProgress = painter.state is AsyncImagePainter.State.Loading,
contentDescription = contentDescription,
modifier = Modifier.size(width = maxWidth, height = maxHeight),
width = maxWidth,
height = maxHeight,
onLoadMapClick = { retryHash++ }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.element.android.features.location.api.R
import io.element.android.libraries.designsystem.preview.DayNightPreviews
Expand All @@ -44,34 +45,34 @@ import io.element.android.libraries.ui.strings.CommonStrings
internal fun StaticMapPlaceholder(
showProgress: Boolean,
contentDescription: String?,
width: Dp,
height: Dp,
modifier: Modifier = Modifier,
onLoadMapClick: () -> Unit,
) {
Box(
contentAlignment = Alignment.Center,
modifier = modifier
.size(width = width, height = height)
.then(if (showProgress) Modifier else Modifier.clickable(onClick = onLoadMapClick))
) {
Image(
painter = painterResource(id = R.drawable.blurred_map),
contentDescription = contentDescription,
modifier = modifier,
contentScale = ContentScale.FillBounds,
modifier = Modifier.size(width = width, height = height)
)
if (showProgress) {
CircularProgressIndicator()
} else {
Box(
modifier = modifier.clickable(onClick = onLoadMapClick),
contentAlignment = Alignment.Center,
Column(
horizontalAlignment = Alignment.CenterHorizontally,
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(
imageVector = Icons.Default.Refresh,
contentDescription = null
)
Text(text = stringResource(id = CommonStrings.action_static_map_load))
}
Icon(
imageVector = Icons.Default.Refresh,
contentDescription = null
)
Text(text = stringResource(id = CommonStrings.action_static_map_load))
}
}
}
Expand All @@ -85,7 +86,8 @@ internal fun StaticMapPlaceholderPreview(
StaticMapPlaceholder(
showProgress = values,
contentDescription = null,
modifier = Modifier.size(400.dp),
width = 400.dp,
height = 400.dp,
onLoadMapClick = {},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun MessageComposerView(
state.eventSink(MessageComposerEvents.FocusChanged(hasFocus))
}

Box {
Box(modifier = modifier) {
AttachmentsBottomSheet(
state = state,
onSendLocationClicked = onSendLocationClicked,
Expand All @@ -69,8 +69,7 @@ fun MessageComposerView(
onAddAttachment = ::onAddAttachment,
onFocusChanged = ::onFocusChanged,
composerCanSendMessage = state.isSendButtonVisible,
composerText = state.text,
modifier = modifier
composerText = state.text
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ fun RoomInviteMembersView(
onSendPressed: (List<MatrixUser>) -> Unit = {},
) {
Scaffold(
modifier = modifier,
topBar = {
RoomInviteMembersTopBar(
onBackPressed = {
Expand All @@ -79,7 +80,7 @@ fun RoomInviteMembersView(
}
) { padding ->
Column(
modifier = modifier
modifier = Modifier
.fillMaxWidth()
.padding(padding)
.consumeWindowInsets(padding),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fun RoomMemberListView(
}

Scaffold(
modifier = modifier,
topBar = {
if (!state.isSearchActive) {
RoomMemberListTopBar(
Expand All @@ -87,7 +88,7 @@ fun RoomMemberListView(
}
) { padding ->
Column(
modifier = modifier
modifier = Modifier
.fillMaxWidth()
.padding(padding)
.consumeWindowInsets(padding),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ internal fun RequestVerificationHeader(
onDismissClicked: () -> Unit,
modifier: Modifier = Modifier,
) {
Box(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
Box(modifier = modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
Surface(
modifier.fillMaxWidth(),
Modifier.fillMaxWidth(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: I will double check that the banner is still displayed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it's displayed, but I have to go back to the home screen and restart the app after a login to see the banner, and it's the same to see the "Complete verification" item in the settings, so this is not something new introduced by this change.

shape = MaterialTheme.shapes.small,
color = MaterialTheme.colorScheme.surfaceVariant
) {
Expand Down