diff options
Diffstat (limited to 'android/app/src')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/List.kt | 13 | ||||
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/List.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/List.kt index dcac2be044..3babb29a21 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/List.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/List.kt @@ -8,6 +8,8 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.material.CircularProgressIndicator import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -22,6 +24,7 @@ import net.mullvad.mullvadvpn.R @Composable fun ListItem( text: String, + isLoading: Boolean, @DrawableRes iconResourceId: Int? = null, onClick: () -> Unit ) { @@ -50,7 +53,15 @@ fun ListItem( .align(Alignment.CenterEnd) .padding(horizontal = 12.dp) ) { - if (iconResourceId != null) { + if (isLoading) { + CircularProgressIndicator( + strokeWidth = 3.dp, + color = Color.White, + modifier = Modifier + .height(24.dp) + .width(24.dp) + ) + } else if (iconResourceId != null) { Image( painter = painterResource(id = iconResourceId), contentDescription = "Remove", diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt index 5d3e028d59..374f2f7275 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt @@ -144,6 +144,7 @@ fun DeviceListScreen( state.devices.forEach { device -> ListItem( text = device.name.capitalizeFirstCharOfEachWord(), + isLoading = false, iconResourceId = R.drawable.icon_close ) { viewModel.stageDeviceForRemoval(device) |
