diff --git a/TODO.md b/TODO.md index e519496..efe5196 100644 --- a/TODO.md +++ b/TODO.md @@ -30,7 +30,7 @@ Issues: - Memory issue on explore list - Word "Subscribe" too long in app bar - VideoList meta bar can't be dynamic height, causes scroll back issue. -- Refreshing video list causes odd loading order of video items +x Refreshing video list causes odd loading order of video items - playback rotate on click doesn't re-hide buttons - Explore list is memory intensive, leak?? - Access Token refresh circular injection problem diff --git a/app/src/main/java/net/schueller/peertube/feature_video/domain/source/SearchPagingSource.kt b/app/src/main/java/net/schueller/peertube/feature_video/domain/source/SearchPagingSource.kt index 553ac66..76f1c36 100644 --- a/app/src/main/java/net/schueller/peertube/feature_video/domain/source/SearchPagingSource.kt +++ b/app/src/main/java/net/schueller/peertube/feature_video/domain/source/SearchPagingSource.kt @@ -53,10 +53,12 @@ class SearchPagingSource ( // We need to get the previous key (or next key if previous is null) of the page // that was closest to the most recently accessed index. // Anchor position is the most recently accessed index - return state.anchorPosition?.let { anchorPosition -> - state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1) - ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1) - } +// return state.anchorPosition?.let { anchorPosition -> +// state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1) +// ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1) +// } +// + return 0 } diff --git a/app/src/main/java/net/schueller/peertube/feature_video/domain/source/VideoPagingSource.kt b/app/src/main/java/net/schueller/peertube/feature_video/domain/source/VideoPagingSource.kt index 43b22c4..47d175e 100644 --- a/app/src/main/java/net/schueller/peertube/feature_video/domain/source/VideoPagingSource.kt +++ b/app/src/main/java/net/schueller/peertube/feature_video/domain/source/VideoPagingSource.kt @@ -49,13 +49,15 @@ class VideoPagingSource ( } // The refresh key is used for subsequent refresh calls to PagingSource.load after the initial load override fun getRefreshKey(state: PagingState): Int? { + Log.v("video1", "getRefreshKey") // We need to get the previous key (or next key if previous is null) of the page // that was closest to the most recently accessed index. // Anchor position is the most recently accessed index - return state.anchorPosition?.let { anchorPosition -> - state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1) - ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1) - } +// return state.anchorPosition?.let { anchorPosition -> +// state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1) +// ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1) +// } + return 0 } diff --git a/app/src/main/java/net/schueller/peertube/feature_video/presentation/video/VideoListScreen.kt b/app/src/main/java/net/schueller/peertube/feature_video/presentation/video/VideoListScreen.kt index 2e60183..b59aca3 100644 --- a/app/src/main/java/net/schueller/peertube/feature_video/presentation/video/VideoListScreen.kt +++ b/app/src/main/java/net/schueller/peertube/feature_video/presentation/video/VideoListScreen.kt @@ -180,7 +180,7 @@ fun VideoListScreen( } else { itemsIndexed(lazyVideoItems) { item, video -> if (video != null) { -// Log.v("VLV", video.id.toString() + "-" + item.toString()) + Log.v("VLV", video.id.toString() + "-" + item.toString()) VideoListItem( video = video, onItemClick = {