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
[Crane] Updates to 7024175 snapshot
  • Loading branch information
Manuel Vivo committed Dec 11, 2020
commit 14f883f1b3487ba1ce010b9906847db2c398e912
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import androidx.compose.ui.test.SemanticsMatcher
import androidx.compose.ui.test.assertLabelEquals
import androidx.compose.ui.test.junit4.ComposeTestRule
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithLabel
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performScrollTo
import dagger.hilt.android.testing.HiltAndroidRule
Expand Down Expand Up @@ -69,16 +69,16 @@ class CalendarTest {

@Test
fun scrollsToTheBottom() {
composeTestRule.onNodeWithLabel("January 1").assertExists()
composeTestRule.onNodeWithLabel("December 31").performScrollTo().performClick()
composeTestRule.onNodeWithText("January 1").assertExists()
composeTestRule.onNodeWithText("December 31").performScrollTo().performClick()
assert(datesRepository.datesSelected.toString() == "Dec 31")
}

@Test
fun onDaySelected() {
composeTestRule.onNodeWithLabel("January 1").assertExists()
composeTestRule.onNodeWithLabel("January 2").assertExists().performClick()
composeTestRule.onNodeWithLabel("January 3").assertExists()
composeTestRule.onNodeWithText("January 1").assertExists()
composeTestRule.onNodeWithText("January 2").assertExists().performClick()
composeTestRule.onNodeWithText("January 3").assertExists()

val datesNoSelected = composeTestRule.onDateNodes(NoSelected)
datesNoSelected[0].assertLabelEquals("January 1")
Expand All @@ -89,13 +89,13 @@ class CalendarTest {

@Test
fun twoDaysSelected() {
composeTestRule.onNodeWithLabel("January 2").assertExists().performClick()
composeTestRule.onNodeWithText("January 2").assertExists().performClick()

val datesNoSelectedOneClick = composeTestRule.onDateNodes(NoSelected)
datesNoSelectedOneClick[0].assertLabelEquals("January 1")
datesNoSelectedOneClick[1].assertLabelEquals("January 3")

composeTestRule.onNodeWithLabel("January 4").assertExists().performClick()
composeTestRule.onNodeWithText("January 4").assertExists().performClick()

composeTestRule.onDateNode(FirstDay).assertLabelEquals("January 2")
composeTestRule.onDateNode(Selected).assertLabelEquals("January 3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.preferredWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyColumnFor
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Divider
Expand Down Expand Up @@ -62,16 +63,19 @@ fun ExploreSection(
style = MaterialTheme.typography.caption.copy(color = crane_caption)
)
Spacer(Modifier.preferredHeight(8.dp))
LazyColumnFor(
LazyColumn(
modifier = Modifier.weight(1f),
items = exploreList
) { item ->
ExploreItem(
modifier = Modifier.fillParentMaxWidth(),
item = item,
onItemClicked = onItemClicked
)
Divider(color = crane_divider_color)
) {
items(exploreList) { exploreItem ->
Column(Modifier.fillParentMaxWidth()) {
ExploreItem(
modifier = Modifier.fillParentMaxWidth(),
item = exploreItem,
onItemClicked = onItemClicked
)
Divider(color = crane_divider_color)
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.SemanticsPropertyKey
import androidx.compose.ui.semantics.SemanticsPropertyReceiver
import androidx.compose.ui.semantics.accessibilityLabel
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -137,7 +137,7 @@ private fun Week(
day,
onDayClicked,
Modifier.semantics {
accessibilityLabel = "${month.name} ${day.value}"
contentDescription = "${month.name} ${day.value}"
dayStatusProperty = day.status
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.Button
import androidx.compose.material.ButtonConstants
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -186,7 +186,7 @@ private fun ZoomControls(
private fun ZoomButton(text: String, onClick: () -> Unit) {
Button(
modifier = Modifier.padding(8.dp),
colors = ButtonConstants.defaultButtonColors(
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.onPrimary,
contentColor = MaterialTheme.colors.primary
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Libs {
}

object Accompanist {
private const val version = "0.4.1.compose-7001724-SNAPSHOT"
private const val version = "0.4.1.compose-7024175-SNAPSHOT"
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
}

Expand All @@ -49,7 +49,7 @@ object Libs {

object AndroidX {
object Compose {
const val snapshot = "7001724"
const val snapshot = "7024175"
private const val version = "1.0.0-SNAPSHOT"

const val runtime = "androidx.compose.runtime:runtime:$version"
Expand Down