-
-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #87: store caches on multiple lists #5521
Conversation
As you can see on http://ci.cgeo.org/job/cgeo%20pull%20request/121/console some symbols are missing from resources. |
new StoreCacheHandler(CacheDetailActivity.this, progress).sendEmptyMessage(CancellableHandler.DONE); | ||
} else { | ||
storeCache(StoredList.TEMPORARY_LIST.id, new StoreCacheHandler(this, progress)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fragment, which is more a repetition of the fragment above, should be refactored to not be repeated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is also a similar code fragment in another file. I'll refactor them.
Now it's compiling, but 3 Unittests are failing. I'll look into them. But maybe not this evening. |
It looks like you might be trying to insert several times the same cache into the same list (probably the default one, where the cache may also be, while you're removing the other list it was into). |
Yes, the where clause which should check if the cache is already on the standard list was wrong. |
I refactored the similar code blocks mentioned above. There was a comment in my mail, but not here on github saying:
Is it obsolete? I couldn't reproduce it. When "Store in list" is clicked, only these Lists are available in the popup which the cache is not yet stored in. Open Issues I see and I'm still working on:
|
|
Have you tried running |
Not yet, I'll check. |
I fixed the failing UnitTest. Didn't know that there are other tests to be executed by gradle alone. Had to search a little bit in AndroidStudio to find them. :) I improved the CacheDetails page a little bit. The "drop" button is back, which removed the Cache from all lists. I'm still not 100% happy with the UI, but it's getting better. Any ideas to improve it are welcome. Regarding the DB migration: I tested again with current master and 3 different Lists. All caches were transferred correctly in the multi list schema. Only going back is not possible. c:geo crashes on startup with a NPE, because it can't downgrade the DB. I think this is a general problem and not related to this change. Should we address this in a separate Issue? I looked again into the |
Concerning the hack: indeed, the clean solution would be to add another field to indicate whether the list is virtual or real, but if you look at it from a mathematical point of view, this is just an extra bit, which can be factored into the actual list id (even though we don't use a separate bit for this and just reserve some values). It might be cleaner to reserve the highest bit for that though, but we have already reserved some extra ids should we need some new virtual lists. |
Finally I adjusted the CacheDetails Popup dialog. Because there is not much room, I just added a comma separated List of Lists at the end. There is not "Remove from list" button for the individual lists. There is only a "Drop" Menu item to remove the Cache from all lists. I think this should be enough. If the user needs more detailed functionality he needs to open the full CacheDetailsPage. Regarding the So right now I don't have any open issues left (the failing tests are because geocaching.com has some problems tonight). |
I am not able to try it right now, but could you please confirm that:
If those answers are both yes, I propose to merge the issue if there are no objections. Ping @Lineflyer, @Bananeweizen, @SammysHP, @rsudev, @kumy, @mucek4 |
Oh no, I missed the GPX Import. Need to fix it. |
No objection for me. This next feature release will be a long standing one, from people I know... Will do extending tests once merged. |
In general ok for me. Just one remark so far:
Why at all does the popup need changes here. As of now there is no reference to any lists. |
Now you can hit "store" all the time. If we don't show the lists you can hardly recognize what's happening. The only clue would be the decreasing list of available lists in the list selection popup. |
I still can't believe that I missed the GPX (PQ) Import feature. While working on it I found two other places which needed attention:
|
@@ -1483,4 +1496,8 @@ | |||
<string name="invitation_title">Invite friends to use c:geo</string> | |||
<string name="invitation_message">Try the c:geo app for geocaching</string> | |||
|
|||
<string name="cache_list_remove_from">Remove from list</string> | |||
<string name="list_list_headline">Lists: </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please trim that string
I've only done review, no testing yet. A question out of curiosity: All existing menus and commands have been reworked. I'm wondering if we should have an additional context and options menu on lists to delete the selected/all caches from all lists instead of the current. I really don't have an opinion about that myself yet. It might be confusing for users, or it might be helpful for power users. No clue. |
I thought we decided to use tags. Each cache can have none, one or many tags (aka labels) and "lists" will be replaced by a filter (e.g. checkboxes in the current list dropdown). |
This proposal, which works very well for me so far, is an extension of what we have now. We can still change the wording afterwards (list -> tag) and add the new notion (collection of tags -> list) if we want, but the current step is needed anyway. |
- Added n:m relationship between caches and lists - List of Lists in CacheDetailActivity - Added CopyToList Command - CacheDetailActivity Menu adjustments - Fixed basicDebugUnitTests - Adjusted CachePopup Dialog - GPX Import with multilist support - CleanIfNeeded - Code Review adjustments
- Added n:m relationship between caches and lists - List of Lists in CacheDetailActivity - Added CopyToList Command - CacheDetailActivity Menu adjustments - Fixed basicDebugUnitTests - Adjusted CachePopup Dialog
Fixed some review comments. Summary of Discussions from comments above:
|
list vs tags is indeed 'just a naming thing', but IMO one that can make a difference when it comes to understanding the feature easily. |
What @rsudev said and:
As this is in some way only a naming issue I'm also the opinion to merge this PR and test it. Before the next release we should think about the naming and possible new ways to use the new system (as written above). |
Let's merge and make it evolve. |
Fix #87: store caches on multiple lists
Thanks for this painful but very useful work @pstorch. |
I couldn't resist and started working on this issue #87 .
It's not ready yet, but as this is a bigger change I would like to have the chance to get some feedback.
I introduced a n:m relationship table between caches and lists. Then I started changed all code which was working with the one ListId of the Cache to be able to handle a Set of ListIds.
The main visible difference is in the CacheDetailActivity.
It's not fully tested and needs some polishing, too. Any feedback is welcome.
If I'm totally wrong here, please tell me, too. Then it was just a programming exercise for me.
Otherwise I'll continue.