io.realm.OrderedRealmCollection Java Examples

The following examples show how to use io.realm.OrderedRealmCollection. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MyRecyclerViewAdapter.java    From realm-android-adapters with Apache License 2.0 5 votes vote down vote up
MyRecyclerViewAdapter(OrderedRealmCollection<Item> data) {
    super(data, true);
    // Only set this if the model class has a primary key that is also a integer or long.
    // In that case, {@code getItemId(int)} must also be overridden to return the key.
    // See https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#hasStableIds()
    // See https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#getItemId(int)
    setHasStableIds(true);
}
 
Example #2
Source File: MapPresenterTest.java    From Forage with Mozilla Public License 2.0 5 votes vote down vote up
@Test
public void setupMap_errorDoesNothing() {
    when(databaseInteractor.getGeocaches()).
            thenReturn(Single.<OrderedRealmCollection<Cache>>error(new Throwable("Error")));

    mapPresenter.setupMap();

    verify(view, never()).addMapMarkers(anyListOf(Cache.class));
}
 
Example #3
Source File: MapPresenterTest.java    From Forage with Mozilla Public License 2.0 5 votes vote down vote up
@Test
public void setupMap_shouldCallViewPopulateMap() {
    //noinspection unchecked
    OrderedRealmCollection<Cache> caches = mock(OrderedRealmCollection.class);
    when(databaseInteractor.getGeocaches()).thenReturn(Single.just(caches));

    mapPresenter.setupMap();

    verify(view, times(1)).addMapMarkers(caches);
}
 
Example #4
Source File: CopiedLiveResults.java    From realm-monarchy with Apache License 2.0 5 votes vote down vote up
@Override
public void updateResults(final OrderedRealmCollection<T> realmCollection) {
    monarchy.doWithRealm(new Monarchy.RealmBlock() {
        @Override
        public void doWithRealm(Realm realm) {
            postValue(realm.copyFromRealm(realmCollection));
        }
    });
}
 
Example #5
Source File: PagedLiveResults.java    From realm-monarchy with Apache License 2.0 5 votes vote down vote up
@Override
public void updateResults(final OrderedRealmCollection<T> realmCollection) {
    monarchy.doWithRealm(new Monarchy.RealmBlock() {
        @Override
        public void doWithRealm(Realm realm) {
            final Monarchy.RealmTiledDataSource<T> ds = dataSource;
            if(ds != null) {
                ds.invalidate();
            }
        }
    });
}
 
Example #6
Source File: MappedLiveResults.java    From realm-monarchy with Apache License 2.0 5 votes vote down vote up
@Override
public void updateResults(final OrderedRealmCollection<T> realmResults) {
    monarchy.doWithRealm(new Monarchy.RealmBlock() {
        @Override
        public void doWithRealm(Realm realm) {
            List<U> list = new ArrayList<>(realmResults.size());
            for(T t: realmResults) {
                list.add(mapper.map(t));
            }
            postValue(Collections.unmodifiableList(list));
        }
    });
}
 
Example #7
Source File: RecyclerViewTestAdapter.java    From realm-android-adapters with Apache License 2.0 4 votes vote down vote up
public RecyclerViewTestAdapter(final Context context, final OrderedRealmCollection<AllJavaTypes> realmResults, final boolean automaticUpdate) {
    super(realmResults, automaticUpdate);
    inflater = LayoutInflater.from(context);
    setHasStableIds(true);
}
 
Example #8
Source File: ProjectsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public ProjectsRecyclerAdapter(Context context, OrderedRealmCollection<Project> data) {
    super(data, true);
    this.context = context;
}
 
Example #9
Source File: ListViewTestAdapter.java    From realm-android-adapters with Apache License 2.0 4 votes vote down vote up
public ListViewTestAdapter(Context context, OrderedRealmCollection<AllJavaTypes> realmResults) {
    super(realmResults);
    inflater = LayoutInflater.from(context);
}
 
Example #10
Source File: MyListAdapter.java    From realm-android-adapters with Apache License 2.0 4 votes vote down vote up
MyListAdapter(OrderedRealmCollection<Item> realmResults) {
    super(realmResults);
}
 
Example #11
Source File: CacheAdapter.java    From Forage with Mozilla Public License 2.0 4 votes vote down vote up
public CacheAdapter(Context context, OrderedRealmCollection<Cache> data, boolean autoUpdate) {
    super(context, data, autoUpdate);
}
 
Example #12
Source File: FragmentMain.java    From iGap-Android with GNU Affero General Public License v3.0 4 votes vote down vote up
public RoomAdapter(@Nullable OrderedRealmCollection<RealmRoom> data, OnComplete complete) {
    super(data, true);
    this.mComplete = complete;
}
 
Example #13
Source File: TimeTableListAdapter.java    From StudentAttendanceCheck with MIT License 4 votes vote down vote up
public TimeTableListAdapter(@NonNull Context context,
                            @Nullable OrderedRealmCollection<StudentModuleDao> data,
                            boolean autoUpdate) {
    super(context, data, autoUpdate);
    mContext = context;
}
 
Example #14
Source File: LogRecyclerViewAdapter.java    From OpenLibre with GNU General Public License v3.0 4 votes vote down vote up
LogRecyclerViewAdapter(LogFragment fragment, OrderedRealmCollection<ReadingData> data) {
    super(data, true);
    this.fragment = fragment;
    PreferenceManager.getDefaultSharedPreferences(fragment.getContext()).registerOnSharedPreferenceChangeListener(this);
}
 
Example #15
Source File: FrozenLiveResults.java    From realm-monarchy with Apache License 2.0 4 votes vote down vote up
@Override
public void updateResults(final OrderedRealmCollection<T> realmCollection) {
    postValue(Collections.unmodifiableList(new ArrayList<>(realmCollection.freeze())));
}
 
Example #16
Source File: TasksRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public TasksRecyclerAdapter(OrderedRealmCollection<Item> data) {
    super(data, true);
}
 
Example #17
Source File: EditPermissionsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public EditPermissionsRecyclerAdapter(OrderedRealmCollection<Permission> data) {
    super(data, true);
}
 
Example #18
Source File: PrivateChatRoomsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public PrivateChatRoomsRecyclerAdapter(Context context, OrderedRealmCollection<PrivateChatRoom> data) {
    super(data, true);
    this.context = context;
}
 
Example #19
Source File: PublicChatRoomsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public PublicChatRoomsRecyclerAdapter(Context context, OrderedRealmCollection<PublicChatRoom> data) {
    super(data, true);
    this.context = context;
}
 
Example #20
Source File: GrantPermissionsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public GrantPermissionsRecyclerAdapter(OrderedRealmCollection<PermissionUser> data) {
    super(data, true);
}
 
Example #21
Source File: MessagesRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public MessagesRecyclerAdapter(OrderedRealmCollection<Message> data, String userIdentity) {
    super(data, true);
    this.userIdentity = userIdentity;
}
 
Example #22
Source File: TasksRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public TasksRecyclerAdapter(OrderedRealmCollection<Item> data) {
    super(data, true);
}
 
Example #23
Source File: ProjectsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public ProjectsRecyclerAdapter(Context context, OrderedRealmCollection<Project> data) {
    super(data, true);
    this.context = context;
}
 
Example #24
Source File: ItemsRecyclerAdapter.java    From my-first-realm-app with Apache License 2.0 4 votes vote down vote up
public ItemsRecyclerAdapter(OrderedRealmCollection<Item> data) {
    super(data, true);
}
 
Example #25
Source File: LiveResults.java    From realm-monarchy with Apache License 2.0 votes vote down vote up
void updateResults(final OrderedRealmCollection<T> realmResults);