Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
```
<dependency>
<groupId>com.wajahatkarim3.BufferTextInputLayout</groupId>
<artifactId>buffertextinputlayout</artifactId>
<version>1.2.0</version>
<type>pom</type>
</dependency>
```

# How to use

Expand Down Expand Up @@ -79,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.
42 changes: 38 additions & 4 deletions buffertextinputlayout/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
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 = '[email protected]'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

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"
}
Expand All @@ -21,7 +48,14 @@ 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"
}

//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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions buffertextinputlayout/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="default_error_color">#ee4f4f</color>
</resources>
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@

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
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

subprojects {
tasks.withType(Javadoc).all { enabled = false }
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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'
}