Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated screenshots/animated gif; PR feedback
  • Loading branch information
IanGClifton committed Aug 26, 2022
commit 6f465ef40ef9dace911f5482df6196975d858999
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.compose.jetsurvey.R
import com.example.compose.jetsurvey.theme.JetsurveyTheme
import com.example.compose.jetsurvey.theme.outlinedTextFieldColors
import com.example.compose.jetsurvey.theme.stronglyDeemphasizedAlpha

@Composable
Expand Down Expand Up @@ -159,7 +158,6 @@ fun Email(
onImeAction()
}
),
colors = outlinedTextFieldColors(),
)

emailState.getError()?.let { error -> TextFieldError(textError = error) }
Expand Down Expand Up @@ -228,7 +226,6 @@ fun Password(
onImeAction()
}
),
colors = outlinedTextFieldColors()
)

passwordState.getError()?.let { error -> TextFieldError(textError = error) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ private fun Branding(modifier: Modifier = Modifier) {
@Composable
private fun Logo(
modifier: Modifier = Modifier,
lightTheme: Boolean = LocalContentColor.current.luminance() < 0.5f,
) {
val assetId = if (LocalContentColor.current.luminance() < 0.5f) {
val assetId = if (lightTheme) {
R.drawable.ic_logo_light
} else {
R.drawable.ic_logo_dark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,9 @@ private fun DateQuestion(
@Composable
private fun PhotoDefaultImage(
modifier: Modifier = Modifier,
lightTheme: Boolean = LocalContentColor.current.luminance() < 0.5f,
) {
val assetId = if (LocalContentColor.current.luminance() < 0.5f) {
val assetId = if (lightTheme) {
R.drawable.ic_selfie_light
} else {
R.drawable.ic_selfie_dark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
package com.example.compose.jetsurvey.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.TextFieldColors
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -90,20 +87,6 @@ private val DarkColors = darkColorScheme(
surfaceTint = md_theme_dark_surfaceTint,
)

@OptIn(ExperimentalMaterial3Api::class) // outlinedTextFieldColors is experimental in m3
@Composable
fun outlinedTextFieldColors(): TextFieldColors =
TextFieldDefaults.outlinedTextFieldColors(
unfocusedLabelColor = MaterialTheme.colorScheme.onSurface
.copy(alpha = stronglyDeemphasizedAlpha),
unfocusedBorderColor = MaterialTheme.colorScheme.onSurface
.copy(alpha = 0.38f),
focusedTrailingIconColor = MaterialTheme.colorScheme.onSurface
.copy(alpha = stronglyDeemphasizedAlpha),
unfocusedTrailingIconColor = MaterialTheme.colorScheme.onSurface
.copy(alpha = stronglyDeemphasizedAlpha),
)

@Composable
fun JetsurveyTheme(
useDarkTheme: Boolean = isSystemInDarkTheme(),
Expand All @@ -120,9 +103,7 @@ fun JetsurveyTheme(
systemUiController.setSystemBarsColor(
color = colors.surface,
darkIcons = !useDarkTheme
) {
md_theme_dark_surface
}
)

onDispose { }
}
Expand Down
Binary file removed Jetsurvey/screenshots/dark_signin.png
Binary file not shown.
Binary file removed Jetsurvey/screenshots/light_signin.png
Binary file not shown.
Binary file removed Jetsurvey/screenshots/signup_error.png
Binary file not shown.
Binary file modified Jetsurvey/screenshots/survey.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Jetsurvey/screenshots/welcome.png
Binary file not shown.
Binary file modified readme/screenshots/Jetsurvey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.