{"id":18975033,"url":"https://github.com/bufferapp/counterview","last_synced_at":"2025-04-15T06:55:23.907Z","repository":{"id":48031362,"uuid":"129687825","full_name":"bufferapp/CounterView","owner":"bufferapp","description":"A simple Android counter view for showing edittext character counts","archived":false,"fork":false,"pushed_at":"2020-08-04T16:34:58.000Z","size":500,"stargazers_count":176,"open_issues_count":0,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-15T06:55:11.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":"2018-04-16T05:12:16.000Z","updated_at":"2023-02-09T14:34:13.000Z","dependencies_parsed_at":"2022-08-12T17:10:20.015Z","dependency_job_id":null,"html_url":"https://github.com/bufferapp/CounterView","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%2FCounterView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FCounterView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FCounterView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FCounterView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufferapp","download_url":"https://codeload.github.com/bufferapp/CounterView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023713,"owners_count":21199958,"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":[],"created_at":"2024-11-08T15:17:06.051Z","updated_at":"2025-04-15T06:55:23.891Z","avatar_url":"https://github.com/bufferapp.png","language":"Kotlin","readme":"# CounterView\nA simple Android counter view for showing edittext character counts. This behaves in the same way as our\n[BufferTextInputLayout](https://github.com/bufferapp/BufferTextInputLayout) except that it does not wrap\naround an EditText view, allowing you to place it elsewhere within your layout.\n\nThe CounterView will display the current count of the input content in the edittext. You need to set the max content length allowed using:\n\n    view_counter.counterMaxLength = someNumberValue\n\nYou can customise the color of the counter using the app:counterTextColor attribute.\n\nIf the input content exceeds this length, the color of the counter will change. This is defaulted as red, but you can change this using the\napp:counterErrorTextColor attribute.\n\nThe CounterView has 3 different counter types, you can set this mode using the counterMode property.\n\n### Ascending\n\n    view_counter.counterMode = CounterMode.ASCENDING\n\nor \n\n    app:counterMode=\"ascending\"\n\n![Ascending counter](art/ascending.gif)\n\n### Descending\n\n    view_counter.counterMode = CounterMode.DESCENDING\n\nor\n\n    app:counterMode=\"descending\"\n\n![Descending counter](art/descending.gif)\n\n### Standard\n\n    view_counter.counterMode = CounterMode.STANDARD\n    \nor\n\n    app:counterMode=\"standard\"\n\n![Counter](art/counter.gif)\n\n## Hiding the CounterView\n\n![Hiding the counter](art/display.gif)\n\nIn some cases you may wish to hide the CounterView until there are only a certain\nnumber of characters available for the input text. You can set this value using:\n\n    view_counter.charactersRemainingUntilCounterDisplay = someNumberValue\n\nThat way, this means that the counter won't be shown until the user is someNumberValue away from the maximum counter length.\n\n## Using the CounterView\n\nYou will need to begin by adding the dependency to your project:\n\n    implementation 'org.buffer.android:counter-view:1.0'\n\nNext, as shown in the sample app, can be added to your layout like so:\n\n    \u003corg.buffer.android.counterview.CounterView\n            android:id=\"@+id/view_counter\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:counterErrorTextColor=\"@color/colorAccent\"\n            app:counterTextColor=\"@color/colorPrimary\" /\u003e\n            \n You then need to attach the CounterView to the desired edittext using:\n \n     view_counter.attachToEditText(view_input)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fcounterview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufferapp%2Fcounterview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fcounterview/lists"}