Android - Search - Code style fixes

This commit is contained in:
Cristian Luis Duarte 2018-05-04 18:37:22 -03:00
parent 843aa9e261
commit d4a6e845cd
2 changed files with 10 additions and 8 deletions

View file

@ -120,7 +120,7 @@ public class HomeActivity extends AppCompatActivity implements NavigationView.On
@Override
public void afterTextChanged(Editable editable) {
mDomainAdapter.loadDomains(editable.toString());
if(editable.length()>0) {
if (editable.length() > 0) {
mSearchIconView.setVisibility(View.GONE);
mClearSearch.setVisibility(View.VISIBLE);
} else {

View file

@ -109,15 +109,17 @@ public class UserStoryDomainProvider implements DomainProvider {
}
private boolean matches(UserStory story) {
if (mWords.length<=0) return true;
boolean res = true;
for (String word: mWords) {
res = res && story.searchText().contains(word);
if (!res) break;
if (mWords.length <= 0) {
return true;
}
return res;
for (String word : mWords) {
if (!story.searchText().contains(word)) {
return false;
}
}
return true;
}
private void addToSuggestions(UserStory story) {