Questions tagged [android-databinding]

Data Binding Library to write declarative layouts and minimize the glue code necessary to bind your application logic and layouts. The Data Binding Library offers both flexibility and broad compatibility — it's a support library, so you can use it with all Android platform versions back to Android 2.1 (API level 7+).

The Data Binding Library offers both flexibility and broad compatibility — it's a support library, so you can use it with all Android platform versions back to Android 2.1 (API level 7+).

To use data binding, Android Plugin for Gradle 1.5.0-alpha1 or higher is required.

Official API Documentation

Data Binding Guide

2508 questions
1
vote
1 answer

Kotlin stdlib and Databinding

Is it possible to use methods from Kotlin stdlib in xml? For example this code
hluhovskyi
  • 9,556
  • 5
  • 30
  • 42
1
vote
1 answer

Android Data Binding doubts

It seems to me that Android Data Binding is an interesting tool, but it doesn't tie very well with the (overly) complex architecture of Android. Many example or tutorials show only some basic scenario that obviously works, but when things become…
1
vote
0 answers

Data Binding broke after upgrade to Play service to 10.2.0

I am using Android Studio 2.3 & Here is app level gradle which is working perfectly with play service 10.0.1 apply plugin: 'com.android.application' ext { retrofitVersion = "2.1.0" sdkVersion = 25 supportLibVersion = '25.3.0' …
1
vote
1 answer

When should InverseBindingAdapter be used?

Why do I need InverseBindingAdapter in Android DataBinding, When should we use it?
Rage TF
  • 66
  • 1
  • 4
1
vote
1 answer

Cannot find the setter for attribute 'android:drawable' with parameter type android.graphics.drawable.Drawable on android.widget.TextView

I'm making a binding adapter where a I can set color filter to a drawable. So I have these lines of code in java class @BindingAdapter(value = {"drawable", "filterColor"}, requireAll= true) public static void setColorFilterToDrawable(View view, int…
devadnqpnd
  • 154
  • 1
  • 3
  • 16
1
vote
0 answers

Bind NavigationView menu

Is there any way now to bind NavigationView menu (using DataBinding)? I'm interested in binding some ActionViews. Now I'm using binding.nvview.post(..); and in postDataBindingUtil.bind(findViewById(my_view_id)), but sometimes post happens before…
1
vote
1 answer

Android data binding for TableLayout

I am reading this manual https://developer.android.com/topic/libraries/data-binding/index.html and it is not clear for me, how to fill the TableLayout with rows if my data is kept in ObservableArrayList? All examples assume there to show a single…
Almaz
  • 920
  • 11
  • 13
1
vote
1 answer

How to bind a variable in android that can be a String or double with the data-binding-library?

For my android application, I want to read the temperature of my raspberry pi. From the server, the variable is returned as a double. From the XML, it is returned as a String. Therefore I thought why wouldn't I make a generic setter that can set the…
user3473161
  • 197
  • 1
  • 4
  • 18
1
vote
1 answer

Resources NotFoundException on SeekBar DataBinding expression

I'm trying to invoke a method using lambda expression for SeekBar onProgressChanged, but I'm getting this exception: android.content.res.Resources$NotFoundException: String resource ID #0x0 at…
juliano.net
  • 7,982
  • 13
  • 70
  • 164
1
vote
2 answers

Wrong Lambda expression evaluation at the time of event happens

In one of my event handler on a button, I am using lambda expression but it evaluate wrong result at the time of event happens. My flow is to check whether a view (In my case it is TextView) is visible or not in the expression. If view is visible…
Vinit Saxena
  • 683
  • 2
  • 11
  • 27
1
vote
1 answer

Android : ProGuard cannot find setter for attribute "bind:items" in recycler view inside layout

Compile time error occurs when I try to run with ProGuard and data binding enabled. Note : Same code works when proGuard is disabled. Here is the console error message Cannot find the setter for attribute 'bind:itemOrders' with parameter type…
Fahadsk
  • 1,099
  • 10
  • 24
1
vote
1 answer

Binding expression results in error, but compiles/runs fine

I seem to be getting an error when creating binding expressions in Android Studio. The code seems to compile and run ok and the method is called, but I'm still left with an error in Android Studio. Am I missing something here? As far as the…
Eurig Jones
  • 8,226
  • 7
  • 52
  • 74
1
vote
1 answer

Foreground using data binding is not working in some devices

I use data binging in a view holder of a recycler view. For showing an inactive row, I set foreground to a color and this is working perfect on my Nexus6 and many other devices.
hadilq
  • 1,023
  • 11
  • 25
1
vote
1 answer

Android Binding - property changing

I have problem with Android binding library. When I'm using property changed '_all' everything works, but when I'm specifying field it don't work. My question is why ? :) public class Person extends BaseObservable{ private String…
1
vote
1 answer

How can I turn Firebase listeners into observable map using data binding library?

TL; DR Would it be possible to hide all Firebase read and write operations behind a ObservableMap as a Facade Pattern? So all we would have to do would be: User oldUser = map.put(user); User newUser = map.get(primaryKey); Full Question According to…
1 2 3
99
100