Skip to content

Commit 69126da

Browse files
authoredNov 6, 2020
Merge pull request android#269 from android/fm/jetsurvey_alpha07
[Jetsurvey] Update to 6953474 snapshot
2 parents 5a6895e + 3c14527 commit 69126da

File tree

7 files changed

+49
-49
lines changed

7 files changed

+49
-49
lines changed
 

Diff for: ‎Jetsurvey/app/src/main/java/com/example/compose/jetsurvey/signinsignup/SignInScreen.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.example.compose.jetsurvey.signinsignup
1818

19-
import androidx.compose.foundation.Text
2019
import androidx.compose.foundation.layout.Box
2120
import androidx.compose.foundation.layout.Column
2221
import androidx.compose.foundation.layout.Spacer
@@ -32,6 +31,7 @@ import androidx.compose.material.Scaffold
3231
import androidx.compose.material.Snackbar
3332
import androidx.compose.material.SnackbarHost
3433
import androidx.compose.material.SnackbarHostState
34+
import androidx.compose.material.Text
3535
import androidx.compose.material.TextButton
3636
import androidx.compose.runtime.Composable
3737
import androidx.compose.runtime.remember

Diff for: ‎Jetsurvey/app/src/main/java/com/example/compose/jetsurvey/signinsignup/SignInSignUp.kt

+11-9
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
package com.example.compose.jetsurvey.signinsignup
1818

19-
import androidx.compose.foundation.AmbientTextStyle
2019
import androidx.compose.foundation.ScrollableColumn
21-
import androidx.compose.foundation.Text
2220
import androidx.compose.foundation.layout.Box
2321
import androidx.compose.foundation.layout.Column
2422
import androidx.compose.foundation.layout.Row
@@ -29,20 +27,24 @@ import androidx.compose.foundation.layout.padding
2927
import androidx.compose.foundation.layout.preferredHeight
3028
import androidx.compose.foundation.layout.preferredWidth
3129
import androidx.compose.foundation.layout.wrapContentSize
32-
import androidx.compose.material.AmbientEmphasisLevels
30+
import androidx.compose.foundation.text.KeyboardOptions
31+
import androidx.compose.material.AmbientContentAlpha
32+
import androidx.compose.material.AmbientTextStyle
33+
import androidx.compose.material.ContentAlpha
3334
import androidx.compose.material.Icon
3435
import androidx.compose.material.IconButton
3536
import androidx.compose.material.MaterialTheme
3637
import androidx.compose.material.OutlinedButton
3738
import androidx.compose.material.OutlinedTextField
38-
import androidx.compose.material.ProvideEmphasis
3939
import androidx.compose.material.Surface
40+
import androidx.compose.material.Text
4041
import androidx.compose.material.TopAppBar
4142
import androidx.compose.material.icons.Icons
4243
import androidx.compose.material.icons.filled.ChevronLeft
4344
import androidx.compose.material.icons.filled.Visibility
4445
import androidx.compose.material.icons.filled.VisibilityOff
4546
import androidx.compose.runtime.Composable
47+
import androidx.compose.runtime.Providers
4648
import androidx.compose.runtime.mutableStateOf
4749
import androidx.compose.runtime.remember
4850
import androidx.compose.ui.Alignment
@@ -117,7 +119,7 @@ fun Email(
117119
emailState.text = it
118120
},
119121
label = {
120-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
122+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
121123
Text(
122124
text = stringResource(id = R.string.email),
123125
style = MaterialTheme.typography.body2
@@ -133,7 +135,7 @@ fun Email(
133135
},
134136
textStyle = MaterialTheme.typography.body2,
135137
isErrorValue = emailState.showErrors(),
136-
imeAction = imeAction,
138+
keyboardOptions = KeyboardOptions.Default.copy(imeAction = imeAction),
137139
onImeActionPerformed = { action, softKeyboardController ->
138140
if (action == ImeAction.Done) {
139141
softKeyboardController?.hideSoftwareKeyboard()
@@ -170,7 +172,7 @@ fun Password(
170172
},
171173
textStyle = MaterialTheme.typography.body2,
172174
label = {
173-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
175+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
174176
Text(
175177
text = label,
176178
style = MaterialTheme.typography.body2
@@ -194,7 +196,7 @@ fun Password(
194196
PasswordVisualTransformation()
195197
},
196198
isErrorValue = passwordState.showErrors(),
197-
imeAction = imeAction,
199+
keyboardOptions = KeyboardOptions.Default.copy(imeAction = imeAction),
198200
onImeActionPerformed = { action, softKeyboardController ->
199201
if (action == ImeAction.Done) {
200202
softKeyboardController?.hideSoftwareKeyboard()
@@ -231,7 +233,7 @@ fun OrSignInAsGuest(
231233
horizontalAlignment = Alignment.CenterHorizontally
232234
) {
233235
Surface {
234-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
236+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
235237
Text(
236238
text = stringResource(id = R.string.or),
237239
style = MaterialTheme.typography.subtitle2

Diff for: ‎Jetsurvey/app/src/main/java/com/example/compose/jetsurvey/signinsignup/SignUpScreen.kt

+6-7
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616

1717
package com.example.compose.jetsurvey.signinsignup
1818

19-
import androidx.compose.foundation.Text
2019
import androidx.compose.foundation.layout.Column
2120
import androidx.compose.foundation.layout.Spacer
2221
import androidx.compose.foundation.layout.fillMaxWidth
2322
import androidx.compose.foundation.layout.preferredHeight
24-
import androidx.compose.material.AmbientEmphasisLevels
23+
import androidx.compose.material.AmbientContentAlpha
2524
import androidx.compose.material.Button
25+
import androidx.compose.material.ContentAlpha
2626
import androidx.compose.material.MaterialTheme
27-
import androidx.compose.material.ProvideEmphasis
2827
import androidx.compose.material.Scaffold
28+
import androidx.compose.material.Text
2929
import androidx.compose.runtime.Composable
30+
import androidx.compose.runtime.Providers
3031
import androidx.compose.runtime.remember
3132
import androidx.compose.ui.Modifier
3233
import androidx.compose.ui.focus.ExperimentalFocus
@@ -103,7 +104,7 @@ fun SignUpContent(
103104
)
104105

105106
Spacer(modifier = Modifier.preferredHeight(16.dp))
106-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
107+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
107108
Text(
108109
text = stringResource(id = R.string.terms_and_conditions),
109110
style = MaterialTheme.typography.caption
@@ -117,9 +118,7 @@ fun SignUpContent(
117118
enabled = emailState.isValid &&
118119
passwordState.isValid && confirmPasswordState.isValid
119120
) {
120-
Text(
121-
text = stringResource(id = R.string.create_account)
122-
)
121+
Text(text = stringResource(id = R.string.create_account))
123122
}
124123
}
125124
}

Diff for: ‎Jetsurvey/app/src/main/java/com/example/compose/jetsurvey/signinsignup/WelcomeScreen.kt

+13-14
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,30 @@ package com.example.compose.jetsurvey.signinsignup
1818

1919
import androidx.compose.animation.animate
2020
import androidx.compose.foundation.Image
21-
import androidx.compose.foundation.Text
2221
import androidx.compose.foundation.layout.Column
2322
import androidx.compose.foundation.layout.fillMaxSize
2423
import androidx.compose.foundation.layout.fillMaxWidth
2524
import androidx.compose.foundation.layout.offsetPx
2625
import androidx.compose.foundation.layout.padding
2726
import androidx.compose.foundation.layout.preferredHeight
2827
import androidx.compose.foundation.layout.wrapContentHeight
29-
import androidx.compose.material.AmbientEmphasisLevels
28+
import androidx.compose.material.AmbientContentAlpha
3029
import androidx.compose.material.Button
30+
import androidx.compose.material.ContentAlpha
3131
import androidx.compose.material.MaterialTheme
32-
import androidx.compose.material.ProvideEmphasis
3332
import androidx.compose.material.Surface
33+
import androidx.compose.material.Text
3434
import androidx.compose.runtime.Composable
35+
import androidx.compose.runtime.Providers
3536
import androidx.compose.runtime.getValue
3637
import androidx.compose.runtime.mutableStateOf
3738
import androidx.compose.runtime.remember
3839
import androidx.compose.runtime.setValue
3940
import androidx.compose.ui.Alignment
4041
import androidx.compose.ui.Modifier
4142
import androidx.compose.ui.layout.boundsInParent
42-
import androidx.compose.ui.onGloballyPositioned
43-
import androidx.compose.ui.onSizeChanged
43+
import androidx.compose.ui.layout.onGloballyPositioned
44+
import androidx.compose.ui.layout.onSizeChanged
4445
import androidx.compose.ui.platform.DensityAmbient
4546
import androidx.compose.ui.res.stringResource
4647
import androidx.compose.ui.res.vectorResource
@@ -113,14 +114,12 @@ private fun Branding(modifier: Modifier = Modifier) {
113114
modifier = modifier.wrapContentHeight(align = Alignment.CenterVertically)
114115
) {
115116
Logo(modifier = Modifier.align(Alignment.CenterHorizontally).padding(horizontal = 76.dp))
116-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.high) {
117-
Text(
118-
text = stringResource(id = R.string.app_tagline),
119-
style = MaterialTheme.typography.subtitle1,
120-
textAlign = TextAlign.Center,
121-
modifier = Modifier.padding(top = 24.dp).fillMaxWidth()
122-
)
123-
}
117+
Text(
118+
text = stringResource(id = R.string.app_tagline),
119+
style = MaterialTheme.typography.subtitle1,
120+
textAlign = TextAlign.Center,
121+
modifier = Modifier.padding(top = 24.dp).fillMaxWidth()
122+
)
124123
}
125124
}
126125

@@ -148,7 +147,7 @@ private fun SignInCreateAccount(
148147
) {
149148
val emailState = remember { EmailState() }
150149
Column(modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally) {
151-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
150+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
152151
Text(
153152
text = stringResource(id = R.string.sign_in_create_account),
154153
style = MaterialTheme.typography.subtitle2,

Diff for: ‎Jetsurvey/app/src/main/java/com/example/compose/jetsurvey/survey/SurveyQuestions.kt

+10-11
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package com.example.compose.jetsurvey.survey
1818

1919
import androidx.compose.foundation.BorderStroke
2020
import androidx.compose.foundation.ScrollableColumn
21-
import androidx.compose.foundation.Text
2221
import androidx.compose.foundation.background
2322
import androidx.compose.foundation.clickable
2423
import androidx.compose.foundation.layout.Arrangement
@@ -30,17 +29,19 @@ import androidx.compose.foundation.layout.fillMaxWidth
3029
import androidx.compose.foundation.layout.padding
3130
import androidx.compose.foundation.layout.preferredHeight
3231
import androidx.compose.foundation.selection.selectable
33-
import androidx.compose.material.AmbientEmphasisLevels
32+
import androidx.compose.material.AmbientContentAlpha
3433
import androidx.compose.material.Button
3534
import androidx.compose.material.Checkbox
3635
import androidx.compose.material.CheckboxConstants
36+
import androidx.compose.material.ContentAlpha
3737
import androidx.compose.material.MaterialTheme
38-
import androidx.compose.material.ProvideEmphasis
3938
import androidx.compose.material.RadioButton
4039
import androidx.compose.material.RadioButtonConstants
4140
import androidx.compose.material.Slider
4241
import androidx.compose.material.Surface
42+
import androidx.compose.material.Text
4343
import androidx.compose.runtime.Composable
44+
import androidx.compose.runtime.Providers
4445
import androidx.compose.runtime.getValue
4546
import androidx.compose.runtime.mutableStateOf
4647
import androidx.compose.runtime.remember
@@ -77,17 +78,15 @@ fun Question(
7778
shape = MaterialTheme.shapes.small
7879
)
7980
) {
80-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.high) {
81-
Text(
82-
text = stringResource(id = question.questionText),
83-
style = MaterialTheme.typography.subtitle1,
84-
modifier = Modifier.fillMaxWidth().padding(vertical = 24.dp, horizontal = 16.dp)
85-
)
86-
}
81+
Text(
82+
text = stringResource(id = question.questionText),
83+
style = MaterialTheme.typography.subtitle1,
84+
modifier = Modifier.fillMaxWidth().padding(vertical = 24.dp, horizontal = 16.dp)
85+
)
8786
}
8887
Spacer(modifier = Modifier.preferredHeight(24.dp))
8988
if (question.description != null) {
90-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
89+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
9190
Text(
9291
text = stringResource(id = question.description),
9392
style = MaterialTheme.typography.caption,

Diff for: ‎Jetsurvey/app/src/main/java/com/example/compose/jetsurvey/survey/SurveyScreen.kt

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.example.compose.jetsurvey.survey
1818

1919
import androidx.compose.foundation.ScrollableColumn
20-
import androidx.compose.foundation.Text
2120
import androidx.compose.foundation.layout.ConstraintLayout
2221
import androidx.compose.foundation.layout.ExperimentalLayout
2322
import androidx.compose.foundation.layout.Row
@@ -27,19 +26,21 @@ import androidx.compose.foundation.layout.fillMaxWidth
2726
import androidx.compose.foundation.layout.padding
2827
import androidx.compose.foundation.layout.preferredHeight
2928
import androidx.compose.foundation.layout.width
30-
import androidx.compose.material.AmbientEmphasisLevels
29+
import androidx.compose.material.AmbientContentAlpha
3130
import androidx.compose.material.Button
31+
import androidx.compose.material.ContentAlpha
3232
import androidx.compose.material.Icon
3333
import androidx.compose.material.IconButton
3434
import androidx.compose.material.LinearProgressIndicator
3535
import androidx.compose.material.MaterialTheme
3636
import androidx.compose.material.OutlinedButton
37-
import androidx.compose.material.ProvideEmphasis
3837
import androidx.compose.material.Scaffold
3938
import androidx.compose.material.Surface
39+
import androidx.compose.material.Text
4040
import androidx.compose.material.icons.Icons
4141
import androidx.compose.material.icons.filled.Close
4242
import androidx.compose.runtime.Composable
43+
import androidx.compose.runtime.Providers
4344
import androidx.compose.runtime.getValue
4445
import androidx.compose.runtime.remember
4546
import androidx.compose.runtime.savedinstancestate.savedInstanceState
@@ -191,7 +192,7 @@ private fun SurveyTopAppBar(
191192
}
192193
)
193194

194-
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
195+
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
195196
IconButton(
196197
onClick = onBackPressed,
197198
modifier = Modifier.padding(horizontal = 12.dp).constrainAs(button) {

Diff for: ‎Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object Versions {
2121
}
2222

2323
object Libs {
24-
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha15"
24+
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha16"
2525
const val jdkDesugar = "com.android.tools:desugar_jdk_libs:1.0.9"
2626

2727
const val junit = "junit:junit:4.13"
@@ -40,8 +40,8 @@ object Libs {
4040
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha01"
4141

4242
object Compose {
43-
const val snapshot = ""
44-
const val version = "1.0.0-alpha06"
43+
const val snapshot = "6953474"
44+
const val version = "1.0.0-SNAPSHOT"
4545

4646
@get:JvmStatic
4747
val snapshotUrl: String

0 commit comments

Comments
 (0)
Please sign in to comment.