Skip to content

Commit e56f841

Browse files
committed
Suppress deprecated SOFT_INPUT_ADJUST_RESIZE warning
LayoutParams.SOFT_INPUT_ADJUST_RESIZE was deprecated on API 30. Using "View.OnApplyWindowInsetsListener" is the recommended way to update it but it requires activity.window that we can't access from AztecsText. It suppressed for now until the migration will be mandatory.
1 parent bfadd9f commit e56f841

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
21122112
source.displayStyledAndFormattedHtml(editHtml)
21132113
builder.setView(dialogView)
21142114

2115-
builder.setPositiveButton(R.string.block_editor_dialog_button_save, { _, _ ->
2115+
builder.setPositiveButton(R.string.block_editor_dialog_button_save) { _, _ ->
21162116
val spanStart = text.getSpanStart(unknownHtmlSpan)
21172117

21182118
val textBuilder = SpannableStringBuilder()
@@ -2137,14 +2137,15 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
21372137
enableTextChangedListener()
21382138

21392139
inlineFormatter.joinStyleSpans(0, text.length)
2140-
})
2140+
}
21412141

2142-
builder.setNegativeButton(R.string.block_editor_dialog_button_cancel, { dialogInterface, _ ->
2142+
builder.setNegativeButton(R.string.block_editor_dialog_button_cancel) { dialogInterface, _ ->
21432143
dialogInterface.dismiss()
2144-
})
2144+
}
21452145

21462146
unknownBlockSpanStart = text.getSpanStart(unknownHtmlSpan)
21472147
blockEditorDialog = builder.create()
2148+
@Suppress("DEPRECATION")
21482149
blockEditorDialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
21492150
blockEditorDialog?.show()
21502151
}

0 commit comments

Comments
 (0)