/** * bind background resource of view. * * @param property the property * @return this. */ public BatchViewBinder<T> bindBackgroundRes(String property) { mBinder.bindBackgroundRes(property, mView); return this; } /**
/** * bind background resource of view. * * @param property the property * @return this. */ public BatchViewBinder<T> bindBackgroundRes(String property) { mBinder.bindBackgroundRes(property, mView); return this; } /**
/** * bind background resource of view. * @param property the property of data * @param view the view. eg: android.view.View on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindBackgroundRes(Property property, Object view){ return bindBackgroundRes(property.getName(), view); }
/** * bind background resource of view. * * @param property the property * @return this. * @since 1.1.2 */ public BatchViewBinder<T> bindBackgroundRes(Property property) { mBinder.bindBackgroundRes(property.getName(), mView); return this; }
/** * bind background resource of view. * * @param property the property * @return this. * @since 1.1.2 */ public BatchViewBinder<T> bindBackgroundRes(Property property) { mBinder.bindBackgroundRes(property.getName(), mView); return this; }
/** * bind background resource of view. * @param property the property of data * @param view the view. eg: android.view.View on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindBackgroundRes(Property property, Object view){ return bindBackgroundRes(property.getName(), view); }
@Override protected void onInit(Context context, Bundle savedInstanceState) { initResource(context); mUserDrawable1 = true; mUserRes1 = true; mUserColor1 = true; binder = DataMediatorFactory.createBinder(ViewBind.class); //初始化属性。 binder.getDataProxy() .setBackground(mDrawable1) .setBackgroundColor(mColor1) .setBackgroundRes(mResId1) .setEnable(true); // 设置属性拦截器,用于应用绑定的时候过滤一些不需要的属性值。 binder.setPropertyInterceptor(PropertyInterceptor.NULL_AND_ZERO); //绑定并 首次应用属性(绑定只需要1次) binder .bindBackground(ViewBind.PROP_background, mV_bg) //使用生成的property对象。有助于模型变化后用的地方知晓改变。 .bindBackgroundRes(ViewBind.PROP_backgroundRes, mV_bg_res) .bindBackgroundColor(ViewBind.PROP_backgroundColor, mV_bg_color) .bindEnable("enable", mV_enable) .applyProperties( // 创建一个只接收固定属性的 拦截器。(1.1.2支持的). 只是用于本次apply. PropertyInterceptor.createFilter(ViewBind.PROP_background, ViewBind.PROP_backgroundRes, ViewBind.PROP_backgroundColor) ); }