/** * create data-binding view holder for target item view. * * @param itemView the item view */ public DataBindingViewHolder(View itemView) { super(itemView); onPreCreateDataBinding(itemView); mDataBinding = DataMediatorFactory.createDataBinding(this); }
/** * create data-binding and bind data to the views. * @param target the target object .which is the owner of view. * @param data the module data * @param index the index of data. often used to bind multi data in one owner. * @param <T> the module data type * @return the binder of target data. * @since 1.4.0 */ public static <T> Binder<T> bind(Object target, T data, int index){ return createDataBinding(target).bind(data, index, null); }
/** * create data-binding and bind data to the views. * @param target the target object .which is the owner of view. * @param data the module data * @param <T> the module data type * @return the binder of target data. * @since 1.4.0 */ public static <T> Binder<T> bind(Object target, T data){ return createDataBinding(target).bind(data, 0, null); }
/** * create data-binding and bind data to the views. * @param target the target object .which is the owner of view. * @param data the module data * @param index the index of data. often used to bind multi data in one owner. * @param <T> the module data type * @return the binder of target data. * @since 1.4.0 */ public static <T> Binder<T> bind(Object target, T data, int index){ return createDataBinding(target).bind(data, index, null); }
/** * create data-binding and bind data to the views. * @param target the target object .which is the owner of view. * @param data the module data * @param <T> the module data type * @return the binder of target data. * @since 1.4.0 */ public static <T> Binder<T> bind(Object target, T data){ return createDataBinding(target).bind(data, 0, null); }
/** * create data-binding and bind data to the views. * @param target the target object .which is the owner of view. * @param data the module data * @param index the index of data. often used to bind multi data in one owner. * @param interceptor the property interceptor * @param <T> the module data type * @return the binder of target data. * @since 1.4.0 */ public static <T> Binder<T> bind(Object target, T data, int index, PropertyInterceptor interceptor){ return createDataBinding(target).bind(data, index, interceptor); }
/** * create data-binding and bind data to the views. * @param target the target object .which is the owner of view. * @param data the module data * @param index the index of data. often used to bind multi data in one owner. * @param interceptor the property interceptor * @param <T> the module data type * @return the binder of target data. * @since 1.4.0 */ public static <T> Binder<T> bind(Object target, T data, int index, PropertyInterceptor interceptor){ return createDataBinding(target).bind(data, index, interceptor); }