Skip to content

Commit

Permalink
Update androidx dependecies and target API (#4212)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-livefront authored Nov 13, 2024
1 parent 072c3a9 commit 911c9e4
Show file tree
Hide file tree
Showing 70 changed files with 721 additions and 765 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## Compatibility

- **Minimum SDK**: 29
- **Target SDK**: 34
- **Target SDK**: 35
- **Device Types Supported**: Phone and Tablet
- **Orientations Supported**: Portrait and Landscape

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -134,14 +133,13 @@ fun SetupAutoFillScreen(
},
)
},
) { innerPadding ->
) {
SetupAutoFillContent(
state = state,
onAutofillServiceChanged = { handler.onAutofillServiceChanged(it) },
onContinueClick = handler.onContinueClick,
onTurnOnLaterClick = handler.onTurnOnLaterClick,
modifier = Modifier
.padding(innerPadding)
.verticalScroll(rememberScrollState())
.fillMaxSize(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -62,11 +61,9 @@ fun SetupCompleteScreen(
modifier = Modifier
.fillMaxSize()
.nestedScroll(scrollBehavior.nestedScrollConnection),
) { innerPadding ->
) {
SetupCompleteContent(
modifier = Modifier
.padding(innerPadding)
.verticalScroll(rememberScrollState()),
modifier = Modifier.verticalScroll(rememberScrollState()),
onContinue = setupCompleteAction,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,13 @@ fun SetupUnlockScreen(
},
)
},
) { innerPadding ->
) {
SetupUnlockScreenContent(
state = state,
showBiometricsPrompt = showBiometricsPrompt,
handler = handler,
biometricsManager = biometricsManager,
modifier = Modifier
.padding(paddingValues = innerPadding)
.fillMaxSize(),
modifier = Modifier.fillMaxSize(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@ fun CheckEmailScreen(
onNavigationIconClick = handler.onBackClick,
)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.padding(innerPadding)
.imePadding()
.fillMaxSize()
.verticalScroll(rememberScrollState()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -158,10 +157,9 @@ fun CompleteRegistrationScreen(
},
)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.padding(innerPadding)
.imePadding()
.fillMaxSize()
.verticalScroll(rememberScrollState()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,9 @@ fun CreateAccountScreen(
},
)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.padding(innerPadding)
.imePadding()
.fillMaxSize()
.verticalScroll(rememberScrollState()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,13 @@ fun EnterpriseSignOnScreen(
},
)
},
) { innerPadding ->
) {
EnterpriseSignOnScreenContent(
state = state,
onOrgIdentifierInputChange = remember(viewModel) {
{ viewModel.trySendAction(EnterpriseSignOnAction.OrgIdentifierInputChange(it)) }
},
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
modifier = Modifier.fillMaxSize(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ fun EnvironmentScreen(
},
)
},
) { innerPadding ->
) {
Column(
Modifier
.padding(innerPadding)
modifier = Modifier
.fillMaxSize()
.imePadding()
.verticalScroll(rememberScrollState()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
Expand Down Expand Up @@ -72,7 +71,7 @@ fun ExpiredRegistrationLinkScreen(
),
)
},
) { innerPadding ->
) {
ExpiredRegistrationLinkContent(
onNavigateToLogin = remember(viewModel) {
{
Expand All @@ -87,7 +86,6 @@ fun ExpiredRegistrationLinkScreen(
}
},
modifier = Modifier
.padding(innerPadding)
.fillMaxSize()
.verticalScroll(rememberScrollState()),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,29 @@ fun LandingScreen(
)
}
},
) { innerPadding ->
overlay = {
BitwardenAccountSwitcher(
isVisible = isAccountMenuVisible,
accountSummaries = state.accountSummaries.toImmutableList(),
onSwitchAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.SwitchAccountClick(it)) }
},
onLockAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.LockAccountClick(it)) }
},
onLogoutAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.LogoutAccountClick(it)) }
},
onAddAccountClick = {
// Not available
},
onDismissRequest = { isAccountMenuVisible = false },
isAddAccountAvailable = false,
topAppBarScrollBehavior = scrollBehavior,
modifier = Modifier.fillMaxSize(),
)
},
) {
LandingScreenContent(
state = state,
isAppBarVisible = isAppBarVisible,
Expand All @@ -167,32 +189,7 @@ fun LandingScreen(
onCreateAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.CreateAccountClick) }
},
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
)

BitwardenAccountSwitcher(
isVisible = isAccountMenuVisible,
accountSummaries = state.accountSummaries.toImmutableList(),
onSwitchAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.SwitchAccountClick(it)) }
},
onLockAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.LockAccountClick(it)) }
},
onLogoutAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LandingAction.LogoutAccountClick(it)) }
},
onAddAccountClick = {
// Not available
},
onDismissRequest = { isAccountMenuVisible = false },
isAddAccountAvailable = false,
topAppBarScrollBehavior = scrollBehavior,
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
modifier = Modifier.fillMaxSize(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,28 @@ fun LoginScreen(
},
)
},
) { innerPadding ->
overlay = {
BitwardenAccountSwitcher(
isVisible = isAccountMenuVisible,
accountSummaries = state.accountSummaries.toImmutableList(),
onSwitchAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.SwitchAccountClick(it)) }
},
onLockAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.LockAccountClick(it)) }
},
onLogoutAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.LogoutAccountClick(it)) }
},
onAddAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.AddAccountClick) }
},
onDismissRequest = { isAccountMenuVisible = false },
topAppBarScrollBehavior = scrollBehavior,
modifier = Modifier.fillMaxSize(),
)
},
) {
LoginScreenContent(
state = state,
onPasswordInputChanged = remember(viewModel) {
Expand All @@ -169,31 +190,7 @@ fun LoginScreen(
onNotYouButtonClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.NotYouButtonClick) }
},
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
)

BitwardenAccountSwitcher(
isVisible = isAccountMenuVisible,
accountSummaries = state.accountSummaries.toImmutableList(),
onSwitchAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.SwitchAccountClick(it)) }
},
onLockAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.LockAccountClick(it)) }
},
onLogoutAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.LogoutAccountClick(it)) }
},
onAddAccountClick = remember(viewModel) {
{ viewModel.trySendAction(LoginAction.AddAccountClick) }
},
onDismissRequest = { isAccountMenuVisible = false },
topAppBarScrollBehavior = scrollBehavior,
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
modifier = Modifier.fillMaxSize(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ fun LoginWithDeviceScreen(
},
)
},
) { paddingValues ->
val modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
) {
when (val viewState = state.viewState) {
is LoginWithDeviceState.ViewState.Content -> {
LoginWithDeviceScreenContent(
Expand All @@ -116,12 +113,12 @@ fun LoginWithDeviceScreen(
onViewAllLogInOptionsClick = remember(viewModel) {
{ viewModel.trySendAction(LoginWithDeviceAction.ViewAllLogInOptionsClick) }
},
modifier = modifier,
modifier = Modifier.fillMaxSize(),
)
}

LoginWithDeviceState.ViewState.Loading -> BitwardenLoadingContent(
modifier = modifier,
modifier = Modifier.fillMaxSize(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,11 @@ fun MasterPasswordGeneratorScreen(
snackbarHost = {
BitwardenSnackbarHost(bitwardenHostState = snackbarHostState)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(innerPadding),
.verticalScroll(rememberScrollState()),
) {
MasterPasswordGeneratorContent(
generatedPassword = state.generatedPassword,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ fun MasterPasswordGuidanceScreen(
},
)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(innerPadding)
.standardHorizontalMargin(),
) {
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ fun MasterPasswordHintScreen(
},
)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.padding(innerPadding)
.fillMaxSize(),
modifier = Modifier.fillMaxSize(),
) {
BitwardenTextField(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ fun PreventAccountLockoutScreen(
},
)
},
) { innerPadding ->
) {
Column(
modifier = Modifier
.padding(innerPadding)
.fillMaxWidth()
.standardHorizontalMargin()
.verticalScroll(rememberScrollState()),
Expand Down
Loading

0 comments on commit 911c9e4

Please sign in to comment.