Update a few colours and strings in the Android welcome and login screens

This commit is contained in:
Jackson Harper 2022-08-24 16:44:55 +08:00
parent 80f91d42bf
commit 1196a24d2d
3 changed files with 43 additions and 14 deletions

View file

@ -11,11 +11,15 @@ import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
@SuppressLint("CoroutineCreationDuringComposition")
@ -46,7 +50,9 @@ fun EmailLoginView(viewModel: LoginViewModel, onAuthProviderButtonTap: () -> Uni
}
ClickableText(
text = AnnotatedString("Continue with Google/Apple ->"),
text = AnnotatedString("Return to Social Login"),
style = MaterialTheme.typography.titleMedium
.plus(TextStyle(textDecoration = TextDecoration.Underline)),
onClick = { onAuthProviderButtonTap() }
)
}
@ -76,7 +82,7 @@ fun LoginFields(
OutlinedTextField(
value = email,
placeholder = { Text(text = "user@email.com") },
label = { Text(text = "email") },
label = { Text(text = "Email") },
onValueChange = onEmailChange,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() })
@ -84,8 +90,8 @@ fun LoginFields(
OutlinedTextField(
value = password,
placeholder = { Text(text = "password") },
label = { Text(text = "password") },
placeholder = { Text(text = "Password") },
label = { Text(text = "Password") },
onValueChange = onPasswordChange,
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
@ -103,8 +109,15 @@ fun LoginFields(
Toast.LENGTH_SHORT
).show()
}
}) {
Text(text = "Login")
}, colors = ButtonDefaults.buttonColors(
contentColor = Color(0xFF3D3D3D),
containerColor = Color(0xffffd234)
)
) {
Text(
text = "Login",
modifier = Modifier.padding(horizontal = 100.dp)
)
}
}
}

View file

@ -20,6 +20,9 @@ import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import app.omnivore.omnivore.R
@ -29,7 +32,7 @@ import kotlinx.coroutines.launch
@Composable
fun WelcomeScreen(viewModel: LoginViewModel) {
Surface(modifier = Modifier.fillMaxSize(), color = Color(0xFFFBEAA8 )) {
Surface(modifier = Modifier.fillMaxSize(), color = Color(0xFFFCEBA8)) {
WelcomeScreenContent(viewModel = viewModel)
}
}
@ -51,7 +54,6 @@ fun WelcomeScreenContent(viewModel: LoginViewModel) {
verticalArrangement = Arrangement.SpaceAround,
horizontalAlignment = Alignment.Start,
modifier = Modifier
.background(Color(0xFFFBEAA8))
.fillMaxSize()
.navigationBarsPadding()
.padding(horizontal = 16.dp)
@ -79,6 +81,11 @@ fun WelcomeScreenContent(viewModel: LoginViewModel) {
style = MaterialTheme.typography.headlineLarge
)
Text(
text = stringResource(id = R.string.welcome_subtitle),
style = MaterialTheme.typography.titleSmall
)
MoreInfoButton()
Spacer(modifier = Modifier.height(50.dp))
@ -124,7 +131,9 @@ fun AuthProviderView(
) {
Spacer(modifier = Modifier.weight(1.0F))
Column(
verticalArrangement = Arrangement.Center,
// verticalArrangement = Arrangement.Center,
// horizontalAlignment = Alignment.CenterHorizontally
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
if (isGoogleAuthAvailable) {
@ -140,7 +149,9 @@ fun AuthProviderView(
)
ClickableText(
text = AnnotatedString("Continue with Email ->"),
text = AnnotatedString("Continue with Email"),
style = MaterialTheme.typography.titleMedium
.plus(TextStyle(textDecoration = TextDecoration.Underline)),
onClick = { onEmailButtonTap() }
)
}
@ -154,8 +165,11 @@ fun MoreInfoButton() {
val intent = remember { Intent(Intent.ACTION_VIEW, Uri.parse("https://omnivore.app/about")) }
ClickableText(
text = AnnotatedString("Learn More ->"),
style = MaterialTheme.typography.titleLarge,
text = AnnotatedString(
stringResource(id = R.string.learn_more),
),
style = MaterialTheme.typography.titleSmall
.plus(TextStyle(textDecoration = TextDecoration.Underline)),
onClick = {
context.startActivity(intent)
},

View file

@ -1,5 +1,7 @@
<resources>
<string name="app_name">Omnivore</string>
<string name="gcp_id">590528454690-mpmbvcb4c3ifmnojmrultt37eo8f64at.apps.googleusercontent.com</string>
<string name="welcome_title">Everything you read.\nSafe, organized, and\neasy to share.</string>
<string name="gcp_id">590528454690-g535h6sd708andjrvrmqgaj1sergtqi9.apps.googleusercontent.com</string>
<string name="welcome_title">Never miss a great read</string>
<string name="learn_more">Learn More</string>
<string name="welcome_subtitle">Save articles and read them later in our distraction-free reader.</string>
</resources>