Hey guys,
I’m facing an issue with an Android library module that contains a custom view created using XML, which has been converted to a composable using
AndroidView
. When I render the preview within the library, it works as expected.
However, when I add this library as a remote dependency and preview the composable, the UI is displayed differently. Specifically:
• The expected behavior shows a clickable "Text" element.
• The unexpected behavior displays a filled button with a colored background.
Any suggestions to resolve this issue?
s
Sagar yadav
01/15/2025, 2:28 PM
Is this just a preview problem or it's same when you run the app as well
s
Satyam SR
01/15/2025, 2:28 PM
its preview problem, when app is running it shows expected result
s
Sagar yadav
01/15/2025, 2:31 PM
Can you share the code here for more context
Sagar yadav
01/15/2025, 2:40 PM
I am assuming when the library is compiled and imported as a external dependency the tools: namespace attributes are getting removed
That may be the reason you are not able to see the expected preview
c
Chrimaeon
01/15/2025, 5:12 PM
FYI there’s #C04TPPEQKEJ for compose related questions.
👍 1
s
Satyam SR
01/16/2025, 8:11 AM
@Sagar yadav instead of using color in this format <item android:color="?colorBgDisabled" android:state_enabled="false" /> i hardcoded the value and i was able to preview the button