mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 04:33:36 +00:00
Fix issue where view padding would not properly update on rotation.
This commit is contained in:
committed by
Greyson Parrelli
parent
ef11a8d98d
commit
7215ca6a28
@@ -18,12 +18,14 @@ object SystemWindowInsetsSetter {
|
||||
val insets: Insets? = ViewCompat.getRootWindowInsets(view)?.getInsets(insetType)
|
||||
|
||||
if (Build.VERSION.SDK_INT > 29 && insets != null && !insets.isEmpty()) {
|
||||
view.setPadding(
|
||||
insets.left,
|
||||
insets.top,
|
||||
insets.right,
|
||||
insets.bottom
|
||||
)
|
||||
view.post {
|
||||
view.setPadding(
|
||||
insets.left,
|
||||
insets.top,
|
||||
insets.right,
|
||||
insets.bottom
|
||||
)
|
||||
}
|
||||
} else {
|
||||
val top = if (insetType and WindowInsetsCompat.Type.statusBars() != 0) {
|
||||
ViewUtil.getStatusBarHeight(view)
|
||||
@@ -37,12 +39,14 @@ object SystemWindowInsetsSetter {
|
||||
0
|
||||
}
|
||||
|
||||
view.setPadding(
|
||||
0,
|
||||
top,
|
||||
0,
|
||||
bottom
|
||||
)
|
||||
view.post {
|
||||
view.setPadding(
|
||||
0,
|
||||
top,
|
||||
0,
|
||||
bottom
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user