I have a layout that I'm inflating into a ViewStub. When its within view A, I want to have one set of styles applied to the EditText fields, and when it's within view B, I want to have a different set of styles applied to the EditText fields.
First, is this possible, and second (if so), how would I go about it?
I'm not sure about ViewStubs specifically, but if you wanted to inflate a predefined layout and add it to a ViewGroup you could use a ContextThemeWrapper.
View viewOne = View.inflate(new ContextThemeWrapper(context, R.style.Theme_One), R.layout.my_layout)
View viewTwo = View.inflate(new ContextThemeWrapper(context, R.style.Theme_Two), R.layout.my_layout)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With