Skip to content

Commit 2818567

Browse files
committed
build: 피쳐모듈 페이징 의존성 추가
1 parent 67b6387 commit 2818567

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import android.app.Activity
2+
import android.content.Intent
3+
import android.net.Uri
4+
import androidx.activity.result.contract.ActivityResultContract
5+
6+
// package com.into.websoso.core.database.datasource.library
7+
//
8+
// import androidx.paging.PagingSource
9+
// import androidx.paging.PagingState
10+
// import com.into.websoso.core.database.entity.InDatabaseNovelEntity
11+
// import com.into.websoso.data.library.model.NovelEntity
12+
//
13+
// internal class NovelEntityPagingSource(
14+
// private val source: PagingSource<Int, InDatabaseNovelEntity>,
15+
// ) : PagingSource<Int, NovelEntity>() {
16+
// override suspend fun load(params: LoadParams<Int>): LoadResult<Int, NovelEntity> =
17+
// when (val result = source.load(params)) {
18+
// is LoadResult.Page -> LoadResult.Page(
19+
// data = result.data.map(InDatabaseNovelEntity::toData),
20+
// prevKey = result.prevKey,
21+
// nextKey = result.nextKey,
22+
// )
23+
//
24+
// is LoadResult.Error -> LoadResult.Error(result.throwable)
25+
// is LoadResult.Invalid -> LoadResult.Invalid()
26+
// }
27+
//
28+
// override fun getRefreshKey(state: PagingState<Int, NovelEntity>): Int? {
29+
// val anchorPosition = state.anchorPosition ?: return null
30+
// val novel = state.closestItemToPosition(anchorPosition) ?: return null
31+
// return novel.userNovelId.toInt()
32+
// }
33+
// }
34+

0 commit comments

Comments
 (0)