{"id":13644310,"url":"https://github.com/DavidPizarro/AutoLabelUI","last_synced_at":"2025-04-21T07:30:49.926Z","repository":{"id":33936641,"uuid":"37660702","full_name":"DavidPizarro/AutoLabelUI","owner":"DavidPizarro","description":"Android library to place labels next to another. If there is not enough space for the next label, it will be added in a new line.","archived":false,"fork":false,"pushed_at":"2016-03-07T09:29:37.000Z","size":4335,"stargazers_count":636,"open_issues_count":17,"forks_count":107,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-11-09T16:44:16.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"spro/the-incredible-pytorch","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidPizarro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-18T13:21:28.000Z","updated_at":"2024-10-07T13:47:19.000Z","dependencies_parsed_at":"2022-07-13T16:48:09.241Z","dependency_job_id":null,"html_url":"https://github.com/DavidPizarro/AutoLabelUI","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FAutoLabelUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FAutoLabelUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FAutoLabelUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FAutoLabelUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidPizarro","download_url":"https://codeload.github.com/DavidPizarro/AutoLabelUI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014577,"owners_count":21360977,"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-08-02T01:02:01.060Z","updated_at":"2025-04-21T07:30:47.648Z","avatar_url":"https://github.com/DavidPizarro.png","language":"Java","funding_links":[],"categories":["TagView","Java"],"sub_categories":[],"readme":"# AutoLabelUI \r\n\r\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AutoLabelUI-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2436) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/autolabelui/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/autolabelui)\r\n\r\nAndroid library to place labels next to another. If there is not enough space for the next label, it will be added in a new line.\r\n\r\n![Example screenshot](art/screenshots_framed.png)\r\n\r\nTry out the sample application on [Google Play][1].\r\n\r\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.dpizarro.libraries.autolabelui\"\u003e\r\n  \u003cimg alt=\"AutoLabelUI Sample on Google Play\"\r\n         src=\"http://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\r\n\u003c/a\u003e\r\n\r\nDemo\r\n=========================\r\n\r\n![Example gif](art/demo.gif)\r\n\r\nIncluding in Your Project\r\n=========================\r\n\r\n**Last version is 1.0.1**\r\n\r\nJust add the following statement in your build.gradle\r\n\r\n    compile 'com.github.davidpizarro:autolabelui:VERSION'\r\n    \r\nYou may also add the library as an Android Library to your project. All the library files live in ```library```.\r\n\r\nUsage\r\n=====\r\n\r\nTo add the AutoLabelUI to your layout, add this to your xml\r\n```xml\r\n\u003ccom.dpizarro.autolabel.library.AutoLabelUI\r\n        android:id=\"@+id/label_view\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"/\u003e\r\n```  \r\n\r\nYou can add custom attributes in your xml to customize: drawables, colors, counters, background, behaviors...\r\n```xml\r\n\r\n\u003ccom.dpizarro.autolabel.library.AutoLabelUI\r\n        android:id=\"@+id/label_view\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        autolabel:max_labels=\"10\"\r\n        autolabel:show_cross=\"true\"\r\n        autolabel:text_color=\"@android:color/white\"\r\n        autolabel:text_size=\"@dimen/label_title_size\"\r\n        autolabel:icon_cross=\"@drawable/cross\"\r\n        autolabel:label_background_res=\"@color/default_background_label\"\r\n        autolabel:label_padding=\"@dimen/label_padding\"\r\n        autolabel:label_clickable=\"true\"/\u003e\r\n        \r\n```\r\n\r\nReview [attrs.xml][3] file to know the list of shapes ready to be used in the library.\r\n\r\n\r\nThis configuration can be also provided programmatically. You can use AutoLabelUI programatically, using the Builder class to set the settings and the desired functionalities:\r\n```java\r\nAutoLabelUI mAutoLabel = (AutoLabelUI) view.findViewById(R.id.label_view);\r\n\r\nAutoLabelUISettings autoLabelUISettings = new AutoLabelUISettings.Builder()\r\n                                                                 .withMaxLabels(5)\r\n                                                                 .withIconCross(R.drawable.cross)\r\n                                                                 .withBackgroundResource(R.drawable.round_corner_background)\r\n                                                                 .withLabelsClickables(false)\r\n                                                                 .withShowCross(true)\r\n                                                                 .withTextColor(android.R.color.holo_red_dark)\r\n                                                                 .withTextSize(R.dimen.label_title_size)\r\n                                                                 .withLabelPadding(R.dimen.label_padding)\r\n                                                                 .build();\r\n\r\nmAutoLabel.setSettings(autoLabelUISettings);\r\n```\r\n\r\nYou can set/get values programatically:\r\n```java\r\nmAutoLabel.getBackgroundResource();\r\nmAutoLabel.getTextColor();\r\nmAutoLabel.getTextSize();\r\nmAutoLabel.isLabelsClickables();\r\nmAutoLabel.setTextColor(android.R.color.holo_red_dark);\r\nmAutoLabel.setMaxLabels(5);\r\nmAutoLabel.setBackgroundResource(R.drawable.round_corner_background);\r\n...\r\n```\r\n\r\nYou can get Label using:\r\n```java\r\nLabel label = mAutoLabel.getLabel(1);\r\nList\u003cLabel\u003e labels = mAutoLabel.getLabels();\r\n```\r\n\r\nor remove them all:\r\n```java\r\nmAutoLabel.clear();\r\n```\r\n\r\nTo know when you have reached the limit of Labels to add, you will need to implement the `onLabelsCompleted` interface:\r\n```java\r\nmAutoLabel.setOnLabelsCompletedListener(new AutoLabelUI.OnLabelsCompletedListener() {\r\n    @Override\r\n    public void onLabelsCompleted() {\r\n        Toast.makeText(getActivity(), \"Completed!\", Toast.LENGTH_SHORT).show();\r\n    }\r\n});\r\n```\r\n\r\nTo know when you have deleted all Labels, you will need to implement the `onLabelsEmpty` interface:\r\n```java\r\nmAutoLabel.setOnLabelsEmptyListener(new AutoLabelUI.OnLabelsEmptyListener() {\r\n    @Override\r\n    public void onLabelsEmpty() {\r\n        Toast.makeText(getActivity(), \"EMPTY!\", Toast.LENGTH_SHORT).show();\r\n    }\r\n});\r\n```\r\n\r\nTo know when you have deleted a Label, you will need to implement the `onRemoveLabel` interface:\r\n```java\r\nmAutoLabel.setOnRemoveLabelListener(new AutoLabelUI.OnRemoveLabelListener() {\r\n    @Override\r\n    public void onRemoveLabel(View view, int position) {\r\n        adapter.setItemSelected(position, false);\r\n    }\r\n});\r\n```\r\n\r\nTo know when you have clicked a Label, you will need to implement the `onClickLabel` interface:\r\n```java\r\nmAutoLabel.setOnLabelClickListener(new AutoLabelUI.OnLabelClickListener() {\r\n    @Override\r\n    public void onClickLabel(View v) {\r\n        Toast.makeText(getActivity(), ((Label) v).getText() , Toast.LENGTH_SHORT).show();\r\n    }\r\n});\r\n```\r\n\r\nOr browse the [source code of the sample application][2] for a complete example of use.\r\n\r\nContribution\r\n============\r\n\r\n#### Pull requests are welcome!\r\n\r\nI'd like to improve this library with your help!\r\nIf you've fixed a bug or have a feature you've added, just create a pull request. Issues can be reported on the github issue tracker.\r\n\r\n\r\nWho's using it\r\n=========================\r\n*Does your app use AutoLabelUI? If you want to be featured on this list drop me a line.*\r\n\r\n\r\nAuthor\r\n=========================\r\n\r\nDavid Pizarro (dpizarro89@gmail.com)\r\n\r\n\u003ca href=\"https://plus.google.com/u/0/110797503395500685158\"\u003e\r\n  \u003cimg alt=\"Follow me on Google+\"\r\n       src=\"https://raw.githubusercontent.com/DavidPizarro/android-live-templates/master/art/google.png\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://twitter.com/DavidPizarro89\"\u003e\r\n  \u003cimg alt=\"Follow me on Twitter\"\r\n       src=\"https://raw.githubusercontent.com/DavidPizarro/android-live-templates/master/art/twitter.png\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://www.linkedin.com/in/davidpizarrodejesus\"\u003e\r\n  \u003cimg alt=\"Follow me on LinkedIn\"\r\n       src=\"https://raw.githubusercontent.com/DavidPizarro/android-live-templates/master/art/linkedin.png\" /\u003e\r\n\u003c/a\u003e\r\n\r\n\r\nLicense\r\n-------\r\n\r\n    Copyright 2015 David Pizarro\r\n\r\n    Licensed under the Apache License, Version 2.0 (the \"License\");\r\n    you may not use this file except in compliance with the License.\r\n    You may obtain a copy of the License at\r\n\r\n       http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n    Unless required by applicable law or agreed to in writing, software\r\n    distributed under the License is distributed on an \"AS IS\" BASIS,\r\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n---\r\n\r\n[1]: https://play.google.com/store/apps/details?id=com.dpizarro.libraries.autolabelui\r\n[2]: https://github.com/DavidPizarro/AutoLabelUI/tree/master/app\r\n[3]: https://github.com/DavidPizarro/AutoLabelUI/blob/master/library/src/main/res/values/attrs.xml\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavidPizarro%2FAutoLabelUI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavidPizarro%2FAutoLabelUI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavidPizarro%2FAutoLabelUI/lists"}