From a00b2c3d503cf35b7c1b26b86db03a315ff9020b Mon Sep 17 00:00:00 2001 From: Ravindra Kumar Date: Wed, 14 Dec 2016 23:10:51 +0530 Subject: [PATCH 1/6] Updated readme with syntax highlighting. --- README.md | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 1120275..0567a2a 100644 --- a/README.md +++ b/README.md @@ -35,23 +35,24 @@ Hence why we created this simple component :) In exactly the same way as the support library! Simply wrap an edit text field like so: - - - - - - +```xml + + + + + +``` #Setting attributes via XML @@ -62,8 +63,10 @@ In our XML layout, we can set two extra attributes for the BufferTextInputLayout e.g - app:displayFromCount="5" - app:counterMode="descending" +```xml +app:displayFromCount="5" +app:counterMode="descending" +``` #Setting attributes programmatically @@ -72,6 +75,7 @@ e.g - setCharactersRemainingUntilCounterDisplay(int remainingCharacters) -> Set the value for which how many characters should be remaining until the counter becomes visible e.g. - - bufferTextInputLayout.setCounterMode(CounterMode.DESCENDING); - bufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40); +```java +bufferTextInputLayout.setCounterMode(CounterMode.DESCENDING); +bufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40); +``` From 0290d3708fd74dd84ffdf8d41002e47c787bba18 Mon Sep 17 00:00:00 2001 From: Joe Birch Date: Thu, 2 Feb 2017 09:22:04 +0000 Subject: [PATCH 2/6] Update build tools --- buffertextinputlayout/build.gradle | 4 ++-- build.gradle | 2 +- sample/build.gradle | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/buffertextinputlayout/build.gradle b/buffertextinputlayout/build.gradle index 9160107..59c2596 100644 --- a/buffertextinputlayout/build.gradle +++ b/buffertextinputlayout/build.gradle @@ -2,10 +2,10 @@ apply plugin: 'com.android.library' android { compileSdkVersion 25 - buildToolsVersion "25.0.1" + buildToolsVersion "25.0.2" defaultConfig { - minSdkVersion 16 + minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" diff --git a/build.gradle b/build.gradle index c20bca1..74b2ab0 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/sample/build.gradle b/sample/build.gradle index 5a6faaa..5f09389 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion "25.0.1" + buildToolsVersion "25.0.2" defaultConfig { applicationId "android.buffer.org.sample" - minSdkVersion 16 + minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" From d9f96f5e67aaca091c8da903c0e0211ccb9c9fba Mon Sep 17 00:00:00 2001 From: Joe Birch Date: Thu, 2 Feb 2017 09:54:57 +0000 Subject: [PATCH 3/6] Add some helper methods for extended functionality --- .../BufferTextInputLayout.java | 24 +++++++++++++++++++ .../TextInputListener.java | 5 ++++ 2 files changed, 29 insertions(+) create mode 100644 buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/TextInputListener.java 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 aa66cdb..8d103c9 100644 --- a/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/BufferTextInputLayout.java +++ b/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/BufferTextInputLayout.java @@ -141,6 +141,7 @@ public class BufferTextInputLayout extends LinearLayout { private int charactersRemainingUntilCounterDisplay; private CounterMode counterMode; + private TextInputListener textInputListener; public BufferTextInputLayout(Context context) { this(context, null); @@ -229,6 +230,28 @@ public void addView(View child, int index, final ViewGroup.LayoutParams params) } } + /** + * Manually update the enabled state of the input label + */ + public void updateEnabledState(int contentLength) { + setCounterEnabled(contentLength >= (getCounterMaxLength() - + charactersRemainingUntilCounterDisplay)); + } + + /** + * Set a listener for when text changes in the edit text + */ + public void setTextInputListener(TextInputListener textInputListener) { + this.textInputListener = textInputListener; + } + + /** + * Manually set the counter length for the label + */ + public void setCounterLength(int length) { + updateCounter(length); + } + /** * Set the count value that the counter labvel should be hidden until. */ @@ -311,6 +334,7 @@ public void afterTextChanged(Editable s) { if (counterEnabled) { updateCounter(s.length()); } + if (textInputListener != null) textInputListener.onTextChanged(s.toString()); } @Override diff --git a/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/TextInputListener.java b/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/TextInputListener.java new file mode 100644 index 0000000..7574a2a --- /dev/null +++ b/buffertextinputlayout/src/main/java/org/buffer/android/buffertextinputlayout/TextInputListener.java @@ -0,0 +1,5 @@ +package org.buffer.android.buffertextinputlayout; + +public interface TextInputListener { + void onTextChanged(String text); +} From 3c8f348be120127ae5cb4e307d9a7997713c9164 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 3 May 2017 08:41:12 -0500 Subject: [PATCH 4/6] Update README formatting --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0567a2a..6a9ccb4 100644 --- a/README.md +++ b/README.md @@ -13,25 +13,25 @@ the counter so that the value displayed was: Hence why we created this simple component :) -##Ascending +## Ascending ![Ascending](/art/ascending.gif) -##Descending +## Descending ![Descending](/art/descending.gif) -##Standard +## Standard ![Standard](/art/standard.gif) -##Display when a given count away from the maximum value +## Display when a given count away from the maximum value ![Hidden](/art/hidden.gif) -#How to use +# How to use In exactly the same way as the support library! Simply wrap an edit text field like so: @@ -54,7 +54,7 @@ In exactly the same way as the support library! Simply wrap an edit text field l ``` -#Setting attributes via XML +# Setting attributes via XML In our XML layout, we can set two extra attributes for the BufferTextInputLayout: @@ -69,7 +69,7 @@ app:counterMode="descending" ``` -#Setting attributes programmatically +# Setting attributes programmatically - setCounterMode(CounterMode counterMode) -> Set the mode in which the counter should use when being displayed (DESCENDING, ASCENDING, STANDARD) - setCharactersRemainingUntilCounterDisplay(int remainingCharacters) -> Set the value for which how many characters should be remaining until the counter becomes visible From 2c9f60cad0875b15ee28c92454d201882812183f Mon Sep 17 00:00:00 2001 From: John Date: Wed, 3 May 2017 08:46:33 -0500 Subject: [PATCH 5/6] Remove `app` module --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 87d5561..4f6658b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':buffertextinputlayout', ':sample' +include ':buffertextinputlayout', ':sample' From ece291adf6173c149b51c0e336b6f8bebbed5089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszczy=C5=84ski?= Date: Tue, 3 Jun 2025 17:24:49 +0200 Subject: [PATCH 6/6] chore: add CODEOWNERS file with @bufferapp/apps as default owner / SEC-96 --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..ae66b2a --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @bufferapp/apps