Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
da7ca9d
[Jetsnack] Add interaction to cart.
JolandaVerhoef Oct 27, 2020
be889b9
[Jetsnack] Animate snack count in cart.
JolandaVerhoef Oct 27, 2020
34ff388
[Jetsnack] Apply spotless fixes
JolandaVerhoef Oct 27, 2020
1cb1501
[Jetsnack] Fix review comments
JolandaVerhoef Oct 29, 2020
047af3e
Merge pull request #260 from android/jv/js_cart_state_flow
JolandaVerhoef Oct 29, 2020
4354d04
[Jetsurvey] Styling the questions progress indicator
florina-muntenescu Oct 28, 2020
d75e4c1
[Jetsurvey] Styling Single and Multiple choice questions
florina-muntenescu Oct 31, 2020
77e548d
[Jetsurvey] Adding question description
florina-muntenescu Oct 31, 2020
8cec984
[Jetsurvey] Setting correct border and background colors
florina-muntenescu Nov 2, 2020
13d04f3
[Jetsurvey] Make the entire Row clickable
florina-muntenescu Nov 2, 2020
b2b8816
[Jetsurvey] Adding end padding to description
florina-muntenescu Nov 4, 2020
cc48218
Merge pull request #265 from android/fm/jetsurvey_redesign2
florina-muntenescu Nov 4, 2020
2e132b5
[Jetsurvey] Update to 6953474 snapshot
florina-muntenescu Nov 6, 2020
c87772e
[Owl] Update to snapshot 6953474 & Accompanist Insets.
nickbutcher Nov 6, 2020
b88faed
[Jetsurvey] Removing ContentAlpha.high
florina-muntenescu Nov 6, 2020
5a6895e
Merge pull request #270 from android/nb/owl_alpha07
nickbutcher Nov 6, 2020
f05a667
[Jetchat] Update to snapshot 6953474
JoseAlcerreca Nov 6, 2020
3c14527
[Jetsurvey] Removing unneeded compiler args
florina-muntenescu Nov 6, 2020
308a6ca
[Jetsnack] Update to snapshot 6953474
JolandaVerhoef Nov 6, 2020
b4e0386
Some fixes
JoseAlcerreca Nov 6, 2020
a541a2d
Merge branch 'dev_alpha07' of github.com:android/compose-samples into…
JoseAlcerreca Nov 6, 2020
38877e0
[Rally] Update to snapshot 6953474
JoseAlcerreca Nov 6, 2020
4f6c460
Fixes tests
JoseAlcerreca Nov 6, 2020
d5d46ad
Fixes tests and text field in dark theme
JoseAlcerreca Nov 6, 2020
69126da
Merge pull request #269 from android/fm/jetsurvey_alpha07
florina-muntenescu Nov 6, 2020
b5ad9bf
[Jetsurvey] Take a selfie
florina-muntenescu Nov 3, 2020
b189bf6
[Jetsurvey] 2nd attempt to camera
florina-muntenescu Nov 4, 2020
1bb7948
[Jetsurvey] Saving the image in the uri
florina-muntenescu Nov 6, 2020
f5b360d
[Jetsurvey] Saving the image cleaned up
florina-muntenescu Nov 8, 2020
8c39a94
[Jetsurvey] Updating the take a photo UI
florina-muntenescu Nov 8, 2020
afde277
Update CONTRIBUTING.md
nickbutcher Nov 9, 2020
05521d4
Merge pull request #277 from android/nb/contrib
nickbutcher Nov 9, 2020
ba9954e
[Jetsurvey] Rebase issues
florina-muntenescu Nov 9, 2020
65d752a
[Jetsnack] Fix review comments
JolandaVerhoef Nov 9, 2020
c83c3cf
Merge branch 'dev_alpha07' into jv/js_alpha07
JolandaVerhoef Nov 9, 2020
44b1708
[Jetsurvey] Fixing the way the state is updated when taking a photo
florina-muntenescu Nov 9, 2020
0732eba
[Jetsurvey] Handling the photo uri creation in a different class
florina-muntenescu Nov 9, 2020
0937e24
[Jetcaster] Update to Compose alpha07 snapshot (#278)
chrisbanes Nov 9, 2020
4dcdb9b
[JetNews] bump to alpha07
yrezgui Nov 9, 2020
193caa8
[JetNews] Update imports (alpha07)
yrezgui Nov 9, 2020
b0e28ed
[JetNews] Rearrange imports (alpha07)
yrezgui Nov 9, 2020
24e7bf6
[JetNews] Update test imports (alpha07)
yrezgui Nov 9, 2020
40a4194
[Jetsnack] Update to snapshot 6961312
JolandaVerhoef Nov 10, 2020
e95b96b
[Jetsurvey] Updating to 6961312 snapshot and addressing review comments
florina-muntenescu Nov 10, 2020
b6ed842
[JetNews] Update spanshot to 6953474 (alpha07)
yrezgui Nov 10, 2020
d5cc734
Merge branch 'dev_alpha07' into jv/js_alpha07
JolandaVerhoef Nov 10, 2020
cf59158
[Jetsurvey] Adding the camera feature only for devices 29+
florina-muntenescu Nov 10, 2020
8a44a0b
Merge pull request #279 from android/fm/camera
florina-muntenescu Nov 10, 2020
d0ab6f3
[JetNews] Remove ContentAlpha.high
yrezgui Nov 10, 2020
4dc2d50
Updates to 6964664
JoseAlcerreca Nov 11, 2020
e955700
Updates snapshot to 6964664
JoseAlcerreca Nov 11, 2020
f5e0219
[Jetsnack] Update to snapshot 6964664
JolandaVerhoef Nov 11, 2020
c40635d
Merge branch 'dev_alpha07' into jv/js_alpha07
JolandaVerhoef Nov 11, 2020
01c0804
Merge branch 'dev_alpha07' into dev_alpha07
yrezgui Nov 11, 2020
6fcd168
[Jetsnack] Fix review comment
JolandaVerhoef Nov 11, 2020
7ea8d53
Merge pull request #271 from android/jv/js_alpha07
JolandaVerhoef Nov 11, 2020
9a5d45f
Merge pull request #272 from JoseAlcerreca/jetchat_alpha07
JoseAlcerreca Nov 11, 2020
cb0a46f
Merge branch 'dev_alpha07' into rally_alpha07
JoseAlcerreca Nov 11, 2020
95c442a
[Jetnews] Bring back a forgotten ContentAlpha.medium
yrezgui Nov 11, 2020
0295dce
Merge branch 'dev_alpha07' into dev_alpha07
yrezgui Nov 11, 2020
a68a925
Merge pull request #273 from JoseAlcerreca/rally_alpha07
JoseAlcerreca Nov 11, 2020
00a472b
Merge branch 'dev_alpha07' into dev_alpha07
yrezgui Nov 11, 2020
8534fc2
Merge pull request #280 from yrezgui/dev_alpha07
yrezgui Nov 11, 2020
1239fac
[Crane] Updates to snapshot 6953474 (#268)
manuelvicnt Nov 11, 2020
a5f219b
[All] Updating to Compose alpha07
florina-muntenescu Nov 11, 2020
008e4ae
[All] Updating Accompanist to 0.3.3.1
florina-muntenescu Nov 11, 2020
7701008
Merge pull request #282 from android/fm/update_alpha07
florina-muntenescu Nov 12, 2020
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Contributor License Agreements

We'd love to accept your sample apps and patches! Before we can take them, we
We'd love to accept your patches! Before we can take them, we
have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement (CLA).
Expand Down
7 changes: 4 additions & 3 deletions Crane/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ android {
}

packagingOptions {
exclude "META-INF/licenses/**"
exclude "META-INF/AL2.0"
exclude "META-INF/LGPL2.1"
// Multiple dependency bring these files in. Exclude them to enable
// our test APK to build (has no effect on our AARs)
excludes += "/META-INF/AL2.0"
excludes += "/META-INF/LGPL2.1"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import androidx.compose.samples.crane.calendar.model.DaySelectedStatus.Selected
import androidx.compose.samples.crane.data.DatesRepository
import androidx.compose.samples.crane.di.DispatchersModule
import androidx.compose.samples.crane.ui.CraneTheme
import androidx.ui.test.ComposeTestRule
import androidx.ui.test.SemanticsMatcher
import androidx.ui.test.assertLabelEquals
import androidx.ui.test.createAndroidComposeRule
import androidx.ui.test.onNodeWithLabel
import androidx.ui.test.performClick
import androidx.ui.test.performScrollTo
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.performClick
import androidx.compose.ui.test.performScrollTo
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import dagger.hilt.android.testing.UninstallModules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import androidx.compose.samples.crane.data.DestinationsRepository
import androidx.compose.samples.crane.data.ExploreModel
import androidx.compose.samples.crane.data.MADRID
import androidx.compose.samples.crane.di.DispatchersModule
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
import androidx.compose.ui.test.onNodeWithText
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.platform.app.InstrumentationRegistry
import androidx.ui.test.AndroidComposeTestRule
import androidx.ui.test.assertIsDisplayed
import androidx.ui.test.onNodeWithText
import com.google.android.libraries.maps.MapView
import com.google.android.libraries.maps.model.CameraPosition
import com.google.android.libraries.maps.model.LatLng
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

package androidx.compose.samples.crane.home

import androidx.compose.material.Surface
import androidx.compose.samples.crane.di.DispatchersModule
import androidx.compose.samples.crane.ui.CraneTheme
import androidx.ui.test.createAndroidComposeRule
import androidx.ui.test.onNodeWithText
import androidx.ui.test.performClick
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import dagger.hilt.android.testing.UninstallModules
Expand All @@ -42,15 +40,7 @@ class HomeTest {
@Before
fun setUp() {
composeTestRule.setContent {
CraneTheme {
Surface {
CraneHomeContent(
onExploreItemClicked = { },
onDateSelectionClicked = { },
openDrawer = { }
)
}
}
MainScreen({ }, { })
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
package androidx.compose.samples.crane.base

import androidx.annotation.DrawableRes
import androidx.compose.foundation.AmbientContentColor
import androidx.compose.foundation.BaseTextField
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.preferredWidth
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material.AmbientContentColor
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down Expand Up @@ -93,13 +93,18 @@ fun CraneEditableUserInput(
showCaption = { !isHint() },
vectorImageId = vectorImageId
) {
BaseTextField(
BasicTextField(
value = textFieldState,
onValueChange = {
textFieldState = it
if (!isHint()) onInputChanged(textFieldState.text)
},
textStyle = if (isHint()) captionTextStyle else MaterialTheme.typography.body1,
textStyle = if (isHint()) {
captionTextStyle.copy(color = AmbientContentColor.current)
} else {
MaterialTheme.typography.body1
},
cursorColor = AmbientContentColor.current
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
package androidx.compose.samples.crane.base

import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.samples.crane.R
import androidx.compose.samples.crane.ui.CraneTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package androidx.compose.samples.crane.base

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.ExperimentalLayout
Expand All @@ -30,6 +29,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Tab
import androidx.compose.material.TabRow
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.samples.crane.R
import androidx.compose.samples.crane.home.CraneScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package androidx.compose.samples.crane.base

import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -33,6 +32,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Divider
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.samples.crane.R
import androidx.compose.samples.crane.data.ExploreModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package androidx.compose.samples.crane.calendar

import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.Text
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -35,6 +34,7 @@ import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material.Colors
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.samples.crane.calendar.model.CalendarDay
import androidx.compose.samples.crane.calendar.model.CalendarMonth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.samples.crane.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.annotation.VisibleForTesting
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -32,6 +31,7 @@ import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.Button
import androidx.compose.material.ButtonConstants
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedTask
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.samples.crane.R
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -32,9 +34,12 @@ private const val SplashWaitTime: Long = 2000
@Composable
fun LandingScreen(modifier: Modifier = Modifier, onTimeout: () -> Unit) {
Box(modifier = modifier.fillMaxSize(), alignment = Alignment.Center) {
LaunchedTask {
// Adds composition consistency. Use the value when LaunchedEffect is first called
val currentOnTimeout by rememberUpdatedState(onTimeout)

LaunchedEffect(Unit) {
delay(SplashWaitTime)
onTimeout()
currentOnTimeout()
}
Image(asset = vectorResource(id = R.drawable.ic_crane_drawer))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package androidx.compose.samples.crane.home

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.annotation.VisibleForTesting
import androidx.compose.animation.DpPropKey
import androidx.compose.animation.core.FloatPropKey
import androidx.compose.animation.core.Spring.StiffnessLow
Expand Down Expand Up @@ -51,29 +52,31 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)

setContent {
CraneScaffold {
val onExploreItemClicked: OnExploreItemClicked = remember {
{ launchDetailsActivity(context = this, item = it) }
}
val onDateSelectionClicked = remember {
{ launchCalendarActivity(this) }
}
MainScreen(
onExploreItemClicked = { launchDetailsActivity(context = this, item = it) },
onDateSelectionClicked = { launchCalendarActivity(this) }
)
}
}
}

var splashShown by remember { mutableStateOf(SplashState.Shown) }
val transition = transition(splashTransitionDefinition, splashShown)
Box {
LandingScreen(
modifier = Modifier.drawOpacity(transition[splashAlphaKey]),
onTimeout = { splashShown = SplashState.Completed }
)
MainContent(
modifier = Modifier.drawOpacity(transition[contentAlphaKey]),
topPadding = transition[contentTopPaddingKey],
onExploreItemClicked = onExploreItemClicked,
onDateSelectionClicked = onDateSelectionClicked
)
}
}
@VisibleForTesting
@Composable
fun MainScreen(onExploreItemClicked: OnExploreItemClicked, onDateSelectionClicked: () -> Unit) {
CraneScaffold {
var splashShown by remember { mutableStateOf(SplashState.Shown) }
val transition = transition(splashTransitionDefinition, splashShown)
Box {
LandingScreen(
modifier = Modifier.drawOpacity(transition[splashAlphaKey]),
onTimeout = { splashShown = SplashState.Completed }
)
MainContent(
modifier = Modifier.drawOpacity(transition[contentAlphaKey]),
topPadding = transition[contentTopPaddingKey],
onExploreItemClicked = onExploreItemClicked,
onDateSelectionClicked = onDateSelectionClicked
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import androidx.compose.animation.ColorPropKey
import androidx.compose.animation.core.transitionDefinition
import androidx.compose.animation.core.tween
import androidx.compose.animation.transition
import androidx.compose.foundation.Text
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down
4 changes: 4 additions & 0 deletions Crane/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ subprojects {
// Use experimental APIs
freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'
freeCompilerArgs += '-Xallow-jvm-ir-dependencies'
freeCompilerArgs += [
'-P',
'plugin:androidx.compose.compiler.plugins.kotlin:intrinsicRemember=true'
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ 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 ktLint = "com.pinterest:ktlint:${Versions.ktLint}"
const val googleMaps = "com.google.android.libraries.maps:maps:3.1.0-beta"

object Accompanist {
private const val version = "0.3.2"
private const val version = "0.3.3.1"
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
}

Expand All @@ -37,7 +37,7 @@ object Libs {
const val extensions = "org.jetbrains.kotlin:kotlin-android-extensions:$version"

object Coroutines {
private const val version = "1.4.0-M1"
private const val version = "1.4.0"
const val android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version"
const val test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version"
}
Expand All @@ -46,7 +46,7 @@ object Libs {
object AndroidX {
object Compose {
const val snapshot = ""
const val version = "1.0.0-alpha06"
const val version = "1.0.0-alpha07"

const val runtime = "androidx.compose.runtime:runtime:$version"
const val runtimeLivedata = "androidx.compose.runtime:runtime-livedata:$version"
Expand Down
5 changes: 5 additions & 0 deletions JetNews/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ android {
kotlinCompilerVersion kotlin_version
kotlinCompilerExtensionVersion compose_version
}

packagingOptions {
excludes += "/META-INF/AL2.0"
excludes += "/META-INF/LGPL2.1"
}
}

dependencies {
Expand Down
Loading