Comments (4)
Hi @zmsansan, thanks for reporting this!
That's a good point, we'll implement the missing unregisterSearchView
.
This being said, I'm curious: what's your use-case for using a SearchView
with two different InstantSearch
, but not using the two at the same time?
As we decoupled the SearchView
from InstantSearch
because we had Multi-Index in mind (where you want a single SearchView to trigger search in several InstantSearches at once), knowing more your use case will help us move forward in the right direction 🙂
from instantsearch-android.
Hi @zmsansan, thanks for these details!
If I understand well, you want to implement the following:
First screen
User can search for states or cities.
- If the user selects a city, goal achieved.
- If the user selects a state, you show a different search interface:
Second screen
User can search for cities in the state selected before.
- If the user selects a city, goal achieved.
- If the user presses back, he's back to the search results on the first screen.
Based on this understanding, you should implement two separate search interfaces:
- A main search interface (let's call it
MainSearchActivity
, searching across all cities and states. User can use the searchbox to type city or state name. When selecting a city he's good, when selecting a state he gets to the second search interface: - The second search interface (let's call it
CitySearchActivity
), is called fromMainSearchActivity
with the name of the selected state. This interface displays list of cities usingfilters=["state:STATE_NAME"]
to only display the cities in the selected state. This interface uses another set of widgets (at least SearchBox and Hits) to let the user type a city name.
With such a setup, if the user presses back he'll be back to the first search interface, where the results will still be there. This is the easiest way to achieve what you're looking for!
Let me know how it goes, and don't hesitate to reopen this ticket if that doesn't work 🙂
from instantsearch-android.
I'am has index where its records has "type" like state or city. User goal is find or select city.
By default i'am show filter result with record with type city in first Hits view.
if user use search then search result is state or city.
if user click on state then i'am need save search result first Hits view and show second Hits view where SearchBox be reused for search only cities of selected state.
If user dont select cities of state and click back button then show saved first Hitsview with states and cities.
For implement it i'am want reuse SearchBox from first Hits view to second Hits view by unregister and register metods.
from instantsearch-android.
(This being said, I'll implement unregisterSearchView
as it might still be useful in other cases.)
from instantsearch-android.
Related Issues (20)
- SearchboxView OnQueryChanged HOT 1
- Crashes in release build after upgrading to gradle 7.0.0 HOT 6
- Insights: expired events in a batch make the server decline the whole batch
- Paging broken in 2.11.0? HOT 2
- Searching for an emoji doesn't search in the selected language
- java.lang.NoSuchMethodError When Instantiating Query HOT 9
- Showing results in a new Activity from another Fragment
- PendingIntent flag error on android 12 HOT 3
- .aar file missing from 2.11.2 in Maven HOT 2
- HttpClient: RESPONSE https://xxxx-dsn.algolia.net/1/indexes/*/queries failed with exception: kotlinx.serialization.MissingFieldException HOT 1
- Dependency Dashboard
- Http client engine HOT 3
- InstantSearch: Duplicated items in Infinite Hits Compose paginator HOT 2
- Instant Search + Paging 3 + Flow HOT 4
- Algolia search suggestion not working in android
- Can't instantiate HitsSearch or any InstantSearch class HOT 4
- Android Instant Search Duplicate Algolia APIs are calling
- Error(s) while processing the retry strategy HOT 1
- Crash in InsightsEventDOMapper when obfuscating with R8 due to Kotlinx Serializer HOT 2
- Android InstantSearch kotlinx.coroutines.JobCancellationException: Parent job is Completed Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instantsearch-android.