Skip to content

Commit 12a1196

Browse files
authored
Merge pull request #79 from azrael8576/fix/video-screen-issues
2 parents 3e4149d + 545c325 commit 12a1196

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

core/data/src/main/java/com/wei/picquest/core/data/repository/DefaultSearchImagesRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DefaultSearchImagesRepository @Inject constructor(
2020
return Pager(
2121
config = PagingConfig(
2222
pageSize = 20,
23-
prefetchDistance = 5,
23+
prefetchDistance = 3,
2424
enablePlaceholders = false,
2525
),
2626
pagingSourceFactory = { PixabayImagePagingSource(pqNetworkDataSource, query) },

feature/video/src/main/java/com/wei/picquest/feature/video/videolibrary/VideoLibraryScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ internal fun VideoLibraryScreen(
151151
isPreview = isPreview,
152152
)
153153

154+
PagingStateHandling(lazyPagingItems = lazyPagingItems)
155+
154156
if (!isInPiPMode) {
155157
TopBarActions(onBackClick = onBackClick)
156158
}
@@ -182,8 +184,6 @@ fun VideoPager(
182184
)
183185
}
184186
}
185-
186-
PagingStateHandling(lazyPagingItems = lazyPagingItems)
187187
}
188188
}
189189

feature/video/src/main/java/com/wei/picquest/feature/video/videolibrary/VideoLibraryViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class VideoLibraryViewModel @Inject constructor(
2525

2626
private val videoLibraryArgs: VideoLibraryArgs = VideoLibraryArgs(savedStateHandle)
2727

28-
val videoSearchQuery = videoLibraryArgs.videoSearchQuery
28+
private val videoSearchQuery = videoLibraryArgs.videoSearchQuery
2929

3030
private val _videosState: MutableStateFlow<PagingData<VideoDetail>> =
3131
MutableStateFlow(value = PagingData.empty())

feature/video/src/main/java/com/wei/picquest/feature/video/videolibrary/lifecycle/MediaPiPLifecycle.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import kotlinx.coroutines.delay
2222
*
2323
* - The ExoPlayer will start playback (`play()`) when the lifecycle event is `ON_RESUME`.
2424
* - The ExoPlayer will pause playback (`pause()`) when the lifecycle event is `ON_STOP`, which
25-
* includes scenarios such as when the application goes into the background or enters Picture-In-Picture mode.
25+
* includes scenarios such as when the application goes into the background.
2626
*
2727
* This lifecycle-aware management ensures that video playback is handled efficiently, respecting
2828
* the application's current state and reducing resource usage when the app is not in the foreground.
@@ -51,7 +51,6 @@ internal fun MediaPiPLifecycle(
5151

5252
if (latestLifecycleEvent == Lifecycle.Event.ON_RESUME) {
5353
LaunchedEffect(latestLifecycleEvent) {
54-
delay(pipEnteringDuration)
5554
exoPlayer.play()
5655
}
5756
}

0 commit comments

Comments
 (0)