-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/upgrade catalog list UI (#3)
* Updated version catalog, added koin for di and guava dependencies * feat(mobile-app): Configured koin modules * feat(mobile-app): Renamed old files * feat(mobile-app): Updated welcome screen composables * feat(mobile-app): Updated main activity * feat(feat-core-catalog-src): Added catalog data in english for fetching * feat(mobile-app): Updated catalog data service dependency for dependency injection * feat(mobile-app): Updated string resource values * feat(mobile-app): Updated unit tests * feat(mobile-app): Renamed old files * feat(mobile-app): Removed viewmodel factory for usage in koin di module * feat(mobile-app): Updated catalog favorites route composable ui * feat(mobile-app): Updated catalog settings route composable ui and viewmodel * feat(mobile-app): Updated scaffold and navigation type * feat(mobile-app): Updated device posture ui feature * feat(mobile-app): Updated catalog search route composable ui * feat(mobile-app): Updated catalog list route composable ui * feat(mobile-app): Updated welcome route composable ui * feat(mobile-app): Updated app ui state * feat(mobile-app): Updated app scaffold content type classifier * feat(mobile-app): Updated string resources * feat(mobile-app): Updated catalog home banner image resources * Updated version catalog * feat(mobile-app): Updated string resources * feat(mobile-app): Added jv logo image resources * feat(mobile-app): Upgraded catalog list route ui * feat(database): Upgraded catalog item entity information * feat(mobile-app): Upgraded catalog list unit tests * feat(mobile-app): Updated mobile app unit tests * feat(mobile-app): Updated main activity * feat(mobile-app): Updated app ui state * feat(mobile-app): Organized opt-in annotations * codefactor: Fixed unnecessary parentheses
- Loading branch information
Showing
41 changed files
with
929 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...pp/src/main/kotlin/dev/marlonlom/apps/cappajv/features/catalog_list/CatalogListContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright 2024 Marlonlom | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package dev.marlonlom.apps.cappajv.features.catalog_list | ||
|
||
import androidx.compose.foundation.ExperimentalFoundationApi | ||
import androidx.compose.foundation.layout.ExperimentalLayoutApi | ||
import androidx.compose.foundation.lazy.LazyListState | ||
import androidx.compose.runtime.Composable | ||
import com.google.accompanist.pager.ExperimentalPagerApi | ||
import dev.marlonlom.apps.cappajv.core.database.entities.CatalogItemTuple | ||
import dev.marlonlom.apps.cappajv.features.catalog_list.screens.DefaultPortraitCatalogListScreen | ||
import dev.marlonlom.apps.cappajv.features.catalog_list.screens.LandscapeCompactCatalogListScreen | ||
import dev.marlonlom.apps.cappajv.ui.layout.DevicePosture | ||
import dev.marlonlom.apps.cappajv.ui.main.CappajvAppState | ||
|
||
/** | ||
* Catalog list content composable ui, conditioned by application ui state. | ||
* | ||
* @author marlonlom | ||
* | ||
* @param appState Application ui state. | ||
* @param catalogItemsListState Catalog items lazy list state. | ||
* @param catalogItems Catalog items list. | ||
* @param categories Categories list. | ||
* @param selectedCategory Selected category name. | ||
* @param onSelectedCategoryChanged Action for category selected. | ||
* @param onCatalogItemSelected Action for catalog item selected. | ||
*/ | ||
@ExperimentalFoundationApi | ||
@ExperimentalPagerApi | ||
@ExperimentalLayoutApi | ||
@Composable | ||
fun CatalogListContent( | ||
appState: CappajvAppState, | ||
catalogItemsListState: LazyListState, | ||
catalogItems: List<CatalogItemTuple>, | ||
categories: List<String>, | ||
selectedCategory: String, | ||
onSelectedCategoryChanged: (String) -> Unit, | ||
onCatalogItemSelected: (Long) -> Unit, | ||
) { | ||
when { | ||
appState.isLandscape.and(appState.devicePosture == DevicePosture.Normal) -> { | ||
LandscapeCompactCatalogListScreen( | ||
appState = appState, | ||
catalogItemsListState = catalogItemsListState, | ||
catalogItems = catalogItems, | ||
categories = categories, | ||
selectedCategory = selectedCategory, | ||
onSelectedCategoryChanged = onSelectedCategoryChanged, | ||
onCatalogItemSelected = onCatalogItemSelected, | ||
) | ||
} | ||
|
||
else -> { | ||
DefaultPortraitCatalogListScreen( | ||
appState = appState, | ||
catalogItemsListState = catalogItemsListState, | ||
catalogItems = catalogItems, | ||
categories = categories, | ||
selectedCategory = selectedCategory, | ||
onSelectedCategoryChanged = onSelectedCategoryChanged, | ||
onCatalogItemSelected = onCatalogItemSelected, | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.