-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [ANDROAPP-6083] Adds device's navigation bars padding to bottom …
…sheet (#235)
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...n/org/hisp/dhis/mobile/ui/designsystem/component/internal/bottomSheet/BottomSheetUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.hisp.dhis.mobile.ui.designsystem.component.internal.bottomSheet | ||
|
||
import android.annotation.SuppressLint | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.platform.LocalContext | ||
|
||
// TODO - hack to get navigation bar padding does not take into account IME padding (reflection) | ||
// TODO - Should be remove when google publish https://issuetracker.google.com/issues/274872542 | ||
@Composable | ||
@SuppressLint("DiscouragedApi") | ||
actual fun rememberDimensionByName(name: String): Int { | ||
val resources = LocalContext.current.resources | ||
return remember { | ||
val id = resources.getIdentifier(name, "dimen", "android") | ||
if (id == 0) 0 else resources.getDimensionPixelSize(id) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...n/org/hisp/dhis/mobile/ui/designsystem/component/internal/bottomSheet/BottomSheetUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.hisp.dhis.mobile.ui.designsystem.component.internal.bottomSheet | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
// TODO - hack to get navigation bar padding does not take into account IME padding (reflection) | ||
// TODO - Should be remove when google publish https://issuetracker.google.com/issues/274872542 | ||
|
||
@Composable | ||
expect fun rememberDimensionByName(name: String): Int |
8 changes: 8 additions & 0 deletions
8
...n/org/hisp/dhis/mobile/ui/designsystem/component/internal/bottomSheet/BottomSheetUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.hisp.dhis.mobile.ui.designsystem.component.internal.bottomSheet | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
// TODO - hack to get navigation bar padding does not take into account IME padding | ||
// TODO - Should be remove when google published https://issuetracker.google.com/issues/274872542 | ||
@Composable | ||
actual fun rememberDimensionByName(name: String) = 0 |