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
Add auto-complete to discovery country selection #6139
Conversation
MaterialAutoCompleteTextView editText = (MaterialAutoCompleteTextView) textInput.getEditText(); | ||
editText.setAdapter(dataAdapter); | ||
if (countryCode.equals(ItunesTopListLoader.DISCOVER_HIDE_FAKE_COUNTRY_CODE)) { | ||
editText.setText(countryCodeNames.get(previousCountryCode)); |
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.
Why do you store the previous code? It's only in a variable anyway, so it doesn't really help?
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.
I use this variable in order to restore country user previously selected when they uncheck "Hide" checkbox, and to show previously selected country in drop-down list instead of empty 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.
Also made this variable stored in prefs
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.
Instead of storing (current, previous) country codes where the current one can be DISCOVER_HIDE_FAKE_COUNTRY_CODE
, I think it would be a lot more clear to store (country, hidden). Then we need to store one string and one boolean and don't need to move strings back and forth between the two variables.
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.
fixed
Hello! |
Hello! |
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.
Thanks! This looks so much better than the old country selector 👍 I added some additional comments :)
app/src/main/java/de/danoeh/antennapod/fragment/DiscoveryFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/danoeh/antennapod/fragment/DiscoveryFragment.java
Outdated
Show resolved
Hide resolved
Can't |
Good point! Pushed new commit |
Thanks! Will be released in version 3.0 |
Hello!
This closes #6098.
Here's a demonstration video
https://imgur.com/a/4avAwIV