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

Elevation of XML components is not taken into account #681

Open
florentmaitre opened this issue Oct 24, 2023 · 0 comments
Open

Elevation of XML components is not taken into account #681

florentmaitre opened this issue Oct 24, 2023 · 0 comments

Comments

@florentmaitre
Copy link
Member

florentmaitre commented Oct 24, 2023

See OdsBottomNavigation XML demo for an example:

Screenshot_20231024_151027
Screenshot_20231024_151142

This is due to the fact that the Surface which contains the composable content in OdsAbstractComposeView clips its content to its bounds.
To fix this we could either:

  1. Add an elevation to the Surface to mimic the bottom navigation elevation. This would mean adding an elevation parameter to OdsTheme which is not the preferred solution.
  2. Use LocalContentColor(and maybe other composition locals) instead of a Surface in OdsTheme to propagate colors properly.

We also need to update the ViewDataBinding method in app:

AndroidView(
    factory = {
        binding.bind()
        binding.executePendingBindings()
        binding.root
    },
    update = {
        binding.bind()
        binding.executePendingBindings()
        (binding.root as? ViewGroup)?.clipChildren = false
    }
)
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

No branches or pull requests

1 participant