Java 类io.realm.OrderedRealmCollection 实例源码

项目:Cluttr    文件:MediaAdapter.java   
private static OrderedRealmCollection<MediaItem> getResults(Album album, String query) {
    switch (Media.getMediaSortType()) {
        case ALPHABETICAL: {
            return album.getMedia().where().contains("name", query).findAll().sort("name", Media.isMediaSortAscending() ? Sort.ASCENDING : Sort.DESCENDING);
        }
        case DATE: {
            return album.getMedia().where().contains("name", query).findAll().sort("date", Media.isMediaSortAscending() ? Sort.ASCENDING : Sort.DESCENDING);
        }
    }
    return null;
}
项目:realm-monarchy    文件:MappedLiveResults.java   
@Override
public void updateResults(final OrderedRealmCollection<T> realmResults) {
    monarchy.doWithRealm(new Monarchy.RealmBlock() {
        @Override
        public void doWithRealm(Realm realm) {
            List<U> list = new LinkedList<>();
            for(T t: realmResults) {
                list.add(mapper.map(t));
            }
            postValue(Collections.unmodifiableList(new ArrayList<U>(list)));
        }
    });
}
项目:realm-monarchy    文件:CopiedLiveResults.java   
@Override
public void updateResults(final OrderedRealmCollection<T> realmCollection) {
    monarchy.doWithRealm(new Monarchy.RealmBlock() {
        @Override
        public void doWithRealm(Realm realm) {
            postValue(realm.copyFromRealm(realmCollection));
        }
    });
}
项目:ElephantAsia    文件:SearchElephantResultActivity.java   
private void displaySearchResult() {
  OrderedRealmCollection<Elephant> realmResults = searchElephants();
  if (!realmResults.isEmpty()) {
    adapter = new RealmElephantAdapter(realmResults, this, false, true);
    listView.setAdapter(adapter);
  } else {
    listView.setVisibility(View.GONE);
    noResult.setVisibility(View.VISIBLE);
  }
}
项目:Hyber-SDK-Android    文件:Hyber.java   
@Nullable
public static OrderedRealmCollection<Device> getAllUserDevices() {
    User user = repo.getCurrentUser();
    if (user == null)
        return null;
    return repo.getDevices(user);
}
项目:DragRecyclerView    文件:DragRealmAdapter.java   
@Override
public void onDrop(int fromPosition, int toPosition) {

    OrderedRealmCollection list = getData();
    list.add(toPosition, list.remove(fromPosition));

    if (mDragListener != null) {
        mDragListener.onDrop(fromPosition, toPosition);
    }
}
项目:Forage    文件:MapPresenterTest.java   
@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);
}
项目:Forage    文件:MapPresenterTest.java   
@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));
}
项目:realm-android-adapters    文件:MyRecyclerViewAdapter.java   
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);
}
项目:Android-Client    文件:KRealmRecyclerViewAdapter.java   
public KRealmRecyclerViewAdapter(@NonNull Context context, @Nullable OrderedRealmCollection<T> data, boolean autoUpdate) {
    super(context, data, autoUpdate);
}
项目:realm-helpers    文件:MainActivity.java   
public CatAdapter(@Nullable OrderedRealmCollection<Cat> data) {
    super(data, true);
}
项目:realm-helpers    文件:MainActivity.java   
public CatAdapter(@Nullable OrderedRealmCollection<Cat> data) {
    super(data, true);
}
项目:WatchIt    文件:MoviesWatchLaterAdapter.java   
public MoviesWatchLaterAdapter(@Nullable OrderedRealmCollection<Movie> data, boolean autoUpdate, OnClickMovieItemListener onClickItemListener) {
    super(data, autoUpdate);
    this.onClickMovieItemListener = onClickItemListener;
}
项目:WatchIt    文件:TvSeriesWatchLaterAdapter.java   
public TvSeriesWatchLaterAdapter(@Nullable OrderedRealmCollection<TvSeries> data, boolean autoUpdate, OnClickTvSeriesItemListener onClickTvSeriesItemListener) {
    super(data, autoUpdate);
    this.onClickTvSeriesItemListener = onClickTvSeriesItemListener;
}
项目:RealmTasks    文件:CommonAdapter.java   
CommonAdapter(Context context, OrderedRealmCollection<T> items)
{
    super(context, items, true);
}
项目:RealmTasks    文件:TaskListAdapter.java   
public TaskListAdapter(Context context, OrderedRealmCollection<TaskList> items)
{
    super(context, items);
}
项目:RealmTasks    文件:TaskAdapter.java   
public TaskAdapter(Context context, OrderedRealmCollection<Task> items)
{
    super(context, items);
}
项目:ElephantAsia    文件:RealmElephantAdapter.java   
public RealmElephantAdapter(OrderedRealmCollection<Elephant> realmResults, Context context, boolean remove, boolean favorite) {
  super(realmResults);
  this.context = context;
  this.favorite = favorite;
  this.remove = remove;
}
项目:OpenLibre    文件:LogRecyclerViewAdapter.java   
LogRecyclerViewAdapter(LogFragment fragment, OrderedRealmCollection<ReadingData> data) {
    super(data, true);
    this.fragment = fragment;
    PreferenceManager.getDefaultSharedPreferences(fragment.getContext()).registerOnSharedPreferenceChangeListener(this);
}
项目:Kutuk    文件:NoteAdapter.java   
public NoteAdapter(@Nullable OrderedRealmCollection<Note> data) {
    super(data, true); // Realm always auto-updates
    setHasStableIds(true);
}
项目:Hyber-SDK-Android    文件:DevicesRVAdapter.java   
public DevicesRVAdapter(Context context, OrderedRealmCollection<Device> data) {
    super(context, data, true);
    this.mContext = context;
}
项目:DragRecyclerView    文件:DragRealmAdapter.java   
public DragRealmAdapter(Context context, OrderedRealmCollection data, boolean autoUpdate) {
    super(data, autoUpdate);
    this.context = context;
}
项目:DragRecyclerView    文件:RealmExamAdapter.java   
RealmExamAdapter(Context context, OrderedRealmCollection data, boolean autoUpdate) {
    super(context, data, autoUpdate);
}
项目:erlymon-litvak-monitor-android    文件:DevicesAdapter.java   
public DevicesAdapter(Context context, OrderedRealmCollection<Device> data) {
    super(context, data);
}
项目:XMVideo    文件:FavoriteAdapter.java   
public FavoriteAdapter(Context context, OrderedRealmCollection<PageDetailInfo> data) {
    this.mContext = context;
    this.mDataset = data;
}
项目:Forage    文件:CacheAdapter.java   
public CacheAdapter(Context context, OrderedRealmCollection<Cache> data, boolean autoUpdate) {
    super(context, data, autoUpdate);
}
项目:ocreader    文件:ItemsAdapter.java   
public OrderedRealmCollection<Item> getItems() {
    return items;
}
项目:ocreader    文件:FolderSpinnerAdapter.java   
public FolderSpinnerAdapter(Context context, OrderedRealmCollection<Folder> folders) {
    this.rootFolder = context.getString(R.string.root_folder);
    this.folders = folders;
}
项目:honki_android2    文件:MyAdapter.java   
public MyAdapter(Context context, OrderedRealmCollection<Cat> cats) {
    super(context, cats);
    this.mContext = context;
}
项目:KSAnime    文件:StarAdapter.java   
public StarAdapter(AnimeListFragment activity, OrderedRealmCollection<Anime> animeList) {
    super(activity, animeList);
}
项目:KSAnime    文件:AnimeAdapter.java   
public AnimeAdapter(AnimeListFragment fragment, OrderedRealmCollection<Anime> animeList) {
    super(fragment.getContext(), animeList, true);
    this.fragment = fragment;
    this.ctx = fragment.getContext();
    this.animeList = animeList;
}
项目:KSAnime    文件:HorizontalAdapter.java   
public HorizontalAdapter(HomeFragment fragment, OrderedRealmCollection<Anime> animeList) {
    super(fragment.getContext(), animeList, true);
    this.fragment = fragment;
    this.ctx = fragment.getContext();
    this.animeList = animeList;
}
项目:KSAnime    文件:FullSearchAdapter.java   
public FullSearchAdapter(@NonNull Context context, @Nullable OrderedRealmCollection<Anime> data, FullSearchAdapter.OnClickListener onClickListener) {
    super(context, data, true);
    this.list = data;
    this.listener = onClickListener;
}
项目:WiFiEye    文件:AvailableNetworksAdapter.java   
public AvailableNetworksAdapter(@NonNull Context context, @Nullable OrderedRealmCollection<NetworkItem> data) {
    super(context, data);
}
项目:WiFiEye    文件:ScannedNetworksAdapter.java   
public ScannedNetworksAdapter(@NonNull Context context, @Nullable OrderedRealmCollection<NetworkItem> data) {
    super(context, data);
}
项目:realm-android-adapters    文件:MyListAdapter.java   
MyListAdapter(OrderedRealmCollection<Item> realmResults) {
    super(realmResults);
}
项目:realm-android-adapters    文件:ListViewTestAdapter.java   
public ListViewTestAdapter(Context context, OrderedRealmCollection<AllJavaTypes> realmResults) {
    super(realmResults);
    inflater = LayoutInflater.from(context);
}
项目:realm-android-adapters    文件:RecyclerViewTestAdapter.java   
public RecyclerViewTestAdapter(final Context context, final OrderedRealmCollection<AllJavaTypes> realmResults, final boolean automaticUpdate) {
    super(realmResults, automaticUpdate);
    inflater = LayoutInflater.from(context);
    setHasStableIds(true);
}
项目:sprockets-android    文件:RealmBindingAdapter.java   
protected RealmBindingAdapter(@LayoutRes int layoutId,
                              @Nullable OrderedRealmCollection<E> data) {
    super(data, true);
    mLayoutId = layoutId;
}
项目:HTWDresden    文件:RoomTimetableAdapter.java   
public RoomTimetableAdapter(@NonNull final Realm realm, @Nullable final OrderedRealmCollection<LessonRoom> data) {
    super(data);
    this.realm = realm;
}