Updated on 2026-08-14
This commit is contained in:
commit
8902b6e07f
3 changed files with 13 additions and 7 deletions
|
|
@ -18,19 +18,22 @@ class NavBarInsetsFragmentLifecycleCallback : FragmentLifecycleCallbacks() {
|
|||
savedInstanceState: Bundle?,
|
||||
) {
|
||||
if (v is ComposeView) return
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(v) { view, windowInsets ->
|
||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars())
|
||||
val statusBarInsets = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars())
|
||||
val navigationBarInsets = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||
|
||||
if (view.fitsSystemWindows) {
|
||||
view.updatePadding(
|
||||
top = insets.top,
|
||||
bottom = insets.bottom,
|
||||
top = statusBarInsets.top,
|
||||
bottom = navigationBarInsets.bottom,
|
||||
)
|
||||
} else {
|
||||
view.updatePadding(
|
||||
bottom = insets.bottom,
|
||||
bottom = navigationBarInsets.bottom,
|
||||
)
|
||||
}
|
||||
windowInsets
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,8 @@ fun BigDecimal.formatAmountAsSpannedString(
|
|||
val integer = amount.substringBefore('.')
|
||||
val reminder = amount.substringAfter('.')
|
||||
|
||||
// test formatter log Log.e("TEST ", BigDecimal("1234567890987654321.1234567890987654321").formatWithSpaces())
|
||||
|
||||
return buildSpannedString {
|
||||
append(integer)
|
||||
append('.')
|
||||
|
|
@ -136,7 +138,7 @@ fun BigDecimal.formatWithSpaces(): String {
|
|||
var index: Int = integerStr.length
|
||||
while (0 < index) {
|
||||
if (index <= 3) {
|
||||
packets.add(0, integerStr)
|
||||
packets.add(integerStr)
|
||||
break
|
||||
}
|
||||
index -= 3
|
||||
|
|
@ -145,7 +147,7 @@ fun BigDecimal.formatWithSpaces(): String {
|
|||
}
|
||||
|
||||
return buildString {
|
||||
packets.forEachIndexed { index, packet ->
|
||||
packets.reversed().forEachIndexed { index, packet ->
|
||||
append(packet)
|
||||
if (index != packets.lastIndex) append(' ')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroundWhite"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue