Skip to content

Commit

Permalink
Fix padding for both tablet and phone UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
roshanrajaratnam committed May 28, 2024
1 parent 7819910 commit 7999ad4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package no.nordicsemi.android.wifi.provisioner.ble.sections
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
Expand All @@ -20,6 +21,7 @@ import no.nordicsemi.android.wifi.provisioner.ui.view.section.SectionTitle
fun ProvisionOverBleSection(onClick: () -> Unit) {
OutlinedCard(
modifier = Modifier
.fillMaxWidth()
.padding(all = 8.dp)
.clickable(onClick = onClick)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package no.nordicsemi.android.wifi.provisioner.softap.view
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
Expand All @@ -20,6 +21,7 @@ import no.nordicsemi.android.wifi.provisioner.ui.view.section.SectionTitle
fun ProvisionOverWifiSection(onClick: () -> Unit) {
OutlinedCard(
modifier = Modifier
.fillMaxWidth()
.padding(all = 8.dp)
.clickable(onClick = onClick)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,55 +115,55 @@ fun SoftApScreen(
OutlinedCard(
modifier = Modifier
.verticalScroll(rememberScrollState())
.padding(vertical = 16.dp, horizontal = 8.dp),
.padding(vertical = 16.dp, horizontal = 16.dp),
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
) {
ConfigureSoftAp(
configureState = state.configureState,
connectionState = state.connectionState,
ssidName = ssidName,
onSsidChange = { ssidName = it }
)
ConnectToSoftAp(
connectionState = state.connectionState,
serviceDiscoveryState = state.discoveringServicesState,
isConnectionRequested = state.isConnectionRequested,
ssidName = ssidName,
start = {
start(ssidName, Open)
}
)
SelectWifi(
provisioningState = state.provisionState,
selectWifiState = state.selectWifiState,
wifiData = state.selectedWifi,
onSelectWifiPressed = onSelectWifiPressed,
onPasswordEntered = onPasswordEntered,
)
SetPassphrase(
provisioningState = state.provisionState,
providePasswordState = state.providePasswordState,
wifiData = state.selectedWifi,
password = state.password,
onPasswordEntered = onPasswordEntered
)
Provisioning(
passwordState = state.providePasswordState,
provisioningState = state.provisionState,
isProvisioningRequested = state.isProvisioningRequested,
onProvisionPressed = onProvisionPressed
)
Verify(
provisioningState = state.provisionState,
verificationState = state.verifyState,
isVerificationRequested = state.isVerificationRequested,
verify = verify
)
}
ConfigureSoftAp(
configureState = state.configureState,
connectionState = state.connectionState,
ssidName = ssidName,
onSsidChange = { ssidName = it }
)
ConnectToSoftAp(
connectionState = state.connectionState,
serviceDiscoveryState = state.discoveringServicesState,
isConnectionRequested = state.isConnectionRequested,
ssidName = ssidName,
start = {
start(ssidName, Open)
}
)
SelectWifi(
provisioningState = state.provisionState,
selectWifiState = state.selectWifiState,
wifiData = state.selectedWifi,
onSelectWifiPressed = onSelectWifiPressed,
onPasswordEntered = onPasswordEntered,
)
SetPassphrase(
provisioningState = state.provisionState,
providePasswordState = state.providePasswordState,
wifiData = state.selectedWifi,
password = state.password,
onPasswordEntered = onPasswordEntered
)
Provisioning(
passwordState = state.providePasswordState,
provisioningState = state.provisionState,
isProvisioningRequested = state.isProvisioningRequested,
onProvisionPressed = onProvisionPressed
)
Verify(
provisioningState = state.provisionState,
verificationState = state.verifyState,
isVerificationRequested = state.isVerificationRequested,
verify = verify
)
}
}
}
Expand Down Expand Up @@ -200,6 +200,7 @@ private fun ConfigureSoftAp(
) {
var showDialog by rememberSaveable { mutableStateOf(false) }
WizardStepComponent(
modifier = Modifier.padding(horizontal = 16.dp),
icon = Icons.Default.Settings,
title = stringResource(R.string.configure),
state = configureState,
Expand Down Expand Up @@ -241,6 +242,7 @@ private fun ConnectToSoftAp(
start: () -> Unit,
) {
WizardStepComponent(
modifier = Modifier.padding(horizontal = 16.dp),
icon = Icons.Default.Wifi,
title = stringResource(id = R.string.connect),
state = connectionState,
Expand Down Expand Up @@ -295,6 +297,7 @@ private fun SelectWifi(
onPasswordEntered: (String) -> Unit,
) {
WizardStepComponent(
modifier = Modifier.padding(horizontal = 16.dp),
icon = Icons.Default.WifiFind,
title = stringResource(id = R.string.select_wifi),
state = selectWifiState,
Expand Down Expand Up @@ -337,6 +340,7 @@ private fun SetPassphrase(
) {
var showDialog by rememberSaveable { mutableStateOf(false) }
WizardStepComponent(
modifier = Modifier.padding(horizontal = 16.dp),
icon = wifiData?.authMode?.toImageVector() ?: Icons.Default.WifiPassword,
title = stringResource(id = R.string.set_passphrase),
state = providePasswordState,
Expand Down Expand Up @@ -385,6 +389,7 @@ private fun Provisioning(
onProvisionPressed: () -> Unit
) {
WizardStepComponent(
modifier = Modifier.padding(horizontal = 16.dp),
icon = Icons.Outlined.NetworkCheck,
title = stringResource(id = R.string.provision),
state = provisioningState,
Expand Down Expand Up @@ -432,6 +437,7 @@ private fun Verify(
verify: () -> Unit
) {
WizardStepComponent(
modifier = Modifier.padding(horizontal = 16.dp),
icon = Icons.Default.Verified,
title = stringResource(id = R.string.verify),
state = verificationState,
Expand Down

0 comments on commit 7999ad4

Please sign in to comment.