Skip to content
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

Closed

Conversation

gupta1anubhav
Copy link

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)

screenshot from 2018-05-26 13-09-38

@gupta1anubhav
Copy link
Author

@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){
Copy link
Member

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.

Copy link
Member

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.

@neslihanturan
Copy link
Collaborator

@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.

@maskaravivek
Copy link
Member

@neslihanturan I guess we can merge this PR if it fixes the underlying issue.

@nicolas-raoul
Copy link
Member

Yes I guess.

Add JavaDoc, rename variables, rename function, make method private, fix formatting
Improve comments, improve efficiency by avoiding going back through ArrayList
@domdomegg
Copy link
Member

Think I've made required changes.

Tested 2.7.1-debug-pr-1555~3bf65ee3 on Samsung Galaxy S6 with API level 25. Uploading and selecting categories seems fine, but it doesn't seem to actually add the categories to beta commons - however master doesn't seem to either. Not quite sure what's going on about that, would appreciate another person testing :/

Example file with 3bf65ee

@commons-app commons-app deleted a comment from codecov-io Dec 20, 2018
@domdomegg
Copy link
Member

@domdomegg domdomegg closed this Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants