1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 04:22:30 +01:00

Set view strategy

This commit is contained in:
Isira Seneviratne 2024-06-20 07:08:12 +05:30
parent e92ba8f5d1
commit 5841eaa6d7

View File

@ -6,6 +6,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.fragment.app.Fragment
import androidx.paging.Pager
import androidx.paging.PagingConfig
@ -23,6 +24,7 @@ class CommentRepliesFragment : Fragment() {
): View {
comment = requireArguments().serializable<CommentsInfoItem>(COMMENT_KEY)!!
return ComposeView(requireContext()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
val flow = remember(comment) {
Pager(PagingConfig(pageSize = 20, enablePlaceholders = false)) {