android.databinding.InverseBindingAdapter Java Examples

The following examples show how to use android.databinding.InverseBindingAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LayerBindingAdapters.java    From spline with Apache License 2.0 5 votes vote down vote up
@InverseBindingAdapter(attribute = "android:text")
public static float getText(TextInputEditText dimView) {
    try {
        String dimString = dimView.getText().toString();
        float dimVal = Float.parseFloat(dimString);
        return dimVal;
    } catch (NumberFormatException e) {
        // Return 0 for now
        return 0;
    }
}
 
Example #2
Source File: DataBindingAdapters.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@InverseBindingAdapter(attribute = "selectedValue", event = "selectedValueAttrChanged")
public static String captureSelectedValue(AppCompatSpinner pAppCompatSpinner) {
    return (String) pAppCompatSpinner.getSelectedItem();
}
 
Example #3
Source File: BindingAdapters.java    From android-mvvm with Apache License 2.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "android:checkedButton")
public static Calculator.Operation getOperation(RadioGroup radioGroup) {
    return toOperation(radioGroup.getCheckedRadioButtonId());
}
 
Example #4
Source File: SeekBarBindingAdapterUtils.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "progressString")
public static String getProgressString(SeekBar view) {
    return "" + view.getProgress();
}
 
Example #5
Source File: CheckBoxBindingAdapterUtils.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "checked")
public static boolean getChecked(CompoundButton button) {
    return button.isChecked();
}
 
Example #6
Source File: SeekBarBindingAdapterUtils.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "progressString")
public static String getProgressString(SeekBar view) {
    return "" + view.getProgress();
}
 
Example #7
Source File: CheckBoxBindingAdapterUtils.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "checked")
public static boolean getChecked(CompoundButton button) {
    return button.isChecked();
}
 
Example #8
Source File: BindingConfig.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "refreshing",event = "refreshingAttrChanged")
public static boolean isRefreshing(SwipeRefreshLayout view) {
    return view.isRefreshing();
}
 
Example #9
Source File: BindingConfig.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
@InverseBindingAdapter(attribute = "refreshing",event = "refreshingAttrChanged")
public static boolean isRefreshing(SwipeRefreshLayout view) {
    return view.isRefreshing();
}