Export to GitHub

android-developer-preview - issue #2613

Data Binding - Allow Access to Styles


Posted on Jul 10, 2015 by Grumpy Panda

Please provide the following:

* Which version of the SDK are you using? Using: "com.android.databinding:dataBinder:1.0-rc0"

* What is the desired behavior of the feature? (Be specific!) I would like to be able to access style resources with the new data binding in xml. Similar to how color and string resources are accessed. Example:

<EditText android:layout_width="wrap_content" android:layout_height="wrap_content" style="@{mode == Mode.Edit ? @style/edit_mode_style : @style/view_mode_style}" />

Comment #1

Posted on Jul 20, 2015 by Swift Elephant

Thank you for this suggestion. We will pass this along to the development team and provide updates as they are available.

Comment #2

Posted on Jul 20, 2015 by Swift Elephant

Thank you for the suggestion. Our development team has looked into this feature request and unfortunately it is not feasible. The style of a View cannot be changed dynamically.

Status: WontFix

Labels:
Type-Feature Release-M Feature-22603241