Relative Content

Tag Archive for paginationandroid-jetpack-composeandroid-pagingandroid-paging-3

Issues with Paging in Firestore: Always Starts from the Beginning

override suspend fun load(params: LoadParams<DocumentSnapshot>): LoadResult<DocumentSnapshot, Diary> { return try { val couple = authRepo.getCouple() ?: return LoadResult.Error(Exception(“Couple ID is null”)) val query = firestore .collection(“pairs”) .document(couple.id) .collection(“diaries”) .whereEqualTo(“pinned”, false) .orderBy(“date”, Query.Direction.DESCENDING) .apply { if (params.key != null) { startAfter(params.key) } }.limit(params.loadSize.toLong() + 1) val snapshot = query.get().await() val diaryEntities = snapshot.documents.mapNotNull { doc -> […]

Issues with Paging in Firestore: Always Starts from the Beginning

override suspend fun load(params: LoadParams<DocumentSnapshot>): LoadResult<DocumentSnapshot, Diary> { return try { val couple = authRepo.getCouple() ?: return LoadResult.Error(Exception(“Couple ID is null”)) val query = firestore .collection(“pairs”) .document(couple.id) .collection(“diaries”) .whereEqualTo(“pinned”, false) .orderBy(“date”, Query.Direction.DESCENDING) .apply { if (params.key != null) { startAfter(params.key) } }.limit(params.loadSize.toLong() + 1) val snapshot = query.get().await() val diaryEntities = snapshot.documents.mapNotNull { doc -> […]

Issues with Paging in Firestore: Always Starts from the Beginning

override suspend fun load(params: LoadParams<DocumentSnapshot>): LoadResult<DocumentSnapshot, Diary> { return try { val couple = authRepo.getCouple() ?: return LoadResult.Error(Exception(“Couple ID is null”)) val query = firestore .collection(“pairs”) .document(couple.id) .collection(“diaries”) .whereEqualTo(“pinned”, false) .orderBy(“date”, Query.Direction.DESCENDING) .apply { if (params.key != null) { startAfter(params.key) } }.limit(params.loadSize.toLong() + 1) val snapshot = query.get().await() val diaryEntities = snapshot.documents.mapNotNull { doc -> […]

Issues with Paging in Firestore: Always Starts from the Beginning

override suspend fun load(params: LoadParams<DocumentSnapshot>): LoadResult<DocumentSnapshot, Diary> { return try { val couple = authRepo.getCouple() ?: return LoadResult.Error(Exception(“Couple ID is null”)) val query = firestore .collection(“pairs”) .document(couple.id) .collection(“diaries”) .whereEqualTo(“pinned”, false) .orderBy(“date”, Query.Direction.DESCENDING) .apply { if (params.key != null) { startAfter(params.key) } }.limit(params.loadSize.toLong() + 1) val snapshot = query.get().await() val diaryEntities = snapshot.documents.mapNotNull { doc -> […]

Issues with Paging in Firestore: Always Starts from the Beginning

override suspend fun load(params: LoadParams<DocumentSnapshot>): LoadResult<DocumentSnapshot, Diary> { return try { val couple = authRepo.getCouple() ?: return LoadResult.Error(Exception(“Couple ID is null”)) val query = firestore .collection(“pairs”) .document(couple.id) .collection(“diaries”) .whereEqualTo(“pinned”, false) .orderBy(“date”, Query.Direction.DESCENDING) .apply { if (params.key != null) { startAfter(params.key) } }.limit(params.loadSize.toLong() + 1) val snapshot = query.get().await() val diaryEntities = snapshot.documents.mapNotNull { doc -> […]

Issues with Paging in Firestore: Always Starts from the Beginning

override suspend fun load(params: LoadParams<DocumentSnapshot>): LoadResult<DocumentSnapshot, Diary> { return try { val couple = authRepo.getCouple() ?: return LoadResult.Error(Exception(“Couple ID is null”)) val query = firestore .collection(“pairs”) .document(couple.id) .collection(“diaries”) .whereEqualTo(“pinned”, false) .orderBy(“date”, Query.Direction.DESCENDING) .apply { if (params.key != null) { startAfter(params.key) } }.limit(params.loadSize.toLong() + 1) val snapshot = query.get().await() val diaryEntities = snapshot.documents.mapNotNull { doc -> […]