{"id":13644512,"url":"https://github.com/bufferapp/BufferTextInputLayout","last_synced_at":"2025-04-21T10:33:28.230Z","repository":{"id":49751530,"uuid":"76442306","full_name":"bufferapp/BufferTextInputLayout","owner":"bufferapp","description":"A simple customised version of the TextInputLayout from the Android Design Support Library ⌨️","archived":false,"fork":false,"pushed_at":"2020-06-22T16:03:56.000Z","size":252,"stargazers_count":982,"open_issues_count":1,"forks_count":99,"subscribers_count":49,"default_branch":"main","last_synced_at":"2025-04-04T06:08:36.755Z","etag":null,"topics":["android","android-library","android-ui","java","textinputlayout"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bufferapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-14T08:59:09.000Z","updated_at":"2025-03-30T00:20:39.000Z","dependencies_parsed_at":"2022-09-11T08:41:35.954Z","dependency_job_id":null,"html_url":"https://github.com/bufferapp/BufferTextInputLayout","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FBufferTextInputLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FBufferTextInputLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FBufferTextInputLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FBufferTextInputLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufferapp","download_url":"https://codeload.github.com/bufferapp/BufferTextInputLayout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040482,"owners_count":21365113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","android-ui","java","textinputlayout"],"created_at":"2024-08-02T01:02:06.375Z","updated_at":"2025-04-21T10:33:27.318Z","avatar_url":"https://github.com/bufferapp.png","language":"Java","readme":"Buffer Text Input Layout\n-------------------------\n\n(Coming to maven central soon!)\n\nThis is a simple customisation of the TextInputLayout found in the Design Support Library.\n\nWhilst this is an awesome component that we've made great use of, we wanted to be able to display\nthe counter so that the value displayed was:\n\n- Not formatted in the way that the support library version was\n- Only visible when we reach a certain number of characters away from the maximum counter value\n\nHence why we created this simple component :)\n\n## Ascending\n\n![Ascending](/art/ascending.gif)\n\n## Descending\n\n![Descending](/art/descending.gif)\n\n## Standard\n\n![Standard](/art/standard.gif)\n\n\n## Display when a given count away from the maximum value\n\n![Hidden](/art/hidden.gif)\n\n\n# How to use\n\nIn exactly the same way as the support library! Simply wrap an edit text field like so:\n\n```xml\n\u003corg.buffer.android.buffertextinputlayout.BufferTextInputLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:counterEnabled=\"true\"\n        app:counterMaxLength=\"10\"\n        app:counterOverflowTextAppearance=\"@style/counterOverride\"\n        app:counterTextAppearance=\"@style/counterText\"\n        app:hintEnabled=\"true\"\n        app:counterMode=\"ascending\"\u003e\n\n    \u003cEditText\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:hint=\"@string/text_hint\" /\u003e\n\n\u003c/org.buffer.android.buffertextinputlayout.BufferTextInputLayout\u003e\n```\n\n# Setting attributes via XML\n\nIn our XML layout, we can set two extra attributes for the BufferTextInputLayout:\n\n- app:counterMode -\u003e Set the mode in which the counter should use when being displayed (DESCENDING, ASCENDING, STANDARD)\n- app:displayFromCount -\u003e Set the value for which how many characters should be remaining until the counter becomes visible\n\ne.g\n\n```xml\napp:displayFromCount=\"5\"\napp:counterMode=\"descending\"\n```\n\n\n# Setting attributes programmatically\n\n- setCounterMode(CounterMode counterMode) -\u003e Set the mode in which the counter should use when being displayed (DESCENDING, ASCENDING, STANDARD)\n- setCharactersRemainingUntilCounterDisplay(int remainingCharacters) -\u003e Set the value for which how many characters should be remaining until the counter becomes visible\n\ne.g.\n```java\nbufferTextInputLayout.setCounterMode(CounterMode.DESCENDING);\nbufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40);\n```\n","funding_links":[],"categories":["EditText"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2FBufferTextInputLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufferapp%2FBufferTextInputLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2FBufferTextInputLayout/lists"}