All Projects → LNSD → RealmSearchView

LNSD / RealmSearchView

Licence: Apache-2.0 license
SearchView with result list powered by Realm

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RealmSearchView

android-kotlin-sample-note
Android Kotlin Sample Note - Dagger2, Realm CRUD, RxJava2
Stars: ✭ 29 (+26.09%)
Mutual labels:  realm
BooksApp
Book selling application with MVVM (Model, View, ViewModel), LiveData, DataBinding, Retrofit, Room Database, Navigation Component(NavGraph, BottomNav), ViewPager2 in TabLayout, SearchView, Vertical Adapter(BestSellers) and Horizontal Adapter(All Books) with ConcatAdapter for Main Screen, Firebase Auth, SearchView in Adapter, Picasso, Lottie, Ani…
Stars: ✭ 53 (+130.43%)
Mutual labels:  searchview
keycloak-home-idp-discovery
Keycloak: Home IdP Discovery - discover home identity provider or realm by email domain
Stars: ✭ 42 (+82.61%)
Mutual labels:  realm
myplanet
🌕 myPlanet android app reads data from 🌎 for offline use as well as it collect usage data and sends them back to the Planet.
Stars: ✭ 17 (-26.09%)
Mutual labels:  realm
DailyFeed
iOS client for newsapi.org
Stars: ✭ 128 (+456.52%)
Mutual labels:  realm
RChat
No description or website provided.
Stars: ✭ 58 (+152.17%)
Mutual labels:  realm
realms-ios
Safe method for Realm
Stars: ✭ 22 (-4.35%)
Mutual labels:  realm
aaf-easyphotomap
📷 Easy Photo Map is a photomap application that displays the location of the photo on the map using the location information included in the photo.
Stars: ✭ 36 (+56.52%)
Mutual labels:  realm
ExamplesAndroid
Simple Example of Android [APIFacebook,APIGoogleMaps,APITwitter,Volley,Picasso etc etc etc]
Stars: ✭ 24 (+4.35%)
Mutual labels:  realm
realm-tester
Writing tests using Realm Java
Stars: ✭ 14 (-39.13%)
Mutual labels:  realm
how-much
💰 iOS price list app using Firebase, Realm & more
Stars: ✭ 22 (-4.35%)
Mutual labels:  realm
Android-ORM-Benchmarks
No description or website provided.
Stars: ✭ 25 (+8.7%)
Mutual labels:  realm
SilverScreener
A feature-rich movie guide app, that lets you discover movies from TMDb.
Stars: ✭ 24 (+4.35%)
Mutual labels:  realm
solar-weather
React Native Weather App w. Realm, Redux, ReasonReact & Forecast.io
Stars: ✭ 13 (-43.48%)
Mutual labels:  realm
realm-mapper-ios
Realm + ObjectMapper
Stars: ✭ 28 (+21.74%)
Mutual labels:  realm
wikilight
A lightweight Wikipedia Client
Stars: ✭ 50 (+117.39%)
Mutual labels:  realm
cordova-plugin-realm
Unofficial Cordova plugin for Realm Mobile Database.
Stars: ✭ 29 (+26.09%)
Mutual labels:  realm
Searchable-RecyclerView-Demo
An example app using a SearchView to filter items in a RecyclerView while taking full advantage of item animations!
Stars: ✭ 722 (+3039.13%)
Mutual labels:  searchview
NewsReader
Android News Reader app. Kotlin Coroutines, Retrofit and Realm
Stars: ✭ 21 (-8.7%)
Mutual labels:  realm
electron-react-ts-rxdb-realm-sqlite
Demo of Native Databases with Electron and ReactJS. Realm, SQLite and RxDB ( with LevelDB/IndexedDB/InMemory adapters)
Stars: ✭ 27 (+17.39%)
Mutual labels:  realm

#SearchView with Realm DB results list ####Powered by

The RealmSearchView extends Android's SearchView widget. This is an much simpler and more versatile approach than Thorbenprimke's original RealmSearchView which implements a wrapper around a EditText and RealmRecyclerView. It's built on top of RealmRecyclerView and RealmBasedRecyclerViewAdapter.

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

##Example

##How to include in your project:

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the following dependencies to your module build.gradle:

	dependencies {
	        compile 'com.github.lnsd:RealmSearchView:v0.1.0'
	        
	      	compile 'com.github.thorbenprimke:realm-recyclerview:0.9.19'
	        compile 'com.github.thorbenprimke:realm-searchview:0.9.6'
	}

This library requires thorbenprimke's RealmRecyclerView and RealmSearchViewAdapter classes.

##How to get started:

The RealmSearchView extends Android's SearchView widget. The RealmSearchAdapter has added functionality for the filtering of the Realm. The snippet below shows how to include the RealmSearchView in your layout file.

    <es.lnsd.realmsearchview.RealmSearchView
        android:id="@+id/search_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:rsvHint="@string/search_hint"
        />

A RealmRecyclerView is required to show the results list.

    <co.moonmonkeylabs.realmrecyclerview.RealmRecyclerView
            android:id="@+id/realm_recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            app:rrvLayoutType="LinearLayout"
            app:rrvEmptyLayoutId="@layout/empty_view" />

The associateRealmRecyclerView() method MUST be called before calling the setAdapter(). Like here.

    @Bind(R.id.search_view) RealmSearchView searchView;
    @Bind(R.id.realm_recycler_view) RealmRecyclerView recyclerView;
	@Override
    protected void onCreate(Bundle savedInstanceState) {
    	...
        searchView.associateRealmRecyclerView(recyclerView);
        searchView.setAdapter(adapter);
    }

##The RealmSearchView attributes:

  • rsvHint: This is the search box hint. It a string 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.

##Work in progress! This library is currently under develpment. 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 (tl;dr)

Copyright (c) 2016 Lorenzo Delgado

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].