-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#254] Apply same structure for components detail screens
- Loading branch information
Showing
14 changed files
with
247 additions
and
159 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
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
48 changes: 48 additions & 0 deletions
48
demo/src/main/java/com/orange/ods/demo/ui/components/ComponentDemoScreen.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,48 @@ | ||
/* | ||
* | ||
* Copyright 2021 Orange | ||
* | ||
* Use of this source code is governed by an MIT-style | ||
* license that can be found in the LICENSE file or at | ||
* https://opensource.org/licenses/MIT. | ||
* / | ||
*/ | ||
|
||
package com.orange.ods.demo.ui.components | ||
|
||
import androidx.compose.material.ExperimentalMaterialApi | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import com.orange.ods.demo.ui.components.bottomnavigation.ComponentBottomNavigation | ||
import com.orange.ods.demo.ui.components.checkboxes.ComponentCheckboxes | ||
import com.orange.ods.demo.ui.components.dialogs.ComponentDialogs | ||
import com.orange.ods.demo.ui.components.lists.ComponentLists | ||
import com.orange.ods.demo.ui.components.progress.ComponentProgress | ||
import com.orange.ods.demo.ui.components.radiobuttons.ComponentRadioButtons | ||
import com.orange.ods.demo.ui.components.sliders.ComponentSliders | ||
import com.orange.ods.demo.ui.components.switches.ComponentSwitches | ||
|
||
@ExperimentalMaterialApi | ||
@Composable | ||
fun ComponentDemoScreen( | ||
componentId: Long, | ||
updateTopBarTitle: (Int) -> Unit, | ||
) { | ||
val component = remember { components.firstOrNull { it.id == componentId } } | ||
|
||
component?.let { | ||
updateTopBarTitle(component.titleRes) | ||
when (component) { | ||
Component.BottomNavigation -> ComponentBottomNavigation() | ||
Component.Checkboxes -> ComponentCheckboxes() | ||
Component.Dialogs -> ComponentDialogs() | ||
Component.Lists -> ComponentLists() | ||
Component.Progress -> ComponentProgress() | ||
Component.RadioButtons -> ComponentRadioButtons() | ||
Component.Sliders -> ComponentSliders() | ||
Component.Switches -> ComponentSwitches() | ||
else -> {} | ||
} | ||
} | ||
|
||
} |
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.