Apache License 2.0

项目介绍

bufferapp/BufferTextInputLayout 是一个托管在 GitHub 上的开源项目,主要使用 Java 编写,采用 Apache License 2.0 许可证,目前获得 978 个 Star、95 次 Fork。

仓库全名
bufferapp/BufferTextInputLayout
开源许可证
Apache License 2.0
Star 数
978
Fork 数
95
未关闭 Issue
1

README 摘要

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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

BufferTextInputLayout 用什么语言开发?

主要使用 Java 编写,采用 Apache License 2.0 许可证,目前有 978 个 Star。

BufferTextInputLayout 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 BufferTextInputLayout 的源码?

可以直接克隆仓库:git clone https://github.com/bufferapp/BufferTextInputLayout.git,默认分支为 main;安装与运行步骤见仓库 README。

BufferTextInputLayout 最近还在维护吗?

仓库最近一次更新为 2025年6月5日,当前有 1 个未关闭 Issue;Star 数为 978,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

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

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1216
价值分
620
活跃状态
活跃

语言占比

Java

Release

  • v.1.12017年2月2日
  • v12017年2月2日

README

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);

评论

暂无评论