airbnb / paris

Define and apply styles to Android views programmatically
Apache License 2.0
1.91k stars 91 forks source link

So basically you cannot apply styles from material library using this solution #91

Open renetik opened 5 years ago

renetik commented 5 years ago

Material library from google is like must have this days. I was trying to switch to creating views programmatically and it went quite nice using kotlin, anko, paris but this looks like stop for me and to go back to layouts. So this library cannot apply any styles that are not supported by it directly so custom style attributes that are used in google material are just ignored. I cannot apply styles by ContextThemeWrapper nor this library so it looks like its too much hustle for little gain.. Correct me if I am wrong please.

ngsilverman commented 5 years ago

@rene-dohan which custom styles attributes are you using? It's possible to add support for new attributes to Paris.

renetik commented 5 years ago

Maybe you have heard about Google Material components libraries, its library with various components melted with styles and guidelines to make android looks like material design standard easily... So yeah there is a lot of attributes there, actually every component has some, I had nice idea to use Paris and Anko layouts together but with material its just too much of code an I cannot reuse styles from material library that is why it is so useful

https://github.com/material-components/material-components-android

ngsilverman commented 5 years ago

@rene-dohan support for external view types and attributes can be added using View Proxies. This can be done within the Paris project or within your own (if you're using Paris). Again, if you can point me to specific views and attributes I can look into adding support for them.

Zoha131 commented 4 years ago

I have tried applying style for MaterialButton using View Proxies. But it did not work for me. This is an awesome library. It would be the game-changer if we get Material Component support out of the box.

ngsilverman commented 4 years ago

@Zoha131 could you maybe create a pull request with your view proxy? I'd be happy to take a look and help debug.

Zoha131 commented 4 years ago

@ngsilverman I would definitely do that. But unfortunately, I have a tight deadline. After I meet my deadline I would do that.

pfieffer commented 4 years ago

Bummer !

Zoha131 commented 4 years ago

@ngsilverman I have submitted a PR #124 for review. Hope you can take a look soon.

cacato86 commented 4 years ago

Any progress on that? I'm interested too