-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* UI Fixes and code cleanup - Android full screen issue (#61) - Made the system bar transparent, so it takes up current screen's BG color - Improved docs (README.md) for /components and /navigation - Component improvements: Button, TextField, Icons, PagerView - Code cleanup: Create profile, Onboarding, TrustedNodeSetup * Handled most TODOs (Tech debts) - Clean, separate RootNavGraph and TabNavGraph - Component improvements: Button, TextField, Icons, Layout components - TopBar for Tab pages - Moved to TabContainerHome (added comments on why?) * - Different onboarding page content in androidNode and xClient (facing some other issue in androidNode * - fix lint issue with node main presenter * - removing unnecessary libs added in node for merge --------- Co-authored-by: Rodrigo Varela <[email protected]>
- Loading branch information
1 parent
7f0c1ee
commit 54d277c
Showing
31 changed files
with
878 additions
and
709 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
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
11 changes: 11 additions & 0 deletions
11
...droidMain/kotlin/network/bisq/mobile/android/node/presentation/OnBoardingNodePresenter.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,11 @@ | ||
package network.bisq.mobile.android.node.presentation | ||
|
||
import network.bisq.mobile.presentation.MainPresenter | ||
import network.bisq.mobile.presentation.ui.uicases.startup.IOnboardingPresenter | ||
import network.bisq.mobile.presentation.ui.uicases.startup.OnBoardingPresenter | ||
|
||
class OnBoardingNodePresenter( | ||
mainPresenter: MainPresenter | ||
) : OnBoardingPresenter(mainPresenter), IOnboardingPresenter { | ||
override val indexesToShow = listOf(1, 2) | ||
} |
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
17 changes: 17 additions & 0 deletions
17
.../src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/README.md
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,17 @@ | ||
# Components | ||
|
||
This folder has all components that can be (re)used across the application | ||
|
||
### Atoms | ||
- This are very simplistic controls, that shows / does just one simple thing. | ||
- They are mostly extensions of basic Compose components like text, button, etc.,, that are customized with Bisq look and feel. | ||
- They are not aware of Presenter or any state management classes. | ||
|
||
### Molecules | ||
[TODO] | ||
|
||
### Organisms | ||
[TODO] | ||
|
||
### Layout | ||
- Container layout components |
52 changes: 34 additions & 18 deletions
52
...tion/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/atoms/Button.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 |
---|---|---|
@@ -1,47 +1,63 @@ | ||
package network.bisq.mobile.presentation.ui.components.atoms | ||
|
||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonColors | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import network.bisq.mobile.presentation.ui.theme.BisqTheme | ||
|
||
// TODO: | ||
// leftIcon, rightIcon -> Not happening right | ||
/** | ||
* Either pass | ||
* - text for regular button (or) | ||
* - iconOnly for Icon only button. | ||
* If both are given, iconOnly takes precedence | ||
*/ | ||
@Composable | ||
fun BisqButton( | ||
text: String, | ||
text: String? = "Button", | ||
onClick: () -> Unit, | ||
color: Color = BisqTheme.colors.light1, | ||
backgroundColor: Color = BisqTheme.colors.primary, | ||
padding: PaddingValues = PaddingValues(horizontal = 48.dp, vertical = 4.dp), | ||
leftIcon: Unit? = null, | ||
rightIcon: Unit? = null, | ||
modifier: Modifier = Modifier | ||
iconOnly: (@Composable () -> Unit)? = null, | ||
leftIcon: (@Composable () -> Unit)? = null, | ||
rightIcon: (@Composable () -> Unit)? = null, | ||
modifier: Modifier = Modifier, | ||
cornerRadius: Dp = 8.dp | ||
) { | ||
|
||
// Apply proper rounded corner | ||
Button( | ||
onClick = { onClick() }, | ||
contentPadding = padding, | ||
contentPadding = if(iconOnly != null) PaddingValues(horizontal = 0.dp, vertical = 0.dp) else padding, | ||
colors = ButtonColors( | ||
containerColor = backgroundColor, | ||
disabledContainerColor = backgroundColor, | ||
contentColor = color, | ||
disabledContentColor = color) | ||
disabledContentColor = color), | ||
shape = RoundedCornerShape(cornerRadius), | ||
) { | ||
Row { | ||
if(leftIcon != null) leftIcon | ||
if(leftIcon != null) Spacer(modifier = Modifier.width(10.dp)) | ||
BisqText.baseMedium( | ||
text = text, | ||
color = BisqTheme.colors.light1, | ||
) | ||
if(rightIcon != null) Spacer(modifier = Modifier.width(10.dp)) | ||
if(rightIcon != null) rightIcon | ||
if (iconOnly == null && text == null) { | ||
BisqText.baseMedium("Error: Pass either text or icon") | ||
} | ||
|
||
if (iconOnly != null) { | ||
iconOnly() | ||
} else if (text != null) { | ||
Row { | ||
if(leftIcon != null) leftIcon() | ||
if(leftIcon != null) Spacer(modifier = Modifier.width(10.dp)) | ||
BisqText.baseMedium( | ||
text = text, | ||
color = BisqTheme.colors.light1, | ||
) | ||
if(rightIcon != null) Spacer(modifier = Modifier.width(10.dp)) | ||
if(rightIcon != null) rightIcon() | ||
} | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...n/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/atoms/TextField.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,38 @@ | ||
package network.bisq.mobile.presentation.ui.components.atoms | ||
|
||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import network.bisq.mobile.components.MaterialTextField | ||
import network.bisq.mobile.presentation.ui.theme.BisqTheme | ||
|
||
@Composable | ||
fun BisqTextField( | ||
label: String, | ||
value: String, | ||
onValueChanged: (String) -> Unit, | ||
placeholder: String?, | ||
labelRightSuffix: (@Composable () -> Unit)? = null, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column(modifier = modifier) { | ||
Row ( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
BisqText.baseRegular( | ||
text = label, | ||
color = BisqTheme.colors.light2, | ||
) | ||
if (labelRightSuffix != null) { | ||
labelRightSuffix() | ||
} | ||
} | ||
MaterialTextField( | ||
text = value, | ||
placeholder = placeholder ?: "", | ||
onValueChanged = { onValueChanged(it) }) | ||
} | ||
} |
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.