android-databinding

View Binding not work with “Include”: incompatible types: ProgressBarLayoutBinding cannot be converted to ViewDataBinding

泄露秘密 提交于 2020-02-28 06:17:28
问题 Android Studio 3.6. Canary 12 build.gradle: buildscript { ext.kotlin_version = '1.3.50' ext.RETROFIT_VERSION = '2.6.0' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.6.0-alpha12' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } in app/build.gradle: apply plugin: 'com.android.application' apply plugin:

Android recyclerview adapter with multiple viewtype using databinding

泄露秘密 提交于 2020-02-26 10:08:27
问题 Is it possible to create a multiple view type in my adapter.. like adding a view for my header then below the header is a list. code snippet for my adapter : public class StoreAdapter extends RecyclerView.Adapter<StoreAdapter.BindingHolder> { List<Store> mStoreList; public class BindingHolder extends RecyclerView.ViewHolder { private ViewDataBinding binding; public BindingHolder(View v) { super(v); binding = DataBindingUtil.bind(v); } public ViewDataBinding getBinding() { return binding; } }

Android recyclerview adapter with multiple viewtype using databinding

拈花ヽ惹草 提交于 2020-02-26 10:05:07
问题 Is it possible to create a multiple view type in my adapter.. like adding a view for my header then below the header is a list. code snippet for my adapter : public class StoreAdapter extends RecyclerView.Adapter<StoreAdapter.BindingHolder> { List<Store> mStoreList; public class BindingHolder extends RecyclerView.ViewHolder { private ViewDataBinding binding; public BindingHolder(View v) { super(v); binding = DataBindingUtil.bind(v); } public ViewDataBinding getBinding() { return binding; } }

Kotlin-DataBinding-Error: Check your module classpath for missing or conflicting dependencies

一曲冷凌霜 提交于 2020-02-25 13:13:08
问题 How can I solve this problem. I can't make this data binding work, I have tried everything. Build.gradle(module app) apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { compileSdkVersion 27 defaultConfig { applicationId "com.fusion.alen.ask" minSdkVersion 16 targetSdkVersion 27 multiDexEnabled true versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner

Kotlin-DataBinding-Error: Check your module classpath for missing or conflicting dependencies

China☆狼群 提交于 2020-02-25 13:07:27
问题 How can I solve this problem. I can't make this data binding work, I have tried everything. Build.gradle(module app) apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { compileSdkVersion 27 defaultConfig { applicationId "com.fusion.alen.ask" minSdkVersion 16 targetSdkVersion 27 multiDexEnabled true versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner

Android databinding with multiple layouts

别说谁变了你拦得住时间么 提交于 2020-02-23 06:13:04
问题 I have issues with the android data binding. I have layouts for different configurations like ie: activity_main.xml / land/activity_main.xml etc. Currently when I use setContentView method, just pass the layout name, and it automatically detects which of the layouts should choose to set content view. But If I use the data binding what would be the solution for that. As I know the names for the binding would be different depending onto the configuration. So If I use ActivityMainBinding, that

Android databinding with multiple layouts

眉间皱痕 提交于 2020-02-23 06:12:49
问题 I have issues with the android data binding. I have layouts for different configurations like ie: activity_main.xml / land/activity_main.xml etc. Currently when I use setContentView method, just pass the layout name, and it automatically detects which of the layouts should choose to set content view. But If I use the data binding what would be the solution for that. As I know the names for the binding would be different depending onto the configuration. So If I use ActivityMainBinding, that

Android databinding with multiple layouts

橙三吉。 提交于 2020-02-23 06:12:29
问题 I have issues with the android data binding. I have layouts for different configurations like ie: activity_main.xml / land/activity_main.xml etc. Currently when I use setContentView method, just pass the layout name, and it automatically detects which of the layouts should choose to set content view. But If I use the data binding what would be the solution for that. As I know the names for the binding would be different depending onto the configuration. So If I use ActivityMainBinding, that

ConstraintLayout with databinding

帅比萌擦擦* 提交于 2020-02-22 15:33:26
问题 Is it possible to do something like this: Xml: <android.support.constraint.Guideline app:layout_constraintGuide_percent="@{viewModel.guidelinePercent}" /> ViewModel: @Bindable public float getGuidelinePercent() { return condition ? 0.6f : 0.8f; } I'm getting this error: Cannot find the setter for attribute 'app:layout_constraintGuide_percent' with parameter type float on android.support.constraint.Guideline. I've tried with BindingAdaptor but it doesn't change the value: ViewModel:

Edit text cursor resets to left when default text of edittext is a float value

£可爱£侵袭症+ 提交于 2020-01-24 17:08:12
问题 I am using Binding adapter to prevent constant text update of edittexts for 2 way binding. @BindingAdapter("binding") public static void bindEditText(EditText editText, final String str) { if ((!editText.getText().toString().equals(str)) && !editText.getText().equals("")) { editText.setText(str); } } It works fine with edit text with integer default text. But when it comes to edit text with float default text. Ex: 70.0, when I key in the first digit, the edit text refreshes and became Ex: 8.0