Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default color of the CascadeDropdownMenu is not the same as DropdownMenu #39

Closed
MV-GH opened this issue Aug 25, 2023 · 1 comment
Closed

Comments

@MV-GH
Copy link

MV-GH commented Aug 25, 2023

Before:
image

after:
image

Showing a default DropdownMenu vs CascadeDropdownMenu

studio64_ydSz9zlk9O.mp4

I am also not sure how not to change the default color with CascadeDropdownMenu

code in question
    CascadeDropdownMenu(
        expanded = expanded,
        onDismissRequest = onDismissRequest,
        modifier = Modifier.semantics { testTagsAsResourceId = true },
    ) {

        DropdownMenuItem(
            text = { Text(text = stringResource(R.string.home_refresh)) },
            leadingIcon = { Icon(Icons.Outlined.Refresh, contentDescription = null) },
            onClick = {
                onDismissRequest()
                onClickRefresh()
            },
            modifier = Modifier.testTag("jerboa:refresh"),
        )
        DropdownMenuItem(
            text = { Text(text = stringResource(R.string.home_post_view_mode)) },
            leadingIcon = { Icon(Icons.Outlined.ViewAgenda, contentDescription = null) },
            children = {
                PostViewMode.entries.map {
                    DropdownMenuItem(
                        text = { Text(text = stringResource(it.mode)) },
                        onClick = {
                            onClickPostViewMode(it)
                            onDismissRequest()
                                  },

                        modifier =
                        if (selectedPostViewMode == it) {
                            Modifier.background(MaterialTheme.colorScheme.onBackground.copy(alpha = .1f))
                        } else {
                            Modifier
                        }.testTag("jerboa:postviewmode_${it.name}"),
                    )
                }
            },
            modifier = Modifier.testTag("jerboa:postviewmode"),
        )
        DropdownMenuItem(
            text = { Text(stringResource(R.string.home_site_info)) },
            leadingIcon = { Icon(Icons.Outlined.Info, contentDescription = null) },
            onClick = {
                onClickSiteInfo()
                onDismissRequest()
            },
        )

Old version https://github.com/MV-GH/jerboa/blob/a5d1b01a6b219ad524d5d97e897e6514058646d5/app/src/main/java/com/jerboa/ui/components/home/Home.kt#L230

@saket
Copy link
Owner

saket commented Oct 8, 2023

Fixed by 07fa1de

@saket saket closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants