Skip to content

Commit

Permalink
Convert select location back button into IconButton
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Nov 29, 2023
1 parent aa7ec42 commit 2e66fa0
Showing 1 changed file with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.mullvad.mullvadvpn.compose.screen

import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
Expand All @@ -15,6 +14,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -27,6 +28,7 @@ import androidx.compose.ui.draw.rotate
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusProperties
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -94,26 +96,19 @@ fun SelectLocationScreen(
Column(modifier = Modifier.background(backgroundColor).fillMaxWidth().fillMaxHeight()) {
Row(
modifier =
Modifier.padding(
horizontal = Dimens.selectLocationTitlePadding,
vertical = Dimens.selectLocationTitlePadding
)
Modifier.padding(vertical = Dimens.selectLocationTitlePadding)
.padding(end = Dimens.selectLocationTitlePadding)
.fillMaxWidth()
) {
Image(
painter = painterResource(id = R.drawable.icon_back),
contentDescription = null,
modifier =
Modifier.focusRequester(backFocus)
.focusProperties { next = listFocus }
.focusProperties {
down = listFocus
right = searchBarFocus
}
.size(Dimens.titleIconSize)
.rotate(270f)
.clickable { onBackClick() }
)
IconButton(onClick = onBackClick) {
Icon(
painter = painterResource(id = R.drawable.icon_back),
contentDescription = null,
tint = Color.Unspecified,
modifier =
Modifier.size(Dimens.titleIconSize).rotate(270f).clickable { onBackClick() }
)
}
Text(
text = stringResource(id = R.string.select_location),
modifier =
Expand Down

0 comments on commit 2e66fa0

Please sign in to comment.