Skip to content

Commit 5152ffc

Browse files
committed
Merge branch 'main' into latest
2 parents 5cb7dd2 + 0d296b9 commit 5152ffc

File tree

11 files changed

+1030
-17
lines changed

11 files changed

+1030
-17
lines changed

.github/workflows/apply_spotless.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
name: Apply spotless
15+
16+
on:
17+
pull_request:
18+
branches: [ '*' ]
19+
workflow_dispatch:
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
25+
jobs:
26+
apply-spotless:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 30
29+
if: github.repository == 'android/snippets'
30+
31+
steps:
32+
- name: Checkout Repository
33+
uses: actions/checkout@v3
34+
with:
35+
token: ${{ secrets.PAT || github.token }}
36+
37+
- name: set up Java 17
38+
uses: actions/setup-java@v2
39+
with:
40+
distribution: 'zulu'
41+
java-version: '17'
42+
43+
- name: Run spotlessApply
44+
run: ./gradlew :compose:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
45+
46+
- name: Auto-commit if spotlessApply has changes
47+
uses: stefanzweifel/git-auto-commit-action@v4
48+
with:
49+
commit_message: Apply Spotless

.github/workflows/build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,12 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v3
3333
with:
34-
token: ${{ secrets.PAT}}
34+
token: ${{ secrets.PAT || github.token }}
3535
- name: set up Java 17
3636
uses: actions/setup-java@v2
3737
with:
3838
distribution: 'zulu'
3939
java-version: '17'
40-
- name: Apply formatting if failed
41-
run: ./gradlew :compose:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
42-
- uses: stefanzweifel/git-auto-commit-action@v4
43-
with:
44-
commit_message: Apply Spotless
4540
- name: Build Compose
4641
run: ./gradlew :compose:snippets:build
4742
- name: Build recompose snippets

.github/workflows/sync_main_latest.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@ jobs:
1010
name: Syncing branches
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
14-
- name: Opening pull request
15-
id: pull
16-
uses: tretuna/[email protected]
13+
uses: actions/checkout@v3
14+
15+
- name: Merge main into latest
16+
run: git checkout latest && git merge main
17+
18+
- name: Create pull request
19+
id: cpr
20+
uses: peter-evans/create-pull-request@v4
1721
with:
18-
GITHUB_TOKEN: ${{secrets.PAT}}
19-
FROM_BRANCH: "main"
20-
TO_BRANCH: "latest"
22+
token: ${{ secrets.PAT }}
23+
commit-message: 🤖 Sync main to latest
24+
committer: compose-devrel-github-bot <[email protected]>
25+
author: compose-devrel-github-bot <[email protected]>
26+
signoff: false
27+
branch: bot-sync-main
28+
delete-branch: true
29+
title: '🤖 Sync main to latest'
30+
body: Updated dependencies
31+
reviewers: ${{ github.actor }}

compose/snippets/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ dependencies {
8686
implementation(libs.androidx.compose.ui)
8787
implementation(libs.androidx.compose.ui.util)
8888
implementation(libs.androidx.compose.ui.graphics)
89+
implementation(libs.androidx.graphics.shapes)
8990
implementation(libs.androidx.compose.ui.tooling.preview)
9091
implementation(libs.androidx.compose.ui.viewbinding)
9192
implementation(libs.androidx.paging.compose)
@@ -128,6 +129,9 @@ dependencies {
128129
implementation(libs.androidx.lifecycle.runtime)
129130
implementation(libs.androidx.lifecycle.viewModelCompose)
130131

132+
implementation(libs.androidx.media3.common)
133+
implementation(libs.androidx.media3.exoplayer)
134+
131135
implementation(libs.androidx.navigation.compose)
132136
implementation(libs.hilt.android)
133137
implementation(libs.androidx.hilt.navigation.compose)

compose/snippets/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@
2828
android:roundIcon="@mipmap/ic_launcher_round"
2929
android:supportsRtl="true"
3030
android:theme="@style/Theme.Snippets">
31+
<!-- [START android_compose_pip_manifest_entry]-->
3132
<activity
3233
android:name=".SnippetsActivity"
3334
android:exported="true"
35+
android:supportsPictureInPicture="true"
36+
android:configChanges="orientation|screenLayout|screenSize|smallestScreenSize"
3437
android:theme="@style/Theme.Snippets">
38+
<!-- [END android_compose_pip_manifest_entry]-->
39+
3540
<intent-filter>
3641
<action android:name="android.intent.action.MAIN" />
3742

compose/snippets/src/main/java/com/example/compose/snippets/SnippetsActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import com.example.compose.snippets.components.ProgressIndicatorExamples
3838
import com.example.compose.snippets.components.ScaffoldExample
3939
import com.example.compose.snippets.components.SliderExamples
4040
import com.example.compose.snippets.components.SwitchExamples
41+
import com.example.compose.snippets.graphics.ApplyPolygonAsClipImage
4142
import com.example.compose.snippets.graphics.BitmapFromComposableSnippet
4243
import com.example.compose.snippets.graphics.BrushExamplesScreen
4344
import com.example.compose.snippets.images.ImageExamplesScreen
@@ -75,6 +76,7 @@ class SnippetsActivity : ComponentActivity() {
7576
it.route
7677
)
7778
}
79+
Destination.ShapesExamples -> ApplyPolygonAsClipImage()
7880
}
7981
}
8082
}

0 commit comments

Comments
 (0)