thorbenprimke / realm-searchview Goto Github PK
View Code? Open in Web Editor NEWA Search View with Result list powered by Realm (No longer maintained!)
A Search View with Result list powered by Realm (No longer maintained!)
Is their any way we can customize its view.
I want to make searchview RTL . should I modify library and recreate the library or is it possible
to do in my code without touching library
Currently, the RealmSearchAdapter
overrides RealmBasedRecyclerViewAdapter
and always passes false
to autoUpdate (third parameter).
public RealmSearchAdapter(@NonNull Context context, @NonNull Realm realm, @NonNull String filterKey, boolean useContains, Case casing, Sort sortOrder, String sortKey, String basePredicate) {
super(context, (RealmResults)null, false, false);
...
}
It would be nice to add this as another customizable feature.
I would like my search input to be a separate element to the results element.
I need input to come from a text view at the top of my fragment, and the results to be displayed underneath a header in a different part of the view.
From what I can tell the input / results elements are tightly joined, I have been unable to customise them so far.
Hey Torben.
Iam using your searchview ( compile 'com.github.thorbenprimke:realm-searchview:0.9.4' ) in my app project, while also using the Realm plugin.
Iam using the Realm plugin 1.1.0 like the version in searchview?.
When building the apk iam getting the DublicateFileExpetion due to multible .so files.
If i use
packagingOptions {
pickFirst("lib/armeabi/librealm-jni.so")
...
}
I can build the apk, but during runtime i get a java.lang.AbstractMethodError: abstract method "io.realm.RealmObject io.realm.internal.RealmProxyMediator.copyOrUpdate(io.realm.Realm, io.realm.RealmObject, boolean, java.util.Map)".
Have any clues to why this happens? Iam assuming that i should still use the plugin while importing searchview?
I want to implement onItemClickListener but not working to my way.
I want the results sorted chronologically. I've not specified a sorting parameter, this seems to be happening either on default, or based on the filterKey specified for search. Is it possible to make it sort by position? The workaround I'm currently using is to make a position column in the database and sort it by that column,. Although it's 100% guaranteed to work, I'd rather not do that.
Edit: just looked into the source code. Seems like it's sorting by the filterKey indeed.
Thanks for this great library.
It would be great if you could consider the following use case for inclusion in an upcoming release.
For example: take a Realm model Vehicles, with an Attribute Type which says if the object is a Car, Motorcycle, Truck.
We would like to display an activity containing a RealmSearchView to allow searching only the Cars from this model. To do this there would need to be a way of adding another condition to the RealmQuery for the required attribute.
I have created a fork with the changes that I have made for my own project to satisfy this use case.
HarvestYield@3ccd3ee
(please ignore the deletion of RealmSearchView.java in that commit)
First of all, great work! It's a pleasure to work with!
Maybe in a next update you can add an option so users are able to search in multiple columns at the same time? Looked into your source code and saw it doesn't work, but it can come in very handy I think.
For example, I have a realm database with stores (store names, addresses,...) and I want one search field where users can simultaneously search for names and cities for example.
I am unable to sync gradle dependencies after adding jitpack to the Project build.gradle and compile 'com.github.thorbenprimke:realm-searchview:0.9.6' to the Module build.gradle file. I get and error: Failed to resolve: annotationProcessor.
I'm using gradle 2.2.2 and realm plugin 2.2.1
Thanks!
I have tried to pass null parameter to a couple of methods like setSortKey, setFilterKey, setSortOrder but it made no difference. I want to show data in the order i am adding it to my Realm data base.
I got this issue when I try complie. Plz help me~
I'm unable as of now to access and change the behavior of the internal EditText
. Examples of What usual customizations:
setOnEditorActionListener
addTextChangedListener
Btw, thank you so much for the library. I'm using it as a replacement for AutoCompleteTextView
which is broken on realm.
How to setText to searchBar onItemClick?
Is it possible for me to contribute to add this feature if there is still none?
i saw it very useful lib but how about filter many columns and sort it by some conditions such as firstColumn is "DESC" and secondColumn is "ASC".
Hi, I have a question. When I'm populating my data with my Contact model, my filter key is "name". But I want to search only by property isFavorite == true - not all contacts. How can i achieve that with the RealmSearchAdapter?
And how does the basePredicate property works?
Thanks! :)
HI Thorben,
You mentioned in your readme that realmsearchadapter can accept without any filter key. I've tried checking around and even asked SO but I didn't see how I can instantiate that adapter without the filter key. Is it possible to do it without filter key?
I cannot compile my project with the 'com.github.thorbenprimke:realm-searchview:0.9.6' together with BottomNavigationBar. Afaik the searchview compiles with recyclerviews from the 23 release, and the BottomNavigationBar was released in the 25 library.
This is my gradle:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.admin.realmtest"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}
realm{
syncEnabled = true;
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:support-vector-drawable:26.+'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
androidTestCompile('com.google.code.findbugs:jsr305:3.0.1')
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'io.realm:android-adapters:2.0.0'
compile 'com.github.thorbenprimke:realm-searchview:0.9.6'
compile 'com.android.support:recyclerview-v7:26.+'
}
i have realm object
contains different categories
class Category extends RealmObject {
@PrimaryKey
int id ;
String title ;
RealmList<Category>subcategories;
int parentID ;
}
how can i search inside a Category Class with specific parentID value using searchview adapter ?
Hello,
thank you for your library, we can set a custom hint in xml but i cant set a custom hint programmatically,
Best Regards
I cannot modify the search results realm objects because the adapter's constructor does not have them as a parameter. What should I do? Normally i use a holder in onBindViewHolder to modify a particular object but in this case i cannot do that. Please help me to achieve this.
https://github.com/sahildave/Search-View-Layout
The animation is pretty smooth. Might be nice to add this as an option / attribute to the SearchView
Hey again, new issue :)
Is there a logic reason why the searchview.setOnFocusChangeListener() is not working?
If I scroll slowly, all works fine. When I scroll quickly, I get the following exception:
java.lang.ClassCastException: io.realm.RealmViewHolder cannot be cast to usmaan.myapp.fragment.question.mine.SelectBackgroundsActivity$BackgroundRecyclerViewAdapter$ViewHolder at usmaan.myapp.fragment.question.mine.SelectBackgroundsActivity$BackgroundRecyclerViewAdapter.onBindRealmViewHolder(SelectBackgroundsActivity.java:312)
And line 312 is simply the class signature:
public class BackgroundRecyclerViewAdapter extends RealmSearchAdapter<BackgroundString, BackgroundRecyclerViewAdapter.ViewHolder>
Is there any way to do this?
How can we implement onItemClickListener to this realmRecyclerView
I found this error
Is possible order where two colums?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.