Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[Jetcaster] Update to Compose alpha07 snapshot (#278)
- Migrated to Accompanist's Insets library
- Migrated over to content alpha
  • Loading branch information
chrisbanes authored Nov 9, 2020
commit 0937e247b0567bbd50f53268ff811eef7459c122
2 changes: 2 additions & 0 deletions Jetcaster/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ dependencies {

implementation Libs.Accompanist.coil

implementation Libs.Accompanist.insets

implementation Libs.OkHttp.okhttp
implementation Libs.OkHttp.logging

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.activity.ComponentActivity
import androidx.compose.ui.platform.setContent
import androidx.core.view.WindowCompat
import com.example.jetcaster.ui.theme.JetcasterTheme
import com.example.jetcaster.util.ProvideDisplayInsets
import dev.chrisbanes.accompanist.insets.ProvideWindowInsets

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -32,7 +32,7 @@ class MainActivity : ComponentActivity() {

setContent {
JetcasterTheme {
ProvideDisplayInsets {
ProvideWindowInsets {
JetcasterApp()
}
}
Expand Down
29 changes: 14 additions & 15 deletions Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.example.jetcaster.ui.home

import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -33,22 +32,24 @@ import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.foundation.layout.preferredHeightIn
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.AmbientContentAlpha
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
import androidx.compose.material.Surface
import androidx.compose.material.Tab
import androidx.compose.material.TabConstants.defaultTabIndicatorOffset
import androidx.compose.material.TabPosition
import androidx.compose.material.TabRow
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AccountCircle
import androidx.compose.material.icons.filled.Search
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedTask
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.Providers
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -76,9 +77,9 @@ import com.example.jetcaster.util.ToggleFollowPodcastIconButton
import com.example.jetcaster.util.constrastAgainst
import com.example.jetcaster.util.quantityStringResource
import com.example.jetcaster.util.rememberDominantColorState
import com.example.jetcaster.util.statusBarsHeight
import com.example.jetcaster.util.verticalGradientScrim
import dev.chrisbanes.accompanist.coil.CoilImage
import dev.chrisbanes.accompanist.insets.statusBarsHeight
import java.time.Duration
import java.time.LocalDateTime
import java.time.OffsetDateTime
Expand Down Expand Up @@ -119,7 +120,7 @@ fun HomeAppBar(
},
backgroundColor = backgroundColor,
actions = {
ProvideEmphasis(AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
IconButton(
onClick = { /* TODO: Open search */ },
icon = { Icon(Icons.Filled.Search) }
Expand Down Expand Up @@ -170,7 +171,7 @@ fun HomeContent(

// When the selected image url changes, call updateColorsFromImageUrl() or reset()
if (selectedImageUrl != null) {
LaunchedTask(selectedImageUrl) {
LaunchedEffect(selectedImageUrl) {
dominantColorState.updateColorsFromImageUrl(selectedImageUrl)
}
} else {
Expand Down Expand Up @@ -338,17 +339,15 @@ private fun FollowedPodcastCarouselItem(
)
}

ProvideEmphasis(AmbientEmphasisLevels.current.high) {
ToggleFollowPodcastIconButton(
onClick = onUnfollowedClick,
isFollowed = true, /* All podcasts are followed in this feed */
modifier = Modifier.align(Alignment.BottomEnd)
)
}
ToggleFollowPodcastIconButton(
onClick = onUnfollowedClick,
isFollowed = true, /* All podcasts are followed in this feed */
modifier = Modifier.align(Alignment.BottomEnd)
)
}

if (lastEpisodeDate != null) {
ProvideEmphasis(AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Text(
text = lastUpdated(lastEpisodeDate),
style = MaterialTheme.typography.caption,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

package com.example.jetcaster.ui.home.category

import androidx.compose.foundation.AmbientContentColor
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 @@ -32,21 +30,23 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.preferredWidth
import androidx.compose.foundation.lazy.ExperimentalLazyDsl
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRowForIndexed
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.AmbientContentAlpha
import androidx.compose.material.AmbientContentColor
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Divider
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.icons.Icons
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.PlaylistAdd
import androidx.compose.material.icons.rounded.PlayCircleFilled
import androidx.compose.material.ripple.RippleIndication
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Providers
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
Expand All @@ -73,7 +73,6 @@ import dev.chrisbanes.accompanist.coil.CoilImage
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle

@OptIn(ExperimentalLazyDsl::class)
@Composable
fun PodcastCategory(
categoryId: Long,
Expand Down Expand Up @@ -166,29 +165,27 @@ fun EpisodeListItem(
)
}

ProvideEmphasis(AmbientEmphasisLevels.current.high) {
Text(
text = episode.title,
maxLines = 2,
style = MaterialTheme.typography.subtitle1,
modifier = Modifier.constrainAs(episodeTitle) {
linkTo(
start = parent.start,
end = image.start,
startMargin = Keyline1,
endMargin = 16.dp,
bias = 0f
)
top.linkTo(parent.top, 16.dp)
Text(
text = episode.title,
maxLines = 2,
style = MaterialTheme.typography.subtitle1,
modifier = Modifier.constrainAs(episodeTitle) {
linkTo(
start = parent.start,
end = image.start,
startMargin = Keyline1,
endMargin = 16.dp,
bias = 0f
)
top.linkTo(parent.top, 16.dp)

width = Dimension.preferredWrapContent
}
)
}
width = Dimension.preferredWrapContent
}
)

val titleImageBarrier = createBottomBarrier(podcastTitle, image)

ProvideEmphasis(AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Text(
text = podcast.title,
maxLines = 2,
Expand All @@ -208,25 +205,23 @@ fun EpisodeListItem(
)
}

ProvideEmphasis(AmbientEmphasisLevels.current.high) {
Image(
asset = Icons.Rounded.PlayCircleFilled,
contentScale = ContentScale.Fit,
colorFilter = ColorFilter.tint(AmbientContentColor.current),
modifier = Modifier
.clickable(indication = RippleIndication(bounded = false, radius = 24.dp)) {
/* TODO */
}
.preferredSize(36.dp)
.constrainAs(playIcon) {
start.linkTo(parent.start, Keyline1)
top.linkTo(titleImageBarrier, margin = 16.dp)
bottom.linkTo(parent.bottom, 16.dp)
}
)
}
Image(
asset = Icons.Rounded.PlayCircleFilled,
contentScale = ContentScale.Fit,
colorFilter = ColorFilter.tint(AmbientContentColor.current),
modifier = Modifier
.clickable(indication = RippleIndication(bounded = false, radius = 24.dp)) {
/* TODO */
}
.preferredSize(36.dp)
.constrainAs(playIcon) {
start.linkTo(parent.start, Keyline1)
top.linkTo(titleImageBarrier, margin = 16.dp)
bottom.linkTo(parent.bottom, 16.dp)
}
)

ProvideEmphasis(AmbientEmphasisLevels.current.medium) {
Providers(AmbientContentAlpha provides ContentAlpha.medium) {
Text(
text = when {
episode.duration != null -> {
Expand Down Expand Up @@ -326,24 +321,20 @@ private fun TopPodcastRowItem(
)
}

ProvideEmphasis(AmbientEmphasisLevels.current.high) {
ToggleFollowPodcastIconButton(
onClick = onToggleFollowClicked,
isFollowed = isFollowed,
modifier = Modifier.align(Alignment.BottomEnd)
)
}
}

ProvideEmphasis(AmbientEmphasisLevels.current.high) {
Text(
text = podcastTitle,
style = MaterialTheme.typography.body2,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(top = 8.dp).fillMaxWidth()
ToggleFollowPodcastIconButton(
onClick = onToggleFollowClicked,
isFollowed = isFollowed,
modifier = Modifier.align(Alignment.BottomEnd)
)
}

Text(
text = podcastTitle,
style = MaterialTheme.typography.body2,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(top = 8.dp).fillMaxWidth()
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.TransitionDefinition
import androidx.compose.animation.core.transitionDefinition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Text
import androidx.compose.foundation.contentColor
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -35,6 +33,7 @@ import androidx.compose.material.ScrollableTabRow
import androidx.compose.material.Surface
import androidx.compose.material.Tab
import androidx.compose.material.TabPosition
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.emptyContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
package com.example.jetcaster.util

import androidx.compose.animation.animate
import androidx.compose.foundation.AmbientContentColor
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.AmbientContentColor
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
Expand Down Expand Up @@ -52,7 +52,7 @@ fun ToggleFollowPodcastIconButton(
tint = animate(
when {
isFollowed -> AmbientContentColor.current
else -> AmbientEmphasisLevels.current.high.applyEmphasis(Color.Black)
else -> Color.Black.copy(alpha = ContentAlpha.high)
}
),
modifier = Modifier
Expand Down
Loading