openwebnet-android icon indicating copy to clipboard operation
openwebnet-android copied to clipboard

Search

Open niqdev opened this issue 9 years ago • 16 comments

From a review, user asked if there is a simple way to find list elements. A solution could be to add a search the in Action Bar for example.

niqdev avatar May 06 '16 21:05 niqdev

The example searchbar for reference.

I would suggest to modify DeviceListFragment, in particular extract from initCards a method to return the result of Observable.zip() i.e. an Observable<Lists<DomoticModel>> and then invoke it when apply a filter from the search bar.

Moreover before start I've just noticed that both this Fragment and the Adapter are not covered by tests, so I would like to have at least the tests on the Fragment in a separate commit before that you add the new feature. In this way we can check if we introduce any regression.

niqdev avatar Oct 03 '16 21:10 niqdev

Hi Nik!

I am in the throws of testing. Still, I have got a "cannot find symbol symbol" on DaggerApplicationComponentTest(line 81) of DeviceListFragmentTest class. Have you got any tip? Thanks a lot.

Il 03/10/2016 23:02, niqdev ha scritto:

The example searchbar https://github.com/DenisMondon/material-design-library/tree/master/sample/src/main/java/com/blunderer/materialdesignlibrary/sample/searchbar for reference.

I would suggest to modify |DeviceListFragment|, in particular extract from |initCards| a method to return the result of |Observable.zip()| i.e. an |Observable<Lists<DomoticModel>>| and then invoke it when apply a filter from the search bar.

Moreover before start I've just noticed that both this Fragment and the Adapter are not covered by tests, so I would like to have at least the tests on the Fragment in a separate commit before that you add the new feature. In this way we can check if we introduce any regression.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/openwebnet/openwebnet-android/issues/48#issuecomment-251226092, or mute the thread https://github.com/notifications/unsubscribe-auth/ALJ6eBtu8eIpf8q1gyge6Z1BKu66_t37ks5qwW1agaJpZM4IZPXo.

fabgio avatar Oct 05 '16 17:10 fabgio

Hi Giovanni,

if I'm not wrong that is due to Dagger 2. Have you ever played with it? Usually for fix that error is enough to clean and rebuild the project from Android Studio.

Have you tried to build the project from the command line? If you run directly ./gradlew build it will fail while building the release cos you are missing the IAB_KEY property, so you should run ./gradlew testDebugUnitTest.

Let me know if it compiles correctly or you have other issue while running tests.

niqdev avatar Oct 05 '16 20:10 niqdev

I am going on with DeviceListFragment class testing,

I created and performed tests on DeviceListFragmentTest class but if I run tests on whole class I have an NPE on

onUpdateDeviceListEvent_initFavouriteCards() whereas if I run tests indidually everything works fine. Any idea?

Btw I drew four tests: three on Fragment and one on the Adapter and all of them passed. May I commit?

Il 03/10/2016 23:02, niqdev ha scritto:

The example searchbar https://github.com/DenisMondon/material-design-library/tree/master/sample/src/main/java/com/blunderer/materialdesignlibrary/sample/searchbar for reference.

I would suggest to modify |DeviceListFragment|, in particular extract from |initCards| a method to return the result of |Observable.zip()| i.e. an |Observable<Lists<DomoticModel>>| and then invoke it when apply a filter from the search bar.

Moreover before start I've just noticed that both this Fragment and the Adapter are not covered by tests, so I would like to have at least the tests on the Fragment in a separate commit before that you add the new feature. In this way we can check if we introduce any regression.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/openwebnet/openwebnet-android/issues/48#issuecomment-251226092, or mute the thread https://github.com/notifications/unsubscribe-auth/ALJ6eBtu8eIpf8q1gyge6Z1BKu66_t37ks5qwW1agaJpZM4IZPXo.

fabgio avatar Oct 14 '16 13:10 fabgio

Hi, can you push your feature branch on your forked repo, please? So I will checkout your branch and try to debug it. Thanks

niqdev avatar Oct 14 '16 14:10 niqdev

Any news with debugging? Need help?

Il 14 ott 2016 4:24 PM, "niqdev" [email protected] ha scritto:

Hi, can you push your feature branch on your forked repo, please? So I will checkout your branch and try to debug it. Thanks

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/openwebnet/openwebnet-android/issues/48#issuecomment-253814742, or mute the thread https://github.com/notifications/unsubscribe-auth/ALJ6eOsbPux02V6QhOAOkNG9rUSxzJqoks5qz5CEgaJpZM4IZPXo .

fabgio avatar Oct 20 '16 06:10 fabgio

Hi, sorry I was looking for a feature branch while you pushed on development. No problem I'll have a look in the next days and let you know. Just for the next time, as a best practice and guidelines, I forgot to tell you, create a feature branch from your development, do your changes on the feature branch and then make a pull request from your feature branch on my development. Is easier for you if you need to rebase later your branches if I push other commits at the same time. Thanks

niqdev avatar Oct 20 '16 07:10 niqdev

I've added few comments on your commit. I would like to add some tests with rx-java on the adapter as example for you and then discuss of how add the search feature. But you need to wait a couple of weeks at least if you need my support or you are stuck cos I'm working on another project and following a course on Scala at the same time and I have really no spare time now. Thanks

niqdev avatar Oct 20 '16 18:10 niqdev

Useful links

  • http://www.materialdoc.com/search-filter/
  • https://coderwall.com/p/zpwrsg/add-search-function-to-list-view-in-android
  • https://github.com/MiguelCatalan/MaterialSearchView
  • http://stackoverflow.com/questions/27556623/creating-a-searchview-that-looks-like-the-material-design-guidelines
  • http://stackoverflow.com/questions/30369246/implementing-searchview-as-per-the-material-design-guidelines
  • https://github.com/Wrdlbrnft/Searchable-RecyclerView-Demo
  • http://stackoverflow.com/questions/29540724/start-new-activity-from-searchview
  • https://github.com/arimorty/floatingsearchview

--> https://github.com/lapism/SearchView

niqdev avatar Dec 13 '16 19:12 niqdev

Hello Nik.

I have been studying for long how to proceed on Add search by name.

  1.   I just  updated the UI! 
    
  2.  My Idea is to develop   two different implementations of initCards method though an interface. The first implementation would be the one that has been developed already. The second one would be similar e to the first one except that it would  use RxJava filter instead, eg. “.filter(domoticitem->domoticItem.getName().startsWith(parameter)”.
    
  3.  The  initcard method  implementation would change on SearchView CallBack
    

Tell me what you think about!

Thanks

Da: niqdev [mailto:[email protected]] Inviato: venerdì 14 ottobre 2016 16:24 A: openwebnet/openwebnet-android [email protected] Cc: fabgio [email protected]; Assign [email protected] Oggetto: Re: [openwebnet/openwebnet-android] Add search by name (#48)

Hi, can you push your feature branch on your forked repo, please? So I will checkout your branch and try to debug it. Thanks

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/openwebnet/openwebnet-android/issues/48#issuecomment-253814742 , or mute the thread https://github.com/notifications/unsubscribe-auth/ALJ6eOsbPux02V6QhOAOkNG9rUSxzJqoks5qz5CEgaJpZM4IZPXo . https://github.com/notifications/beacon/ALJ6eGyjaLAwXQHbrk8SU-sFpni7nZqGks5qz5CEgaJpZM4IZPXo.gif

fabgio avatar Jan 28 '17 14:01 fabgio

Hi Giovanni,

Nice to hear from you, a couple of weeks ago I spent a bit of time and did a bit of research. Now I run out of free time and I'm too busy again. So, there is already a branch but unfortunately is not stable.

I've found a library that could be useful, but we can't integrate it directly:

  • library
  • issue overlapping list elevation
  • the library uses the latest sdk version, but is incompatible with Roboelectric and half of the test don't pass: broken build
  • there is a well know Roboelectic issue referenced inside the project
  • I don't like that uses a separate sql db only for the search history

A possible solution would be to copy only what we need, adjust the animation, fix the bug and write a SearchView component that fits our needs i.e. an history table adapter integrated with Realm and add the typeahead that uses directly the repository/service.

Please, have a look before at the links that I shared with you and let me know what you think.

Thanks

niqdev avatar Jan 28 '17 15:01 niqdev

Hi Niq!

I studied the library. I agree , I would write a custom SearchView component based on Realm DB. I would proceed as follows:

  1.  Refector the SearchView component to Realm DB:
    
  2.  Refafactor SearchHistoryTable class  helper methods’ to Realm; 
    
  3.  Refactor   SearchAdapter class to  Realm;
    
  4.  Add an history table to the existing OpenWebnet-Android  Realm DB:
    
  5.  Integrate the new  SearchView Component with OpenWebnet-Android app 
    

Meanwhile I downgraded SearchView app SDK to 24 level and it compiled, built and run with no issues.

As far as the bug overlapping list elevation, IMO is not a priority and we could tackle it afterwards.

Let me know.

Giovanni

Da: niqdev [mailto:[email protected]] Inviato: sabato 28 gennaio 2017 16:35 A: openwebnet/openwebnet-android [email protected] Cc: fabgio [email protected]; Assign [email protected] Oggetto: Re: [openwebnet/openwebnet-android] Add search by name (#48)

Hi Giovanni,

Nice to hear from you, a couple of weeks ago I spent a bit of time and did a bit of research. Now I run out of free time and I'm too busy again. So, there is already a branch https://github.com/openwebnet/openwebnet-android/tree/feature/search-view but unfortunately is not stable.

I've found a library that could be useful, but we can't integrate it directly:

A possible solution would be to copy only what we need, adjust the animation, fix the bug and write a SearchView component that fits our needs i.e. an history table adapter integrated with Realm and add the typeahead that uses directly the repository/service.

Please, have a look before at the links that I shared with you and let me know what you think.

Thanks

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/openwebnet/openwebnet-android/issues/48#issuecomment-275854831 , or mute the thread https://github.com/notifications/unsubscribe-auth/ALJ6eC04yhNy65dLcYteyUCxWTviLs9yks5rW2AIgaJpZM4IZPXo . https://github.com/notifications/beacon/ALJ6eKUoUdihF87i36zquJTFBw-4dfcqks5rW2AIgaJpZM4IZPXo.gif

fabgio avatar Feb 04 '17 14:02 fabgio

Hi Giovanni, did you push some changes on any forked branch?

So, this could be an idea:

  • Create a forked branch from development and try to create a SearchView starting from this tutorial using the official support library and compare/copy the animation with the autocomplete from the SearchView library
  • The autocomplete layout should show: the icon (depending on the corresponding device type), the name (bigger) and the environment (second line, smaller)
  • Use the EventBus as I have already done on the feature/search-view branch to show the icon in the AppBar only after all the cards have been loaded
  • Use the EventBus to hide the FloatingButton when open the autocomplete and show the keyboard
  • Use the EventBus to hide the icon in the AppBar when the Settings are shown
  • of course the EventBus should handle the toggle (hide/show) for each event (something is already done in the other branch)
  • Create a "hidden" menu (the user will never be able to select this menu manually from the NavigationDrawer) with the only purpose to show the result i.e. the selected card that executes the request when selected (I'm expecting only 1 card of course)
  • Integrate the autocomplete animation with the search functionality using services on all the table, should be something similar with what is already there with the Observable.zip but with all the element filtered by the input chars, of course the typeahed should be fired only with at least 3 chars for example
  • The history/Realm integration is NOT a priority at the moment, we can discuss it later. I think there is already enough to do to make this working properly without introducing any regression

Some guidelines

  • create all the component in a package called com.github.openwebnet.view.search
  • all the commit should have a single responsability, the comments should be short, present tense, lower case
  • test your component
  • all tests should pass and the build on travis
  • the code should be well formatted and respect the styleguide as linked here

Give me a feedback on this. Thanks

niqdev avatar Feb 04 '17 15:02 niqdev

Hi Niq!

I have been working on the first three points of your scheduling, Still, I don’t know I am proceeding on the right way.

I am sorry but even though I have been programming for five years I have no experience in team working as I am a self-thought programmer.

Could you please review what I did so far? I tried to push some stuff but I do not see anything on github. I read that from a forked branch there may be restrictions in pushing!

I am bit stack actually.

Thank you for your patience.

Giovanni

Da: niqdev [mailto:[email protected]] Inviato: sabato 4 febbraio 2017 16:31 A: openwebnet/openwebnet-android [email protected] Cc: fabgio [email protected]; Assign [email protected] Oggetto: Re: [openwebnet/openwebnet-android] Add search by name (#48)

Hi Giovanni, did you push some changes on any forked branch?

So, this could be an idea:

  • Create a forked branch from development and try to create a SearchView starting from this tutorial http://www.materialdoc.com/search-filter/ using the official support library and compare/copy the animation with the autocomplete from the SearchView library
  • The autocomplete layout should show: the icon (depending on the corresponding device type), the name (bigger) and the environment (second line, smaller)
  • Use the EventBus as I have already done on the feature/search-view branch to show the icon in the AppBar only after all the cards have been loaded
  • Use the EventBus to hide the FloatingButton when open the autocomplete and show the keyboard
  • Use the EventBus to hide the icon in the AppBar when the Settings are shown
  • of course the EventBus should handle the toggle (hide/show) for each event (something is already done in the other branch)
  • Create a "hidden" menu (the user will never be able to select this menu manually from the NavigationDrawer) with the only purpose to show the result i.e. the selected card that executes the request when selected (I'm expecting only 1 card of course)
  • Integrate the autocomplete animation with the search functionality using services on all the table, should be something similar with what is already there with the Observable.zip but with all the element filtered by the input chars, of course the typeahed should be fired only with at least 3 chars for example
  • The history/Realm integration is NOT a priority at the moment, we can discuss it later. I think there is already enough to do to make this working properly without introducing any regression

Some guidelines

  • create all the component in a package called com.github.openwebnet.view.search
  • all the commit should have a single responsability, the comments should be short, present tense, lower case
  • test your component
  • all tests should pass and the build on travis succeed
  • the code should be well formatted and respect the styleguide as linked here https://github.com/openwebnet/openwebnet-android/blob/master/CONTRIBUTING.md

Give me a feedback on this. Thanks

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/openwebnet/openwebnet-android/issues/48#issuecomment-277453200 , or mute the thread https://github.com/notifications/unsubscribe-auth/ALJ6eM5k1_hZ2CnGrw11CkEp8XymnhXUks5rZJm-gaJpZM4IZPXo . https://github.com/notifications/beacon/ALJ6eIEUOq4wcHaHEgJArcKRiEU6oA8Uks5rZJm-gaJpZM4IZPXo.gif

fabgio avatar Mar 19 '17 11:03 fabgio

Hi Giovanni, no problem, so in theory you should have forked the latest version of the project, checkout development and created a branch named feature/branch-name, committed your changes there and pushed on your forked branch and in case you want to do a pull request you should create it pointing to development, not master. But on your fork I can;t find any branch. Did you push on your remote? if you need any help just ask me. Thanks

niqdev avatar Mar 19 '17 18:03 niqdev

[Hacktoberfest] Please contact me to have more info about this issue, any help would be very appreciated. Thanks

niqdev avatar Sep 29 '17 08:09 niqdev