本文整理匯總了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;
}
}
});
}
示例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);
}
示例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);
}
};
}
示例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);
}
};
}
示例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);
}
};
}
示例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);
}
};
}
示例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);
}
};
}
示例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);
}
};
}
示例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);
}
};
}
示例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));
}
}
});
}
};
}
示例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));
}
示例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);
}
};
}
示例13: DBFlowOnChangeOperator
import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
private DBFlowOnChangeOperator() {
mFlowContentObserver = new FlowContentObserver();
}
示例14: DBFlowOnChangeOperator
import com.raizlabs.android.dbflow.runtime.FlowContentObserver; //導入依賴的package包/類
public DBFlowOnChangeOperator() {
mFlowContentObserver = new FlowContentObserver();
}
示例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();
}