Skip to content

Commit 742e2ac

Browse files
committed
Merge branch 'develop'
2 parents fd73190 + b5db33c commit 742e2ac

File tree

61 files changed

+1222
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1222
-68
lines changed

.idea/codeStyles/Project.xml

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

androidx-core-ktx/build.gradle

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apply plugin: 'com.github.dcendents.android-maven'
2+
3+
group = 'com.github.codeerow.databinding'
4+
5+
6+
apply plugin: 'com.android.library'
7+
apply plugin: 'kotlin-android'
8+
apply plugin: 'kotlin-android-extensions'
9+
10+
11+
android {
12+
compileSdkVersion 29
13+
buildToolsVersion "29.0.2"
14+
15+
16+
defaultConfig {
17+
minSdkVersion 14
18+
targetSdkVersion 29
19+
versionCode 1
20+
versionName "1.0"
21+
22+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23+
consumerProguardFiles 'consumer-rules.pro'
24+
}
25+
26+
buildTypes {
27+
release {
28+
minifyEnabled false
29+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
30+
}
31+
}
32+
33+
}
34+
35+
dependencies {
36+
implementation fileTree(dir: 'libs', include: ['*.jar'])
37+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
38+
implementation 'androidx.appcompat:appcompat:1.1.0'
39+
implementation 'androidx.core:core-ktx:1.1.0'
40+
testImplementation 'junit:junit:4.12'
41+
androidTestImplementation 'androidx.test:runner:1.2.0'
42+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
43+
44+
api project(':androidx-core')
45+
}

androidx-core-ktx/consumer-rules.pro

Whitespace-only changes.
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.codeerow.databinding.android.core
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.runner.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.codeerow.databinding.android.core.test", appContext.packageName)
23+
}
24+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.codeerow.dsl_databinding">
3-
</manifest>
2+
package="com.codeerow.databinding.android.core" />
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.codeerow.databinding.androidx.core
2+
3+
import androidx.lifecycle.LifecycleOwner
4+
5+
6+
fun LifecycleOwner.dataBinding(form: LifecycleDataBinding.() -> Unit): LifecycleDataBinding {
7+
val dataBinding = LifecycleDataBinding(this)
8+
form(dataBinding)
9+
return dataBinding
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.codeerow.databinding.androidx.core.bindings.seekbar
2+
3+
import android.widget.SeekBar
4+
import androidx.lifecycle.MutableLiveData
5+
import com.codeerow.databinding.androidx.core.LifecycleDataBinding
6+
7+
8+
fun LifecycleDataBinding.progress(
9+
view: SeekBar,
10+
liveData: MutableLiveData<Int>,
11+
twoWay: Boolean = false
12+
) {
13+
this.apply(ProgressBinding(view, lifecycleOwner, liveData, twoWay))
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.codeerow.databinding.androidx.core.bindings.textview
2+
3+
import android.widget.TextView
4+
import androidx.lifecycle.MutableLiveData
5+
import com.codeerow.databinding.androidx.core.LifecycleDataBinding
6+
7+
8+
fun LifecycleDataBinding.text(
9+
view: TextView,
10+
liveData: MutableLiveData<String>,
11+
twoWay: Boolean = false
12+
) {
13+
this.apply(TextBinding(view, lifecycleOwner, liveData, twoWay))
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.codeerow.databinding.android.core.bindings.toolbar
2+
3+
import android.view.View
4+
import androidx.appcompat.widget.Toolbar
5+
import com.codeerow.databinding.DataBinding
6+
7+
8+
fun DataBinding.navButtonClick(view: Toolbar, listener: View.OnClickListener) {
9+
view.setNavigationOnClickListener(listener)
10+
}
11+
12+
fun DataBinding.navButtonClick(view: Toolbar, listener: (View) -> Unit) {
13+
view.setNavigationOnClickListener(listener)
14+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.codeerow.databinding.androidx.core.bindings.view
2+
3+
import android.view.View
4+
import androidx.lifecycle.MutableLiveData
5+
import com.codeerow.databinding.androidx.core.LifecycleDataBinding
6+
7+
8+
fun LifecycleDataBinding.visibility(
9+
view: View,
10+
liveData: MutableLiveData<Boolean>,
11+
goneWhenInvisible: Boolean = false
12+
) {
13+
this.apply(VisibilityBinding(view, lifecycleOwner, liveData, goneWhenInvisible))
14+
}
15+
16+
fun LifecycleDataBinding.enabled(view: View, liveData: MutableLiveData<Boolean>) {
17+
this.apply(EnabledBinding(view, lifecycleOwner, liveData))
18+
}
19+
20+
21+
fun LifecycleDataBinding.click(view: View, listener: View.OnClickListener) {
22+
this.apply(ClickBinding(view, listener))
23+
}
24+
25+
fun LifecycleDataBinding.click(view: View, listener: (View) -> Unit) {
26+
this.apply(ClickBinding(view, listener))
27+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">android-core-ktx</string>
3+
</resources>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.codeerow.databinding.android.core
2+
3+
import org.junit.Test
4+
5+
import org.junit.Assert.*
6+
7+
/**
8+
* Example local unit test, which will execute on the development machine (host).
9+
*
10+
* See [testing documentation](http://d.android.com/tools/testing).
11+
*/
12+
class ExampleUnitTest {
13+
@Test
14+
fun addition_isCorrect() {
15+
assertEquals(4, 2 + 2)
16+
}
17+
}

androidx-core/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
apply plugin: 'com.github.dcendents.android-maven'
22

3-
group = 'com.github.codeerow.dsldatabinding'
3+
group = 'com.github.codeerow.databinding'
44

55

66
apply plugin: 'com.android.library'
7-
apply plugin: 'kotlin-android'
8-
apply plugin: 'kotlin-android-extensions'
9-
107

118
android {
12-
compileSdkVersion 28
9+
compileSdkVersion 29
10+
buildToolsVersion "29.0.2"
11+
12+
1313
defaultConfig {
1414
minSdkVersion 14
15-
targetSdkVersion 28
15+
targetSdkVersion 29
1616
versionCode 1
1717
versionName "1.0"
18+
1819
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20+
consumerProguardFiles 'consumer-rules.pro'
1921
}
22+
2023
buildTypes {
2124
release {
2225
minifyEnabled false
2326
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2427
}
2528
}
29+
2630
}
2731

2832
dependencies {
2933
implementation fileTree(dir: 'libs', include: ['*.jar'])
30-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$project.versions.kotlin"
31-
implementation 'androidx.appcompat:appcompat:1.0.2'
32-
implementation 'androidx.core:core-ktx:1.0.2'
34+
35+
implementation 'androidx.appcompat:appcompat:1.1.0'
3336
testImplementation 'junit:junit:4.12'
3437
androidTestImplementation 'androidx.test:runner:1.2.0'
3538
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
39+
40+
api project(':core')
3641
}

androidx-core/consumer-rules.pro

Whitespace-only changes.

androidx-core/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)