Java 类android.databinding.InverseBindingAdapter 实例源码

项目:DroidMVVMValidator    文件:Bindings.java   
@InverseBindingAdapter(attribute = "android:text", event = "android:textAttrChanged")
public static Integer getIntegerText(TextView view) {
    CharSequence text = view.getText();
    if (text != null && text.length() > 0) {
        return Integer.valueOf(text.toString());
    }
    return null;
}
项目:spline    文件:LayerBindingAdapters.java   
@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;
    }
}
项目:Jockey    文件:RecyclerViewBindingAdapters.java   
@InverseBindingAdapter(attribute = "scrollPosition")
public static int getScrollPosition(RecyclerView recyclerView) {
    if (recyclerView.getChildCount() == 0) {
        return 0;
    }

    return recyclerView.getChildAdapterPosition(recyclerView.getChildAt(0));
}
项目:SampleAppArch    文件:SpinnerBindingUtil.java   
@InverseBindingAdapter(attribute = "selectedValue", event = "selectedValueAttrChanged")
public static String captureSelectedValue(AppCompatSpinner pAppCompatSpinner) {
  return (String) pAppCompatSpinner.getSelectedItem();
}
项目:ElephantAsia    文件:SpinnerBindingUtil.java   
@InverseBindingAdapter(attribute = "bind:selectedValue", event = "bind:selectedValueAttrChanged")
public static String captureSelectedValue(Spinner pSpinner) {
  return (String) pSpinner.getSelectedItem();
}
项目:OCast-Java    文件:ViewModel.java   
@InverseBindingAdapter(attribute = "selectedItemPosition")
public Integer getSelectedItemPosition(AppCompatSpinner spinner)
{
    return spinner.getSelectedItemPosition();
}
项目:DataBindingGuide    文件:CustomBindings.java   
@InverseBindingAdapter(attribute = "app:text", event = "android:textAttrChanged")
public static String getTextString(TextView view) {
    return view.getText().toString();
}
项目:Android-MVVMFramework    文件:BindingConfig.java   
@InverseBindingAdapter(attribute = "refreshing",event = "refreshingAttrChanged")
public static boolean isRefreshing(SwipeRefreshLayout view) {
    return view.isRefreshing();
}
项目:Android-MVVMFramework    文件:BindingConfig.java   
@InverseBindingAdapter(attribute = "refreshing",event = "refreshingAttrChanged")
public static boolean isRefreshing(SwipeRefreshLayout view) {
    return view.isRefreshing();
}
项目:Jockey    文件:ViewPagerBindingAdapters.java   
@InverseBindingAdapter(attribute = "page")
public static int getPage(ViewPager pager) {
    return pager.getCurrentItem();
}
项目:nethunter-app    文件:MITMFViewModel.java   
@InverseBindingAdapter(attribute = "android:checked", event = "android:checked")
public static boolean getViewChecked(CheckBox view) {
    return view.isChecked();
}