diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-09 00:24:40 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-09 00:24:40 -0700 |
commit | 40d6788abfa46ac99f46b32fd4aeb78e67c3b6f6 (patch) | |
tree | 523f72bd0c53817815fd0ab1aa7c3124a3264745 | |
parent | bcc7dd36752829b650b583fd6ee6168de3e6f95a (diff) | |
download | kau-40d6788abfa46ac99f46b32fd4aeb78e67c3b6f6.tar.gz kau-40d6788abfa46ac99f46b32fd4aeb78e67c3b6f6.tar.bz2 kau-40d6788abfa46ac99f46b32fd4aeb78e67c3b6f6.zip |
Clean up gradle and test build
41 files changed, 185 insertions, 380 deletions
diff --git a/.idea/misc.xml b/.idea/misc.xml index 7319f02..085136f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -53,7 +53,7 @@ <ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Remove" /> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> diff --git a/about/build.gradle b/about/build.gradle index 5598429..6718145 100644 --- a/about/build.gradle +++ b/about/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } resourcePrefix "kau_" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } } dependencies { @@ -52,8 +14,8 @@ dependencies { compile project(':core-ui') compile project(':adapter') - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" compile("com.mikepenz:aboutlibraries:${ABOUT_LIBRARIES}@aar") { transitive = true diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt index 638b7c5..90dbfd3 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -10,7 +10,6 @@ import android.transition.TransitionInflater import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import ca.allanwang.kau.R import ca.allanwang.kau.adapters.FastItemThemedAdapter import ca.allanwang.kau.adapters.ThemableIItemColors import ca.allanwang.kau.adapters.ThemableIItemColorsDelegate diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt index 34e8641..9a4f6bf 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.about import android.support.v7.widget.RecyclerView import android.view.View -import ca.allanwang.kau.R +import ca.allanwang.kau.about.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.ui.views.CutoutView diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt index 1b832a2..82d71dc 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt @@ -6,7 +6,7 @@ import android.support.v7.widget.RecyclerView import android.text.Html import android.view.View import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.about.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.utils.bindView diff --git a/adapter/build.gradle b/adapter/build.gradle index 82c89b0..7894627 100644 --- a/adapter/build.gradle +++ b/adapter/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } resourcePrefix "kau_" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } } dependencies { @@ -51,8 +13,8 @@ dependencies { compile project(':core') - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" compile "com.mikepenz:fastadapter:${FAST_ADAPTER}@aar" compile "com.mikepenz:fastadapter-commons:${FAST_ADAPTER_COMMONS}@aar" diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt index 3380ade..68b247c 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt @@ -9,7 +9,7 @@ import android.widget.Button import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.adapter.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.utils.* diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt index 814d5c0..21a49f2 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt @@ -4,7 +4,7 @@ import android.support.v7.widget.CardView import android.support.v7.widget.RecyclerView import android.view.View import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.adapter.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.utils.bindView diff --git a/android.gradle b/android.gradle new file mode 100644 index 0000000..7d3db8f --- /dev/null +++ b/android.gradle @@ -0,0 +1,42 @@ +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'com.github.dcendents.android-maven' +group = project.APP_GROUP + +repositories { + jcenter() + mavenCentral() + maven { url "https://jitpack.io" } + maven { url "https://maven.google.com" } +} + +android { + compileSdkVersion Integer.parseInt(project.TARGET_SDK) + buildToolsVersion project.BUILD_TOOLS + + defaultConfig { + minSdkVersion Integer.parseInt(project.MIN_SDK) + targetSdkVersion Integer.parseInt(project.TARGET_SDK) +// versionCode androidGitVersion.code() +// versionName androidGitVersion.name() + consumerProguardFiles 'progress-proguard.txt' + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + lintOptions { + abortOnError false + checkReleaseBuilds false + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + test.java.srcDirs += 'src/test/kotlin' + } +}
\ No newline at end of file diff --git a/build.gradle b/build.gradle index 76797e2..960f7e6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,32 +1,83 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.1.3' repositories { jcenter() maven { url 'https://maven.fabric.io/public' } + maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN}" classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } -allprojects { - repositories { - jcenter() - mavenCentral() - maven { url "https://jitpack.io" } - maven { url "https://maven.google.com" } - } -} +//plugins { +// id 'com.gladed.androidgitversion' version '0.3.4' apply false +//} -task clean(type: Delete) { - delete rootProject.buildDir -} +//configure(subprojects - project(':sample')) { +//// apply plugin: 'com.gladed.androidgitversion' +//// apply from: '../extra.gradle' +// apply plugin: 'com.android.library' +// apply plugin: 'kotlin-android' +// apply plugin: 'com.github.dcendents.android-maven' +// +//// if (!it.plugins.hasPlugin('com.gladed.androidgitversion')) apply plugin: 'com.gladed.androidgitversion' +//// else dependencies { +//// compile project(':core') +//// } +// +// group = project.APP_GROUP +// +// repositories { +// jcenter() +// mavenCentral() +// maven { url "https://jitpack.io" } +// maven { url "https://maven.google.com" } +// } +// +// android { +// compileSdkVersion Integer.parseInt(project.TARGET_SDK) +// buildToolsVersion project.BUILD_TOOLS +// +//// androidGitVersion { +//// codeFormat = 'MMNNPPBB' +//// prefix 'v' +//// } +// +// defaultConfig { +// minSdkVersion Integer.parseInt(project.MIN_SDK) +// targetSdkVersion Integer.parseInt(project.TARGET_SDK) +//// versionCode androidGitVersion.code() +//// versionName androidGitVersion.name() +// consumerProguardFiles 'progress-proguard.txt' +// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" +// } +// buildTypes { +// release { +// minifyEnabled false +// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' +// } +// } +// lintOptions { +// abortOnError false +// checkReleaseBuilds false +// } +// resourcePrefix "kau_color" +// sourceSets { +// main.java.srcDirs += 'src/main/kotlin' +// test.java.srcDirs += 'src/test/kotlin' +// } +// } +//} + +//task clean(type: Delete) { +// delete rootProject.buildDir +//} task generateChangelogMd() { def parsedProjectXml = (new XmlParser()).parse("$project.rootDir/sample/src/main/res/xml/changelog.xml") diff --git a/colorpicker/build.gradle b/colorpicker/build.gradle index 1833119..5972ea3 100644 --- a/colorpicker/build.gradle +++ b/colorpicker/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } - resourcePrefix "kau_color" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } + resourcePrefix "kau_color_" } dependencies { @@ -50,8 +12,8 @@ dependencies { testCompile 'junit:junit:4.12' compile project(':core') - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" compile "com.afollestad.material-dialogs:commons:${MATERIAL_DIALOG}" } diff --git a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt index 6d23ade..e987c2c 100644 --- a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt +++ b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt @@ -4,7 +4,6 @@ import android.content.Context import android.graphics.Color import android.support.annotation.DimenRes import android.support.annotation.StringRes -import ca.allanwang.kau.R import ca.allanwang.kau.utils.string import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.Theme diff --git a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt index 6565585..04345a1 100644 --- a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt +++ b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt @@ -11,7 +11,6 @@ import android.util.AttributeSet import android.view.View import android.view.ViewGroup import android.widget.* -import ca.allanwang.kau.R import ca.allanwang.kau.utils.* import com.afollestad.materialdialogs.DialogAction import com.afollestad.materialdialogs.MaterialDialog @@ -29,7 +28,7 @@ internal class ColorPickerView @JvmOverloads constructor( var selectedColor: Int = -1 var isInSub: Boolean = false var isInCustom: Boolean = false - var circleSize: Int = context.dimen(R.dimen.kau_cp_circle_size).toInt() + var circleSize: Int = context.dimen(R.dimen.kau_color_circle_size).toInt() val backgroundColor = context.resolveColor(R.attr.md_background_color, if (context.resolveColor(android.R.attr.textColorPrimary).isColorDark) Color.WHITE else 0xff424242.toInt()) val backgroundColorTint = backgroundColor.colorToForeground() diff --git a/core-ui/build.gradle b/core-ui/build.gradle index 996918f..99f4567 100644 --- a/core-ui/build.gradle +++ b/core-ui/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } resourcePrefix "kau_" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } } dependencies { @@ -51,8 +13,8 @@ dependencies { compile project(':core') compile project(':adapter') - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" compile "io.reactivex.rxjava2:rxkotlin:${RX_KOTLIN}" compile "io.reactivex.rxjava2:rxandroid:${RX_ANDROID}" diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt index 554f71f..db002b9 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt @@ -3,7 +3,8 @@ package ca.allanwang.kau.ui.views import android.content.Context import android.support.v7.widget.CardView import android.util.AttributeSet -import ca.allanwang.kau.R +import ca.allanwang.kau.ui.R +import ca.allanwang.kau.utils.parentVisibleHeight /** diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/CutoutView.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/CutoutView.kt index abd96ed..42f19b9 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/CutoutView.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/CutoutView.kt @@ -24,7 +24,7 @@ import android.util.AttributeSet import android.util.DisplayMetrics import android.util.TypedValue import android.view.View -import ca.allanwang.kau.R +import ca.allanwang.kau.ui.R import ca.allanwang.kau.utils.dimenPixelSize import ca.allanwang.kau.utils.getFont import ca.allanwang.kau.utils.parentVisibleHeight diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt index 452fd56..c208210 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt @@ -22,7 +22,7 @@ import android.graphics.Color import android.util.AttributeSet import android.view.View import android.widget.FrameLayout -import ca.allanwang.kau.R +import ca.allanwang.kau.ui.R import ca.allanwang.kau.utils.* /** diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java index cc90cb2..cad6997 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java @@ -36,7 +36,7 @@ import android.view.animation.Interpolator; import java.util.Arrays; -import ca.allanwang.kau.R; +import ca.allanwang.kau.ui.R; import ca.allanwang.kau.utils.AnimHolder; import ca.allanwang.kau.utils.ColorUtilsKt; diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt index f38a0b7..bcd930f 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt @@ -10,7 +10,7 @@ import android.view.animation.Animation import android.view.animation.AnimationUtils import android.widget.TextSwitcher import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.ui.R import java.util.* /** diff --git a/core/build.gradle b/core/build.gradle index 3a3bb75..bcdf89a 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } resourcePrefix "kau_" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } } dependencies { @@ -49,8 +11,8 @@ dependencies { }) testCompile 'junit:junit:4.12' - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" compile "com.android.support:appcompat-v7:${ANDROID_SUPPORT_LIBS}" compile "com.android.support:support-v4:${ANDROID_SUPPORT_LIBS}" diff --git a/gradle.properties b/gradle.properties index 4eb876a..8e2555e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,6 +22,7 @@ TARGET_SDK=26 BUILD_TOOLS=26.0.0 ANDROID_SUPPORT_LIBS=26.0.0-beta2 +KOTLIN=1.1.3-2 MATERIAL_DIALOG=0.9.4.5 ICONICS=2.8.9 IICON_GOOGLE=3.0.1.1 diff --git a/imagepicker/build.gradle b/imagepicker/build.gradle index b2b9b7d..b98b736 100644 --- a/imagepicker/build.gradle +++ b/imagepicker/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } resourcePrefix "kau_" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } } dependencies { diff --git a/imagepicker/src/main/kotlin/ca/allanwang/kau/imagepicker/ImagePickerActivityBase.kt b/imagepicker/src/main/kotlin/ca/allanwang/kau/imagepicker/ImagePickerActivityBase.kt index a236e64..47d57c2 100644 --- a/imagepicker/src/main/kotlin/ca/allanwang/kau/imagepicker/ImagePickerActivityBase.kt +++ b/imagepicker/src/main/kotlin/ca/allanwang/kau/imagepicker/ImagePickerActivityBase.kt @@ -39,8 +39,8 @@ abstract class ImagePickerActivityBase : AppCompatActivity(), LoaderManager.Load draggableFrame.addListener(object : ElasticDragDismissFrameLayout.SystemChromeFader(this) { override fun onDragDismissed() { if (draggableFrame.translationY < 0) { - window.returnTransition = TransitionInflater.from(this@ImagePickerActivityBase) - .inflateTransition(R.transition.kau_about_return_upwards) +// window.returnTransition = TransitionInflater.from(this@ImagePickerActivityBase) +// .inflateTransition(R.transition.kau_about_return_upwards) } finishAfterTransition() } diff --git a/imagepicker/src/main/res/values/styles.xml b/imagepicker/src/main/res/values/styles.xml index 1dc5149..e2d7280 100644 --- a/imagepicker/src/main/res/values/styles.xml +++ b/imagepicker/src/main/res/values/styles.xml @@ -1,8 +1,8 @@ <resources> <style name="Kau.Translucent.ImagePicker"> - <item name="android:windowEnterTransition">@transition/kau_enter_slide_bottom</item> - <item name="android:windowReturnTransition">@transition/kau_about_return_downward</item> + <!--<item name="android:windowEnterTransition">@transition/kau_enter_slide_bottom</item>--> + <!--<item name="android:windowReturnTransition">@transition/kau_about_return_downward</item>--> </style> </resources> diff --git a/kpref-activity/build.gradle b/kpref-activity/build.gradle index 31d0a70..dac2b69 100644 --- a/kpref-activity/build.gradle +++ b/kpref-activity/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } - resourcePrefix "kau_pref" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } + resourcePrefix "kau_" } dependencies { @@ -53,8 +15,8 @@ dependencies { compile project(':adapter') compile project(':colorpicker') - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" } diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt index be8fad8..b978a6e 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt @@ -11,7 +11,6 @@ import android.view.animation.Animation import android.view.animation.AnimationUtils import android.widget.FrameLayout import android.widget.ViewAnimator -import ca.allanwang.kau.R import ca.allanwang.kau.kpref.activity.items.KPrefItemCore import ca.allanwang.kau.ui.views.RippleCanvas import ca.allanwang.kau.ui.widgets.TextSlider @@ -55,7 +54,7 @@ abstract class KPrefActivity : AppCompatActivity(), KPrefActivityContract { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) //setup layout - setContentView(R.layout.kau_activity_kpref) + setContentView(R.layout.kau_pref_activity) setSupportActionBar(toolbar) if (supportActionBar != null) with(supportActionBar!!) { diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt index b7ccc69..baefba7 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View import android.widget.CheckBox -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.utils.tint /** diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefColorPicker.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefColorPicker.kt index 38008f3..83d886d 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefColorPicker.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefColorPicker.kt @@ -1,12 +1,12 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View -import ca.allanwang.kau.R import ca.allanwang.kau.colorpicker.CircleView import ca.allanwang.kau.colorpicker.ColorBuilder import ca.allanwang.kau.colorpicker.ColorContract import ca.allanwang.kau.colorpicker.colorPickerDialog import ca.allanwang.kau.kpref.activity.GlobalOptions +import ca.allanwang.kau.kpref.activity.R /** * Created by Allan Wang on 2017-06-07. diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefHeader.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefHeader.kt index 009caba..e0eb37a 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefHeader.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefHeader.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R /** * Created by Allan Wang on 2017-06-07. diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt index d7133c1..ac54cb0 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.kpref.activity.items import android.support.annotation.CallSuper import android.view.View -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.utils.resolveDrawable diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt index fdda464..61d5ea3 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt @@ -11,7 +11,7 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.kpref.activity.GlobalOptions diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt index dd58cd5..c0afe13 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions /** diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt index 522ba7c..6ca7fcd 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt @@ -3,7 +3,7 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View import android.widget.SeekBar import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.KPrefException import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.utils.tint diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt index 509394c..9081ec8 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt index 33510c3..a1603ce 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefText.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.kpref.activity.items import android.view.View import android.widget.TextView -import ca.allanwang.kau.R +import ca.allanwang.kau.kpref.activity.R import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.utils.toast diff --git a/sample/build.gradle b/sample/build.gradle index 11b7a60..be204d0 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,10 +1,16 @@ plugins { id 'com.gladed.androidgitversion' version '0.3.4' } - apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +repositories { + jcenter() + mavenCentral() + maven { url "https://jitpack.io" } + maven { url "https://maven.google.com" } +} + android { compileSdkVersion Integer.parseInt(project.TARGET_SDK) buildToolsVersion project.BUILD_TOOLS @@ -15,20 +21,25 @@ android { } defaultConfig { - applicationId "${project.APP_GROUP}." + project.APP_ID.toLowerCase() + ".sample" minSdkVersion Integer.parseInt(project.MIN_SDK) targetSdkVersion Integer.parseInt(project.TARGET_SDK) versionCode androidGitVersion.code() versionName androidGitVersion.name() testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } + buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + lintOptions { + abortOnError false + checkReleaseBuilds false + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' test.java.srcDirs += 'src/test/kotlin' @@ -50,8 +61,5 @@ dependencies { }) testCompile 'junit:junit:4.12' compile "com.mikepenz:google-material-typeface:${IICON_GOOGLE}.original@aar" - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" -} -repositories { - mavenCentral() + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" } diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt index de741ab..e675ebf 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt @@ -1,5 +1,6 @@ package ca.allanwang.kau.sample +import ca.allanwang.kau.about.AboutActivityBase import ca.allanwang.kau.adapters.FastItemThemedAdapter import ca.allanwang.kau.iitems.CardIItem import com.mikepenz.fastadapter.IItem diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt index 81f34d2..9a874cb 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -4,8 +4,19 @@ import android.os.Bundle import android.os.PersistableBundle import android.view.Menu import android.view.MenuItem +import ca.allanwang.kau.email.sendEmail +import ca.allanwang.kau.kpref.activity.CoreAttributeContract +import ca.allanwang.kau.kpref.activity.KPrefActivity +import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder import ca.allanwang.kau.searchview.SearchItem import ca.allanwang.kau.searchview.SearchView +import ca.allanwang.kau.searchview.bindSearchView +import ca.allanwang.kau.ui.views.RippleCanvas +import ca.allanwang.kau.utils.materialDialog +import ca.allanwang.kau.utils.navigationBarColor +import ca.allanwang.kau.utils.startActivity +import ca.allanwang.kau.utils.toast +import com.mikepenz.google_material_typeface_library.GoogleMaterial class MainActivity : KPrefActivity() { diff --git a/searchbar/build.gradle b/searchbar/build.gradle index 80394ea..78054b3 100644 --- a/searchbar/build.gradle +++ b/searchbar/build.gradle @@ -1,45 +1,7 @@ -plugins { - id 'com.gladed.androidgitversion' version '0.3.4' -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' - -group = project.APP_GROUP +apply from: '../android.gradle' android { - compileSdkVersion Integer.parseInt(project.TARGET_SDK) - buildToolsVersion project.BUILD_TOOLS - - androidGitVersion { - codeFormat = 'MMNNPPBB' - prefix 'v' - } - - defaultConfig { - minSdkVersion Integer.parseInt(project.MIN_SDK) - targetSdkVersion Integer.parseInt(project.TARGET_SDK) - versionCode androidGitVersion.code() - versionName androidGitVersion.name() - consumerProguardFiles 'progress-proguard.txt' - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - checkReleaseBuilds false - } - resourcePrefix "kau_search_" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' - } + resourcePrefix "kau_" } dependencies { @@ -52,8 +14,8 @@ dependencies { compile project(':core-ui') compile project(':adapter') - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}" + testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" } diff --git a/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt b/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt index f1e49e0..75d9b27 100644 --- a/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt +++ b/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt @@ -10,7 +10,6 @@ import android.text.style.StyleSpan import android.view.View import android.widget.ImageView import android.widget.TextView -import ca.allanwang.kau.R import ca.allanwang.kau.iitems.KauIItem import ca.allanwang.kau.utils.* import com.mikepenz.google_material_typeface_library.GoogleMaterial diff --git a/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt index 59f4bc1..2178806 100644 --- a/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt +++ b/searchbar/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt @@ -16,7 +16,6 @@ import android.view.* import android.widget.FrameLayout import android.widget.ImageView import android.widget.ProgressBar -import ca.allanwang.kau.R import ca.allanwang.kau.animators.NoAnimator import ca.allanwang.kau.kotlin.nonReadable import ca.allanwang.kau.searchview.SearchView.Configs |