realm-searchview


Source link: https://github.com/thorbenprimke/realm-searchview

A Search View with Result list powered by Realm

A simple and powerful EditText and RecyclerView UI component. It's build on top of RealmRecyclerView and RealmBasedRecyclerViewAdapter.

It's easily customizable via layout attributes and adapter parameters.

##How To Include It:

 repositories {

// ...

maven {
 url "https://jitpack.io" 
}

  
}
 
 dependencies {

 compile 'com.github.thorbenprimke:realm-searchview:0.9.6'  
}
 

##Demo

How To Get Started:

The RealmSearchView is a wrapper around a EditText and RealmRecyclerView. The RealmSearchAdapter has added functionality for the filtering of the Realm.

##RealmSearchView

The snippet below shows how to include the RealmSearchView in your layout file.


 <co.moonmonkeylabs.realmsearchview.RealmSearchView

android:id="@+id/search_view"

android:layout_width="match_parent"

android:layout_height="match_parent"

app:rsvHint="@string/search_hint"

/> 

The RealmSearchView can be with two attributes:

  • rsvHint: This is the search box hint. It a string reference.

  • rsvClearDrawable: This is for the clear drawable. It's a drawable reference.

##RealmSearchAdapter

The adapter does all the filtering. The following list of parameters are available to customize the filtering.

  • filterKey: The filterKey is required as it is the columnName that the results are filtered by.

  • useContains: If true, uses contains, otherwise uses beginsWith.

  • useCaseSensitive: If true, ensures that the filter is respecting casing. If false, ignores any casing.

  • sortAscending: If true, ascending, otherwise descending.

  • sortKey: The columnName by which the results should be sorted.

  • basePredicate: The basePredicate is used to filter the results whenever the searchBar is empty.

The RealmSearchAdapter has two constructors. One that only takes the filterKey parameter and one that takes all parameters. In addition, the adapter has to be provided with a valid instance of Realm. It is used throughout the life of view to requery the results.

##Feedback/More Features: I would love to hear your feedback. Do you find the RealmSearchView useful? What functionality are you missing? Open a Github issue and let me know. Thanks!

License

Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.  Included dependencies are: Realm (https://github.com/realm/realm-java) realm-recyclerview (https://github.com/thorbenprimke/realm-recyclerview) In Example: Jackson (https://github.com/FasterXML/jackson-databind/) Butterknife (https://github.com/JakeWharton/butterknife) 

Resources

Annotation-based library that allows for easy data model creation for Parse Android SDK.

Get growth using your high value users. Deeplinks, Viral Analytics, Engagement Automation.

Info-dumper is a Stetho plugin which shows your android application's information.

Spinner2 is a re-implementation of the default Android's spinner, with a simple way for control selection behavior.

A Page Indicator Library which is realized in a different way.

A powerful android view looper library with animation.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes