From 7c1f3262fd7954d25e67c7edf6bf9f0c372b2e55 Mon Sep 17 00:00:00 2001 From: Anselmo Alexandre Date: Fri, 15 Dec 2023 01:56:29 +0200 Subject: [PATCH 1/4] Added Portuguese string translation - value-pt (#655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sunflower - Added, author_name, menu_filter_by_grow_zone string translation to -pt * Sunflower, Added, author_name, menu_filter_by_grow_zone string translation to -pt * Sunflower, Added, my_garden_title string translation to -pt * Sunflower, Added, plant_list_title string translation to -pt * Sunflower, Added, available string translation to -pt * Sunflower, Added, plant_details_title string translation to -pt * Sunflower, Added, add_plant string translation to -pt * Sunflower, Added, added_plant_to_garden string translation to -pt * Sunflower, Added, garden_empty string translation to -pt * Sunflower, Added, plant_date_header string translation to -pt * Sunflower, Added, watered_date_header string translation to -pt * Sunflower - Added, menu_item_share_plant string translation to -pt * Sunflower - Added, share_text_plant string translation to -pt * Sunflower - Added, gallery_title string translation to -pt * Sunflower - Added, watering_needs_prefix string translation to -pt * Sunflower - Added, one and other watering_needs_suffix string translation to -pt * Sunflower - Added, one and other watering_next string translation to -pt * Sunflower - Added, ally_plant_item_image string translation to -pt * Sunflower - Added, gallery_content_description string translation to -pt * Sunflower - Added, plant_detail_content_description string translation to -pt * Update app/src/main/res/values-pt/strings.xml Co-authored-by: Rosário Pereira Fernandes * Update app/src/main/res/values-pt/strings.xml Co-authored-by: Rosário Pereira Fernandes * Update app/src/main/res/values-pt/strings.xml Co-authored-by: Rosário Pereira Fernandes * Update app/src/main/res/values-pt/strings.xml Co-authored-by: Rosário Pereira Fernandes * Update app/src/main/res/values-pt/strings.xml Co-authored-by: Rosário Pereira Fernandes * Update app/src/main/res/values-pt/strings.xml Co-authored-by: Rosário Pereira Fernandes --------- Co-authored-by: Rosário Pereira Fernandes Co-authored-by: Caren --- app/src/main/res/values-pt/strings.xml | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/src/main/res/values-pt/strings.xml diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml new file mode 100644 index 000000000..9c848e8fc --- /dev/null +++ b/app/src/main/res/values-pt/strings.xml @@ -0,0 +1,50 @@ + + + + + + Filtrar por zona de cultivo + Meu jardim + Lista de plantas + Plantas disponíveis + Detalhes da planta + Adicionar planta + Adicionou planta ao jardim + Seu jardim está vazio + Plantada + Regado pela última vez + Partilhar + Confira o %s da planta na aplicação Sunflower + Imagens tiradas do Unsplash + + + Necessidades de rega + + todos dias + a cada %d dias + + + + regar amanhã. + regar dentro de %d dias. + + + + Foto da planta + Navegue para a tela da galeria + Imagem da planta + From 0a07de227ab2c18f8c33c0bc8350174eef5a4efa Mon Sep 17 00:00:00 2001 From: yela Date: Sat, 16 Dec 2023 01:16:25 +0400 Subject: [PATCH 2/4] feat:Avoid the plantImage not expanding all the way when you swipe up and down quickly. (#939) --- .../apps/sunflower/compose/plantdetail/PlantDetailView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/google/samples/apps/sunflower/compose/plantdetail/PlantDetailView.kt b/app/src/main/java/com/google/samples/apps/sunflower/compose/plantdetail/PlantDetailView.kt index b187e271e..b290f4da5 100644 --- a/app/src/main/java/com/google/samples/apps/sunflower/compose/plantdetail/PlantDetailView.kt +++ b/app/src/main/java/com/google/samples/apps/sunflower/compose/plantdetail/PlantDetailView.kt @@ -219,7 +219,7 @@ fun PlantDetails( hasValidUnsplashKey = hasValidUnsplashKey, imageHeight = with(LocalDensity.current) { val candidateHeight = - Dimens.PlantDetailAppBarHeight + toolbarOffsetHeightPx.value.toDp() + Dimens.PlantDetailAppBarHeight // FIXME: Remove this workaround when https://github.com/bumptech/glide/issues/4952 // is released maxOf(candidateHeight, 1.dp) From cdccad4cece22d112d331273a1bab3f80f06149b Mon Sep 17 00:00:00 2001 From: tjmtic Date: Fri, 15 Dec 2023 13:28:12 -0800 Subject: [PATCH 3/4] Update pagingCompose dependencyversion, Update LazyGridScope Implementation (#935) Co-authored-by: Chris Arriola --- .../apps/sunflower/compose/gallery/GalleryScreen.kt | 8 ++------ gradle/libs.versions.toml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/google/samples/apps/sunflower/compose/gallery/GalleryScreen.kt b/app/src/main/java/com/google/samples/apps/sunflower/compose/gallery/GalleryScreen.kt index eaf0c8c7c..08c31320b 100644 --- a/app/src/main/java/com/google/samples/apps/sunflower/compose/gallery/GalleryScreen.kt +++ b/app/src/main/java/com/google/samples/apps/sunflower/compose/gallery/GalleryScreen.kt @@ -40,6 +40,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.paging.PagingData import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.collectAsLazyPagingItems +import androidx.paging.compose.itemKey import com.google.samples.apps.sunflower.R import com.google.samples.apps.sunflower.compose.plantlist.PhotoListItem import com.google.samples.apps.sunflower.data.UnsplashPhoto @@ -79,14 +80,9 @@ private fun GalleryScreen( modifier = Modifier.padding(padding), contentPadding = PaddingValues(all = dimensionResource(id = R.dimen.card_side_margin)) ) { - // TODO update this implementation once paging Compose supports LazyGridScope - // See: https://issuetracker.google.com/issues/178087310 items( count = pagingItems.itemCount, - key = { index -> - val photo = pagingItems[index] - "${ photo?.id ?: ""}${index}" - } + key = pagingItems.itemKey { it } ) { index -> val photo = pagingItems[index] ?: return@items PhotoListItem(photo = photo) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 05832e41d..0c27a9ccb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -45,7 +45,7 @@ minSdk = "23" monitor = "1.6.0" navigation = "2.5.3" okhttpLogging = "4.10.0" -pagingCompose = "1.0.0-alpha18" +pagingCompose = "1.0.0-alpha19" profileInstaller = "1.2.0" recyclerView = "1.3.0-alpha02" retrofit = "2.9.0" From 937fc8040d08760ce24c87b2ab55ef88c0cbdbd5 Mon Sep 17 00:00:00 2001 From: Chris Arriola Date: Wed, 20 Dec 2023 15:56:32 -0800 Subject: [PATCH 4/4] Update to Compose 2023.10.01 (#940) * Update to Compose 2023.10.01 Change-Id: I9e663b9eda4762fbd83b418d33ee4d7a22820a7c * Update usage of Pages. Change-Id: I5a9421041d497c83a12585ab429f847e441e4c92 --- .../apps/sunflower/compose/home/HomeScreen.kt | 13 ++++++++----- gradle/libs.versions.toml | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt b/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt index 299c21467..9deaba6a8 100644 --- a/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt +++ b/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt @@ -71,9 +71,10 @@ enum class SunflowerPage( fun HomeScreen( modifier: Modifier = Modifier, onPlantClick: (Plant) -> Unit = {}, - viewModel: PlantListViewModel = hiltViewModel() + viewModel: PlantListViewModel = hiltViewModel(), + pages: Array = SunflowerPage.values() ) { - val pagerState = rememberPagerState() + val pagerState = rememberPagerState(pageCount = { pages.size }) val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior() Scaffold( @@ -89,6 +90,7 @@ fun HomeScreen( HomePagerScreen( onPlantClick = onPlantClick, pagerState = pagerState, + pages = pages, Modifier.padding(top = contentPadding.calculateTopPadding()) ) } @@ -99,8 +101,8 @@ fun HomeScreen( fun HomePagerScreen( onPlantClick: (Plant) -> Unit, pagerState: PagerState, + pages: Array, modifier: Modifier = Modifier, - pages: Array = SunflowerPage.values() ) { Column(modifier) { val coroutineScope = rememberCoroutineScope() @@ -129,7 +131,6 @@ fun HomePagerScreen( // Pages HorizontalPager( modifier = Modifier.background(MaterialTheme.colorScheme.background), - pageCount = pages.size, state = pagerState, verticalAlignment = Alignment.Top ) { index -> @@ -200,9 +201,11 @@ private fun HomeTopAppBar( @Composable private fun HomeScreenPreview() { SunflowerTheme { + val pages = SunflowerPage.values() HomePagerScreen( onPlantClick = {}, - pagerState = PagerState(), + pagerState = rememberPagerState(pageCount = { pages.size }), + pages = pages ) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0c27a9ccb..fb9ecac4e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,8 +20,8 @@ androidGradlePlugin = "8.1.2" benchmark = "1.1.0" # @keep compileSdk = "34" -composeLatest = "1.4.0-alpha03" -composeBom = "2023.06.01" +composeLatest = "1.6.0-beta03" +composeBom = "2023.10.01" compose-compiler = "1.5.3" constraintLayoutCompose = "1.0.1" coreTesting = "2.2.0"