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
This commit is contained in:
commit
69486c60dd
7 changed files with 27 additions and 23 deletions
|
|
@ -61,7 +61,7 @@ allprojects {
|
||||||
config.from(files("$rootDir/tools/detekt/detekt.yml"))
|
config.from(files("$rootDir/tools/detekt/detekt.yml"))
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
detektPlugins("io.nlopez.compose.rules:detekt:0.1.12")
|
detektPlugins("io.nlopez.compose.rules:detekt:0.2.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
// KtLint
|
// KtLint
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,8 @@ fun StaticMapView(
|
||||||
StaticMapPlaceholder(
|
StaticMapPlaceholder(
|
||||||
showProgress = painter.state is AsyncImagePainter.State.Loading,
|
showProgress = painter.state is AsyncImagePainter.State.Loading,
|
||||||
contentDescription = contentDescription,
|
contentDescription = contentDescription,
|
||||||
modifier = Modifier.size(width = maxWidth, height = maxHeight),
|
width = maxWidth,
|
||||||
|
height = maxHeight,
|
||||||
onLoadMapClick = { retryHash++ }
|
onLoadMapClick = { retryHash++ }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import io.element.android.features.location.api.R
|
import io.element.android.features.location.api.R
|
||||||
import io.element.android.libraries.designsystem.preview.DayNightPreviews
|
import io.element.android.libraries.designsystem.preview.DayNightPreviews
|
||||||
|
|
@ -44,34 +45,34 @@ import io.element.android.libraries.ui.strings.CommonStrings
|
||||||
internal fun StaticMapPlaceholder(
|
internal fun StaticMapPlaceholder(
|
||||||
showProgress: Boolean,
|
showProgress: Boolean,
|
||||||
contentDescription: String?,
|
contentDescription: String?,
|
||||||
|
width: Dp,
|
||||||
|
height: Dp,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onLoadMapClick: () -> Unit,
|
onLoadMapClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
|
modifier = modifier
|
||||||
|
.size(width = width, height = height)
|
||||||
|
.then(if (showProgress) Modifier else Modifier.clickable(onClick = onLoadMapClick))
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.drawable.blurred_map),
|
painter = painterResource(id = R.drawable.blurred_map),
|
||||||
contentDescription = contentDescription,
|
contentDescription = contentDescription,
|
||||||
modifier = modifier,
|
|
||||||
contentScale = ContentScale.FillBounds,
|
contentScale = ContentScale.FillBounds,
|
||||||
|
modifier = Modifier.size(width = width, height = height)
|
||||||
)
|
)
|
||||||
if (showProgress) {
|
if (showProgress) {
|
||||||
CircularProgressIndicator()
|
CircularProgressIndicator()
|
||||||
} else {
|
} else {
|
||||||
Box(
|
Column(
|
||||||
modifier = modifier.clickable(onClick = onLoadMapClick),
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
) {
|
) {
|
||||||
Column(
|
Icon(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
imageVector = Icons.Default.Refresh,
|
||||||
) {
|
contentDescription = null
|
||||||
Icon(
|
)
|
||||||
imageVector = Icons.Default.Refresh,
|
Text(text = stringResource(id = CommonStrings.action_static_map_load))
|
||||||
contentDescription = null
|
|
||||||
)
|
|
||||||
Text(text = stringResource(id = CommonStrings.action_static_map_load))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -85,7 +86,8 @@ internal fun StaticMapPlaceholderPreview(
|
||||||
StaticMapPlaceholder(
|
StaticMapPlaceholder(
|
||||||
showProgress = values,
|
showProgress = values,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(400.dp),
|
width = 400.dp,
|
||||||
|
height = 400.dp,
|
||||||
onLoadMapClick = {},
|
onLoadMapClick = {},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ fun MessageComposerView(
|
||||||
state.eventSink(MessageComposerEvents.FocusChanged(hasFocus))
|
state.eventSink(MessageComposerEvents.FocusChanged(hasFocus))
|
||||||
}
|
}
|
||||||
|
|
||||||
Box {
|
Box(modifier = modifier) {
|
||||||
AttachmentsBottomSheet(
|
AttachmentsBottomSheet(
|
||||||
state = state,
|
state = state,
|
||||||
onSendLocationClicked = onSendLocationClicked,
|
onSendLocationClicked = onSendLocationClicked,
|
||||||
|
|
@ -69,8 +69,7 @@ fun MessageComposerView(
|
||||||
onAddAttachment = ::onAddAttachment,
|
onAddAttachment = ::onAddAttachment,
|
||||||
onFocusChanged = ::onFocusChanged,
|
onFocusChanged = ::onFocusChanged,
|
||||||
composerCanSendMessage = state.isSendButtonVisible,
|
composerCanSendMessage = state.isSendButtonVisible,
|
||||||
composerText = state.text,
|
composerText = state.text
|
||||||
modifier = modifier
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ fun RoomInviteMembersView(
|
||||||
onSendPressed: (List<MatrixUser>) -> Unit = {},
|
onSendPressed: (List<MatrixUser>) -> Unit = {},
|
||||||
) {
|
) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
modifier = modifier,
|
||||||
topBar = {
|
topBar = {
|
||||||
RoomInviteMembersTopBar(
|
RoomInviteMembersTopBar(
|
||||||
onBackPressed = {
|
onBackPressed = {
|
||||||
|
|
@ -79,7 +80,7 @@ fun RoomInviteMembersView(
|
||||||
}
|
}
|
||||||
) { padding ->
|
) { padding ->
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
.consumeWindowInsets(padding),
|
.consumeWindowInsets(padding),
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ fun RoomMemberListView(
|
||||||
}
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
modifier = modifier,
|
||||||
topBar = {
|
topBar = {
|
||||||
if (!state.isSearchActive) {
|
if (!state.isSearchActive) {
|
||||||
RoomMemberListTopBar(
|
RoomMemberListTopBar(
|
||||||
|
|
@ -87,7 +88,7 @@ fun RoomMemberListView(
|
||||||
}
|
}
|
||||||
) { padding ->
|
) { padding ->
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
.consumeWindowInsets(padding),
|
.consumeWindowInsets(padding),
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ internal fun RequestVerificationHeader(
|
||||||
onDismissClicked: () -> Unit,
|
onDismissClicked: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
Box(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
|
Box(modifier = modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
|
||||||
Surface(
|
Surface(
|
||||||
modifier.fillMaxWidth(),
|
Modifier.fillMaxWidth(),
|
||||||
shape = MaterialTheme.shapes.small,
|
shape = MaterialTheme.shapes.small,
|
||||||
color = MaterialTheme.colorScheme.surfaceVariant
|
color = MaterialTheme.colorScheme.surfaceVariant
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue