Skip to content

Commit 64dbe6e

Browse files
W-17867189: [MSDK Android] Login View Bottom App Bar Shown Even When Empty (#2680)
1 parent 38268d0 commit 64dbe6e

1 file changed

Lines changed: 11 additions & 27 deletions

File tree

  • libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/components

libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/components/LoginView.kt

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,17 @@ fun LoginView() {
173173
} else null
174174
}
175175

176-
val bottomAppBar = viewModel.bottomAppBar ?: {
177-
DefaultBottomAppBar(
178-
backgroundColor = viewModel.dynamicBackgroundColor,
179-
button = bioAuthButton ?: idpButton ?: customButton,
180-
loading = viewModel.loading.value,
181-
showButton = !viewModel.authFinished.value,
182-
)
183-
}
176+
val bottomAppBarButton = bioAuthButton ?: idpButton ?: customButton
177+
val bottomAppBar = viewModel.bottomAppBar ?: bottomAppBarButton?.let { button ->
178+
{
179+
DefaultBottomAppBar(
180+
backgroundColor = viewModel.dynamicBackgroundColor,
181+
button = button,
182+
loading = viewModel.loading.value,
183+
showButton = !viewModel.authFinished.value
184+
)
185+
}
186+
} ?: {}
184187

185188
LoginView(
186189
loginUrlData = viewModel.loginUrl,
@@ -505,25 +508,6 @@ private fun AppBarBackButtonPreview() {
505508
}
506509
}
507510

508-
@Preview
509-
@Composable
510-
private fun AppBarBackButtonLoadinPreview() {
511-
val loginUrl = "https://login.salesforce.com"
512-
val backgroundColor = Color(red = 244, green = 246, blue = 249)
513-
MaterialTheme(colorScheme = if (isSystemInDarkTheme()) sfDarkColors() else sfLightColors()) {
514-
DefaultTopAppBar(
515-
backgroundColor = backgroundColor,
516-
titleText = loginUrl,
517-
titleTextColor = Color.Black,
518-
showServerPicker = remember { mutableStateOf(false) },
519-
clearCookies = { },
520-
reloadWebView = { },
521-
shouldShowBackButton = true,
522-
finish = { },
523-
)
524-
}
525-
}
526-
527511
@Preview
528512
@Composable
529513
private fun AppBarDarkPreview() {

0 commit comments

Comments
 (0)