-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes #1521 (Search activity, image search feature added.) #1561
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
Fixes #1521 (Search activity, image search feature added.) #1561
Conversation
|
@neslihanturan @nicolas-raoul I have completed search feature. Can you tell me the improvements? Also, some extra commits are coming due to merging master, how can I remove them? |
b5af070 to
021905a
Compare
|
|
||
| @Override | ||
| public void onBackPressed() { | ||
| if (getSupportFragmentManager().getBackStackEntryCount()==1){ |
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.
spaces around ==
|
|
||
| public class SearchImageFragment extends CommonsDaggerSupportFragment { | ||
|
|
||
| public static final int SEARCH_IMAGES_LIMIT = 25; |
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.
javadoc
|
|
||
| return rootView; | ||
| } | ||
|
|
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.
javadoc
| private Observable<SearchImageItem> searchImages(String query) { | ||
| return mwApi.searchImages(query, SEARCH_IMAGES_LIMIT).map(s -> new SearchImageItem(s)); | ||
| } | ||
|
|
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.
javadoc
| @@ -0,0 +1,13 @@ | |||
| package fr.free.nrw.commons.explore.images; | |||
|
|
|||
| public class SearchImageItem { | |||
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.
javadoc
| import java.util.List; | ||
|
|
||
|
|
||
| class SearchImagesAdapterFactory { |
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.
javadoc
| interface ImageClickedListener { | ||
| void imageClicked(SearchImageItem item); | ||
| } | ||
|
|
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.
javadoc
| return CategoryImageUtils.getMediaList(childNodes); | ||
| } | ||
|
|
||
| @Override |
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.
javadoc
|
Strangely I get |
|
Umm, @nicolas-raoul I have not changed anything in gradle files and it is working fine in my Laptop. |
|
@nicolas-raoul Also can we enable codacy for our branch. |
|
can you ping me when it is ready to test @ujjwalagrawal17 ? |
|
@neslihanturan @nicolas-raoul I think it is ready for review. |
|
Okay so search is added to featured activity for now. But it will be added to another activity in future right? Our task has no relation with featured activity. |
|
Actually, we can rename featured image activity as explore Activity and menu in a drawer. We don't have to make a new activity for Explore feature then. If we make a separate activity then featured image will not be used. So I think its better to refractor already existing activity. |
|
We have to think about UIs. Because Featured images is not same with explore. You can explore ALL images. But when we add search icon top of featured images, it feels like user can only search in featured images. This is not the case. |
|
Yes @neslihanturan you are right. There are 2 solutions for this -
|
|
In both cases in toolbar and navigation drawer, we have to write "Explore". |
|
@neslihanturan Can that issue not be solved by having existing text in the search bar that says "Search all images in Commons"? I would personally prefer Browse and Featured to be united in a single activity if possible, as they are highly related and it reduces cluttering. I believe we were discussing this at #1521 |
|
I also meant we definitely should have them in same activity but maybe different tabs? Or your solution could also work. Under any case I think it is better to discuss on mockups. @ujjwalagrawal17 are you willing to create some mockups to find best solution? @nicolas-raoul I really wonder your opinion about this topic. Please continue to discussion at #1521 |
|
@neslihanturan sure I will share some mock-ups tomorrow. I think we can merge that in a seperate PR. |
|
Travis fail is not about this PR. Thanks a lot @ujjwalagrawal17 for great job! Looking forward for your other PRs:) |
Add Search activity, image search feature
Fixes #1521 (Add search Images from commons feature)
Fixes #1522 (Browse search field: Pressing Enter should launch search, rather than add newline character)
Description
Tests performed
Manually tested on [API 25 Motog5S+] with ProdDebug
Please test on ProdDebug as betaDebug variant doesn't have many images to search
Screenshots showing what changed