Skip to content

Commit

Permalink
Added vertical scroll for drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
sirekanian committed Oct 26, 2023
1 parent 2772504 commit 65d1ad7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/src/main/java/org/sirekanyan/outline/ui/DrawerContent.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package org.sirekanyan.outline.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Done
Expand All @@ -26,7 +33,15 @@ import org.sirekanyan.outline.text.formatTraffic

@Composable
fun DrawerContent(dao: ApiUrlDao, state: MainState) {
ModalDrawerSheet {
val insets = WindowInsets.systemBars.asPaddingValues()
ModalDrawerSheet(windowInsets = WindowInsets(0.dp)) {
DrawerSheetContent(dao, state, insets)
}
}

@Composable
private fun DrawerSheetContent(dao: ApiUrlDao, state: MainState, insets: PaddingValues) {
Column(Modifier.verticalScroll(rememberScrollState()).padding(insets).padding(bottom = 8.dp)) {
Text(
text = stringResource(R.string.app_name),
modifier = Modifier.padding(horizontal = 28.dp, vertical = 16.dp),
Expand Down

0 comments on commit 65d1ad7

Please sign in to comment.