GithubHelp home page GithubHelp logo

Comments (4)

PLNech avatar PLNech commented on May 26, 2024 1

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.

PLNech avatar PLNech commented on May 26, 2024 1

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 from MainSearchActivity with the name of the selected state. This interface displays list of cities using filters=["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.

zmsansan avatar zmsansan commented on May 26, 2024

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.

PLNech avatar PLNech commented on May 26, 2024

(This being said, I'll implement unregisterSearchView as it might still be useful in other cases.)

from instantsearch-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.