Closed IEnoobong closed 6 years ago
-In your xml, inside
-In your adapter class, do something like this.
@BindingAdapter("bind:countryValue")
public static void setCountryValue(final CountryCodePicker picker, ObservableField
-Inside Viewmodel class,
public final ObservableField<String> code = new ObservableField<>();
Now, You can get the values using- code.get();
@pankajnegii, thank you for the answer. @IEnoobong , we hope @pankajnegii's answer worked for you. If you have any further question feel free to comment back.
Thank you very much @pankajnegii and @hbb20 ! Much appreciated!
Can anyone help me with LiveData instead of ObservableField.
Hello hbb20, thanks for this wonderful library. I've been able to implement it inside of a fragment using android databinding, however i'm finding it a bit of a challenge getting the country code inside of a viewmodel (MVVM) with databinding Would really appreciate any help. Thanks
Please how can I use with databinding to get
selectedCountryCodeWithPlus
Thanks!