{"id":23381239,"url":"https://github.com/farukcankaya/expandablefilter","last_synced_at":"2025-04-10T23:17:16.903Z","repository":{"id":150973477,"uuid":"92305462","full_name":"farukcankaya/ExpandableFilter","owner":"farukcankaya","description":"A simple library that creates an expandable filter with given items. Filter items can be collapsed/expanded. Also, it supports rtl views, changing color, text size, font family, etc...","archived":false,"fork":false,"pushed_at":"2017-05-28T23:45:22.000Z","size":2378,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T23:17:11.036Z","etag":null,"topics":["animation","expandable","filter","layout","menu","rtl"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/farukcankaya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-05-24T15:05:10.000Z","updated_at":"2024-06-27T13:01:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccc479e5-a1ad-4da6-a0d4-28973164c57e","html_url":"https://github.com/farukcankaya/ExpandableFilter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukcankaya%2FExpandableFilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukcankaya%2FExpandableFilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukcankaya%2FExpandableFilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukcankaya%2FExpandableFilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farukcankaya","download_url":"https://codeload.github.com/farukcankaya/ExpandableFilter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312131,"owners_count":21082638,"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":["animation","expandable","filter","layout","menu","rtl"],"created_at":"2024-12-21T20:48:32.132Z","updated_at":"2025-04-10T23:17:16.896Z","avatar_url":"https://github.com/farukcankaya.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExpandableFilter\nA simple library that creates an expandable filter with given items. Filter items can be collapsed/expanded. Also, it supports rtl views, changing color, text size, font family, etc...\n\n [ ![Download](https://api.bintray.com/packages/farukcankaya/maven/ExpandableFilter/images/download.svg) ](https://bintray.com/farukcankaya/maven/ExpandableFilter/_latestVersion)\n\n\u003ca href=\"https://youtu.be/8irq_WdFumo\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/farukcankaya/ExpandableFilter/raw/master/art/showcase.gif\" /\u003e\u003c/a\u003e\n\n| LTR        | RTL           |\n| ------------- |:-------------:|\n| \u003cimg src=\"https://github.com/farukcankaya/ExpandableFilter/raw/master/art/ltr.png\" /\u003e | \u003cimg src=\"https://github.com/farukcankaya/ExpandableFilter/raw/master/art/rtl.png\" /\u003e |\n\n# Usage\n\n### Add dependecy\n```java\ndependencies {\n    ...\n    compile 'com.farukcankaya:expandablefilter:1.0.1'\n}\n```\n\n### Add ExpandableFilter to your layout\n`emoji`, `label` and `items` attributes are mandatory.\n\nres/values/arrays.xml\n```xml\n\u003cresources\u003e\n    \u003cstring-array name=\"items\"\u003e\n        \u003citem\u003e$\u003c/item\u003e\n        \u003citem\u003e$$\u003c/item\u003e\n        \u003citem\u003e$$$\u003c/item\u003e\n        \u003citem\u003e$$$$\u003c/item\u003e\n    \u003c/string-array\u003e\n\u003c/resources\u003e\n```\n\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:items=\"@array/items\"\n            app:label=\"...\" /\u003e\n```\n\nThat's it.\n\n# Customization\n\n\u003cimg src=\"https://github.com/farukcankaya/ExpandableFilter/raw/master/art/art.png\" /\u003e\n\nYou can change many attributes listed below:\n### Duration\nDefault duration is 300ms. \n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:duration=\"1200\"/\u003e\n```\n\n### Font Family\nYou specify custom font for label and emoji separately. Fonts should be under `assets/font` directory. If you want to use different font for different language, you need to create a directory for that language. For example, we want to use different font for Arabic, we will create `font-ar` directory under `assets` directory. Then, we will put custom font in it.\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:labelFont=\"label.ttf\"\n            app:emojiFont=\"emoji.ttf\"/\u003e\n```\n\n### Text Size\nYou specify text size for label and emoji separately.\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:labelFontSize=\"16sp\"\n            app:emojiFontSize=\"20sp\"/\u003e\n```\n\n### Text Color\nThere are two ways to change text color. We can give color resource:\n\nres/color/text_color.xml\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cselector xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n    \u003c!-- Selected --\u003e\n    \u003citem android:color=\"#FFFFFF\" android:state_selected=\"true\" /\u003e\n    \u003c!-- Hovered --\u003e\n    \u003citem android:color=\"#FFFFFF\" android:state_hovered=\"true\" /\u003e\n    \u003c!-- Pressed --\u003e\n    \u003citem android:color=\"#FFFFFF\" android:state_pressed=\"true\" /\u003e\n    \u003c!-- Default --\u003e\n    \u003citem android:color=\"#ff6969\" /\u003e\n\u003c/selector\u003e\n```\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:itemTextColor=\"@color/text_color\"/\u003e\n```\n\nor we can specify default and active text color:\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:activeTextColor=\"#5080EA\"\n            app:defaultTextColor=\"#FFFFFF\"/\u003e\n```\n**Note:** `activeTextColor` **and** `defaultTextColor` **attributes override** `itemTextColor`. \n\n### Background color\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:activeBackgroundColor=\"#FFFFFF\"\n            app:defaultBackgroundColor=\"#5080EA\"/\u003e\n```\n\n### Item Padding\nYou can arrange padding of items. Default it is `8dp`.\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:itemPadding=\"8dp\"/\u003e\n```\n\n### Divider Margin\nYou can arrange margin between items. Default it is `1dp`.\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:itemDividerMargin=\"1dp\"/\u003e\n```\n\n### Radius\nYou can arrange radius. Default it is `4dp`.\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:radius=\"4dp\"/\u003e\n```\n\n### Arrange maximum selectable item count\nYou can arrange arrange maximum selectable item count. Default, all filter items can be selected.\n```xml\n\u003ccom.farukcankaya.expandablefilter.ExpandableFilter\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            app:emoji=\"...\"\n            app:label=\"...\"\n            app:items=\"@array/items\"\n            app:maxSelectableItemCount=\"1\"/\u003e\n```\n\n### ExpandableFilter.OnItemSelectListener\nYou can add listener to ExpandableFilter. If there is no items and filter is selected/deselected, `onSelected` / `onDeselected` methods return `-1` as position.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarukcankaya%2Fexpandablefilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarukcankaya%2Fexpandablefilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarukcankaya%2Fexpandablefilter/lists"}