-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #1550 Duplicated category suggestions #1555
Fixes #1550 Duplicated category suggestions #1555
Conversation
@nicolas-raoul any update? |
@@ -194,6 +195,20 @@ public void onActivityCreated(Bundle savedInstanceState) { | |||
onCategoriesSaveHandler = (OnCategoriesSaveHandler) getActivity(); | |||
getActivity().setTitle(R.string.categories_activity_title); | |||
} | |||
void removeduplicates(RVRendererAdapter<CategoryItem> categoriesAdapter){ |
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.
private
I guess? Please also mind the line spacing.
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.
Default class visibility is private
so I am okay with the method signature not being explicit about it. I agree with the line spacing comment though.
@gupta1anubhav are you willing to solve problems according to @nicolas-raoul 's reviews? If not, I can implement them on top of your changes too. |
@neslihanturan I guess we can merge this PR if it fixes the underlying issue. |
Yes I guess. |
Add JavaDoc, rename variables, rename function, make method private, fix formatting
Improve comments, improve efficiency by avoiding going back through ArrayList
Think I've made required changes. Tested |
Done in #1968, see apps-android-commons/app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java Line 525 in db38174
|
Duplicated category suggestions
Fixes #1550
Description (required)
Before calling notifydatasetchanged on categories adapter, I have removed the duplicates from categoriesAdapter by using linked hash set which has the property that it contains unique values and maintains the order of categories adapter.
And All this work is done in O(n) time.
Now Duplicates are not present.
{Describe the changes made and why they were made.}
Tests performed (required)
Manually tested on [API 24 Redmi Note 4] with ProdDebug,BetaDebug
Screenshots showing what changed (optional)