2,494 questions
0
votes
0
answers
46
views
How do we define the view model store to be used in a stand alone composable
I am trying to migrate the bottom sheet set up to use Compose. While I can use the Compose's ModalBottomSheet for this purpose,
I have the following questions:
My ViewModel's view store owner is the ...
1
vote
0
answers
33
views
com.google.android.material.textfield.MaterialAutoCompleteTextView height issue
Here is presented a part of layout I have in project, I use databinding.
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_name"
android:layout_width=&...
0
votes
1
answer
67
views
@BindingAdapter not found no matter what I try
I'm new to Android Development so hopefully my issue will be an easy fix.
I've been trying to play around with @BindingAdapter in an existing project, but no matter where I place the binding adapter ...
0
votes
1
answer
46
views
Android Data Binding Type Mismatch in RecyclerView with MVVM
I'm developing an Android notes app using Kotlin and MVVM architecture. I'm facing a persistent type mismatch error when using data binding in my RecyclerView, even though the code seems correct.
...
2
votes
1
answer
144
views
How to resolve SpotBugs warning about exposing internal representation with Android Data Binding?
I'm working on an Android project using data binding, and I've encountered a warning in the SpotBugs violation report that I'm not sure how to address. Here's the setup:
<?xml version="1.0&...
0
votes
1
answer
151
views
cannot find symbol class ActivityMainBindingImpl
I am currently learning about Data binding and I did exactly as the tutorial but I keep getting the error "error: cannot find symbol class ActivityMainBindingImpl" when I run the app no ...
1
vote
0
answers
35
views
Firebase Crashlytics Plugin clashes with data-binding
I can build with plugin version 2.9.9, but the current version 3.0.0 seems to clash when data-binding is enabled:
android.buildFeatures {
buildConfig true
dataBinding true
}
This is the ...
0
votes
0
answers
81
views
Duplicate GlobalKey detected in widget tree Error FLUTTER
When i tap the color button in add_task_page.dart page app crashes. And When i open the app dont display sqflite table in homepage(homepagepass.dart) also and i'm seeing this error which is this:
(...
1
vote
1
answer
238
views
error: cannot find symbol View root = inflater.inflate(R.layout.toolbar, parent, false);
I used data binding to connect the UI, but when I rebuild the project, I get this error:
error: cannot find symbol
View root = inflater.inflate(R.layout.toolbar, parent, false);
...
0
votes
1
answer
49
views
Cannot resolve method 'inflate' in 'DashboardActivity'
This is a simple application. I am using Intent to navigate from activity_main.xml to activity_dashboard.xml
In DashboardActivity.java file I am trying to use Data binding property. But I am getting 2 ...
0
votes
1
answer
166
views
class NumberpickercustomlayoutBinding is public, should be declared in a file named NumberpickercustomlayoutBinding.java
I have enabled data binding in my android studio project. Whenever I build my project it shows this error:
" error: class NumberpickercustomlayoutBinding is public, should be declared in a file ...
-1
votes
1
answer
332
views
How to use View Binding insted of butterknife?
I am updating an app. In the new program, I intend to use View Binding because butterknife library does not work. My codes are as follows. How do I use the new method?
The previous code uses the ...
1
vote
1
answer
117
views
Android Data binding missing return statement in generated code
@BindingAdapter(
"onTimeViewClick",
"onLocationViewClick",
"onSetDeliveryAddressClick",
)
internal fun setSubHeaderData(
onTimeViewClick: (() -> Unit)?,...
2
votes
2
answers
255
views
Android Kotlin ImageView inside RecyclerView.Adapter doesn't update as expected
After finally implementing icons for device types in my server, I replaced the temporary drawables I previously used with the icons from the server and load them using coil. The ImageView for them is ...
2
votes
1
answer
49
views
Databinding displays unpopulated value while waiting for the value to be populated in Android
I am using databinding to display text on TextView using ternary syntax.
android:text="@{vm.value.firstValue != null ? vm.value.firstValue.toString() : @string/source1}"
This code displays @...
0
votes
0
answers
118
views
I can't import class that generated using annotation via databinding
I generated a class with below annotation generator.
@AutoService(Processor::class)
class GenerateSealedGettersProcessor : AbstractProcessor() {
override fun getSupportedAnnotationTypes(): ...
0
votes
1
answer
208
views
Android proguard rule for databinding
I have used onclick databinding in my layout files
<data>
<variable
name="clickHandler"
type="com.example.ui.ClickHandler" />
</...
12
votes
2
answers
7k
views
Do I still need to use the kapt plugin (I am using ksp) if I am enabling dataBinding for a project?
I am aware that dataBinding requires an annotation processor (that is provided by kapt), is there anyway to use ksp for that purpose?
0
votes
1
answer
82
views
Android Studio databinding android:text error = <expr> expected, got '''
android:text="@{String.valueOf(detailedPostVM.postLiveData.likedUsers.size)+'people liked'}"
android:text="@{detailedPostVM.alreadyLiked ? 'LIKED' : 'LIKE'}"
I am trying to use ...
1
vote
1
answer
572
views
Android Studio: Build folder in app directory erroring out
I am getting multiple errors in various files in the build folder, which is labeled with "Files under the 'build' folder are generated and should not be edited." I have a hunch that this is ...
-1
votes
2
answers
329
views
What could be the reason that an app can get stuck at Binding.inflate which previously works fine?
After realizing that my app seems to be miss behaving, I did some clever debugging tactics, namely adding Log calls between my code and some cheeky debug breakpoints, I realized that my MainActivity ...
0
votes
1
answer
185
views
RadioGroup Android Databinding XML With Include Layouts
I am currently facing an issue with the radio buttons in my app. My app comprises Information Forms which include Radio buttons with other Views and there are multiple forms. When I select option 1 of ...
0
votes
2
answers
500
views
How to place an icon just after the last character of a multiline textview
I would like to locate a view just after the last word of a (potentially) multi-line TextView.
For example, the TextView might be two lines, with the second line being about half as long as the ...
1
vote
1
answer
370
views
Binary XML file line #23 in layout/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout
I am upgrading android gradle and migrating to android X. I am getting this runtime error on inflating splash screen.
Edited:
So this project is made for sdk 28 and it's working fine in android pie.
...
0
votes
0
answers
32
views
Databinding compiling issue Android
I am getting error on xml layout file:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<...
0
votes
1
answer
19
views
How can I include one layout in another only, if the viewmodel is of a certain subtype with databinding?
I have a complex layout, that should include another layout only, if the viewmodel is of a specific subtype. (e.g. I have four types of entries and one of them has a special layout that others have ...
0
votes
0
answers
21
views
How to propertly include layout in to the main layout to store all data in one data binding?
I have three different blocks in my application. I'm trying to make a data binding.
Right now, I'm trying to figure out how to bind at least two layouts together.
This is part of my layout that I have ...
0
votes
1
answer
246
views
How to propertly get data from editText in data binding(beginner)
I'm a beginner in android programming.
I'm trying to build my first app and wanted to implement straight away the right logic.
I read about DataBinding and tried to implement this thing in my project.
...
1
vote
1
answer
956
views
Android View Binding for a "base fragment"?
Android/Kotlin rookie here.
I'm converting someone else's code, that was written with synthetics, to View Bindings per Google Play's upcoming deprecation deadline. I read this and this and converted ...
0
votes
1
answer
471
views
error: cannot find symbol import com.example.databinding2.databinding.ActivityMainBindingImpl;
I'm unable to resolve this error.
I wanted to use two-way databinding in edittext.
Here is the code for the layout file.
<?xml version="1.0" encoding="utf-8"?>
<layout ...
0
votes
2
answers
52
views
RecycleView not shownig any items
I'm new to android and kotlin and I'm having trouble making a recycleView for my app
There are 0 errors in my code, but items don't show up in the simulater and the recyclervie is just blank.
I havent ...
2
votes
1
answer
1k
views
Android Error "AbstractMethodError: abstract method androidx.databinding.ViewDataBinding androidx.databinding.DataBinderMapper.getDataBinder
I have a library made by me, the library uses databinding, I export the library as an aar file. I have a test project where the library works for me, but when I import it into another project, it ...
0
votes
1
answer
65
views
Running the same code in three different fragments under the common class
I am using databinding in my application.
I have three different fragments, all three have toolbars with the same id.
I have code that is the same in three toolbars.
float radius = ...
0
votes
1
answer
132
views
Using data binding for custom layout files
I am working on a project on android studio (KOTLIN) where activity_main.xml only contains the drawer layout and it includes app_bar_main.xml file and my app_bar_main.xml is a coordinator layout ...
0
votes
0
answers
66
views
Data Binding in autoCompleteTextView in Android
Can anyone help me with data binding in autoCompleteTextView for setting an adapter and getting value in android using java language?
I needed to implement MVVM model architecture in the example, but ...
2
votes
1
answer
283
views
"RuntimeException: Failed to parse data binding compiler options" with Android data binding
I am currently writing a small fragment view in Kotlin for an Android application and enabled data binding und view binding in the build gradle. The view is quite simple and just shows some TextView ...
-1
votes
1
answer
246
views
Is it OK to load an image from the Fragment/Acvtivity when using Coil?
Question 1: When I load an image using the Coil library, I do it in the Fragment or Activity: imageView.load("https://example.com/image.jpg"). Is it OK to use the internet connection (method ...
0
votes
2
answers
66
views
Populating data from MainActivity to ViewModel not observed in fragment
I'm trying to populate some live data from within the MainActivity into a ViewModel. However, the Fragment only appears to observe the initial data once ("NO DATA YET") which is set in the ...
0
votes
0
answers
2k
views
Error of binding class missing while building gradle project
Execution failed for task ':app:dataBindingGenBaseClassesDebug'.
> Cannot access output property 'sourceOutFolder' of task ':app:dataBindingGenBaseClassesDebug'. Accessing unreadable inputs or ...
1
vote
1
answer
126
views
Android-Databinding TextField with Regex
I'm using M3 TextField with XML data binding. I want to send input to ViewModel and if is valid, text field's text should equal to this input, else should no change on TextField's text.
Here is XML ...
0
votes
1
answer
102
views
RecyclerView doesn't show items until scrolling in kotlin
I have a RecyclerView that shows a list with livedata.
RecyclerView adapter is prepared with viewBinding.
My problem is that the RecyclerView does not show the items, but when I scroll the ...
0
votes
1
answer
194
views
android data binding cannot find method get() in class Statistic
I have a model class like this
data class FixtureById(
@SerializedName("get")
val `get`: String?,
@SerializedName("response")
val response: List<Response?>?,
)...
0
votes
1
answer
52
views
Pojo (with Binding) object is null in 2 way data binding in Android
Below is my xml
Below is my Pojo
Below is my kotlin class
I'm always getting null at line 19 of kotlin class for binding.data
I would like to know, when binding.tv1 & binding.et1 are not null, ...
0
votes
2
answers
1k
views
Android data binding generates Cannot Resolve Method
I'm trying to add databinding to my project according to Android Developers Official Documentation and I'm getting a 'Cannot resolve method' error for setUser. I'm getting really frustrated and ...
0
votes
1
answer
229
views
Android get variable in layout preview with data binding?
Is it possible to see in layout preview in Android Studio window an int in view's marginLeft? Here is what I'm trying:
<data>
<variable
name="doorLeft"
type=&...
1
vote
0
answers
31
views
Is it possible to use style attribute as default value in databinding?
Do you know if it's possible to use theme attributes as default values for databinding?
example:
android:background="@{toolbarColors.backgroundColor, default=@color/color_primary}"
...
0
votes
0
answers
59
views
Problem in import statement of databinding
I cannot import databinding to my project. I enabled databinding and imported the databinding class in my kotlin code but I get unresolved error.
I verified my build.gradle (:app) file and there is no ...
0
votes
1
answer
957
views
Android: How to pass EditText's text property to DataBinding expression of another view
I have an EditText (@+id/quantityNumber) and a Button (@+id/addToCartButton) view next to each other in my layout. The EditText is a quantity field and the Button takes the value entered in the ...
0
votes
1
answer
2k
views
kotlin.UninitializedPropertyAccessException: lateinit property binding has not been initialized
my application is giving the below error that you mentioned above and it says there is an error on line 69, but you have tried all the solutions and could not fix it. You are new to programming and ...
0
votes
1
answer
1k
views
How to initialize preference datastore class in fragment to get saved data from login in kotlin?
as I'm new to kotlin and data store preference so I'm putting this question in a hope to get some proper way to do it.