Skip to content

Commit f604aa6

Browse files
committed
update captcha dialog.
1 parent cb67f8b commit f604aa6

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

base/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ last chosen location.</string>
555555
<string name="unblock_full_access">Unlock full access to Windscribe</string>
556556
<string name="go_pro_for_unlimited_everything">Go Pro for unlimited everything</string>
557557
<string name="custom_configs">Custom Configs</string>
558-
<string name="slide_puzzle_piece_into_place">Slide puzzle piece into place</string>
558+
<string name="slide_puzzle_piece_into_place">Drag left puzzle piece into place</string>
559559
<string name="complete_puzzle_to_continue">Complete Puzzle to continue"</string>
560560
<string name="none">None</string>
561561
<string name="free">Free</string>

mobile/src/main/java/com/windscribe/mobile/ui/common/AppBackground.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fun AppBackground(content: @Composable BoxScope.() -> Unit) {
1818
.fillMaxSize()
1919
.focusable()
2020
.clickable {}
21-
.background(AppColors.deepBlue)
21+
.background(AppColors.charcoalBlue)
2222
.focusable(true)) {
2323
content()
2424
}

mobile/src/main/java/com/windscribe/mobile/ui/common/CaptchaDialog.kt

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ import androidx.compose.runtime.mutableStateOf
3232
import androidx.compose.runtime.remember
3333
import androidx.compose.ui.Alignment
3434
import androidx.compose.ui.Modifier
35+
import androidx.compose.ui.draw.clip
3536
import androidx.compose.ui.graphics.Color
3637
import androidx.compose.ui.graphics.asImageBitmap
3738
import androidx.compose.ui.input.pointer.pointerInput
3839
import androidx.compose.ui.layout.ContentScale
40+
import androidx.compose.ui.layout.ModifierLocalBeyondBoundsLayout
3941
import androidx.compose.ui.platform.LocalDensity
4042
import androidx.compose.ui.res.stringResource
43+
import androidx.compose.ui.text.font.FontWeight
4144
import androidx.compose.ui.text.style.TextAlign
4245
import androidx.compose.ui.unit.IntSize
4346
import androidx.compose.ui.unit.dp
@@ -74,10 +77,14 @@ fun CaptchaDebugDialog(
7477
onCancel: () -> Unit,
7578
onSolutionSubmit: (Float, Map<String, List<Float>>) -> Unit
7679
) {
77-
Dialog(onDismissRequest = onCancel, properties = DialogProperties(usePlatformDefaultWidth = false)) {
80+
Dialog(
81+
onDismissRequest = onCancel,
82+
properties = DialogProperties(usePlatformDefaultWidth = false)
83+
) {
7884
Surface(
7985
shape = RoundedCornerShape(16.dp),
8086
color = AppColors.charcoalBlue,
87+
modifier = Modifier.padding(16.dp),
8188
border = BorderStroke(1.dp, AppColors.white.copy(alpha = 0.05f)),
8289
tonalElevation = 8.dp,
8390
) {
@@ -122,27 +129,38 @@ fun CaptchaDebugView(
122129

123130
var dragJob: Job? = remember { null }
124131
val coroutineScope = remember { CoroutineScope(Dispatchers.Main) }
132+
val shape = RoundedCornerShape(8.dp)
125133
Column(
126134
horizontalAlignment = Alignment.CenterHorizontally,
127135
verticalArrangement = Arrangement.Center,
128-
modifier = Modifier.padding(top = 24.dp, start = 24.dp, end = 24.dp)
136+
modifier = Modifier.padding(top = 24.dp, start = 24.dp, end = 24.dp, bottom = 16.dp)
129137
) {
130138
Text(
131139
stringResource(com.windscribe.vpn.R.string.complete_puzzle_to_continue),
132140
color = Color.White,
133-
style = font18
141+
style = font18.copy(fontWeight = FontWeight.Medium)
134142
)
135143
Spacer(modifier = Modifier.height(24.dp))
136144
Box {
137-
Box {
145+
Box(
146+
modifier = Modifier
147+
.border(
148+
width = 1.dp,
149+
color = AppColors.white.copy(alpha = 0.05f),
150+
shape = shape
151+
)
152+
.clip(shape)
153+
.background(Color.Transparent)
154+
.padding(1.dp)
155+
) {
138156
Image(
139157
bitmap = backgroundBitmap,
140158
contentDescription = "Captcha Background",
141159
modifier = with(density) {
142160
Modifier
143161
.height(backgroundSize.value.height.toDp())
144162
.width(backgroundSize.value.width.toDp())
145-
}.background(color = Color.Transparent, shape = RoundedCornerShape(12.dp)),
163+
},
146164
contentScale = ContentScale.FillBounds
147165
)
148166
}
@@ -192,7 +210,7 @@ fun CaptchaDebugView(
192210
)
193211
}
194212
}
195-
Spacer(modifier = Modifier.height(16.dp))
213+
Spacer(modifier = Modifier.height(24.dp))
196214
Box(
197215
modifier = Modifier
198216
.fillMaxWidth()
@@ -206,12 +224,13 @@ fun CaptchaDebugView(
206224
) {
207225
Text(
208226
stringResource(com.windscribe.vpn.R.string.slide_puzzle_piece_into_place),
209-
style = font12,
227+
style = font12.copy(fontWeight = FontWeight.Normal),
210228
textAlign = TextAlign.Center,
211229
color = AppColors.white.copy(alpha = 0.50f),
212230
modifier = Modifier.align(Alignment.Center)
213231
)
214232
}
233+
Spacer(modifier = Modifier.height(16.dp))
215234
TextButton(stringResource(id = com.windscribe.vpn.R.string.cancel), onClick = {
216235
onCancel()
217236
})

0 commit comments

Comments
 (0)