A simple customised version of the TextInputLayout from the Android Design Support Library ⌨️

Overview

Buffer Text Input Layout

(Coming to maven central soon!)

This is a simple customisation of the TextInputLayout found in the Design Support Library.

Whilst this is an awesome component that we've made great use of, we wanted to be able to display the counter so that the value displayed was:

  • Not formatted in the way that the support library version was
  • Only visible when we reach a certain number of characters away from the maximum counter value

Hence why we created this simple component :)

Ascending

Ascending

Descending

Descending

Standard

Standard

Display when a given count away from the maximum value

Hidden

How to use

In exactly the same way as the support library! Simply wrap an edit text field like so:

<org.buffer.android.buffertextinputlayout.BufferTextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:counterEnabled="true"
        app:counterMaxLength="10"
        app:counterOverflowTextAppearance="@style/counterOverride"
        app:counterTextAppearance="@style/counterText"
        app:hintEnabled="true"
        app:counterMode="ascending">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/text_hint" />

</org.buffer.android.buffertextinputlayout.BufferTextInputLayout>

Setting attributes via XML

In our XML layout, we can set two extra attributes for the BufferTextInputLayout:

  • app:counterMode -> Set the mode in which the counter should use when being displayed (DESCENDING, ASCENDING, STANDARD)
  • app:displayFromCount -> Set the value for which how many characters should be remaining until the counter becomes visible

e.g

app:displayFromCount="5"
app:counterMode="descending"

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

e.g.

bufferTextInputLayout.setCounterMode(CounterMode.DESCENDING);
bufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40);
You might also like...
Navigation Drawer Activity with material design style and simplified methods

MaterialNavigationDrawer Navigation Drawer Activity with material design style and simplified methods       It requires 10+ API and android support v7

An implementation of tap targets from the Material Design guidelines for feature discovery.
An implementation of tap targets from the Material Design guidelines for feature discovery.

TapTargetView An implementation of tap targets from Google's Material Design guidelines on feature discovery. Min SDK: 14 JavaDoc Installation TapTar

Maetrial Design Delete Concept Implement
Maetrial Design Delete Concept Implement

MaterialDeleteLayout 说明 早上逛github的时候,发现ParticleLayout这个开源项目,觉得这个创意还可以... 从说明中又点进去看IOS的效果,也从那里看到了原设计图... 原设计图是这样子的: IOS的效果是这样的: 那一刻感觉android的效果lower了好多

Material Design Search View Layout, now implemented in Google Maps, Dialer, etc

THIS PROJECT IS DEPRECATED Component is not maintained anymore. Implementation of Lollipop+ Dialer and Google Maps. DEMO Add in View Add to your layou

:octocat: 📃  FoldingCell is a material design expanding content cell inspired by folding paper material made by @Ramotion
:octocat: 📃 FoldingCell is a material design expanding content cell inspired by folding paper material made by @Ramotion

FOLDING CELL [JAVA] Expanding content cell with animation inspired by folding paper card material design. We specialize in the designing and coding of

A very simple arc layout library for Android
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Simple android library to present an animated ferris wheel
Simple android library to present an animated ferris wheel

Ferris Wheel View Overview An Android Library used to implement an animated Ferris Wheel in android. API SDK 15+ Written in Kotlin Supports landscape

Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Comments
  • Added hintCollapseBoundsMode

    Added hintCollapseBoundsMode

    As a requirement for the current project that I am working. I have made a small changes for hint Collapsable Bounds whenever there is a drawableleft on the editText By default the hint is shown just above the text(2nd edit text in the gif) My requirement was to discard the drawable padding which would look something like first edit text in the gif

    opened by arnoldlaishram 0
Releases(1.1)
Owner
Buffer
Helping people build their business on social media since 2011
Buffer
Ultra Pull to Refresh for Android. Support all the views.

Welcome to follow me on GitHub or Twitter GitHub: https://github.com/liaohuqiu Twitter: https://twitter.com/liaohuqiu 中文版文档 Wanna auto-load-more? This

Huqiu Liao 9.6k Jan 5, 2023
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

dinus_developer 1.7k Nov 10, 2022
A custom SwipeRefreshLayout to support the pull-to-refresh featrue.RecyclerView,ListView,GridView,NestedScrollView,ScrollView are supported.

SuperSwipeRefreshLayout A custom SwipeRefreshLayout to support the pull-to-refresh featrue.You can custom your header view and footer view. RecyclerVi

Zheng Haibo(莫川) 1.3k Dec 13, 2022
Added support to modify text size and indicator width based on the original TabLayout.

XTabLayout——可修改选中项字体大小和指示器长度的TabLayout XTabLayout是基于design包中的TabLayout进行了功能的扩展,在保留原有功能的基础上,增加了修改选中项字体大小、修改指示器长度以及限制屏幕显示范围内显示的Tab个数。 集成步骤: 1.添加XTabLayo

Kennor 660 Dec 20, 2022
Android drawer icon with material design animation

LDrawer Android drawer icon with material design animation Note Basically same as appcompat_v7 version 21, you can use appcompat_v7 compile 'com.andro

Hasan Keklik 1.4k Dec 25, 2022
Android Sample Project with Material Design and Toolbar.

AndroidMaterialDesignToolbar -- PROJECT IS NOT SUPPORTED Android Sample Project with Material Design and Toolbar. Project use Appcompat library for ma

kemal selim tekinarslan 713 Nov 11, 2022
Material Design tap target for Android. https://sjwall.github.io/MaterialTapTargetPrompt/

Material Tap Target Prompt A Tap Target implementation in Android based on Material Design Onboarding guidelines. For more information on tap targets

Sam Wall 1.5k Dec 29, 2022
Pixel perfect for design layout android

Pixelperfect Pixel perfect helps you design layouts according to the resolution of your users' device Follow the steps below to implement : dependen

null 10 Oct 23, 2022
A layout to transition between two views using a Floating Action Button as shown in many Material Design concepts

⚠ This library is no longer maintained ⚠️ FABRevealLayout A layout to transition between two views using a Floating Action Button as shown in many Mat

Tomás Ruiz-López 901 Dec 9, 2022