Permalink
Browse files

Update to Paging alpha4-1

  • Loading branch information...
ianhanniballake committed Dec 15, 2017
1 parent bd32d4a commit 1a7e1b71601c99070ed36a64c8bbeac05ca331a6
View
@@ -45,7 +45,7 @@ ext {
constraintLayoutVersion = "1.0.2"
lifecycleVersion = "1.0.0"
roomVersion = "1.0.0"
pagingVersion = "1.0.0-alpha3"
pagingVersion = "1.0.0-alpha4-1"
googlePlayServicesVersion = "11.6.0"
crashlyticsVersion = "2.7.1"
wearableVersion = "2.1.0"
@@ -18,7 +18,7 @@
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.paging.LivePagedListProvider;
import android.arch.paging.DataSource;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
@@ -192,7 +192,7 @@ private static void writeUriToFile(Context context, Uri uri, File destFile) thro
abstract ChosenPhoto getChosenPhotoBlocking(Long id);
@Query("SELECT * FROM chosen_photos ORDER BY _id DESC")
abstract LivePagedListProvider<Integer, ChosenPhoto> getChosenPhotosPaged();
abstract DataSource.Factory<Integer, ChosenPhoto> getChosenPhotosPaged();
@Query("SELECT * FROM chosen_photos ORDER BY _id DESC")
abstract LiveData<List<ChosenPhoto>> getChosenPhotos();
@@ -20,6 +20,7 @@
import android.arch.lifecycle.AndroidViewModel;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.paging.LivePagedListBuilder;
import android.arch.paging.PagedList;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -43,11 +44,9 @@
public GallerySettingsViewModel(Application application) {
super(application);
mChosenPhotos = GalleryDatabase.getInstance(application).chosenPhotoDao()
.getChosenPhotosPaged().create(0,
new PagedList.Config.Builder()
.setPageSize(24)
.build());
mChosenPhotos = new LivePagedListBuilder<>(
GalleryDatabase.getInstance(application).chosenPhotoDao().getChosenPhotosPaged(),
24).build();
mGetContentActivityInfoListLiveData = new MutableLiveData<List<ActivityInfo>>() {
private BroadcastReceiver mPackagesChangedReceiver = new BroadcastReceiver() {
@Override

0 comments on commit 1a7e1b7

Please sign in to comment.