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

Dependencies updated, build fixed. #30

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea/
3 changes: 3 additions & 0 deletions BasicSample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'GoogleAppIndexingWarning'
}
dataBinding {
enabled true
}
Expand Down
2 changes: 1 addition & 1 deletion BasicSample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="com.example.android.databinding.basicsample">

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object BindingAdapters {
* A Binding Adapter that is called whenever the value of the attribute `app:popularityIcon`
* changes. Receives a popularity level that determines the icon and tint color to use.
*/
@BindingAdapter("app:popularityIcon")
@BindingAdapter("popularityIcon")
@JvmStatic fun popularityIcon(view: ImageView, popularity: Popularity) {

val color = getAssociatedColor(popularity, view.context)
Expand All @@ -49,7 +49,7 @@ object BindingAdapters {
* A Binding Adapter that is called whenever the value of the attribute `android:progressTint`
* changes. Depending on the value it determines the color of the progress bar.
*/
@BindingAdapter("app:progressTint")
@BindingAdapter("progressTint")
@JvmStatic fun tintPopularity(view: ProgressBar, popularity: Popularity) {

val color = getAssociatedColor(popularity, view.context)
Expand All @@ -65,7 +65,7 @@ object BindingAdapters {
* Showcases Binding Adapters with multiple attributes. Note that this adapter is called
* whenever any of the attribute changes.
*/
@BindingAdapter(value = ["app:progressScaled", "android:max"], requireAll = true)
@BindingAdapter(value = ["progressScaled", "android:max"], requireAll = true)
@JvmStatic fun setProgress(progressBar: ProgressBar, likes: Int, max: Int) {
progressBar.progress = (likes * max / 5).coerceAtMost(max)
}
Expand All @@ -74,7 +74,7 @@ object BindingAdapters {
* Unused Binding Adapter to replace the Binding Converter that hides a view if the number
* of likes is zero.
*/
@BindingAdapter("app:hideIfZero")
@BindingAdapter("hideIfZero")
@JvmStatic fun hideIfZero(view: View, number: Int) {
view.visibility = if (number == 0) View.GONE else View.VISIBLE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ import android.widget.ImageView
*/
@BindingMethods(
BindingMethod(type = ImageView::class,
attribute = "app:srcCompat",
attribute = "srcCompat",
method = "setImageResource"))
class MyBindingMethods
3 changes: 0 additions & 3 deletions BasicSample/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<resources>
<string name="app_name">BasicSample</string>
<string name="likes">Likes</string>
<string name="textview">TextView</string>
<string name="profile_name">NAME</string>
<string name="profile_lastname">LAST NAME</string>
<string name="last_name_label">Last name</string>
<string name="name_label">Name</string>
<string name="profile_avatar_cd">Profile\'s avatar</string>
Expand Down
15 changes: 6 additions & 9 deletions BasicSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
ext {
// SDK and tools
compileSdkVersion = 28
compileSdkVersion = 29
minSdkVersion = 21
targetSdkVersion = 28
targetSdkVersion = 29

// App dependencies
androidXTestVersion = '1.1.1'
Expand All @@ -45,9 +42,9 @@ buildscript {
kotlinVersion = '1.3.21'
runnerExtVersion = '1.1.0'
rulesVersion = '1.0.1'
appCompatVersion = '1.0.2'
appCompatVersion = '1.1.0'
supportLibraryVersion = '1.0.2'
archLifecycleVersion = '2.1.0-alpha03'
archLifecycleVersion = '2.2.0-rc01'
}
}

Expand Down
3 changes: 3 additions & 0 deletions BasicSample/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.databinding.incremental=true
android.lifecycleProcessor.incremental=true
2 changes: 1 addition & 1 deletion BasicSample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
4 changes: 3 additions & 1 deletion TwoWaySample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'Autofill', 'GoogleAppIndexingWarning', 'LabelFor'
}
dataBinding {
enabled true
}
Expand All @@ -49,7 +52,6 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "androidx.appcompat:appcompat:$appCompatVersion"
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"

implementation "androidx.lifecycle:lifecycle-extensions:$archLifecycleVersion"

testImplementation "junit:junit:$junitVersion"
Expand Down
2 changes: 1 addition & 1 deletion TwoWaySample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="com.example.android.databinding.twowaysample">

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ import androidx.databinding.ObservableInt
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.util.Log
import com.example.android.databinding.twowaysample.BR
import androidx.databinding.library.baseAdapters.BR
import com.example.android.databinding.twowaysample.R
import com.example.android.databinding.twowaysample.data.IntervalTimerViewModel
import com.example.android.databinding.twowaysample.data.IntervalTimerViewModelFactory
import com.example.android.databinding.twowaysample.databinding.IntervalTimerBinding


const val SHARED_PREFS_KEY = "timer"

/**
Expand Down Expand Up @@ -114,6 +113,7 @@ class MainActivity : AppCompatActivity() {

private fun observeAndSaveNumberOfSets(viewModel: IntervalTimerViewModel) {
viewModel.addOnPropertyChangedCallback(object : Observable.OnPropertyChangedCallback() {

@SuppressLint("CommitPrefEdits")
override fun onPropertyChanged(observable: Observable?, p1: Int) {
if (p1 == BR.numberOfSets) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ object NumberOfSetsConverters {
/**
* This is the Inverse Method used in `numberOfSets`, to convert from String to array.
*
* Note that Context is passed
* Note that Context must be passed.
*/
@JvmStatic fun stringToSetArray(unused: Context, value: String): Array<Int> {
// Converts String to long
Expand Down
2 changes: 1 addition & 1 deletion TwoWaySample/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<string name="pause">Pause</string>
<string name="minus_sign">-</string>
<string name="plus_sign">+</string>
<string name="sets_format">Sets: %d/%d</string>
<string name="sets_format" formatted="false">Sets: %d/%d</string>
<string name="prefs_timePerWorkSet">SHARED_PREFS_TIMEPERWORKSET</string>
<string name="prefs_timePerRestSet">SHARED_PREFS_TIMEPERRESTSET</string>
<string name="prefs_numberOfSets">SHARED_PREFS_NUMBEROFSETS</string>
Expand Down
12 changes: 6 additions & 6 deletions TwoWaySample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
buildscript {
ext {
// SDK and tools
compileSdkVersion = 28
compileSdkVersion = 29
minSdkVersion = 21
targetSdkVersion = 28
targetSdkVersion = 29

// App dependencies
androidXTestVersion = '1.1.1'
constraintLayoutVersion = '1.1.3'
espressoVersion = '3.1.0-alpha4'
gradleVersion = '3.3.1'
gradleVersion = '3.5.1'
junitVersion = '4.12'
hamcrestVersion = '1.3'
kotlinVersion = '1.3.21'
kotlinVersion = '1.3.50'
runnerExtVersion = '1.1.0'
rulesVersion = '1.0.1'
appCompatVersion = '1.0.2'
appCompatVersion = '1.1.0'
supportLibraryVersion = '1.0.2'
archLifecycleVersion = '2.1.0-alpha03'
archLifecycleVersion = '2.2.0-rc01'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion TwoWaySample/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
4 changes: 2 additions & 2 deletions TwoWaySample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 29 14:34:40 CET 2019
#Fri Oct 25 03:39:52 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip