https://github.com/farukcankaya/expandablefilter
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...
https://github.com/farukcankaya/expandablefilter
animation expandable filter layout menu rtl
Last synced: about 1 year ago
JSON representation
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...
- Host: GitHub
- URL: https://github.com/farukcankaya/expandablefilter
- Owner: farukcankaya
- Created: 2017-05-24T15:05:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T23:45:22.000Z (about 9 years ago)
- Last Synced: 2025-04-10T23:17:11.036Z (about 1 year ago)
- Topics: animation, expandable, filter, layout, menu, rtl
- Language: Java
- Size: 2.27 MB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# ExpandableFilter
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...
[  ](https://bintray.com/farukcankaya/maven/ExpandableFilter/_latestVersion)
| LTR | RTL |
| ------------- |:-------------:|
|
|
|
# Usage
### Add dependecy
```java
dependencies {
...
compile 'com.farukcankaya:expandablefilter:1.0.1'
}
```
### Add ExpandableFilter to your layout
`emoji`, `label` and `items` attributes are mandatory.
res/values/arrays.xml
```xml
$
$$
$$$
$$$$
```
```xml
```
That's it.
# Customization

You can change many attributes listed below:
### Duration
Default duration is 300ms.
```xml
```
### Font Family
You 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.
```xml
```
### Text Size
You specify text size for label and emoji separately.
```xml
```
### Text Color
There are two ways to change text color. We can give color resource:
res/color/text_color.xml
```xml
```
```xml
```
or we can specify default and active text color:
```xml
```
**Note:** `activeTextColor` **and** `defaultTextColor` **attributes override** `itemTextColor`.
### Background color
```xml
```
### Item Padding
You can arrange padding of items. Default it is `8dp`.
```xml
```
### Divider Margin
You can arrange margin between items. Default it is `1dp`.
```xml
```
### Radius
You can arrange radius. Default it is `4dp`.
```xml
```
### Arrange maximum selectable item count
You can arrange arrange maximum selectable item count. Default, all filter items can be selected.
```xml
```
### ExpandableFilter.OnItemSelectListener
You can add listener to ExpandableFilter. If there is no items and filter is selected/deselected, `onSelected` / `onDeselected` methods return `-1` as position.
