Skip to content

Commit

Permalink
Jetsnack - Migrate to Material 3 (#1437)
Browse files Browse the repository at this point in the history
Jetsnack sample is using Material 2 instead of Material 3, keeping most
of the UI the same as previously. Material 3 is the preferred choice for
Material.

This pull request migrates to using M3, as well as fixes the filters
screen selection to have a shared element transition to show and hide
the dialog.


https://github.com/user-attachments/assets/0121a41c-2aff-4bb0-abc3-d2075a8f2bd4

It also fixes build issues some machines were experiencing, where there
is a mismatch in JVM versions by setting `jvmToolchain` version.
  • Loading branch information
riggaroo committed Aug 13, 2024
2 parents d5c7da6 + 9ea3eba commit 9996d5e
Show file tree
Hide file tree
Showing 67 changed files with 577 additions and 656 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/JetNews.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,10 @@ jobs:
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
arch: x86
disable-animations: true
script: ./gradlew connectedCheck --stacktrace
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,6 @@ jobs:
draft: true
prerelease: false

- name: Upload Crane
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Crane/app/build/outputs/apk/debug/app-debug.apk
asset_name: crane-debug.apk
asset_content_type: application/vnd.android.package-archive

- name: Upload Owl
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Owl/app/build/outputs/apk/debug/app-debug.apk
asset_name: owl-debug.apk
asset_content_type: application/vnd.android.package-archive

- name: Upload Jetcaster
uses: actions/upload-release-asset@v1
env:
Expand Down Expand Up @@ -99,13 +79,3 @@ jobs:
asset_path: Jetsnack/app/build/outputs/apk/debug/app-debug.apk
asset_name: jetsnack-debug.apk
asset_content_type: application/vnd.android.package-archive

- name: Upload Jetsurvey
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Jetsurvey/app/build/outputs/apk/debug/app-debug.apk
asset_name: jetsurvey-debug.apk
asset_content_type: application/vnd.android.package-archive
41 changes: 0 additions & 41 deletions .github/workflows/main.yml

This file was deleted.

1 change: 0 additions & 1 deletion JetLagged/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.google.android.material)

implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.foundation)
Expand Down
2 changes: 1 addition & 1 deletion JetLagged/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
the License.
-->
<resources>
<style name="Theme.JetLagged" parent="Theme.MaterialComponents.DayNight"/>
<style name="Theme.JetLagged" parent="android:Theme.Material.Light.NoActionBar"/>
</resources>
3 changes: 0 additions & 3 deletions JetLagged/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ kotlin = "2.0.0"
kotlinx_immutable = "0.3.7"
ksp = "2.0.0-1.0.21"
maps-compose = "3.1.1"
material = "1.11.0"
# @keep
minSdk = "21"
okhttp = "4.11.0"
Expand Down Expand Up @@ -78,7 +77,6 @@ androidx-compose-animation = { module = "androidx.compose.animation:animation",
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-latest"}
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" ,version.ref = "androidx-compose-latest"}
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-material3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "androidx-compose-material3-adaptive" }
Expand Down Expand Up @@ -138,7 +136,6 @@ androidx-window-core = { module = "androidx.window:window-core", version.ref = "
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
dagger-hiltandroidplugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
Expand Down
2 changes: 0 additions & 2 deletions JetNews/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ dependencies {
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.window)

implementation(libs.google.android.material)

androidTestImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.runner)
Expand Down
3 changes: 0 additions & 3 deletions JetNews/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ kotlin = "2.0.0"
kotlinx_immutable = "0.3.7"
ksp = "2.0.0-1.0.21"
maps-compose = "3.1.1"
material = "1.11.0"
# @keep
minSdk = "21"
okhttp = "4.11.0"
Expand Down Expand Up @@ -78,7 +77,6 @@ androidx-compose-animation = { module = "androidx.compose.animation:animation",
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-latest"}
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" ,version.ref = "androidx-compose-latest"}
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-material3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "androidx-compose-material3-adaptive" }
Expand Down Expand Up @@ -138,7 +136,6 @@ androidx-window-core = { module = "androidx.window:window-core", version.ref = "
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
dagger-hiltandroidplugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/core/data-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlin {
jvmToolchain(17)
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(projects.core.data)
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlin {
jvmToolchain(17)
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlin {
jvmToolchain(17)
}
composeCompiler {
enableStrongSkippingMode = true
}
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/core/domain-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlin {
jvmToolchain(17)
}
dependencies {
implementation(projects.core.domain)

Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlin {
jvmToolchain(17)
}
dependencies {
coreLibraryDesugaring(libs.core.jdk.desugaring)
implementation(projects.core.data)
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/glancewidget/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ android {
}
}
}

kotlin {
jvmToolchain(17)
}
composeCompiler {
enableStrongSkippingMode = true
}
Expand Down
3 changes: 0 additions & 3 deletions Jetcaster/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ kotlin = "2.0.0"
kotlinx_immutable = "0.3.7"
ksp = "2.0.0-1.0.21"
maps-compose = "3.1.1"
material = "1.11.0"
# @keep
minSdk = "21"
okhttp = "4.11.0"
Expand Down Expand Up @@ -78,7 +77,6 @@ androidx-compose-animation = { module = "androidx.compose.animation:animation",
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-latest"}
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" ,version.ref = "androidx-compose-latest"}
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-material3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "androidx-compose-material3-adaptive" }
Expand Down Expand Up @@ -138,7 +136,6 @@ androidx-window-core = { module = "androidx.window:window-core", version.ref = "
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
dagger-hiltandroidplugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/mobile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ android {
excludes += "/META-INF/LGPL2.1"
}
}

kotlin {
jvmToolchain(17)
}
composeCompiler {
enableStrongSkippingMode = true
}
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/tv/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ android {
}
}
}

kotlin {
jvmToolchain(17)
}
composeCompiler {
enableStrongSkippingMode = true
}
Expand Down
4 changes: 3 additions & 1 deletion Jetcaster/wear/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ android {
}
}
}

kotlin {
jvmToolchain(17)
}
dependencies {


Expand Down
5 changes: 3 additions & 2 deletions Jetchat/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ android {
composeCompiler {
enableStrongSkippingMode = true
}

kotlin {
jvmToolchain(17)
}
dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
Expand All @@ -100,7 +102,6 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.google.android.material)

implementation(libs.androidx.compose.foundation.layout)
implementation(libs.androidx.compose.material3)
Expand Down
2 changes: 1 addition & 1 deletion Jetchat/app/src/main/res/values-v23/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<resources>

<style name="Platform.Theme.Jetchat" parent="Theme.Material3.DayNight">
<style name="Platform.Theme.Jetchat" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
</style>
Expand Down
2 changes: 1 addition & 1 deletion Jetchat/app/src/main/res/values-v27/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<resources>

<style name="Platform.Theme.Jetchat" parent="Theme.Material3.DayNight">
<style name="Platform.Theme.Jetchat" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
Expand Down
2 changes: 1 addition & 1 deletion Jetchat/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- Allows us to override platform level specific attributes in their
respective values-vXX folder. -->
<style name="Platform.Theme.Jetchat" parent="Theme.Material3.DayNight">
<style name="Platform.Theme.Jetchat" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@color/black30</item>
</style>

Expand Down
3 changes: 0 additions & 3 deletions Jetchat/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ kotlin = "2.0.0"
kotlinx_immutable = "0.3.7"
ksp = "2.0.0-1.0.21"
maps-compose = "3.1.1"
material = "1.11.0"
# @keep
minSdk = "21"
okhttp = "4.11.0"
Expand Down Expand Up @@ -78,7 +77,6 @@ androidx-compose-animation = { module = "androidx.compose.animation:animation",
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-latest"}
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" ,version.ref = "androidx-compose-latest"}
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-material3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "androidx-compose-material3-adaptive" }
Expand Down Expand Up @@ -138,7 +136,6 @@ androidx-window-core = { module = "androidx.window:window-core", version.ref = "
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
dagger-hiltandroidplugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
Expand Down
Loading

0 comments on commit 9996d5e

Please sign in to comment.