Skip to content

Commit 50b2502

Browse files
committedFeb 23, 2021
[Jetsurvey] Update to beta01 snapshot
1 parent 66fa1da commit 50b2502

File tree

10 files changed

+87
-127
lines changed

10 files changed

+87
-127
lines changed
 

‎Jetsurvey/app/build.gradle

-10
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,4 @@ dependencies {
113113
implementation Libs.AndroidX.Compose.runtimeLivedata
114114

115115
implementation Libs.Accompanist.coil
116-
117-
// FIXME: only needed for Compose alpha12
118-
androidTestImplementation Libs.AndroidX.Activity.activityCompose
119-
120-
androidTestImplementation Libs.junit
121-
androidTestImplementation Libs.AndroidX.Test.core
122-
androidTestImplementation Libs.AndroidX.Test.espressoCore
123-
androidTestImplementation Libs.AndroidX.Test.rules
124-
androidTestImplementation Libs.AndroidX.Test.Ext.junit
125-
androidTestImplementation Libs.AndroidX.Compose.uiTest
126116
}

‎Jetsurvey/app/src/androidTest/java/com/example/compose/jetsurvey/ExampleInstrumentedTest.kt

-38
This file was deleted.

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import androidx.compose.foundation.layout.Column
2121
import androidx.compose.foundation.layout.Spacer
2222
import androidx.compose.foundation.layout.fillMaxSize
2323
import androidx.compose.foundation.layout.fillMaxWidth
24+
import androidx.compose.foundation.layout.height
2425
import androidx.compose.foundation.layout.padding
25-
import androidx.compose.foundation.layout.preferredHeight
2626
import androidx.compose.foundation.layout.wrapContentHeight
2727
import androidx.compose.material.Button
2828
import androidx.compose.material.ExperimentalMaterialApi
@@ -72,7 +72,7 @@ fun SignIn(onNavigationEvent: (SignInEvent) -> Unit) {
7272
onBackPressed = { onNavigationEvent(SignInEvent.NavigateBack) }
7373
)
7474
},
75-
bodyContent = {
75+
content = {
7676
SignInSignUpScreen(
7777
onSignedInAsGuest = { onNavigationEvent(SignInEvent.SignInAsGuest) },
7878
modifier = Modifier.fillMaxWidth()
@@ -83,7 +83,7 @@ fun SignIn(onNavigationEvent: (SignInEvent) -> Unit) {
8383
onNavigationEvent(SignInEvent.SignIn(email, password))
8484
}
8585
)
86-
Spacer(modifier = Modifier.preferredHeight(16.dp))
86+
Spacer(modifier = Modifier.height(16.dp))
8787
TextButton(
8888
onClick = {
8989
scope.launch {
@@ -120,7 +120,7 @@ fun SignInContent(
120120
val emailState = remember { EmailState() }
121121
Email(emailState, onImeAction = { focusRequester.requestFocus() })
122122

123-
Spacer(modifier = Modifier.preferredHeight(16.dp))
123+
Spacer(modifier = Modifier.height(16.dp))
124124

125125
val passwordState = remember { PasswordState() }
126126
Password(
@@ -129,7 +129,7 @@ fun SignInContent(
129129
modifier = Modifier.focusRequester(focusRequester),
130130
onImeAction = { onSignInSubmitted(emailState.text, passwordState.text) }
131131
)
132-
Spacer(modifier = Modifier.preferredHeight(16.dp))
132+
Spacer(modifier = Modifier.height(16.dp))
133133
Button(
134134
onClick = { onSignInSubmitted(emailState.text, passwordState.text) },
135135
modifier = Modifier
@@ -156,7 +156,7 @@ fun ErrorSnackbar(
156156
snackbar = { data ->
157157
Snackbar(
158158
modifier = Modifier.padding(16.dp),
159-
text = {
159+
content = {
160160
Text(
161161
text = data.message,
162162
style = MaterialTheme.typography.body2

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

+12-19
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import androidx.compose.foundation.layout.Row
2222
import androidx.compose.foundation.layout.Spacer
2323
import androidx.compose.foundation.layout.fillMaxSize
2424
import androidx.compose.foundation.layout.fillMaxWidth
25+
import androidx.compose.foundation.layout.height
2526
import androidx.compose.foundation.layout.padding
26-
import androidx.compose.foundation.layout.preferredHeight
27-
import androidx.compose.foundation.layout.preferredWidth
27+
import androidx.compose.foundation.layout.width
2828
import androidx.compose.foundation.layout.wrapContentSize
2929
import androidx.compose.foundation.lazy.LazyColumn
3030
import androidx.compose.foundation.text.KeyboardActions
@@ -45,15 +45,14 @@ import androidx.compose.material.icons.filled.ChevronLeft
4545
import androidx.compose.material.icons.filled.Visibility
4646
import androidx.compose.material.icons.filled.VisibilityOff
4747
import androidx.compose.runtime.Composable
48-
import androidx.compose.runtime.Providers
48+
import androidx.compose.runtime.CompositionLocalProvider
4949
import androidx.compose.runtime.mutableStateOf
5050
import androidx.compose.runtime.remember
5151
import androidx.compose.ui.Alignment
5252
import androidx.compose.ui.Modifier
5353
import androidx.compose.ui.focus.FocusState
5454
import androidx.compose.ui.focus.onFocusChanged
5555
import androidx.compose.ui.res.stringResource
56-
import androidx.compose.ui.text.SoftwareKeyboardController
5756
import androidx.compose.ui.text.input.ImeAction
5857
import androidx.compose.ui.text.input.PasswordVisualTransformation
5958
import androidx.compose.ui.text.input.VisualTransformation
@@ -70,15 +69,15 @@ fun SignInSignUpScreen(
7069
) {
7170
LazyColumn(modifier = modifier) {
7271
item {
73-
Spacer(modifier = Modifier.preferredHeight(44.dp))
72+
Spacer(modifier = Modifier.height(44.dp))
7473
Box(
7574
modifier = Modifier
7675
.fillMaxWidth()
7776
.padding(horizontal = 20.dp)
7877
) {
7978
content()
8079
}
81-
Spacer(modifier = Modifier.preferredHeight(16.dp))
80+
Spacer(modifier = Modifier.height(16.dp))
8281
OrSignInAsGuest(
8382
onSignedInAsGuest = onSignedInAsGuest,
8483
modifier = Modifier
@@ -111,7 +110,7 @@ fun SignInSignUpTopAppBar(topAppBarText: String, onBackPressed: () -> Unit) {
111110
},
112111
// We need to balance the navigation icon, so we add a spacer.
113112
actions = {
114-
Spacer(modifier = Modifier.preferredWidth(68.dp))
113+
Spacer(modifier = Modifier.width(68.dp))
115114
},
116115
backgroundColor = MaterialTheme.colors.surface,
117116
elevation = 0.dp
@@ -124,14 +123,13 @@ fun Email(
124123
imeAction: ImeAction = ImeAction.Next,
125124
onImeAction: () -> Unit = {}
126125
) {
127-
lateinit var softwareKeyboardController: SoftwareKeyboardController
128126
OutlinedTextField(
129127
value = emailState.text,
130128
onValueChange = {
131129
emailState.text = it
132130
},
133131
label = {
134-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
132+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
135133
Text(
136134
text = stringResource(id = R.string.email),
137135
style = MaterialTheme.typography.body2
@@ -148,13 +146,11 @@ fun Email(
148146
}
149147
},
150148
textStyle = MaterialTheme.typography.body2,
151-
isErrorValue = emailState.showErrors(),
152-
onTextInputStarted = { softwareKeyboardController = it },
149+
isError = emailState.showErrors(),
153150
keyboardOptions = KeyboardOptions.Default.copy(imeAction = imeAction),
154151
keyboardActions = KeyboardActions(
155152
onDone = {
156153
onImeAction()
157-
softwareKeyboardController.hideSoftwareKeyboard()
158154
}
159155
)
160156
)
@@ -170,7 +166,6 @@ fun Password(
170166
imeAction: ImeAction = ImeAction.Done,
171167
onImeAction: () -> Unit = {}
172168
) {
173-
lateinit var softwareKeyboardController: SoftwareKeyboardController
174169
val showPassword = remember { mutableStateOf(false) }
175170
OutlinedTextField(
176171
value = passwordState.text,
@@ -189,7 +184,7 @@ fun Password(
189184
},
190185
textStyle = MaterialTheme.typography.body2,
191186
label = {
192-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
187+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
193188
Text(
194189
text = label,
195190
style = MaterialTheme.typography.body2
@@ -218,13 +213,11 @@ fun Password(
218213
} else {
219214
PasswordVisualTransformation()
220215
},
221-
isErrorValue = passwordState.showErrors(),
222-
onTextInputStarted = { softwareKeyboardController = it },
216+
isError = passwordState.showErrors(),
223217
keyboardOptions = KeyboardOptions.Default.copy(imeAction = imeAction),
224218
keyboardActions = KeyboardActions(
225219
onDone = {
226220
onImeAction()
227-
softwareKeyboardController.hideSoftwareKeyboard()
228221
}
229222
)
230223
)
@@ -238,7 +231,7 @@ fun Password(
238231
@Composable
239232
fun TextFieldError(textError: String) {
240233
Row(modifier = Modifier.fillMaxWidth()) {
241-
Spacer(modifier = Modifier.preferredWidth(16.dp))
234+
Spacer(modifier = Modifier.width(16.dp))
242235
Text(
243236
text = textError,
244237
modifier = Modifier.fillMaxWidth(),
@@ -257,7 +250,7 @@ fun OrSignInAsGuest(
257250
horizontalAlignment = Alignment.CenterHorizontally
258251
) {
259252
Surface {
260-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
253+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
261254
Text(
262255
text = stringResource(id = R.string.or),
263256
style = MaterialTheme.typography.subtitle2

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ package com.example.compose.jetsurvey.signinsignup
1919
import androidx.compose.foundation.layout.Column
2020
import androidx.compose.foundation.layout.Spacer
2121
import androidx.compose.foundation.layout.fillMaxWidth
22-
import androidx.compose.foundation.layout.preferredHeight
22+
import androidx.compose.foundation.layout.height
2323
import androidx.compose.material.Button
2424
import androidx.compose.material.ContentAlpha
2525
import androidx.compose.material.LocalContentAlpha
2626
import androidx.compose.material.MaterialTheme
2727
import androidx.compose.material.Scaffold
2828
import androidx.compose.material.Text
2929
import androidx.compose.runtime.Composable
30-
import androidx.compose.runtime.Providers
30+
import androidx.compose.runtime.CompositionLocalProvider
3131
import androidx.compose.runtime.remember
3232
import androidx.compose.ui.Modifier
3333
import androidx.compose.ui.focus.FocusRequester
@@ -55,7 +55,7 @@ fun SignUp(onNavigationEvent: (SignUpEvent) -> Unit) {
5555
onBackPressed = { onNavigationEvent(SignUpEvent.NavigateBack) }
5656
)
5757
},
58-
bodyContent = {
58+
content = {
5959
SignInSignUpScreen(
6060
onSignedInAsGuest = { onNavigationEvent(SignUpEvent.SignInAsGuest) },
6161
modifier = Modifier.fillMaxWidth()
@@ -82,7 +82,7 @@ fun SignUpContent(
8282
val emailState = remember { EmailState() }
8383
Email(emailState, onImeAction = { passwordFocusRequest.requestFocus() })
8484

85-
Spacer(modifier = Modifier.preferredHeight(16.dp))
85+
Spacer(modifier = Modifier.height(16.dp))
8686
val passwordState = remember { PasswordState() }
8787
Password(
8888
label = stringResource(id = R.string.password),
@@ -92,7 +92,7 @@ fun SignUpContent(
9292
modifier = Modifier.focusRequester(passwordFocusRequest)
9393
)
9494

95-
Spacer(modifier = Modifier.preferredHeight(16.dp))
95+
Spacer(modifier = Modifier.height(16.dp))
9696
val confirmPasswordState = remember { ConfirmPasswordState(passwordState = passwordState) }
9797
Password(
9898
label = stringResource(id = R.string.confirm_password),
@@ -101,15 +101,15 @@ fun SignUpContent(
101101
modifier = Modifier.focusRequester(confirmationPasswordFocusRequest)
102102
)
103103

104-
Spacer(modifier = Modifier.preferredHeight(16.dp))
105-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
104+
Spacer(modifier = Modifier.height(16.dp))
105+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
106106
Text(
107107
text = stringResource(id = R.string.terms_and_conditions),
108108
style = MaterialTheme.typography.caption
109109
)
110110
}
111111

112-
Spacer(modifier = Modifier.preferredHeight(16.dp))
112+
Spacer(modifier = Modifier.height(16.dp))
113113
Button(
114114
onClick = { onSignUpSubmitted(emailState.text, passwordState.text) },
115115
modifier = Modifier.fillMaxWidth(),

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import androidx.compose.foundation.Image
2121
import androidx.compose.foundation.layout.Column
2222
import androidx.compose.foundation.layout.fillMaxSize
2323
import androidx.compose.foundation.layout.fillMaxWidth
24+
import androidx.compose.foundation.layout.height
2425
import androidx.compose.foundation.layout.offset
2526
import androidx.compose.foundation.layout.padding
26-
import androidx.compose.foundation.layout.preferredHeight
2727
import androidx.compose.foundation.layout.wrapContentHeight
2828
import androidx.compose.material.Button
2929
import androidx.compose.material.ContentAlpha
@@ -32,7 +32,7 @@ import androidx.compose.material.MaterialTheme
3232
import androidx.compose.material.Surface
3333
import androidx.compose.material.Text
3434
import androidx.compose.runtime.Composable
35-
import androidx.compose.runtime.Providers
35+
import androidx.compose.runtime.CompositionLocalProvider
3636
import androidx.compose.runtime.getValue
3737
import androidx.compose.runtime.mutableStateOf
3838
import androidx.compose.runtime.remember
@@ -88,7 +88,7 @@ fun WelcomeScreen(onEvent: (WelcomeEvent) -> Unit) {
8888
.weight(1f)
8989
.onGloballyPositioned {
9090
if (brandingBottom == 0f) {
91-
brandingBottom = it.boundsInParent.bottom
91+
brandingBottom = it.boundsInParent().bottom
9292
}
9393
}
9494
)
@@ -110,7 +110,7 @@ private fun Modifier.brandingPreferredHeight(
110110
return if (!showBranding) {
111111
this
112112
.wrapContentHeight(unbounded = true)
113-
.preferredHeight(heightDp)
113+
.height(heightDp)
114114
} else {
115115
this
116116
}
@@ -162,7 +162,7 @@ private fun SignInCreateAccount(
162162
) {
163163
val emailState = remember { EmailState() }
164164
Column(modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally) {
165-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
165+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
166166
Text(
167167
text = stringResource(id = R.string.sign_in_create_account),
168168
style = MaterialTheme.typography.subtitle2,

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import androidx.compose.foundation.layout.Row
2828
import androidx.compose.foundation.layout.Spacer
2929
import androidx.compose.foundation.layout.fillMaxSize
3030
import androidx.compose.foundation.layout.fillMaxWidth
31+
import androidx.compose.foundation.layout.height
3132
import androidx.compose.foundation.layout.padding
32-
import androidx.compose.foundation.layout.preferredHeight
3333
import androidx.compose.foundation.layout.width
3434
import androidx.compose.foundation.layout.wrapContentSize
3535
import androidx.compose.foundation.lazy.LazyColumn
@@ -51,7 +51,7 @@ import androidx.compose.material.icons.Icons
5151
import androidx.compose.material.icons.filled.AddAPhoto
5252
import androidx.compose.material.icons.filled.SwapHoriz
5353
import androidx.compose.runtime.Composable
54-
import androidx.compose.runtime.Providers
54+
import androidx.compose.runtime.CompositionLocalProvider
5555
import androidx.compose.runtime.getValue
5656
import androidx.compose.runtime.mutableStateOf
5757
import androidx.compose.runtime.remember
@@ -79,7 +79,7 @@ fun Question(
7979
contentPadding = PaddingValues(start = 20.dp, end = 20.dp)
8080
) {
8181
item {
82-
Spacer(modifier = Modifier.preferredHeight(44.dp))
82+
Spacer(modifier = Modifier.height(44.dp))
8383
val backgroundColor = if (MaterialTheme.colors.isLight) {
8484
MaterialTheme.colors.onSurface.copy(alpha = 0.04f)
8585
} else {
@@ -101,9 +101,9 @@ fun Question(
101101
.padding(vertical = 24.dp, horizontal = 16.dp)
102102
)
103103
}
104-
Spacer(modifier = Modifier.preferredHeight(24.dp))
104+
Spacer(modifier = Modifier.height(24.dp))
105105
if (question.description != null) {
106-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
106+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
107107
Text(
108108
text = stringResource(id = question.description),
109109
style = MaterialTheme.typography.caption,

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

+38-31
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

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

19-
import androidx.compose.foundation.layout.ConstraintLayout
20-
import androidx.compose.foundation.layout.ExperimentalLayout
19+
import androidx.compose.foundation.layout.Box
20+
import androidx.compose.foundation.layout.Column
2121
import androidx.compose.foundation.layout.Row
2222
import androidx.compose.foundation.layout.Spacer
2323
import androidx.compose.foundation.layout.fillMaxSize
2424
import androidx.compose.foundation.layout.fillMaxWidth
25+
import androidx.compose.foundation.layout.height
2526
import androidx.compose.foundation.layout.padding
26-
import androidx.compose.foundation.layout.preferredHeight
2727
import androidx.compose.foundation.layout.width
2828
import androidx.compose.foundation.lazy.LazyColumn
2929
import androidx.compose.material.Button
@@ -40,15 +40,18 @@ 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
43+
import androidx.compose.runtime.CompositionLocalProvider
4444
import androidx.compose.runtime.remember
45+
import androidx.compose.ui.Alignment
4546
import androidx.compose.ui.Modifier
4647
import androidx.compose.ui.res.stringResource
4748
import androidx.compose.ui.text.buildAnnotatedString
4849
import androidx.compose.ui.text.font.FontWeight
4950
import androidx.compose.ui.text.withStyle
51+
import androidx.compose.ui.tooling.preview.Preview
5052
import androidx.compose.ui.unit.dp
5153
import com.example.compose.jetsurvey.R
54+
import com.example.compose.jetsurvey.theme.JetsurveyTheme
5255
import com.example.compose.jetsurvey.theme.progressIndicatorBackground
5356

5457
@Composable
@@ -71,7 +74,7 @@ fun SurveyQuestionsScreen(
7174
onBackPressed = onBackPressed
7275
)
7376
},
74-
bodyContent = { innerPadding ->
77+
content = { innerPadding ->
7578
Question(
7679
question = questionState.question,
7780
answer = questionState.answer,
@@ -104,7 +107,7 @@ fun SurveyResultScreen(
104107
) {
105108
Surface(modifier = Modifier.fillMaxSize()) {
106109
Scaffold(
107-
bodyContent = { innerPadding ->
110+
content = { innerPadding ->
108111
val modifier = Modifier.padding(innerPadding)
109112
SurveyResult(result = result, modifier = modifier)
110113
},
@@ -126,7 +129,7 @@ fun SurveyResultScreen(
126129
private fun SurveyResult(result: SurveyState.Result, modifier: Modifier = Modifier) {
127130
LazyColumn(modifier = modifier.fillMaxSize()) {
128131
item {
129-
Spacer(modifier = Modifier.preferredHeight(44.dp))
132+
Spacer(modifier = Modifier.height(44.dp))
130133
Text(
131134
text = result.surveyResult.library,
132135
style = MaterialTheme.typography.h3,
@@ -174,43 +177,47 @@ private fun TopAppBarTitle(
174177
)
175178
}
176179

177-
@Suppress("DEPRECATION") // ConstraintLayout
178-
@OptIn(ExperimentalLayout::class)
180+
@Preview
181+
@Composable
182+
fun TAPPreview() {
183+
JetsurveyTheme {
184+
SurveyTopAppBar(questionIndex = 3, totalQuestionsCount = 1, onBackPressed = { })
185+
}
186+
}
187+
179188
@Composable
180189
private fun SurveyTopAppBar(
181190
questionIndex: Int,
182191
totalQuestionsCount: Int,
183192
onBackPressed: () -> Unit
184193
) {
185-
ConstraintLayout(modifier = Modifier.fillMaxWidth()) {
186-
val (button, text, progress) = createRefs()
187-
TopAppBarTitle(
188-
questionIndex = questionIndex,
189-
totalQuestionsCount = totalQuestionsCount,
190-
modifier = Modifier
191-
.padding(vertical = 20.dp)
192-
.constrainAs(text) { centerHorizontallyTo(parent) }
193-
)
194-
195-
Providers(LocalContentAlpha provides ContentAlpha.medium) {
196-
IconButton(
197-
onClick = onBackPressed,
194+
Column(modifier = Modifier.fillMaxWidth()) {
195+
Box(modifier = Modifier.fillMaxWidth()) {
196+
TopAppBarTitle(
197+
questionIndex = questionIndex,
198+
totalQuestionsCount = totalQuestionsCount,
198199
modifier = Modifier
199-
.padding(horizontal = 12.dp)
200-
.constrainAs(button) { end.linkTo(parent.end) }
201-
) {
202-
Icon(Icons.Filled.Close, contentDescription = stringResource(id = R.string.close))
200+
.padding(vertical = 20.dp)
201+
.align(Alignment.Center)
202+
)
203+
204+
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
205+
IconButton(
206+
onClick = onBackPressed,
207+
modifier = Modifier.padding(horizontal = 12.dp)
208+
) {
209+
Icon(
210+
Icons.Filled.Close,
211+
contentDescription = stringResource(id = R.string.close)
212+
)
213+
}
203214
}
204215
}
205-
206216
LinearProgressIndicator(
207217
progress = (questionIndex + 1) / totalQuestionsCount.toFloat(),
208218
modifier = Modifier
209219
.fillMaxWidth()
210-
.padding(horizontal = 20.dp)
211-
.constrainAs(progress) {
212-
bottom.linkTo(text.bottom)
213-
},
220+
.padding(horizontal = 20.dp),
214221
backgroundColor = MaterialTheme.colors.progressIndicatorBackground
215222
)
216223
}

‎Jetsurvey/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ subprojects {
4141
if (Libs.AndroidX.Compose.version.endsWith('SNAPSHOT')) {
4242
maven { url Libs.AndroidX.Compose.snapshotUrl }
4343
}
44+
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
4445
}
4546

4647
apply plugin: 'com.diffplug.spotless'
@@ -71,4 +72,11 @@ subprojects {
7172
jvmTarget = "1.8"
7273
}
7374
}
75+
configurations.configureEach {
76+
resolutionStrategy.eachDependency { details ->
77+
if (details.requested.group.startsWith('androidx.compose')) {
78+
details.useVersion Libs.AndroidX.Compose.version
79+
}
80+
}
81+
}
7482
}

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

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

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

2727
const val junit = "junit:junit:4.13"
2828

2929
const val material = "com.google.android.material:material:1.1.0"
3030

3131
object Accompanist {
32-
private const val version = "0.5.1"
32+
private const val version = "0.5.2.compose-7141639-SNAPSHOT"
3333
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
3434
}
3535

@@ -58,12 +58,12 @@ object Libs {
5858
}
5959

6060
object Activity {
61-
const val activityCompose = "androidx.activity:activity-compose:1.3.0-alpha02"
61+
const val activityCompose = "androidx.activity:activity-compose:1.3.0-SNAPSHOT"
6262
}
6363

6464
object Compose {
65-
const val snapshot = ""
66-
const val version = "1.0.0-alpha12"
65+
const val snapshot = "7141639"
66+
const val version = "1.0.0-SNAPSHOT"
6767

6868
@get:JvmStatic
6969
val snapshotUrl: String

0 commit comments

Comments
 (0)
Please sign in to comment.