alorma/Compose-Settings

Material 3

Closed this issue · 8 comments

Hello. Do you want support Material 3?

Surely!

I have the idea to move to material 3 someday... as a separate artifact.

Would you create a pull request with material 3?

Surely!

I have the idea to move to material 3 someday... as a separate artifact.

Would you create a pull request with material 3?

Hello, sorry, as for me, it is "black box". I can immediate test at pet project). I found that you created pull request before

Yes 🤣

I've started with it.

Give me some days to polish details of M3. As I don't have any guidelines on settings with M3.

Yes 🤣

I've started with it.

Give me some days to polish details of M3. As I don't have any guidelines on settings with M3.

Thanks a lot.

Hey @daimonkor .

I've just released a new version 0.13.0 with a new artifact (module).

You can try it with:

implementation 'com.github.alorma:compose-settings-ui-m3:0.13.0'

Please, try it and give me any issue that you find!

Hey @daimonkor .

I've just released a new version 0.13.0 with a new artifact (module).

You can try it with:

implementation 'com.github.alorma:compose-settings-ui-m3:0.13.0'

Please, try it and give me any issue that you find!

Thanks a lot, in process

@alorma
Hm, can not recompose switchers component when changed language

@Composable
fun SetLanguage(locale: Locale) {
    val configuration = LocalConfiguration.current
    configuration.setLocale(locale)
    val resources = LocalContext.current.resources
    resources.updateConfiguration(configuration, resources.displayMetrics)
}
 setContent {
            SetLanguage(locale = Locale.forLanguageTag(settingsViewModel.settings.languageTag))
-----
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun Settings(
    navController: NavController,
    isDarkMode: Boolean,
) {
val darkSwitcherState = rememberBooleanSettingState(isDarkMode)
SettingsSwitch(
                state = darkSwitcherState,
                modifier = Modifier
                    .background(MaterialTheme.colorScheme.background),
                icon = {
                    Icon(
                        imageVector = Icons.Default.DarkMode,
                        contentDescription = stringResource(R.string.dark_mode),
                        tint = MaterialTheme.colorScheme.onBackground
                    )
                },
                title = {
                    Text(
                        stringResource(R.string.dark_mode),
                        color = MaterialTheme.colorScheme.onBackground
                    )
                },
                onCheckedChange = onDarkModeChange
            )
}

Looks like https://prnt.sc/GG-Owt-VbALQ
Please try check, thanks a lot.

@alorma Hello, I mean recompose does not work for your switchers when changed configuration (locale)