Skip to content

Commit

Permalink
Fix diagnostic popup paddings
Browse files Browse the repository at this point in the history
  • Loading branch information
zhelenskiy committed Apr 9, 2024
1 parent d82d88d commit ec458df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ development=true

#Publication
group=com.zhelenskiy
version=0.0.2
version=0.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ private fun DiagnosticsHeader(
.clickable { onCollapsedChanged(!collapsed) }
.padding(settings.padding),
) {
for (severity in DiagnosticSeverity.entries) {
val currentDiagnostics = diagnostics.filter { it.severity == severity }
val severity2diagnostics = diagnostics.groupBy { it.severity }
for ((index, severity) in DiagnosticSeverity.entries.withIndex()) {
val currentDiagnostics = severity2diagnostics[severity] ?: emptyList()
val isLast = DiagnosticSeverity.entries.slice((index + 1)..DiagnosticSeverity.entries.lastIndex)
.all { severity2diagnostics[it].isNullOrEmpty() }
AnimatedVisibility(currentDiagnostics.isNotEmpty() || diagnostics.isEmpty()) {
Row(verticalAlignment = Alignment.CenterVertically) {
severity.icon(
Expand All @@ -173,9 +176,11 @@ private fun DiagnosticsHeader(
style = settings.labelTextStyle,
color = colorScheme.countLabelColor,
)
AnimatedVisibility(!isLast) {
Spacer(Modifier.width(settings.spaceBetweenDiagnosticSeverities))
}
}
}
Spacer(Modifier.width(settings.spaceBetweenDiagnosticSeverities))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sample/sample.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'sample'
spec.version = '0.0.1'
spec.version = '0.0.3'
spec.homepage = 'h'
spec.source = { :http=> ''}
spec.authors = ''
Expand Down

0 comments on commit ec458df

Please sign in to comment.