Rename action to barAction
This commit is contained in:
parent
ce3261df07
commit
d268fcd389
3 changed files with 8 additions and 7 deletions
|
@ -20,7 +20,7 @@ import be.ugent.sel.studeez.R.string as AppText
|
||||||
fun DrawerScreenTemplate(
|
fun DrawerScreenTemplate(
|
||||||
title: String,
|
title: String,
|
||||||
drawerActions: DrawerActions,
|
drawerActions: DrawerActions,
|
||||||
action: @Composable RowScope.() -> Unit = {},
|
barAction: @Composable RowScope.() -> Unit = {},
|
||||||
content: @Composable (PaddingValues) -> Unit
|
content: @Composable (PaddingValues) -> Unit
|
||||||
) {
|
) {
|
||||||
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
||||||
|
@ -41,7 +41,7 @@ fun DrawerScreenTemplate(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions = action
|
actions = barAction
|
||||||
)},
|
)},
|
||||||
|
|
||||||
drawerContent = {
|
drawerContent = {
|
||||||
|
|
|
@ -31,7 +31,7 @@ fun PrimaryScreenTemplate(
|
||||||
title: String,
|
title: String,
|
||||||
drawerActions: DrawerActions,
|
drawerActions: DrawerActions,
|
||||||
navigationBarActions: NavigationBarActions,
|
navigationBarActions: NavigationBarActions,
|
||||||
action: @Composable RowScope.() -> Unit = {},
|
barAction: @Composable RowScope.() -> Unit = {},
|
||||||
content: @Composable (PaddingValues) -> Unit
|
content: @Composable (PaddingValues) -> Unit
|
||||||
) {
|
) {
|
||||||
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
||||||
|
@ -53,7 +53,7 @@ fun PrimaryScreenTemplate(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions = action
|
actions = barAction
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package be.ugent.sel.studeez.common.composable
|
package be.ugent.sel.studeez.common.composable
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.RowScope
|
||||||
import androidx.compose.material.*
|
import androidx.compose.material.*
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
|
@ -10,13 +11,12 @@ import be.ugent.sel.studeez.R
|
||||||
import be.ugent.sel.studeez.resources
|
import be.ugent.sel.studeez.resources
|
||||||
import be.ugent.sel.studeez.ui.theme.StudeezTheme
|
import be.ugent.sel.studeez.ui.theme.StudeezTheme
|
||||||
|
|
||||||
// TODO Add option for button in top right corner as extra button
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
// Does not contain floatingActionButton and bottom bar, used in all the other screens
|
// Does not contain floatingActionButton and bottom bar, used in all the other screens
|
||||||
fun SecondaryScreenTemplate(
|
fun SecondaryScreenTemplate(
|
||||||
title: String,
|
title: String,
|
||||||
popUp: () -> Unit,
|
popUp: () -> Unit,
|
||||||
|
barAction: @Composable RowScope.() -> Unit = {},
|
||||||
content: @Composable (PaddingValues) -> Unit
|
content: @Composable (PaddingValues) -> Unit
|
||||||
) {
|
) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
@ -30,7 +30,8 @@ fun SecondaryScreenTemplate(
|
||||||
contentDescription = resources().getString(R.string.go_back)
|
contentDescription = resources().getString(R.string.go_back)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
actions = barAction
|
||||||
) },
|
) },
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
content(paddingValues)
|
content(paddingValues)
|
||||||
|
|
Reference in a new issue