Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d71778c
Add snippets for Indication and Ripple migration (#191)
arriolac Jan 24, 2024
0bad025
Convert NeonIndication to data class. (#193)
arriolac Jan 24, 2024
ef49816
Merge branch 'main' into latest
arriolac Jan 25, 2024
5cb7dd2
Adding pip snippets to latest branch (#196)
MagicalMeghan Jan 30, 2024
5152ffc
Merge branch 'main' into latest
arriolac Feb 6, 2024
940a400
Delete pictureInPicture. (#213)
arriolac Feb 9, 2024
41acfd7
Update activity compose level and align log tag with main branch (#215)
MagicalMeghan Feb 14, 2024
aa8c5fe
Merge remote-tracking branch 'origin/main' into latest
compose-devrel-github-bot Feb 28, 2024
3637c7f
Merge pull request #229 from android/bot-sync-main
arriolac Feb 28, 2024
d9dbbf7
Merge remote-tracking branch 'origin/main' into latest
compose-devrel-github-bot Feb 29, 2024
c616bd2
Merge pull request #231 from android/bot-sync-main
arriolac Feb 29, 2024
fc0a273
Merge remote-tracking branch 'origin/main' into latest
compose-devrel-github-bot Mar 6, 2024
67f4f28
Merge pull request #235 from android/bot-sync-main
arriolac Mar 6, 2024
74e4d28
Merge remote-tracking branch 'origin/main' into latest
compose-devrel-github-bot Mar 6, 2024
72e3789
Merge pull request #237 from android/bot-sync-main
arriolac Mar 6, 2024
8242f9e
Migrate recomposeHighlighter to Modifier.Node (#197) (#238)
compose-devrel-github-bot Mar 11, 2024
bf83206
Adding samples for ContextualFlowRow (#234)
riggaroo Mar 12, 2024
6d2b166
Merge remote-tracking branch 'origin/main' into latest
compose-devrel-github-bot Mar 20, 2024
2441cae
Merge pull request #245 from android/bot-sync-main
arriolac Mar 20, 2024
2e672f9
Update libs.versions.toml (#247) (#248)
compose-devrel-github-bot Apr 8, 2024
c8a6c3b
Merge remote-tracking branch 'origin/main' into latest
compose-devrel-github-bot Apr 12, 2024
a9f1084
Merge pull request #250 from android/bot-sync-main
arriolac Apr 12, 2024
21a691c
Update Bitmap to image snippet to use new Graphics Layers (#254)
riggaroo Apr 23, 2024
b365d6d
add shared element snippets
riggaroo Apr 29, 2024
7c2c698
Apply Spotless
riggaroo Apr 29, 2024
f45f8ad
Split snippets into different files.
riggaroo Apr 29, 2024
d6e029f
Merge branch 'riggaroo/shared-element-snippets' of https://github.com…
riggaroo Apr 29, 2024
8e22485
Apply Spotless
riggaroo Apr 29, 2024
ee796a9
Shared element snippets (#256)
riggaroo Apr 30, 2024
90bcd56
Update libs.versions.toml (#251) (#252)
compose-devrel-github-bot Apr 30, 2024
664855e
Snippet updates based on peer feedback.
riggaroo May 1, 2024
4b60d08
Merge branch 'latest' into riggaroo/shared-element-snippets
riggaroo May 1, 2024
2c46281
Shared element snippets (#258)
riggaroo May 1, 2024
23d2ab2
Unique key snippet
riggaroo May 1, 2024
0349cd8
Merge branch 'latest' into riggaroo/shared-element-snippets
riggaroo May 1, 2024
fb5f982
Update SharedElementsWithNavigationSnippets.kt
riggaroo May 1, 2024
d6d77eb
Update AsyncImage snippet
riggaroo May 2, 2024
5a44e5e
Add placeholder size example
riggaroo May 2, 2024
d918044
Add comment to snippet about unmatched bounds
riggaroo May 3, 2024
77e9ab1
🤖 Sync main to latest (#259)
compose-devrel-github-bot May 7, 2024
3f7adbe
Update to new lazy list snippets. (#265)
riggaroo May 9, 2024
8abe5cc
Compose - beta01 (#270)
riggaroo May 14, 2024
960f6de
Added snippet for AnimatedVisibility usage with Shared elements (#272)
riggaroo May 24, 2024
f3f38d4
Merge branch 'refs/heads/main' into latest
riggaroo Jul 15, 2024
6846c24
Add clickable text snippets (#297)
bentrengrove Jul 24, 2024
536e487
🤖 Sync main to latest (#266)
compose-devrel-github-bot Jul 29, 2024
0442b19
🤖 Sync main to latest (#301)
compose-devrel-github-bot Aug 13, 2024
a6cfa39
Snippet updates for type safe navigation APIs
dturner Aug 20, 2024
750acf3
Downgrade compileSdk to 34
dturner Aug 20, 2024
b2cdbdc
Merge pull request #316 from android/dt/type-safe-nav-2
dturner Aug 22, 2024
c5d4717
🤖 Sync main to latest (#313)
compose-devrel-github-bot Aug 27, 2024
74aaf25
Latest beta06 updates for Compose (#300)
riggaroo Aug 28, 2024
9942a9a
Merge branch 'main' into latest
riggaroo Aug 28, 2024
43c9fe8
Migrate CompositionLocal snippets to m3 (#321) (#323)
compose-devrel-github-bot Aug 28, 2024
2b78281
Update snippets to use material3-adaptive rc01 (#324)
alexvanyo Aug 29, 2024
cf8e3c9
Migrate many snippets to use Material 3 instead of Material 2. (#320)
riggaroo Aug 30, 2024
bbdb61b
Revert shape changes for now.
riggaroo Sep 2, 2024
be01a96
Fix text snippets in latest (#326)
bentrengrove Sep 3, 2024
7045d7d
🤖 Sync main to latest (#327)
compose-devrel-github-bot Sep 3, 2024
6eedaf3
Merge branch 'main' into latest
riggaroo Sep 3, 2024
19ace26
Add M3 Carousel examples
riggaroo Sep 4, 2024
ab3798a
Apply Spotless
riggaroo Sep 4, 2024
816ad66
Merge branch 'main' into feature/m3-carousel
riggaroo Oct 1, 2024
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
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/apply_spotless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT || github.token }}
fetch-depth: 0

- name: set up Java 17
uses: actions/setup-java@v4
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -45,7 +45,7 @@ jobs:
run: ./gradlew :compose:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace

- name: Auto-commit if spotlessApply has changes
uses: stefanzweifel/git-auto-commit-action@v5
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply Spotless

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT || github.token }}
- name: set up Java 17
uses: actions/setup-java@v4
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/sync_main_latest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Sync main and latest
on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -11,13 +10,10 @@ jobs:
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set git config user
run: git config user.email "[email protected]" && git config user.name "compose-devrel-github-bot"
uses: actions/checkout@v3

- name: Merge main into latest
run: git fetch && git switch latest && git merge -s ours origin/main --allow-unrelated-histories
run: git checkout latest && git merge main

- name: Create pull request
id: cpr
Expand All @@ -31,5 +27,5 @@ jobs:
branch: bot-sync-main
delete-branch: true
title: '🤖 Sync main to latest'
body: 'Update `latest` with `main`'
body: Updated dependencies
reviewers: ${{ github.actor }}
4 changes: 2 additions & 2 deletions .github/workflows/update_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
Expand All @@ -43,7 +43,7 @@ class MainActivity : ComponentActivity() {

@Composable
private fun Content() {
var counter by remember { mutableIntStateOf(0) }
var counter by remember { mutableStateOf(0) }
Column(
Modifier
.fillMaxSize()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.example.compose.snippets.components

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.carousel.HorizontalMultiBrowseCarousel
import androidx.compose.material3.carousel.HorizontalUncontainedCarousel
import androidx.compose.material3.carousel.rememberCarouselState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.compose.snippets.R

@OptIn(ExperimentalMaterial3Api::class)
@Preview
// [START android_compose_carousel_multi_browse_basic]
@Composable
private fun CarouselExamples_MultiBrowse() {
data class CarouselItem(
val id: Int,
@DrawableRes val imageResId: Int,
val contentDescription: String
)

val items = remember {
listOf(
CarouselItem(0, R.drawable.cupcake, "cupcake"),
CarouselItem(1, R.drawable.donut, "donut"),
CarouselItem(2, R.drawable.eclair, "eclair"),
CarouselItem(3, R.drawable.froyo, "froyo"),
CarouselItem(4, R.drawable.gingerbread, "gingerbread"),
)
}

HorizontalMultiBrowseCarousel(
state = rememberCarouselState { items.count() },
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(top = 16.dp, bottom = 16.dp),
preferredItemWidth = 186.dp,
itemSpacing = 8.dp,
contentPadding = PaddingValues(horizontal = 16.dp)
) { i ->
val item = items[i]
Image(
modifier = Modifier
.height(205.dp)
.maskClip(MaterialTheme.shapes.extraLarge),
painter = painterResource(id = item.imageResId),
contentDescription = item.contentDescription,
contentScale = ContentScale.Crop
)
}
}

// [END android_compose_carousel_multi_browse_basic]
@OptIn(ExperimentalMaterial3Api::class)
@Preview
// [START android_compose_carousel_uncontained_basic]
@Composable
private fun CarouselExamples() {
data class CarouselItem(
val id: Int,
@DrawableRes val imageResId: Int,
val contentDescription: String
)

val items = remember {
listOf(
CarouselItem(0, R.drawable.cupcake, "cupcake"),
CarouselItem(1, R.drawable.donut, "donut"),
CarouselItem(2, R.drawable.eclair, "eclair"),
CarouselItem(3, R.drawable.froyo, "froyo"),
CarouselItem(4, R.drawable.gingerbread, "gingerbread"),
)
}

HorizontalUncontainedCarousel(
state = rememberCarouselState { items.count() },
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(top = 16.dp, bottom = 16.dp),
itemWidth = 186.dp,
itemSpacing = 8.dp,
contentPadding = PaddingValues(horizontal = 16.dp)
) { i ->
val item = items[i]
Image(
modifier = Modifier
.height(205.dp)
.maskClip(MaterialTheme.shapes.extraLarge),
painter = painterResource(id = item.imageResId),
contentDescription = item.contentDescription,
contentScale = ContentScale.Crop
)
}
}
// [END android_compose_carousel_uncontained_basic]
1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#Tue May 14 19:06:12 BST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
Expand Down
Loading