{"id":23511205,"url":"https://github.com/percolate/mentions","last_synced_at":"2025-10-18T17:57:45.776Z","repository":{"id":148675294,"uuid":"41341215","full_name":"percolate/mentions","owner":"percolate","description":"Easily add @ mention functionality to your Android applications","archived":false,"fork":false,"pushed_at":"2023-03-16T17:59:37.000Z","size":202,"stargazers_count":100,"open_issues_count":6,"forks_count":23,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-04-19T03:07:40.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/percolate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-25T03:38:00.000Z","updated_at":"2023-10-28T02:58:14.000Z","dependencies_parsed_at":"2023-07-02T05:47:12.585Z","dependency_job_id":null,"html_url":"https://github.com/percolate/mentions","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/percolate/mentions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fmentions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fmentions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fmentions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fmentions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/percolate","download_url":"https://codeload.github.com/percolate/mentions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fmentions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274893250,"owners_count":25369278,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-25T12:13:44.124Z","updated_at":"2025-10-18T17:57:45.657Z","avatar_url":"https://github.com/percolate.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mentions\n\n[![Circle CI](https://circleci.com/gh/percolate/mentions.svg?style=svg\u0026circle-token=82fa2c37e303a6d5c44baa2e64199d6b06141aaf)](https://circleci.com/gh/percolate/mentions)\n[![codecov.io](http://codecov.io/github/percolate/mentions/coverage.svg?branch=master\u0026token=U8DlJgcAzs)](http://codecov.io/github/percolate/mentions?branch=master)\n[![](https://jitpack.io/v/percolate/mentions.svg)](https://jitpack.io/#percolate/mentions)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/26fc38f55811459aa2b4c3b4cfbe080d)](https://www.codacy.com/app/mohit-sarveiya/mentions?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=percolate/mentions\u0026amp;utm_campaign=Badge_Grade)\n\nThis library provides a simple and customizable away to setup @ mentions on any\nEditText. Here's all it takes to get started.\n\n## Usage Examples\n\nWe provide a builder through which you can setup different options for @\nmentions.\nHere is an example:\n\n```java\nEditText commentField = findViewById(activity, R.id.my_edit_text);\n\nMentions mentions = new Mentions.Builder(activity, commentField)\n    .highlightColor(R.color.blue)\n    .maxCharacters(5)\n    .queryListener(new QueryListener() {\n        void onQueryReceived(final String query) {\n           // Get and display results for query.\n        }\n    })\n    .suggestionsListener(new SuggestionsListener() {\n        void displaySuggestions(final boolean display) {\n          // Hint that can be used to show or hide your list of @ mentions\".\n        }\n    })\n    .build();\n```\n\nThe library allows you to display suggestions as you see fit. Here is an example\nin the sample app [Display Suggestions](https://github.com/percolate/mentions/blob/master/Mentions/sample/src/main/java/com/percolate/mentions/sample/activities/MainActivity.java#L95).\nWhen the user chooses a suggestion to @ mention, show it in the `EditText` view\nby:\n\n```java\nfinal Mention mention = new Mention();\nmention.setMentionName(user.getFullName());\nmentions.insertMention(mention);\n```\n\nInserting the mention will highlight it in the `EditText` view and the library\nwill keep track of its offset. As the user types more text in the view, the\nlibrary will update the offset and maintain the highlighting for you.\n\nIf you need to get the mentions currently shown in your `EditText` view (to send\nto your API or do further processing):\n\n```java\nfinal List\u003cMentionable\u003e mentions = mentions.getInsertedMentions();\nfor (Mentionable mention : mentions) {\n    println(\"Position of 1st Character in EditText \" + mention.getMentionOffset());\n    println(\"Text \" + mention.getMentionName())\n    println(\"Length \" + mention.getMentionLength());\n}\n```\n\n### Builder methods\n\n#### highlightColor(int color)\n\n- After a mention is chosen from a suggestions list, it is inserted into the\n  `EditText` view and the mention is highlighted with a default color of orange.\n  You may change the highlight color by providing a color resource id.\n\n#### maxCharacters(int maxCharacters)\n\n- The user may type @ followed by some letters. You may want to set a threshold\n  to only consider certain number of characters after the @ symbol as valid\n  search queries. The default value 13 characters. You may configure to any\n  number of characters.\n\n#### suggestionsListener(SuggestionsListener suggestionsListener)\n\n- The SuggestionsListener interface has the method displaySuggestions(final\n  boolean display). It will inform you on whether to show or hide a suggestions\n  drop down.\n\n#### queryListener(QueryListener queryListener)\n\n- The QueryListener interface has the method onQueryReceived(final String\n  query). The library will provide you with a valid query that you could use to\n  filter and search for mentions. For example, if the user types @Tes, the\n  callback will receive \"Tes\" as the query.\n\n## Adding to your application\n\nSimply add Mentions as a gradle dependency.  Distribution is done through\njitpack.io.\n\nSee \u003chttps://jitpack.io/com/github/percolate/mentions/\u003e for instructions\n\n[![](https://jitpack.io/v/percolate/mentions.svg)](https://jitpack.io/#percolate/mentions)\n\n## Running Tests\n\nThe library contains unit tests written in [Kotlin](https://kotlinlang.org/)\nwith [Mockito](http://mockito.org/) and [Robolectric](http://robolectric.org/).\n\nTo run the tests and generate a coverage, please execute the command\n\n```\ngradlew clean coverage\n```\n\n## License\n\nOpen source.  Distributed under the BSD 3 license.  See\n[LICENSE.txt](https://github.com/percolate/mentions/blob/master/LICENSE.txt) for\ndetails.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercolate%2Fmentions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercolate%2Fmentions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercolate%2Fmentions/lists"}