@Override public void onPropertyValueChanged(Student data, Property prop, Object oldValue, Object newValue) { Logger.w("TestPropertyChangeActivity","onPropertyValueChanged","prop = " + prop.getName() + " ,oldValue = " + oldValue + " ,newValue = " + newValue); mTv_desc.setText(String.valueOf(newValue)); } });
/** * bind text size of Text view. * @param property the property * @return this. * @since 1.1.2 */ public BatchTextViewBinder<T> bindTextSize(Property property){ mBinder.bindTextSize(property.getName(), mView); return this; } /**
/** * bind text size resource of Text view. * @param property the property of data * @param textView the text view. eg: android.widget.TextView on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindTextSizeRes(Property property,Object textView){ return bindTextSizeRes(property.getName(), textView); } /**
/** * bind text size of Text view. use default unit 'dip'. * @param property the property of data * @param textView the text view. eg: android.widget.TextView on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindTextSize(Property property, Object textView){ return bindTextSize(property.getName(), textView); } /**
/** * bind image resource of image view. * @param property the property of data * @param imageView the image view. eg: android.widget.ImageView on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindImageRes(Property property, Object imageView){ return bindImageRes(property.getName(), imageView); } /**
/** * bind visibility of view (on android the visibility is masked as int.). * here force use property of visibility as boolean. * * @param property the property * @return this. * @since 1.1.2 */ public BatchViewBinder<T> bindVisibility(Property property) { return bindVisibility(property.getName(), true); }
/** * bind background color of view. * * @param property the property * @return this. * @since 1.1.2 */ public BatchViewBinder<T> bindBackgroundColor(Property property) { mBinder.bindBackgroundColor(property.getName(), mView); return this; }
/** * bind enable 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> bindEnable(Property property, Object view){ return bindEnable(property.getName(), view); } /**
/** * 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 text color of Text view. * @param property the property of data * @param textView the text view. eg: android.widget.TextView on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindTextColor(Property property, Object textView){ return bindTextColor(property.getName(), textView); } /**
/** * bind image uri (android.net.Uri) of image view. * @param property the property of data * @param imageView the image view. eg: android.widget.ImageView on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindImageUri(Property property, Object imageView){ return bindImageUri(property.getName(), imageView); } /**
/** * bind text color of Text view. * @param property the property * @return this. * @since 1.1.2 */ public BatchTextViewBinder<T> bindTextColor(Property property){ mBinder.bindTextColor(property.getName(), mView); return this; } /**
/** * bind text dimension size(pix value) of Text view. * @param property the property * @return this. * @since 1.4.1 */ public BatchTextViewBinder<T> bindTextSizePx(Property property){ mBinder.bindTextSizePx(property.getName(), mView); return this; } /**
/** * bind hint text resource of text view. * @param property the property * @return this. * @since 1.4.3 */ public final BatchTextViewBinder<T> bindHintTextRes(Property property){ mBinder.bindHintTextRes(property.getName(), mView); return this; }
/** * bind visibility of view (on android the visibility is masked as int.). * here force use property of visibility as boolean. * * @param property the property * @return this. * @since 1.1.2 */ public BatchViewBinder<T> bindVisibility(Property property) { return bindVisibility(property.getName(), true); }
/** * bind image url of image view. * @param property the property of data * @param imageView the image view. eg: android.widget.ImageView on android platform * @param imgLoader the image loader which can load image. * @return this. * @since 1.1.2 */ public final Binder<T> bindImageUrl(Property property, Object imageView, Object imgLoader){ return bindImageUrl(property.getName(), imageView, imgLoader); } /**
/** * bind image bitmap of image view. * @param property the property of data * @param imageView the image view. eg: android.widget.ImageView on android platform * @return this. * @since 1.1.2 */ public final Binder<T> bindImageBitmap(Property property, Object imageView){ return bindImageBitmap(property.getName(), imageView); } /**
@Override public void onPropertyValueChanged(Object data, Property prop, Object oldValue, Object newValue) { if(prop.getName().equals(treeInfo.lastSecondNode.prop)){ //virtual property // dm.getBaseMediator().dispatchValueChanged(prop, oldValue, newValue); } } });
@Override protected void onInit(Context context, Bundle savedInstanceState) { mDm = DataMediatorFactory.createDataMediator(TestBind.class); // 这里直接用属性回调。也可以用binder.bind(String property, SparseArrayPropertyCallback<? super T> callback)方法 mDm.addDataMediatorCallback(DataMediatorCallback.createForSparse( TestBind.PROP_cityData2.getName(), new CallbackImpl())); }
@Override public void onPropertyValueChanged(Student data, Property prop, Object oldValue, Object newValue) { if(prop.getName().equals(stuPropName)){ //virtual property dm.getBaseMediator().dispatchValueChanged(prop, oldValue, newValue); } } });