Code Monkey home page Code Monkey logo

Comments (6)

oscarnylander avatar oscarnylander commented on May 14, 2024

I can only assume that it has to do with the Context-manipulation used for the different preview-flavors has something to do with it.

This assumption appears to have been correct - the offending context is from RTLComponentCard. This appears, in turn, to be caused by Context::createConfigurationContext not inheriting the theme of its parent context, and hence upon resolution receiving the default theme for the platform (for API 29, where I'm performing these tests, this is android:style/Theme.DeviceDefault.Light.DarkActionBar).

I realize that working around this limitation might be out of scope for this library, but I think it might be possible to work around the issue by 'forwarding' the theme of the parent context to the newly created context by Context::createConfigurationContext. If time allows, I'll make a PR!

from showkase.

oscarnylander avatar oscarnylander commented on May 14, 2024

Come to think of it - what is the reason that a configuration-context is created in this case? 🤔

Looking at the code, the following line:

CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl) {
appears to be sufficient in making the UI load in RTL. I tried commenting out all of the lines related to Context in the RTLComponentCard-composable, and there was no observable difference.

Could the configuration-context be redundant in this case?

from showkase.

vinaygaba avatar vinaygaba commented on May 14, 2024

@hedvigoscar I think you might be right. Afair, LocalLayoutDirection didn't exist when I first created Showkase. I probably added it during some of the later iterations. I think you might be right about it being fine to remove it. Do you wanna push that PR since you found the issue anyway :D I can do it too but would love to make sure you get credited with a contribution to your name!!

from showkase.

oscarnylander avatar oscarnylander commented on May 14, 2024

That's thoughtful of you, thanks!

I'll have it up shortly.

from showkase.

oscarnylander avatar oscarnylander commented on May 14, 2024

Done, check out #168 @vinaygaba 🙂

from showkase.

vinaygaba avatar vinaygaba commented on May 14, 2024

Fixed by #168

from showkase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.