Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BasicSample] Updates to AGP 8.3 #52

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/BasicSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
java-version: 17

- name: Generate cache key
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
Expand Down Expand Up @@ -68,4 +68,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: build-reports-BasicSample
path: ${{ env.SAMPLE_PATH }}/app/build/reports
path: ${{ env.SAMPLE_PATH }}/app/build/reports
5 changes: 5 additions & 0 deletions BasicSample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
namespace 'com.example.android.databinding.basicsample'
compileSdkVersion rootProject.compileSdkVersion
defaultConfig {
applicationId "com.example.android.databinding.basicsample"
Expand All @@ -40,6 +41,10 @@ android {
buildFeatures {
dataBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import androidx.databinding.Bindable
import androidx.databinding.ObservableField
import androidx.databinding.ObservableInt
import androidx.lifecycle.LiveData
import androidx.lifecycle.map
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.example.android.databinding.basicsample.BR
import com.example.android.databinding.basicsample.util.ObservableViewModel
Expand All @@ -41,7 +41,7 @@ class ProfileLiveDataViewModel : ViewModel() {
val likes: LiveData<Int> = _likes

// popularity is exposed as LiveData using a Transformation instead of a @Bindable property.
val popularity: LiveData<Popularity> = Transformations.map(_likes) {
val popularity: LiveData<Popularity> = _likes.map {
when {
it > 9 -> Popularity.STAR
it > 4 -> Popularity.POPULAR
Expand Down
2 changes: 1 addition & 1 deletion BasicSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildscript {
activityVersion = '1.6.1'
constraintLayoutVersion = '2.1.4'
espressoVersion = '3.5.1'
gradleVersion = '7.4.0'
gradleVersion = '8.3.0'
junitVersion = '4.13.2'
hamcrestVersion = '1.3'
kotlinVersion = '1.8.0'
Expand Down
2 changes: 1 addition & 1 deletion BasicSample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading