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 ...

0
votes
0answers
8 views

Android XML data binding not working with inheritance

I am using MVVM architecture and databind my XML textviews to a viewmodel associated with the fragment. The viewmodel contains an AllTimeStats object (the model) and has getters for each variable in ...
0
votes
1answer
30 views

Is it possible to set text of TextView with a method of ViewModel that returns String?

Is it possible to change text of TextView with a method that returns String?For training purposes i created this ViewModel class, it puts User object into List<User> mUserList and i wonder if ...
1
vote
1answer
17 views

How to smooth scroll to specific position in Recycler View (evant/binding-collection-adapter)

I am using evant/binding-collection-adapter to render the list of items. I want to scroll to a specific position when after rendering the list. Following is my code, but it's not working. any help..??...
0
votes
0answers
22 views

Unresolved reference: BR (Android Studio)

My top level build.gradle:buildscript {ext.kotlin_version='1.2.41'ext.lifecycle_version="1.1.1"repositories {google()jcenter()}dependencies {...
1
vote
0answers
23 views

How to use companion objects on xml layout?

I am trying to use a companion object property inside the layout but the compiler doesn't recognise it.Kotlin Classclass MyClass {companion object {val SomeProperty="hey"}}XML ...
0
votes
1answer
8 views

Blank screen when trying to implement MVVM / ViewModel and data binding architecture

I am trying to implement the Model-View-ViewModel architectural pattern and XML data binding in my Android Java app. The code seems all correct as far as I can see, however I'm getting a blank screen ...
0
votes
1answer
15 views

Recycle views in PagerAdapter with data binding

I've been trying to implement recycling in my PagerAdapter, which I could do successfully thanks to this question however I'm running into a problem to cache the views with data binding. I have ...
0
votes
2answers
48 views

How to use data binding to set layout_centerVertical in relativelayout

Say I have view that might be center vertical aligned in RelativeLayout. I want to use data binding to achieve this. android:layout_centerVertical="@{data.shouldCenter ? true : false}"I'm getting ...
0
votes
2answers
49 views

Android Studio Binding error Cannot resolve method

Android Studio 3.1.3 informs that cannot resolve method error while trying call Data Binding method. Data binding is enabled in build.gradle. Clear and/or Rebuild project takes no effect. Only one ...
-1
votes
0answers
19 views

Update View style from AndroidViewModel

I'm using databinding in my recent app. Where using AndroidViewModel viewModel for observable text updates.I've able to set values etc dynamically by ObservableField<String> abc. But I ...
0
votes
2answers
52 views

Live Data and 2-Way Data Binding: Custom setter not being called

I am using 2-way data binding to update a LiveData String object from my ViewModel with a string set in the EditText:<android.support.design.widget.TextInputEditTextandroid:id="@+id/...
0
votes
0answers
28 views

Android: How to deal with more than one Root Tags in XML?

So I was making a common Layout to include it in several classes and while doing so, I used <merge> tag as it helps in removing extra ViewGroups. There is no problem with it but if I also add &...
0
votes
1answer
42 views

Show progress Bar when loading image with Glide in DataBinding

I am trying to learn DataBinding and stuck with one problem . I am not able to show Progress during loading the image with GLide . Below is my code .@BindingAdapter("android:src")public static ...
8
votes
1answer
380 views

Kotlin 1.2.50 asks for baseFeatureInfoDir

When I switch in an Android project with classpath 'com.android.tools.build:gradle:3.2.0-alpha18' to classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.50"I run intoWhat went wrong:...
0
votes
0answers
29 views

How to get a ViewModel from other Activity?

I'am creating a Login Activity on my App.I have a Viewmodel + LiveData + DataBingind to update a TextView and display info about the progress of all background work when a user try to login....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,