After 5 years of being an Android Dev I still don't fully understand how theming and styles work. But after watching the video it seems to be getting more clear
This is usually such a pain on a typical project where designers use tools that do not support Android theming/styling model. So we, developers, just have to deal with hard-coded colors and sizes. Ok, that would not be such a problem, but usually mockups are not consistent across screens.
Good Talk! Theming and Styling is one area of Android which is overly complex, poorly documented and very less understood. This talk tries to throw light on those grey areas to some extent.
Honestly, I wish android had just used some subset of CSS ... it's proven to work well, fast ... the resource/style system they have is ... well, sad to say the least. Very confusing, full of duplication... I've looked through the material library, and it's just *_painful._*
I'm not saying CSS is perfect. By no means. But definitely better. Especially with variables (which, I think is what they wanted, and CSS did not have have the mat all, when Android started, but still) - With CSS one can use SASS etc. (- could be a variant for Android, that can get compiled to resources) - But resources have many issues: they are only read while inflating, and there is no way to 'change' 'style' of a parent, such that it would influence children (i.e. adding to 'class' of a layout), etc...
You can safely use theme attributes inside of AnimatedVectorDrawableCompat and VectorDrawableCompat XML files. The reason why it doesn't crash is because the vector support library parses the XML drawable files as plain text in order to create a "compat" implementation that will work on older platforms.
@@samsulkarim164 Honestly, I wish android had just used some subset of CSS ... it's proven to work well, fast ... the resource/style system they have is ... well, sad to say the least. Very confusing, full of duplication... I've looked through the material library, and it's just *_painful._*
After 5 years of being an Android Dev I still don't fully understand how theming and styles work. But after watching the video it seems to be getting more clear
Can you please share one demo for explaining the same. It will be very helpful.
This is usually such a pain on a typical project where designers use tools that do not support Android theming/styling model.
So we, developers, just have to deal with hard-coded colors and sizes.
Ok, that would not be such a problem, but usually mockups are not consistent across screens.
Finally, after a long time learning styles and theming. I still can't figure out why my text color doesn't want to change .💀
Good Talk! Theming and Styling is one area of Android which is overly complex, poorly documented and very less understood. This talk tries to throw light on those grey areas to some extent.
Could anyone explain what was the problem when we set style to only one button via "style attribute on Button in layout XML"? 13:30
You mentioned Primary Light as a replacement for onPrimary, but here we are 4 years later and jetpack compose uses onPrimary... What gives?
How we can switch to dark mode via code?
So how we can switch between themes?
Did you find it bro..?
@@mg-ht9ir I've re-created the Activity, otherwise we should update every ui I think
Honestly, I wish android had just used some subset of CSS ... it's proven to work well, fast ... the resource/style system they have is ... well, sad to say the least. Very confusing, full of duplication... I've looked through the material library, and it's just *_painful._*
I'm not saying CSS is perfect. By no means. But definitely better. Especially with variables (which, I think is what they wanted, and CSS did not have have the mat all, when Android started, but still) - With CSS one can use SASS etc. (- could be a variant for Android, that can get compiled to resources)
- But resources have many issues: they are only read while inflating, and there is no way to 'change' 'style' of a parent, such that it would influence children (i.e. adding to 'class' of a layout), etc...
I hope styling will get somewhat fixed for Compose...
100% right, take for example ReactNative styling
wait, wait, wait, wait! on the slide @ 18:50 - android:fillColor="?attr/colorPrimary" does crash on pre-21 devices, doesn't it?
You can safely use theme attributes inside of AnimatedVectorDrawableCompat and VectorDrawableCompat XML files. The reason why it doesn't crash is because the vector support library parses the XML drawable files as plain text in order to create a "compat" implementation that will work on older platforms.
Nope, VectorDrawableCompat supports theme colors on all platform levels.
How can I use ?attr with conditionals in the xml? for example textColor=@{if foo ?attr/blue : ?attr/red} seems to only allow @ sematics in there?
The 1080p@30fps is bugging me
So, I watched this talk, finally thought I understand it, tried it.... _aaand_ I don't. XD oh well.
Not alone dude...
Yes, tough stuff. Try to example GitHub project tho...
@@samsulkarim164 Honestly, I wish android had just used some subset of CSS ... it's proven to work well, fast ... the resource/style system they have is ... well, sad to say the least. Very confusing, full of duplication... I've looked through the material library, and it's just *_painful._*
isbit
Too much of a flat plain gradiant