Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
sLee0306 committed Dec 15, 2023
1 parent 971ce34 commit 142c344
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions app/src/main/java/com/sample/android/tmdb/ui/feed/FeedFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.compose.runtime.Composable
import com.sample.android.tmdb.domain.model.FeedWrapper
import com.sample.android.tmdb.domain.model.TmdbItem
import com.sample.android.tmdb.ui.base.BaseNavigationFragment
import com.sample.android.tmdb.ui.common.Content
Expand All @@ -14,8 +12,6 @@ import com.sample.android.tmdb.ui.common.composeView

abstract class FeedFragment<T : TmdbItem> : BaseNavigationFragment<Nothing>() {

private var feeds: List<FeedWrapper<T>>? = null

protected abstract val viewModel: FeedViewModel<T>

override fun onCreateView(
Expand All @@ -25,25 +21,15 @@ abstract class FeedFragment<T : TmdbItem> : BaseNavigationFragment<Nothing>() {
): View {
return composeView {
TmdbTheme {
if (feeds == null) {
Content(viewModel) {
feeds = it
FeedCollectionScreen()
Content(viewModel) {
FeedCollectionList(
navType,
it
) { tmdbItem ->
startDetailActivity(tmdbItem)
}
} else {
FeedCollectionScreen()
}
}
}
}

@Composable
private fun FeedCollectionScreen() {
FeedCollectionList(
navType,
feeds!!
) { tmdbItem ->
startDetailActivity(tmdbItem)
}
}
}

0 comments on commit 142c344

Please sign in to comment.