當前位置: 首頁>>代碼示例>>Java>>正文


Java BaseObservable類代碼示例

本文整理匯總了Java中android.databinding.BaseObservable的典型用法代碼示例。如果您正苦於以下問題:Java BaseObservable類的具體用法?Java BaseObservable怎麽用?Java BaseObservable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseObservable類屬於android.databinding包,在下文中一共展示了BaseObservable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: AtomWatcher

import android.databinding.BaseObservable; //導入依賴的package包/類
public AtomWatcher(BaseObservable... fields){
    for(BaseObservable field: fields){

        BaseObservable af = field;

        Observable.OnPropertyChangedCallback callback = new Observable.OnPropertyChangedCallback() {
            @Override
            public void onPropertyChanged(Observable sender, int propertyId) {
                run();
            }
        };

        field.addOnPropertyChangedCallback(callback);

        closables.add(new ClosableAction(()->{
            af.removeOnPropertyChangedCallback(callback);
        }));
    }
}
 
開發者ID:neurospeech,項目名稱:ui-atoms-android,代碼行數:20,代碼來源:AtomWatcher.java

示例2: createTypeSpec

import android.databinding.BaseObservable; //導入依賴的package包/類
private TypeSpec createTypeSpec() {
    return TypeSpec.classBuilder(storeModel.getClassName().simpleName())
            .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
            .addSuperinterface(storeModel.getInterfaceName())
            .superclass(TypeName.get(BaseObservable.class))
            .addFields(createFieldSpecs())
            .addMethod(createConstructor())
            .addMethod(createBuilderMethodSpec())
            .addMethods(createGetterMethodSpecs())
            .addMethod(createDispatchMethodSpec())
            .addType(new StoreBuilderClassGenerator(storeModel).createBuilderTypeSpec())
            .build();
}
 
開發者ID:izumin5210,項目名稱:Droidux,代碼行數:14,代碼來源:StoreClassGenerator.java

示例3: watch

import android.databinding.BaseObservable; //導入依賴的package包/類
public <T> AtomWatcher<T> watch(BaseObservable... fields){
    AtomWatcher<T> watcher = new AtomWatcher<T>(fields);
    register(watcher);
    return watcher;
}
 
開發者ID:neurospeech,項目名稱:ui-atoms-android,代碼行數:6,代碼來源:AtomViewModel.java

示例4: unbind

import android.databinding.BaseObservable; //導入依賴的package包/類
public static void unbind(BaseObservable observable, Observable.OnPropertyChangedCallback callback) {
    if (null == observable || null == callback) {
        return;
    }
    observable.removeOnPropertyChangedCallback(callback);
}
 
開發者ID:zxmmmmmm,項目名稱:Mvvm,代碼行數:7,代碼來源:ObservableMessage.java

示例5: computeArrayList

import android.databinding.BaseObservable; //導入依賴的package包/類
public static <T> CinderArrayList<T> computeArrayList(OnComputeArrayListCallback<T> computeCallback, BaseObservable... observables) {
    CinderArrayList<T> cinderArrayList = new CinderArrayList<>();
    cinderArrayList.setObservableBehaviour(Cinder.observe(() -> computeCallback.onComputeChange(cinderArrayList), observables));
    return cinderArrayList;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例6: computeArrayMap

import android.databinding.BaseObservable; //導入依賴的package包/類
public static <K, V> CinderArrayMap<K, V> computeArrayMap(OnComputeArrayMapCallback<K, V> computeCallback, BaseObservable... observables) {
    CinderArrayMap<K, V> cinderArrayMap = new CinderArrayMap<>();
    cinderArrayMap.setObservableBehaviour(Cinder.observe(() -> computeCallback.onComputeChange(cinderArrayMap), observables));
    return cinderArrayMap;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例7: computeBoolean

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderBoolean computeBoolean(OnComputeBooleanCallback computeCallback, BaseObservable... observables) {
    CinderBoolean cinderBoolean = new CinderBoolean();
    cinderBoolean.setObservableBehaviour(Cinder.observe(() -> cinderBoolean.set(computeCallback.onComputeChange()), observables));
    return cinderBoolean;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例8: computeByte

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderByte computeByte(OnComputeByteCallback computeCallback, BaseObservable... observables) {
    CinderByte cinderByte = new CinderByte();
    cinderByte.setObservableBehaviour(Cinder.observe(() -> cinderByte.set(computeCallback.onComputeChange()), observables));
    return cinderByte;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例9: computeChar

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderChar computeChar(OnComputeCharCallback computeCallback, BaseObservable... observables) {
    CinderChar cinderChar = new CinderChar();
    cinderChar.setObservableBehaviour(Cinder.observe(() -> cinderChar.set(computeCallback.onComputeChange()), observables));
    return cinderChar;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例10: computeDouble

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderDouble computeDouble(OnComputeDoubleCallback computeCallback, BaseObservable... observables) {
    CinderDouble cinderDouble = new CinderDouble();
    cinderDouble.setObservableBehaviour(Cinder.observe(() -> cinderDouble.set(computeCallback.onComputeChange()), observables));
    return cinderDouble;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例11: computeField

import android.databinding.BaseObservable; //導入依賴的package包/類
public static <T> CinderField<T> computeField(OnComputeFieldCallback<T> computeCallback, BaseObservable... observables) {
    CinderField<T> cinderField = new CinderField<>();
    cinderField.setObservableBehaviour(Cinder.observe(() -> cinderField.set(computeCallback.onComputeChange()), observables));
    return cinderField;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例12: computeFloat

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderFloat computeFloat(OnComputeFloatCallback computeCallback, BaseObservable... observables) {
    CinderFloat cinderFloat = new CinderFloat();
    cinderFloat.setObservableBehaviour(Cinder.observe(() -> cinderFloat.set(computeCallback.onComputeChange()), observables));
    return cinderFloat;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例13: computeInt

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderInt computeInt(OnComputeIntCallback computeCallback, BaseObservable... observables) {
    CinderInt cinderInt = new CinderInt();
    cinderInt.setObservableBehaviour(Cinder.observe(() -> cinderInt.set(computeCallback.onComputeChange()), observables));
    return cinderInt;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例14: computeLong

import android.databinding.BaseObservable; //導入依賴的package包/類
public static CinderLong computeLong(OnComputeLongCallback computeCallback, BaseObservable... observables) {
    CinderLong cinderLong = new CinderLong();
    cinderLong.setObservableBehaviour(Cinder.observe(() -> cinderLong.set(computeCallback.onComputeChange()), observables));
    return cinderLong;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java

示例15: computeParcelable

import android.databinding.BaseObservable; //導入依賴的package包/類
public static <T extends Parcelable> CinderParcelable<T> computeParcelable(OnComputeParcelableCallback<T> computeCallback, BaseObservable... observables) {
    CinderParcelable<T> cinderParcelable = new CinderParcelable<>();
    cinderParcelable.setObservableBehaviour(Cinder.observe(() -> cinderParcelable.set(computeCallback.onComputeChange()), observables));
    return cinderParcelable;
}
 
開發者ID:akiraspeirs,項目名稱:Cinder,代碼行數:6,代碼來源:Cinder.java


注:本文中的android.databinding.BaseObservable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。