From b754e38a11fda03d9acfee4b0749d609f53f94f8 Mon Sep 17 00:00:00 2001 From: Wajahat Karim Date: Wed, 21 Mar 2018 01:53:43 +0500 Subject: [PATCH 1/4] update support and build tools and fixed a color issue... --- buffertextinputlayout/build.gradle | 8 ++++---- .../buffertextinputlayout/BufferTextInputLayout.java | 4 ++-- buffertextinputlayout/src/main/res/values/colors.xml | 4 ++++ build.gradle | 4 +++- gradle/wrapper/gradle-wrapper.properties | 4 ++-- sample/build.gradle | 10 +++++----- 6 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 buffertextinputlayout/src/main/res/values/colors.xml diff --git a/buffertextinputlayout/build.gradle b/buffertextinputlayout/build.gradle index 59c2596..2e20034 100644 --- a/buffertextinputlayout/build.gradle +++ b/buffertextinputlayout/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 27 + buildToolsVersion '26.0.3' defaultConfig { minSdkVersion 15 - targetSdkVersion 25 + targetSdkVersion 27 versionCode 1 versionName "1.0" } @@ -21,7 +21,7 @@ android { } dependencies { - final SUPPORT_LIBRARY_VERSION = '25.1.0' + final SUPPORT_LIBRARY_VERSION = '27.0.2' compile fileTree(dir: 'libs', include: ['*.jar']) compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION" } diff --git a/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/BufferTextInputLayout.java b/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/BufferTextInputLayout.java index 8d103c9..ba92ee1 100644 --- a/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/BufferTextInputLayout.java +++ b/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/BufferTextInputLayout.java @@ -582,7 +582,7 @@ public void setErrorEnabled(boolean enabled) { TextViewCompat.setTextAppearance(errorView, android.support.v7.appcompat.R.style.TextAppearance_AppCompat_Caption); errorView.setTextColor(ContextCompat.getColor( - getContext(), R.color.design_textinput_error_color_light)); + getContext(), R.color.default_error_color)); } errorView.setVisibility(INVISIBLE); ViewCompat.setAccessibilityLiveRegion(errorView, @@ -701,7 +701,7 @@ public void setCounterEnabled(boolean enabled) { TextViewCompat.setTextAppearance(counterView, android.support.v7.appcompat.R.style.TextAppearance_AppCompat_Caption); counterView.setTextColor(ContextCompat.getColor( - getContext(), R.color.design_textinput_error_color_light)); + getContext(), R.color.default_error_color)); } addIndicator(counterView, -1); if (editText == null) { diff --git a/buffertextinputlayout/src/main/res/values/colors.xml b/buffertextinputlayout/src/main/res/values/colors.xml new file mode 100644 index 0000000..2c1a8d2 --- /dev/null +++ b/buffertextinputlayout/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #ee4f4f + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 74b2ab0..5120095 100644 --- a/build.gradle +++ b/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:3.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -14,6 +15,7 @@ buildscript { allprojects { repositories { + google() jcenter() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 04e285f..0b72fed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Dec 28 10:00:20 PST 2015 +#Wed Mar 21 01:24:13 PKT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/sample/build.gradle b/sample/build.gradle index 5f09389..15a040c 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 27 + buildToolsVersion '26.0.3' defaultConfig { applicationId "android.buffer.org.sample" - minSdkVersion 15 - targetSdkVersion 25 + minSdkVersion 18 + targetSdkVersion 27 versionCode 1 versionName "1.0" } @@ -23,6 +23,6 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':buffertextinputlayout') - compile 'com.android.support:appcompat-v7:25.1.0' + compile 'com.android.support:appcompat-v7:27.0.2' testCompile 'junit:junit:4.12' } From 26b6a29dd7aeea0f19443c9a5b1c16d4158ed451 Mon Sep 17 00:00:00 2001 From: Wajahat Karim Date: Wed, 21 Mar 2018 02:38:44 +0500 Subject: [PATCH 2/4] uploaded the library to jcenter() with version 1.2.0 --- buffertextinputlayout/build.gradle | 34 ++++++++++++++++++++++++++++++ build.gradle | 6 ++++++ 2 files changed, 40 insertions(+) diff --git a/buffertextinputlayout/build.gradle b/buffertextinputlayout/build.gradle index 2e20034..0289985 100644 --- a/buffertextinputlayout/build.gradle +++ b/buffertextinputlayout/build.gradle @@ -1,4 +1,31 @@ apply plugin: 'com.android.library' +apply plugin: 'com.jfrog.bintray' +apply plugin: 'com.github.dcendents.android-maven' + +ext { + + bintrayRepo = "BufferTextInputLayout" + bintrayName = "com.wajahatkarim3.BufferTextInputLayout" + + publishedGroupId = 'com.wajahatkarim3.BufferTextInputLayout' + libraryName = 'buffertextinputlayout' + artifact = 'buffertextinputlayout' + + libraryDescription = 'A simple customised version of the TextInputLayout from the Android Design Support Library' + + siteUrl = 'https://github.com/wajahatkarim3/BufferTextInputLayout' + gitUrl = 'https://github.com/wajahatkarim3/BufferTextInputLayout.git' + + libraryVersion = '1.2.0' + + developerId = 'buffer' + developerName = 'Buffer' + developerEmail = 'wajahatkarim3@gmail.com' + + licenseName = 'The Apache Software License, Version 2.0' + licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + allLicenses = ["Apache-2.0"] +} android { compileSdkVersion 27 @@ -25,3 +52,10 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION" } + +//Add these lines to publish library to bintray. This is the readymade scripts made by github user nuuneoi to make uploading to bintray easy. +//Place it at the end of the file +if (project.rootProject.file('local.properties').exists()) { + apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' + apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5120095..7ff96e4 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,8 @@ buildscript { // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' } } @@ -23,3 +25,7 @@ allprojects { task clean(type: Delete) { delete rootProject.buildDir } + +subprojects { + tasks.withType(Javadoc).all { enabled = false } +} From 82314159a1d7b8b15edb2195d63ffffb7624ac47 Mon Sep 17 00:00:00 2001 From: Wajahat Karim Date: Wed, 21 Mar 2018 02:45:55 +0500 Subject: [PATCH 3/4] Update README.md --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a9ccb4..677e798 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ Buffer Text Input Layout ------------------------- -(Coming to maven central soon!) +~~(Coming to maven central soon!)~~ +Now available on Gradle. Check [**Installation**](https://github.com/wajahatkarim3/BufferTextInputLayout#installation) section. This is a simple customisation of the TextInputLayout found in the Design Support Library. @@ -30,6 +31,22 @@ Hence why we created this simple component :) ![Hidden](/art/hidden.gif) +# Installation + +## Gradle +```groovy +compile 'com.wajahatkarim3.BufferTextInputLayout:buffertextinputlayout:1.2.0' +``` + +## Maven +``` + + com.wajahatkarim3.BufferTextInputLayout + buffertextinputlayout + 1.2.0 + pom + +``` # How to use From f8d3cc6cb439c5dcee1a6479716454e9ea271805 Mon Sep 17 00:00:00 2001 From: Wajahat Karim Date: Wed, 21 Mar 2018 02:49:40 +0500 Subject: [PATCH 4/4] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 677e798..3a136c6 100644 --- a/README.md +++ b/README.md @@ -96,3 +96,22 @@ e.g. bufferTextInputLayout.setCounterMode(CounterMode.DESCENDING); bufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40); ``` + +# Developed By +This component has been completely developer by team at [Buffer](https://github.com/bufferapp) and has been forked from their [BufferTextInputLayout](https://github.com/bufferapp/BufferTextInputLayout) library. I have only uploaded the AAR on jCenter() and Maven() so that other developers can use it directly using gradle. + +# License + + Copyright 2018 Wajahat Karim + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.