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


Java FlowContentObserver類代碼示例

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


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

示例1: onNext

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public void onNext(T o) {
    mActual.onNext(o);

    for (int i = 0; i < mSubscribedClasses.size(); i++) {
        mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
    }

    mFlowContentObserver.addOnTableChangedListener(
            new FlowContentObserver.OnTableChangedListener() {
                @Override
                public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {
                    if(isDisposed()){
                        return;
                    }

                    if (!mIsInTransaction) {
                        mActual.onNext(mRestartAction.run());
                    } else {
                        mHasPendingChange = true;
                    }
                }
            });
}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:25,代碼來源:DBFlowRestartOnChange.java

示例2: DBFlowOnChangeOperator

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
public DBFlowOnChangeOperator(Class<TModel> modelClazz, ModelQueriable<TModel> baseModelQueriable) {
    mSubscribedClasses = new ArrayList<>();
    mModelClazz = modelClazz;
    mBaseModelQueriable = baseModelQueriable;
    mFlowContentObserver = new FlowContentObserver();
    mSubscribedClasses.add(mModelClazz);
}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:8,代碼來源:DBFlowListObservable.java

示例3: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super List<TModel>> call(final Subscriber<? super List<TModel>> subscriber) {
    return new Subscriber<List<TModel>>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(List<TModel> tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {
                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(mBaseModelQueriable.queryList());
                            }
                        }
                    });
            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:35,代碼來源:DBFlowListObservable.java

示例4: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super FlowCursorList<TModel>> call(final Subscriber<? super FlowCursorList<TModel>> subscriber) {
    return new Subscriber<FlowCursorList<TModel>>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(FlowCursorList<TModel> tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {

                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(mBaseModelQueriable.cursorList());
                            }
                        }
                    });
            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:36,代碼來源:DBFlowCursorListObservable.java

示例5: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super CursorResult<TModel>> call(final Subscriber<? super CursorResult<TModel>> subscriber) {
    return new Subscriber<CursorResult<TModel>>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(CursorResult<TModel> tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {

                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(mBaseModelQueriable.queryResults());
                            }
                        }
                    });
            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:36,代碼來源:DBFlowResultObservable.java

示例6: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super FlowQueryList<TModel>> call(final Subscriber<? super FlowQueryList<TModel>> subscriber) {
    return new Subscriber<FlowQueryList<TModel>>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(FlowQueryList<TModel> tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {

                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(mBaseModelQueriable.flowQueryList());
                            }
                        }
                    });
            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:36,代碼來源:DBFlowQueryListObservable.java

示例7: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super TModel> call(final Subscriber<? super TModel> subscriber) {
    return new Subscriber<TModel>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(TModel tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addModelChangeListener(new FlowContentObserver.OnModelStateChangedListener() {
                @Override
                public void onModelStateChanged(@Nullable Class<?> table, BaseModel.Action action, @NonNull SQLOperator[] primaryKeyValues) {
                    if (subscriber.isUnsubscribed()) {
                        mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                    } else {
                        subscriber.onNext(runQuery());
                    }
                }
            });

            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:35,代碼來源:DBFlowModelObservable.java

示例8: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super Cursor> call(final Subscriber<? super Cursor> subscriber) {
    return new Subscriber<Cursor>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(Cursor cursor) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {

                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(runQuery());
                            }
                        }
                    });
            subscriber.onNext(cursor);
        }
    };
}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:35,代碼來源:DBFlowCursorObservable.java

示例9: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super List<TQueryModel>> call(final Subscriber<? super List<TQueryModel>> subscriber) {
    return new Subscriber<List<TQueryModel>>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(List<TQueryModel> tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {
                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(mBaseModelQueriable.queryCustomList(mModelClazz));
                            }
                        }
                    });
            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:35,代碼來源:DBFlowCustomListObservable.java

示例10: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super TQueryModel> call(final Subscriber<? super TQueryModel> subscriber) {
    return new Subscriber<TQueryModel>() {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {

        }

        @Override
        public void onNext(TQueryModel tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }
            mFlowContentObserver.addModelChangeListener(new FlowContentObserver.OnModelStateChangedListener() {
                @Override
                public void onModelStateChanged(@Nullable Class<?> table, BaseModel.Action action, @NonNull SQLOperator[] primaryKeyValues) {
                    if (subscriber.isUnsubscribed()) {
                        mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                    } else {
                        subscriber.onNext(mBaseModelQueriable.queryCustomSingle(mModelClazz));
                    }
                }
            });
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:33,代碼來源:DBFlowCustomModelObservable.java

示例11: DBFlowOnChangeOperator

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
private DBFlowOnChangeOperator(Class<? extends Model>[] tableToListen) {
    mSubscribedClasses = new ArrayList<>();
    mFlowContentObserver = new FlowContentObserver();
    for (int i = 0; i < tableToListen.length; i++) {
        mSubscribedClasses.add(tableToListen[i]);
    }
    mSubscribedClasses.addAll(Arrays.asList(tableToListen));
}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:9,代碼來源:DBFlowCountObservable.java

示例12: call

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
@Override
public Subscriber<? super Long> call(final Subscriber<? super Long> subscriber) {
    return new Subscriber<Long>() {
        @Override
        public void onCompleted() {
            subscriber.onCompleted();
        }

        @Override
        public void onError(Throwable e) {
            subscriber.onError(e);
        }

        @Override
        public void onNext(Long tModels) {
            for (int i = 0; i < mSubscribedClasses.size(); i++) {
                mFlowContentObserver.registerForContentChanges(FlowManager.getContext(), mSubscribedClasses.get(i));
            }

            mFlowContentObserver.addOnTableChangedListener(
                    new FlowContentObserver.OnTableChangedListener() {
                        @Override
                        public void onTableChanged(@Nullable Class<?> tableChanged, BaseModel.Action action) {

                            if (subscriber.isUnsubscribed()) {
                                mFlowContentObserver.unregisterForContentChanges(FlowManager.getContext());
                            } else {
                                subscriber.onNext(triggerCount());
                            }
                        }
                    });
            subscriber.onNext(tModels);
        }
    };

}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:37,代碼來源:DBFlowCountObservable.java

示例13: DBFlowOnChangeOperator

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
private DBFlowOnChangeOperator() {
    mFlowContentObserver = new FlowContentObserver();
}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:4,代碼來源:DBFlowResultObservable.java

示例14: DBFlowOnChangeOperator

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
public DBFlowOnChangeOperator() {
    mFlowContentObserver = new FlowContentObserver();
}
 
開發者ID:roadhouse-dev,項目名稱:RxDbflow,代碼行數:4,代碼來源:DBFlowModelObservable.java

示例15: ModelChangeObserver

import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
public ModelChangeObserver(DbLoader.TrackedTable trackedTable, DbLoader<?> loader) {
    mTrackedTable = isNull(trackedTable, "TrackedTable object must not be null");
    mLoader = isNull(loader, "DbLoader must not be null");
    mObserver = new FlowContentObserver();
}
 
開發者ID:dhis2,項目名稱:dhis2-android-dashboard,代碼行數:6,代碼來源:ModelChangeObserver.java


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