Skip to content

Commit

Permalink
Fix account screen margins to better fit all content on 16:9 TVs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Mar 11, 2024
1 parent 4854387 commit bfdd941
Showing 1 changed file with 41 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,48 +196,57 @@ fun AccountScreen(
) { modifier ->
Column(
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(Dimens.accountRowSpacing),
modifier = modifier.animateContentSize().padding(horizontal = Dimens.sideMargin)
modifier =
modifier
.animateContentSize()
.padding(horizontal = Dimens.sideMargin)
.padding(bottom = Dimens.screenVerticalMargin)
) {
DeviceNameRow(deviceName = state.deviceName ?: "", onInfoClick = navigateToDeviceInfo)
Column(
verticalArrangement = Arrangement.spacedBy(Dimens.accountRowSpacing),
modifier = Modifier.padding(bottom = Dimens.smallPadding).animateContentSize()
) {
DeviceNameRow(
deviceName = state.deviceName ?: "",
onInfoClick = navigateToDeviceInfo
)

AccountNumberRow(accountNumber = state.accountNumber ?: "", onCopyAccountNumber)
AccountNumberRow(accountNumber = state.accountNumber ?: "", onCopyAccountNumber)

PaidUntilRow(accountExpiry = state.accountExpiry)
PaidUntilRow(accountExpiry = state.accountExpiry)
}

Spacer(modifier = Modifier.weight(1f))

Column(modifier = Modifier.padding(bottom = Dimens.screenVerticalMargin)) {
state.billingPaymentState?.let {
PlayPayment(
billingPaymentState = state.billingPaymentState,
onPurchaseBillingProductClick = { productId ->
onPurchaseBillingProductClick(productId)
},
onInfoClick = navigateToVerificationPendingDialog,
modifier = Modifier.padding(bottom = Dimens.buttonSpacing)
)
}

if (state.showSitePayment) {
ExternalButton(
text = stringResource(id = R.string.manage_account),
onClick = onManageAccountClick,
modifier = Modifier.padding(bottom = Dimens.buttonSpacing)
)
}

RedeemVoucherButton(
onClick = onRedeemVoucherClick,
modifier = Modifier.padding(bottom = Dimens.buttonSpacing),
isEnabled = true
state.billingPaymentState?.let {
PlayPayment(
billingPaymentState = state.billingPaymentState,
onPurchaseBillingProductClick = { productId ->
onPurchaseBillingProductClick(productId)
},
onInfoClick = navigateToVerificationPendingDialog,
modifier = Modifier.padding(bottom = Dimens.buttonSpacing)
)
}

NegativeButton(
text = stringResource(id = R.string.log_out),
onClick = onLogoutClick,
if (state.showSitePayment) {
ExternalButton(
text = stringResource(id = R.string.manage_account),
onClick = onManageAccountClick,
modifier = Modifier.padding(bottom = Dimens.buttonSpacing)
)
}

RedeemVoucherButton(
onClick = onRedeemVoucherClick,
modifier = Modifier.padding(bottom = Dimens.buttonSpacing),
isEnabled = true
)

NegativeButton(
text = stringResource(id = R.string.log_out),
onClick = onLogoutClick,
)
}
}
}
Expand Down

0 comments on commit bfdd941

Please sign in to comment.