Skip to content

Commit

Permalink
Adding new param to update the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuppan committed Nov 27, 2023
1 parent eebc570 commit 028bb46
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.nkuppan.countrycompose.presentation.country

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.Dialog
Expand All @@ -10,11 +11,12 @@ import com.github.nkuppan.countrycompose.ui.theme.CountryAppTheme
@Composable
fun CountrySelectionDialog(
modifier: Modifier = Modifier,
isDarkTheme: Boolean = isSystemInDarkTheme(),
countryListViewModel: CountryListViewModel = viewModel(factory = ViewModelFactory),
onDismissRequest: (() -> Unit)? = null,
selection: ((Country) -> Unit)? = null
) {
CountryAppTheme {
CountryAppTheme(isDarkTheme = isDarkTheme) {
Dialog(
onDismissRequest = {
onDismissRequest?.invoke()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.nkuppan.countrycompose.presentation.country

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.lifecycle.viewmodel.compose.viewModel
Expand All @@ -10,11 +11,12 @@ import com.github.nkuppan.countrycompose.ui.theme.CountryAppTheme
@Composable
fun CountrySelectionPage(
modifier: Modifier = Modifier,
isDarkTheme: Boolean = isSystemInDarkTheme(),
countryListViewModel: CountryListViewModel = viewModel(factory = ViewModelFactory),
onDismissRequest: (() -> Unit)? = null,
selection: ((Country) -> Unit)? = null
) {
CountryAppTheme {
CountryAppTheme(isDarkTheme = isDarkTheme) {
CountryListAndSearchView(
modifier,
countryListViewModel,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.nkuppan.countrycompose.presentation.currency

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.Dialog
Expand All @@ -12,11 +13,12 @@ import com.github.nkuppan.countrycompose.ui.theme.CountryAppTheme
@Composable
fun CountryCurrencySelectionDialog(
modifier: Modifier = Modifier,
isDarkTheme: Boolean = isSystemInDarkTheme(),
countryListViewModel: CountryListViewModel = viewModel(factory = ViewModelFactory),
onDismissRequest: (() -> Unit)? = null,
selection: ((Country) -> Unit)? = null
) {
CountryAppTheme {
CountryAppTheme(isDarkTheme = isDarkTheme) {
Dialog(
onDismissRequest = {
onDismissRequest?.invoke()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.nkuppan.countrycompose.presentation.currency

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.lifecycle.viewmodel.compose.viewModel
Expand All @@ -12,11 +13,12 @@ import com.github.nkuppan.countrycompose.ui.theme.CountryAppTheme
@Composable
fun CountryCurrencySelectionPage(
modifier: Modifier = Modifier,
isDarkTheme: Boolean = isSystemInDarkTheme(),
countryListViewModel: CountryListViewModel = viewModel(factory = ViewModelFactory),
onDismissRequest: (() -> Unit)? = null,
selection: ((Country) -> Unit)? = null
) {
CountryAppTheme {
CountryAppTheme(isDarkTheme = isDarkTheme) {
CountryCurrencyListAndSearchView(
modifier,
countryListViewModel,
Expand Down

0 comments on commit 028bb46

Please sign in to comment.