Skip to content

Repository files navigation

Android FilterView

Build a simple filter view with customizable controls.

Download from Gradle

  1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
} 
  1. Add the dependency
dependencies {
compile 'com.github.FranciscoJavierPRamos:Android-FilterView:1.0.4'
}

Usage

  • Create a section
SingleSectionsingleSection = newSingleSection.Builder("Category", 1)
.setSectionNameColor(R.color.colorAccent)
.addOption(newSingleOption("CUSTOMER", R.color.colorAccent,
R.drawable.ic_account_black_24dp, R.color.colorBackground,
R.color.colorAccent, 2, R.color.colorAccent))
.addOption(newSingleOption("ORGANIZATION", R.color.colorAccent,
R.drawable.ic_layers_black_24dp, R.color.colorBackground,
R.color.colorAccent, 2, R.color.colorAccent))
.build().setOnSingleOptionListener(newOnSingleOptionListener() {
@OverridepublicvoidonClick(SingleOptionoption) {
}
});
  • Create FilterView instance and add section
newFilterView.Builder(this)
.withTitle("Aplicar")
.setToolbarVisible(true)
.withTitleColor(R.color.colorAccent)
.withDivisorColor(R.color.colorAccent)
.setCloseIconColor(R.color.colorAccent)
.addSection(singleSection)
.build()
.setOnFilterViewResultListener(newOnFilterViewResultListener() {
@OverridepublicvoidonResult(JSONArraydata) {
System.out.println(data.toString());
}
}).show();

Call to show(); method to display FilterView and setOnFilterViewResultListener(...) to return JSONArray with data filtered.

Sections

  • SingleSection with SingleOption control.
  • SliderSection with SliderOption control.
  • TagSection with String tags.
  • ExtraSection with:
    • ExtraBoolean
    • ExtraCurrencyEditText
    • ExtraDate
    • ExtraHSM
    • ExtraList
    • ExtraEditText

License

LicensedundertheApacheLicense, Version2.0 (the "License");
youmaynotusethisfileexceptincompliancewiththeLicense.
YoumayobtainacopyoftheLicenseathttp://www.apache.org/licenses/LICENSE-2.0Unlessrequiredbyapplicablelaworagreedtoinwriting, softwaredistributedundertheLicenseisdistributedonan"AS IS"BASIS,
WITHOUTWARRANTIESORCONDITIONSOFANYKIND, eitherexpressorimplied.
SeetheLicenseforthespecificlanguagegoverningpermissionsandlimitationsundertheLicense.```

About

Build a simple filter view with customizable controls.

Topics

Resources

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages