Skip to content

Commit 5df0b46

Browse files
committed
fix: Empty patch description padding
1 parent 7ebeefc commit 5df0b46

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎app/src/main/java/app/revanced/manager/patcher/patch/PatchInfo.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ data class CompatiblePackage(
6666
@Immutable
6767
data class Option<T>(
6868
val name: String,
69-
val description: String,
69+
val description: String?,
7070
val required: Boolean,
7171
val type: KType,
7272
val default: T?,
@@ -75,7 +75,7 @@ data class Option<T>(
7575
) {
7676
constructor(option: PatchOption<T>) : this(
7777
option.name,
78-
option.description.orEmpty(),
78+
option.description,
7979
option.required,
8080
option.type,
8181
option.default,

‎app/src/main/java/app/revanced/manager/ui/component/bundle/BundlePatchesDialog.kt‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,12 @@ fun PatchItem(
312312
style = MaterialTheme.typography.titleMedium,
313313
color = MaterialTheme.colorScheme.primary
314314
)
315-
Text(
316-
text = option.description,
317-
style = MaterialTheme.typography.bodyMedium
318-
)
315+
option.description?.let {
316+
Text(
317+
text = it,
318+
style = MaterialTheme.typography.bodyMedium
319+
)
320+
}
319321
}
320322
}
321323
}

‎app/src/main/java/app/revanced/manager/ui/component/patches/OptionFields.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ fun <T : Any> OptionItem(
279279
} else null,
280280
supportingContent = {
281281
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
282-
Text(option.description)
282+
option.description?.let { Text(it) }
283283

284284
OptionDropdownSection(
285285
option = option,
@@ -507,7 +507,7 @@ private fun ListOptionItem(
507507
} else null,
508508
supportingContent = {
509509
Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
510-
Text(option.description)
510+
option.description?.let { Text(it) }
511511
if (option.required && value == null) {
512512
Text(
513513
style = MaterialTheme.typography.labelLargeEmphasized,
@@ -562,7 +562,7 @@ private fun InvalidListWarningDialog(
562562
Text(stringResource(R.string.patch_options_value_list_invalid_dialog_description))
563563
ListItem(
564564
headlineContent = { OptionItemHeadline(option) },
565-
supportingContent = { Text(option.description) },
565+
supportingContent = { option.description?.let { Text(it) } },
566566
colors = transparentListItemColors,
567567
)
568568
}

0 commit comments

Comments
 (0)