ods-android icon indicating copy to clipboard operation
ods-android copied to clipboard

Elevation of XML components is not taken into account

Open florentmaitre opened this issue 2 years ago • 0 comments

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
    }
)

florentmaitre avatar Oct 24 '23 14:10 florentmaitre