Skip to content

Commit

Permalink
Merge pull request #108 from joreilly/dependency_updates
Browse files Browse the repository at this point in the history
dependency updates
  • Loading branch information
joreilly authored Mar 3, 2024
2 parents 43b7381 + 149fa36 commit fbf7884
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.items
import androidx.paging.compose.itemContentType
import androidx.paging.compose.itemKey
import dev.johnoreilly.mortycomposekmm.fragment.CharacterDetail
import dev.johnoreilly.mortycomposekmm.ui.MainViewModel

Expand All @@ -21,7 +22,13 @@ fun CharactersListView(viewModel: MainViewModel, bottomBar: @Composable () -> Un
bottomBar = bottomBar)
{
LazyColumn(contentPadding = it) {
items(lazyCharacterList) { character ->

items(
count = lazyCharacterList.itemCount,
key = lazyCharacterList.itemKey { it.id },
contentType = lazyCharacterList.itemContentType { "MyPagingItems" }
) { index ->
val character = lazyCharacterList[index]
character?.let {
CharactersListRowView(character, characterSelected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.items
import androidx.paging.compose.itemContentType
import androidx.paging.compose.itemKey
import dev.johnoreilly.mortycomposekmm.fragment.EpisodeDetail
import dev.johnoreilly.mortycomposekmm.ui.MainViewModel


@Composable
fun EpisodesListView(viewModel: MainViewModel, bottomBar: @Composable () -> Unit, episodeSelected: (episode: EpisodeDetail) -> Unit) {
val lazyEpisodeList = viewModel.episodes.collectAsLazyPagingItems()
Expand All @@ -19,7 +21,12 @@ fun EpisodesListView(viewModel: MainViewModel, bottomBar: @Composable () -> Unit
bottomBar = bottomBar)
{
LazyColumn(contentPadding = it) {
items(lazyEpisodeList) { episode ->
items(
count = lazyEpisodeList.itemCount,
key = lazyEpisodeList.itemKey { it.id },
contentType = lazyEpisodeList.itemContentType { "MyPagingItems" }
) { index ->
val episode = lazyEpisodeList[index]
episode?.let {
EpisodesListRowView(episode, episodeSelected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.items
import androidx.paging.compose.itemContentType
import androidx.paging.compose.itemKey
import dev.johnoreilly.mortycomposekmm.fragment.LocationDetail
import dev.johnoreilly.mortycomposekmm.ui.MainViewModel
import dev.johnoreilly.mortycomposekmm.ui.episodes.EpisodesListRowView


@Composable
Expand All @@ -20,7 +22,12 @@ fun LocationsListView(viewModel: MainViewModel, bottomBar: @Composable () -> Uni
bottomBar = bottomBar)
{
LazyColumn(contentPadding = it) {
items(lazyLocationsList) { location ->
items(
count = lazyLocationsList.itemCount,
key = lazyLocationsList.itemKey { it.name },
contentType = lazyLocationsList.itemContentType { "MyPagingItems" }
) { index ->
val location = lazyLocationsList[index]
location?.let {
LocationsListRowView(location, locationSelected)
}
Expand Down
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[versions]
kotlin = "2.0.0-Beta1"
ksp = "2.0.0-Beta1-1.0.14"
coroutines = "1.7.3"
kotlin = "2.0.0-Beta4"
ksp = "2.0.0-Beta4-1.0.17"
coroutines = "1.8.0"
androidGradlePlugin = "8.1.4"
koin = "3.5.0"
koinCompose = "3.5.0"
apollo = "4.0.0-alpha.2"
kmpNativeCoroutines = "1.0.0-ALPHA-20"
koin = "3.5.3"
koinCompose = "3.5.3"
apollo = "4.0.0-beta.4"
kmpNativeCoroutines = "1.0.0-ALPHA-24-kotlin-2.0.0-Beta3"

androidxActivity = "1.8.0"
androidxComposeCompiler = "1.5.5-dev-k2.0.0-Beta1-06b8ae672a4"
androidxComposeBom = "2023.10.01"
androidxPagingCompose = "1.0.0-alpha20"
androidxNavigationCompose = "2.7.5"
androidxActivity = "1.8.2"
androidxComposeCompiler = "1.5.11-dev-k2.0.0-Beta4-21f5e479a96"
androidxComposeBom = "2024.02.01"
androidxPagingCompose = "3.2.1"
androidxNavigationCompose = "2.7.7"
accompanist = "0.30.1"
coilCompose = "2.5.0"
coilCompose = "2.6.0"
multiplatformPaging = "0.6.2"

junit = "4.13.2"
Expand Down

0 comments on commit fbf7884

Please sign in to comment.