Search code examples
javaandroidandroid-viewandroidplot

Add Custom Attributes to Existing View


I am using AndroidPlot since a while and found out that their are serveral settings, that cannot be set using xml. Now during playing around with BindingAdapter, I created some Methodes to extend existing attributes with custom which are only provided Programmically. Now my problem is that I have to bind something to the attributes in order to take effect.

So I have two questions:

  1. Is it possible to add xml-Attributes, using something simular like BindingAdapters to Views.
  2. Or is it possible to force android to use the BindingAdapter for OneTimeBinding?

Thanks


Solution

  • I solved it using a ViewModel for the Diagramm, so I can check the States additionally using TDD and can use the BindingAdapter to add some xml Attributes.