This repository was archived by the owner on Jul 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/com/example/android/databinding/basicsample/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ jobs:
2727 - name : Copy CI gradle.properties
2828 run : mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2929
30- - name : Set up JDK 11
31- uses : actions/setup-java@v3
30+ - name : Set up JDK 17
31+ uses : actions/setup-java@v4
3232 with :
3333 distribution : ' zulu'
34- java-version : 11
34+ java-version : 17
3535
3636 - name : Generate cache key
3737 run : ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
6868 uses : actions/upload-artifact@v3
6969 with :
7070 name : build-reports-BasicSample
71- path : ${{ env.SAMPLE_PATH }}/app/build/reports
71+ path : ${{ env.SAMPLE_PATH }}/app/build/reports
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ apply plugin: 'kotlin-android'
2121apply plugin : ' kotlin-kapt'
2222
2323android {
24+ namespace ' com.example.android.databinding.basicsample'
2425 compileSdkVersion rootProject. compileSdkVersion
2526 defaultConfig {
2627 applicationId " com.example.android.databinding.basicsample"
@@ -40,6 +41,10 @@ android {
4041 buildFeatures {
4142 dataBinding true
4243 }
44+ compileOptions {
45+ sourceCompatibility JavaVersion . VERSION_17
46+ targetCompatibility JavaVersion . VERSION_17
47+ }
4348}
4449
4550dependencies {
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ import androidx.databinding.Bindable
2020import androidx.databinding.ObservableField
2121import androidx.databinding.ObservableInt
2222import androidx.lifecycle.LiveData
23+ import androidx.lifecycle.map
2324import androidx.lifecycle.MutableLiveData
24- import androidx.lifecycle.Transformations
2525import androidx.lifecycle.ViewModel
2626import com.example.android.databinding.basicsample.BR
2727import com.example.android.databinding.basicsample.util.ObservableViewModel
@@ -41,7 +41,7 @@ class ProfileLiveDataViewModel : ViewModel() {
4141 val likes: LiveData <Int > = _likes
4242
4343 // popularity is exposed as LiveData using a Transformation instead of a @Bindable property.
44- val popularity: LiveData <Popularity > = Transformations .map( _likes ) {
44+ val popularity: LiveData <Popularity > = _likes .map {
4545 when {
4646 it > 9 -> Popularity .STAR
4747 it > 4 -> Popularity .POPULAR
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ buildscript {
2727 activityVersion = ' 1.6.1'
2828 constraintLayoutVersion = ' 2.1.4'
2929 espressoVersion = ' 3.5.1'
30- gradleVersion = ' 7.4 .0'
30+ gradleVersion = ' 8.3 .0'
3131 junitVersion = ' 4.13.2'
3232 hamcrestVersion = ' 1.3'
3333 kotlinVersion = ' 1.8.0'
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-7.5 -bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.4 -bin.zip
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
You can’t perform that action at this time.
0 commit comments