-
Notifications
You must be signed in to change notification settings - Fork 6
Edge-to-Edge サポート #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Edge-to-Edge サポート #81
Conversation
…PayjpCardFormActivityのActionBarをToolBarに変更
|
@laiso @yatatsu cc: @koutaku921 |
| right = insets.right, | ||
| bottom = insets.bottom, | ||
| ) | ||
| WindowInsetsCompat.CONSUMED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ScrollView の下端がソフトウェアキーボードに隠れてしまうため、WindowInsetsCompat.Type.ime()でPaddingを調整する必要がありました。
例:
internal fun View.applyWindowInsets() {
val initialLeft = paddingLeft
val initialTop = paddingTop
val initialRight = paddingRight
val initialBottom = paddingBottom
ViewCompat.setOnApplyWindowInsetsListener(this) { v, windowInsets ->
val systemInsets = windowInsets.getInsets(
WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()
)
val imeInsets = windowInsets.getInsets(WindowInsetsCompat.Type.ime())
val bottomInset = maxOf(systemInsets.bottom, imeInsets.bottom)
v.updatePadding(
left = initialLeft + systemInsets.left,
top = initialTop + systemInsets.top,
right = initialRight + systemInsets.right,
bottom = initialBottom + bottomInset,
)
windowInsets
}
ViewCompat.requestApplyInsets(this)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
概要
Android 15からのEdge-to-Edgeのサポート追加
関連Issues
動作検証