From 85a0be8a4bbf68cc60ce83269ffce5139363e6f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petrus=20Nguy=E1=BB=85n=20Th=C3=A1i=20H=E1=BB=8Dc?= Date: Mon, 20 Nov 2023 16:26:45 +0700 Subject: [PATCH] Update GithubRepoItemsList.kt: add contentType (#102) --- .../github_search_kmm/android/ui/GithubRepoItemsList.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/androidApp/src/main/java/com/hoc081098/github_search_kmm/android/ui/GithubRepoItemsList.kt b/androidApp/src/main/java/com/hoc081098/github_search_kmm/android/ui/GithubRepoItemsList.kt index 42d93141..aa035386 100644 --- a/androidApp/src/main/java/com/hoc081098/github_search_kmm/android/ui/GithubRepoItemsList.kt +++ b/androidApp/src/main/java/com/hoc081098/github_search_kmm/android/ui/GithubRepoItemsList.kt @@ -78,7 +78,8 @@ internal fun GithubRepoItemsList( ) { items( items = items, - key = { it.id } + key = { it.id }, + contentType = { "GithubRepoItemRow" }, ) { item -> GithubRepoItemRow( modifier = Modifier @@ -89,13 +90,13 @@ internal fun GithubRepoItemsList( } if (isLoading) { - item { + item(contentType = "LoadingIndicator") { LoadingIndicator( modifier = Modifier.height(128.dp) ) } } else if (error !== null) { - item { + item(contentType = "RetryButton") { RetryButton( modifier = Modifier.height(128.dp), errorMessage = error.getReadableMessage(), @@ -103,7 +104,7 @@ internal fun GithubRepoItemsList( ) } } else if (!hasReachedMax) { - item { + item(contentType = "Spacer") { Spacer(modifier = Modifier.height(128.dp)) } }