diff --git a/app/src/main/java/com/tangem/tap/NavBarInsetsFragmentLifecycleCallback.kt b/app/src/main/java/com/tangem/tap/NavBarInsetsFragmentLifecycleCallback.kt index ddedbca8f6..2239eacd70 100644 --- a/app/src/main/java/com/tangem/tap/NavBarInsetsFragmentLifecycleCallback.kt +++ b/app/src/main/java/com/tangem/tap/NavBarInsetsFragmentLifecycleCallback.kt @@ -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 } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Specific.kt b/app/src/main/java/com/tangem/tap/common/extensions/Specific.kt index 219e9339da..795bc8e268 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/Specific.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/Specific.kt @@ -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(' ') } diff --git a/app/src/main/res/layout/fragment_onboarding_main.xml b/app/src/main/res/layout/fragment_onboarding_main.xml index 82b94a5def..faa2c0c829 100644 --- a/app/src/main/res/layout/fragment_onboarding_main.xml +++ b/app/src/main/res/layout/fragment_onboarding_main.xml @@ -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">