Merge pull request #351 from connyduck/bugfix-search

fix bug where "no result" message was not shown in SearchActivity
This commit is contained in:
Vavassor 2017-07-18 20:20:41 -04:00 committed by GitHub
commit 25b680c401
1 changed files with 1 additions and 3 deletions

View File

@ -37,8 +37,6 @@ import com.keylesspalace.tusky.adapter.SearchResultsAdapter;
import com.keylesspalace.tusky.entity.SearchResults; import com.keylesspalace.tusky.entity.SearchResults;
import com.keylesspalace.tusky.interfaces.LinkListener; import com.keylesspalace.tusky.interfaces.LinkListener;
import java.util.List;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
@ -165,7 +163,7 @@ public class SearchActivity extends BaseActivity implements SearchView.OnQueryTe
public void onResponse(Call<SearchResults> call, Response<SearchResults> response) { public void onResponse(Call<SearchResults> call, Response<SearchResults> response) {
if (response.isSuccessful()) { if (response.isSuccessful()) {
SearchResults results = response.body(); SearchResults results = response.body();
if (results.accounts != null || results.hashtags != null) { if (results.accounts != null && results.accounts.length > 0 || results.hashtags != null && results.hashtags.length > 0) {
adapter.updateSearchResults(results); adapter.updateSearchResults(results);
hideFeedback(); hideFeedback();
} else { } else {