Skip to content

Commit b44dde4

Browse files
authored
Merge pull request #1001 from vector-im/renovate/io.nlopez.compose.rules-detekt-0.x
Update dependency io.nlopez.compose.rules:detekt to v0.2.1
2 parents cd47f5f + a3ae891 commit b44dde4

File tree

7 files changed

+27
-23
lines changed

7 files changed

+27
-23
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ allprojects {
6161
config.from(files("$rootDir/tools/detekt/detekt.yml"))
6262
}
6363
dependencies {
64-
detektPlugins("io.nlopez.compose.rules:detekt:0.1.12")
64+
detektPlugins("io.nlopez.compose.rules:detekt:0.2.1")
6565
}
6666

6767
// KtLint

features/location/api/src/main/kotlin/io/element/android/features/location/api/StaticMapView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ fun StaticMapView(
111111
StaticMapPlaceholder(
112112
showProgress = painter.state is AsyncImagePainter.State.Loading,
113113
contentDescription = contentDescription,
114-
modifier = Modifier.size(width = maxWidth, height = maxHeight),
114+
width = maxWidth,
115+
height = maxHeight,
115116
onLoadMapClick = { retryHash++ }
116117
)
117118
}

features/location/api/src/main/kotlin/io/element/android/features/location/api/internal/StaticMapPlaceholder.kt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import androidx.compose.ui.res.painterResource
3131
import androidx.compose.ui.res.stringResource
3232
import androidx.compose.ui.tooling.preview.PreviewParameter
3333
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
34+
import androidx.compose.ui.unit.Dp
3435
import androidx.compose.ui.unit.dp
3536
import io.element.android.features.location.api.R
3637
import io.element.android.libraries.designsystem.preview.DayNightPreviews
@@ -44,34 +45,34 @@ import io.element.android.libraries.ui.strings.CommonStrings
4445
internal fun StaticMapPlaceholder(
4546
showProgress: Boolean,
4647
contentDescription: String?,
48+
width: Dp,
49+
height: Dp,
4750
modifier: Modifier = Modifier,
4851
onLoadMapClick: () -> Unit,
4952
) {
5053
Box(
5154
contentAlignment = Alignment.Center,
55+
modifier = modifier
56+
.size(width = width, height = height)
57+
.then(if (showProgress) Modifier else Modifier.clickable(onClick = onLoadMapClick))
5258
) {
5359
Image(
5460
painter = painterResource(id = R.drawable.blurred_map),
5561
contentDescription = contentDescription,
56-
modifier = modifier,
5762
contentScale = ContentScale.FillBounds,
63+
modifier = Modifier.size(width = width, height = height)
5864
)
5965
if (showProgress) {
6066
CircularProgressIndicator()
6167
} else {
62-
Box(
63-
modifier = modifier.clickable(onClick = onLoadMapClick),
64-
contentAlignment = Alignment.Center,
68+
Column(
69+
horizontalAlignment = Alignment.CenterHorizontally,
6570
) {
66-
Column(
67-
horizontalAlignment = Alignment.CenterHorizontally,
68-
) {
69-
Icon(
70-
imageVector = Icons.Default.Refresh,
71-
contentDescription = null
72-
)
73-
Text(text = stringResource(id = CommonStrings.action_static_map_load))
74-
}
71+
Icon(
72+
imageVector = Icons.Default.Refresh,
73+
contentDescription = null
74+
)
75+
Text(text = stringResource(id = CommonStrings.action_static_map_load))
7576
}
7677
}
7778
}
@@ -85,7 +86,8 @@ internal fun StaticMapPlaceholderPreview(
8586
StaticMapPlaceholder(
8687
showProgress = values,
8788
contentDescription = null,
88-
modifier = Modifier.size(400.dp),
89+
width = 400.dp,
90+
height = 400.dp,
8991
onLoadMapClick = {},
9092
)
9193
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/MessageComposerView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fun MessageComposerView(
5555
state.eventSink(MessageComposerEvents.FocusChanged(hasFocus))
5656
}
5757

58-
Box {
58+
Box(modifier = modifier) {
5959
AttachmentsBottomSheet(
6060
state = state,
6161
onSendLocationClicked = onSendLocationClicked,
@@ -69,8 +69,7 @@ fun MessageComposerView(
6969
onAddAttachment = ::onAddAttachment,
7070
onFocusChanged = ::onFocusChanged,
7171
composerCanSendMessage = state.isSendButtonVisible,
72-
composerText = state.text,
73-
modifier = modifier
72+
composerText = state.text
7473
)
7574
}
7675
}

features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ fun RoomInviteMembersView(
6464
onSendPressed: (List<MatrixUser>) -> Unit = {},
6565
) {
6666
Scaffold(
67+
modifier = modifier,
6768
topBar = {
6869
RoomInviteMembersTopBar(
6970
onBackPressed = {
@@ -79,7 +80,7 @@ fun RoomInviteMembersView(
7980
}
8081
) { padding ->
8182
Column(
82-
modifier = modifier
83+
modifier = Modifier
8384
.fillMaxWidth()
8485
.padding(padding)
8586
.consumeWindowInsets(padding),

features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ fun RoomMemberListView(
7676
}
7777

7878
Scaffold(
79+
modifier = modifier,
7980
topBar = {
8081
if (!state.isSearchActive) {
8182
RoomMemberListTopBar(
@@ -87,7 +88,7 @@ fun RoomMemberListView(
8788
}
8889
) { padding ->
8990
Column(
90-
modifier = modifier
91+
modifier = Modifier
9192
.fillMaxWidth()
9293
.padding(padding)
9394
.consumeWindowInsets(padding),

features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RequestVerificationHeader.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ internal fun RequestVerificationHeader(
5050
onDismissClicked: () -> Unit,
5151
modifier: Modifier = Modifier,
5252
) {
53-
Box(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
53+
Box(modifier = modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
5454
Surface(
55-
modifier.fillMaxWidth(),
55+
Modifier.fillMaxWidth(),
5656
shape = MaterialTheme.shapes.small,
5757
color = MaterialTheme.colorScheme.surfaceVariant
5858
) {

0 commit comments

Comments
 (0)