Skip to content

Commit d69edcb

Browse files
committed
Uses WindowInsets
Updated the code to use WindowInsets
1 parent 229182d commit d69edcb

File tree

1 file changed

+2
-4
lines changed
  • modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings

1 file changed

+2
-4
lines changed

modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/HelpFragment.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import android.view.LayoutInflater
66
import android.view.ViewGroup
77
import android.webkit.WebView
88
import androidx.compose.foundation.layout.WindowInsets
9+
import androidx.compose.foundation.layout.asPaddingValues
910
import androidx.compose.foundation.layout.fillMaxSize
1011
import androidx.compose.foundation.layout.ime
1112
import androidx.compose.foundation.layout.padding
1213
import androidx.compose.runtime.collectAsState
1314
import androidx.compose.runtime.getValue
1415
import androidx.compose.ui.Modifier
1516
import androidx.compose.ui.platform.LocalContext
16-
import androidx.compose.ui.platform.LocalDensity
1717
import androidx.compose.ui.unit.dp
1818
import androidx.fragment.compose.content
1919
import au.com.shiftyjelly.pocketcasts.compose.AppThemeWithBackground
@@ -42,9 +42,7 @@ class HelpFragment : BaseFragment(), HasBackstack {
4242
) = content {
4343
AppThemeWithBackground(theme.activeTheme) {
4444
val context = LocalContext.current
45-
val density = LocalDensity.current
46-
val imeInsets = WindowInsets.ime
47-
val keyboardHeight = with(density) { imeInsets.getBottom(density).toDp() }
45+
val keyboardHeight = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
4846

4947
val bottomPadding by settings.bottomInset.collectAsState(0)
5048
val miniPlayerPadding = bottomPadding.pxToDp(context).dp

0 commit comments

Comments
 (0)