Skip to content

Commit

Permalink
android: ui changes (#1863)
Browse files Browse the repository at this point in the history
* update credential screen

* merge feedback and support

* update screenshots
  • Loading branch information
zaneschepke authored Jan 7, 2025
1 parent 6ae8f1f commit f54a3f3
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 164 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import net.nymtech.nymvpn.ui.screens.settings.appearance.display.DisplayScreen
import net.nymtech.nymvpn.ui.screens.settings.appearance.language.LanguageScreen
import net.nymtech.nymvpn.ui.screens.settings.credential.CredentialScreen
import net.nymtech.nymvpn.ui.screens.settings.developer.DeveloperScreen
import net.nymtech.nymvpn.ui.screens.settings.feedback.FeedbackScreen
import net.nymtech.nymvpn.ui.screens.settings.legal.LegalScreen
import net.nymtech.nymvpn.ui.screens.settings.legal.licenses.LicensesScreen
import net.nymtech.nymvpn.ui.screens.settings.logs.LogsScreen
Expand Down Expand Up @@ -225,7 +224,6 @@ class MainActivity : AppCompatActivity() {
}
composable<Route.Logs> { LogsScreen(appViewModel) }
composable<Route.Support> { SupportScreen(appViewModel) }
composable<Route.Feedback> { FeedbackScreen(appViewModel) }
composable<Route.Legal> { LegalScreen(appViewModel) }
composable<Route.Credential> {
CredentialScreen(appState, appViewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ sealed class Route {
@Serializable
data object Logs : Route()

@Serializable
data object Feedback : Route()

@Serializable
data object Support : Route()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,18 @@ fun SettingsScreen(appViewModel: AppViewModel, appUiState: AppUiState, viewModel
)
SurfaceSelectionGroupButton(
listOf(
SelectionItem(
ImageVector.vectorResource(R.drawable.feedback),
{
val icon = Icons.AutoMirrored.Outlined.ArrowRight
Icon(icon, icon.name, Modifier.size(iconSize))
},
title = { Text(stringResource(R.string.feedback), style = MaterialTheme.typography.bodyLarge.copy(MaterialTheme.colorScheme.onSurface)) },
onClick = { navController.navigate(Route.Feedback) },
),
SelectionItem(
ImageVector.vectorResource(R.drawable.support),
{
val icon = Icons.AutoMirrored.Outlined.ArrowRight
Icon(icon, icon.name, Modifier.size(iconSize))
},
title = { Text(stringResource(R.string.support), style = MaterialTheme.typography.bodyLarge.copy(MaterialTheme.colorScheme.onSurface)) },
title = {
Text(
stringResource(R.string.support_and_feedback),
style = MaterialTheme.typography.bodyLarge.copy(MaterialTheme.colorScheme.onSurface),
)
},
onClick = { navController.navigate(Route.Support) },
),
SelectionItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,17 @@ fun CredentialScreen(appUiState: AppUiState, appViewModel: AppViewModel, viewMod
modifier =
Modifier
.padding(
horizontal = 24.dp.scaledWidth(),
vertical = 24.dp.scaledHeight(),
),
) {
Text(
text = stringResource(id = R.string.welcome_exclaim),
text = stringResource(id = R.string.welcome_to_nym),
style = MaterialTheme.typography.headlineSmall,
color = MaterialTheme.colorScheme.onBackground,
)
Text(
text = stringResource(id = R.string.recovery_phrase_message),
text = stringResource(id = R.string.enter_access_code),
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Center,
)
Text(
text = stringResource(id = R.string.recovery_phrase_disclaimer),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
textAlign = TextAlign.Center,
)
Expand All @@ -193,7 +186,11 @@ fun CredentialScreen(appUiState: AppUiState, appViewModel: AppViewModel, viewMod
) {
CustomTextField(
placeholder = {
Text(stringResource(R.string.mnemonic_example), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Column {
Text(stringResource(R.string.access_code), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text("")
Text(stringResource(R.string.mnemonic_example), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
}
},
value = mnemonic,
onValueChange = {
Expand Down Expand Up @@ -273,7 +270,7 @@ fun CredentialScreen(appUiState: AppUiState, appViewModel: AppViewModel, viewMod
annotation = appUiState.managerState.accountLinks?.signUp ?: stringResource(R.string.create_account_url),
)
withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) {
append(stringResource(id = R.string.create_account))
append(stringResource(id = R.string.get_access_code))
}
pop()
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,27 @@ fun SupportScreen(appViewModel: AppViewModel) {
val icon = Icons.AutoMirrored.Outlined.ArrowRight
Icon(icon, icon.name, Modifier.size(iconSize))
},
title = { Text(stringResource(R.string.contact_support), style = MaterialTheme.typography.bodyLarge.copy(MaterialTheme.colorScheme.onSurface)) },
onClick = { context.openWebUrl(context.getString(R.string.contact_url)) },
title = { Text(stringResource(R.string.get_in_touch), style = MaterialTheme.typography.bodyLarge.copy(MaterialTheme.colorScheme.onSurface)) },
onClick = {
context.openWebUrl(context.getString(R.string.contact_url))
},
),
),
)
SurfaceSelectionGroupButton(
listOf(
SelectionItem(
leadingIcon = ImageVector.vectorResource(R.drawable.github),
{
val icon = Icons.AutoMirrored.Outlined.ArrowRight
Icon(icon, icon.name, Modifier.size(iconSize))
},
title = { Text(stringResource(R.string.open_github), style = MaterialTheme.typography.bodyLarge.copy(MaterialTheme.colorScheme.onSurface)) },
onClick = {
context.openWebUrl(
context.getString(R.string.github_issues_url),
)
},
),
),
)
Expand Down
6 changes: 6 additions & 0 deletions nym-vpn-android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,10 @@
<string name="credential_modal_description">To add this device, go to your account\'s \'Devices\' page, remove one of the existing devices, and then log in on this device with your recovery phrase.</string>
<string name="manage_devices">Manage your devices</string>
<string name="close">Close</string>
<string name="enter_access_code">Please enter your anonymous Access Code.</string>
<string name="welcome_to_nym">Welcome to NymVPN</string>
<string name="get_access_code">Get Access Code</string>
<string name="access_code">24-word-access-code</string>
<string name="support_and_feedback"><![CDATA[Support & feedback]]></string>
<string name="get_in_touch">Get in touch</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,19 @@ class NymBackend private constructor(val context: Context) : Backend, TunnelStat
}

suspend fun waitForInit() {
val startTime = System.currentTimeMillis()
val timeout = 5000L
while (System.currentTimeMillis() - startTime < timeout) {
if (initialized.get()) {
return
runCatching {
val startTime = System.currentTimeMillis()
val timeout = 5000L
while (System.currentTimeMillis() - startTime < timeout) {
if (initialized.get()) {
return
}
delay(10)
}
delay(10)
throw TimeoutException("Failed to initialize backend")
}.onFailure {
Timber.e(it)
}
throw TimeoutException("Failed to initialize backend")
}

private suspend fun initEnvironment(environment: Tunnel.Environment) {
Expand Down

0 comments on commit f54a3f3

Please sign in to comment.