Skip to content

Commit 6e67779

Browse files
author
tanpengcheng
committed
[feat] Adjust MessageFragment bottom padding.
1 parent d4c281d commit 6e67779

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/com/tans/tfiletransporter/ui/filetransport/MessageFragment.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class MessageFragment : BaseCoroutineStateFragment<Unit>(
120120
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
121121
// SoftKeyboard
122122
val imeBars = insets.getInsets(WindowInsetsCompat.Type.ime())
123-
v.setPadding(v.paddingLeft, v.paddingTop, v.paddingRight, systemBars.bottom + imeBars.bottom)
124123
if (imeBars.bottom > 0) {
125124
// If soft keyboard show, scroll to first.
126125
launch {
@@ -129,6 +128,10 @@ class MessageFragment : BaseCoroutineStateFragment<Unit>(
129128
viewBinding.messageRv.scrollToPosition(0)
130129
}
131130
}
131+
v.setPadding(v.paddingLeft, v.paddingTop, v.paddingRight, imeBars.bottom)
132+
} else {
133+
// soft keyboard hide.
134+
v.setPadding(v.paddingLeft, v.paddingTop, v.paddingRight, systemBars.bottom)
132135
}
133136
insets
134137
}

0 commit comments

Comments
 (0)