Skip to content

Commit

Permalink
Merge branch 'dev_alpha07' into dev_alpha07
Browse files Browse the repository at this point in the history
  • Loading branch information
yrezgui authored Nov 11, 2020
2 parents 0295dce + a68a925 commit 00a472b
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 40 deletions.
5 changes: 5 additions & 0 deletions Rally/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ android {
kotlinCompilerExtensionVersion Libs.AndroidX.Compose.version
}

packagingOptions {
exclude "META-INF/licenses/**"
exclude "META-INF/AL2.0"
exclude "META-INF/LGPL2.1"
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.test.onRoot
import androidx.compose.ui.unit.dp
import androidx.test.filters.SdkSuppress
import androidx.ui.test.createComposeRule
import androidx.ui.test.onRoot
import com.example.compose.rally.ui.components.AnimatedCircle
import com.example.compose.rally.ui.theme.RallyTheme
import org.junit.Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.compose.ui.graphics.asAndroidBitmap
import androidx.compose.ui.test.SemanticsNodeInteraction
import androidx.compose.ui.test.captureToImage
import androidx.test.platform.app.InstrumentationRegistry
import androidx.ui.test.SemanticsNodeInteraction
import androidx.ui.test.captureToBitmap
import java.io.FileOutputStream

/**
Expand All @@ -39,7 +40,7 @@ fun assertScreenshotMatchesGolden(
goldenName: String,
node: SemanticsNodeInteraction
) {
val bitmap = node.captureToBitmap()
val bitmap = node.captureToImage().asAndroidBitmap()

// Save screenshot to file for debugging
saveScreenshot(goldenName + System.currentTimeMillis().toString(), bitmap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.example.compose.rally.ui.components

import androidx.compose.foundation.Text
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -26,14 +25,16 @@ 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.material.AmbientEmphasisLevels
import androidx.compose.material.AmbientContentAlpha
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Providers
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -89,10 +90,8 @@ private fun BaseRow(
)
Spacer(Modifier.preferredWidth(12.dp))
Column(Modifier) {
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.high) {
Text(text = title, style = typography.body1)
}
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
Text(text = title, style = typography.body1)
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Text(text = subtitle, style = typography.subtitle1)
}
}
Expand All @@ -115,7 +114,7 @@ private fun BaseRow(
}
Spacer(Modifier.preferredWidth(16.dp))

ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Icon(
asset = Icons.Filled.ChevronRight,
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.example.compose.rally.ui.components

import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
Expand All @@ -26,6 +25,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package com.example.compose.rally.ui.components

import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.AlertDialog
import androidx.compose.material.Divider
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.animation.animate
import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -31,6 +30,7 @@ import androidx.compose.foundation.selection.selectable
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.ripple.RippleIndication
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.example.compose.rally.ui.overview

import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.Text
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -27,12 +26,11 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.Card
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Sort
Expand Down Expand Up @@ -102,13 +100,11 @@ private fun AlertHeader(onClickSeeAll: () -> Unit) {
modifier = Modifier.padding(RallyDefaultPadding).fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween
) {
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.high) {
Text(
text = "Alerts",
style = MaterialTheme.typography.subtitle2,
modifier = Modifier.align(Alignment.CenterVertically)
)
}
Text(
text = "Alerts",
style = MaterialTheme.typography.subtitle2,
modifier = Modifier.align(Alignment.CenterVertically)
)
TextButton(
onClick = onClickSeeAll,
contentPadding = PaddingValues(0.dp),
Expand All @@ -128,18 +124,16 @@ private fun AlertItem(message: String) {
modifier = Modifier.padding(RallyDefaultPadding),
horizontalArrangement = Arrangement.SpaceBetween
) {
ProvideEmphasis(emphasis = AmbientEmphasisLevels.current.high) {
Text(
style = MaterialTheme.typography.body2,
modifier = Modifier.weight(1f),
text = message
)
IconButton(
onClick = {},
modifier = Modifier.align(Alignment.Top)
) {
Icon(Icons.Filled.Sort)
}
Text(
style = MaterialTheme.typography.body2,
modifier = Modifier.weight(1f),
text = message
)
IconButton(
onClick = {},
modifier = Modifier.align(Alignment.Top)
) {
Icon(Icons.Filled.Sort)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object Versions {
}

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

const val junit = "junit:junit:4.13"
Expand All @@ -47,8 +47,8 @@ object Libs {
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha02"

object Compose {
const val snapshot = ""
const val version = "1.0.0-alpha06"
const val snapshot = "6964664"
const val version = "1.0.0-SNAPSHOT"

const val core = "androidx.compose.ui:ui:$version"
const val foundation = "androidx.compose.foundation:foundation:$version"
Expand Down

0 comments on commit 00a472b

Please sign in to comment.