mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fix issue 3137 (#3637)
* Fix issue 3137 * Remove import Timber * Remove unnecessary space
This commit is contained in:
parent
62f176443b
commit
46847f0d77
3 changed files with 17 additions and 15 deletions
|
|
@ -147,6 +147,7 @@ public class SearchDepictionsFragment extends CommonsDaggerSupportFragment imple
|
|||
*/
|
||||
@Override
|
||||
public void initErrorView() {
|
||||
isLoading = false;
|
||||
progressBar.setVisibility(GONE);
|
||||
bottomProgressBar.setVisibility(GONE);
|
||||
depictionNotFound.setVisibility(VISIBLE);
|
||||
|
|
@ -195,10 +196,11 @@ public class SearchDepictionsFragment extends CommonsDaggerSupportFragment imple
|
|||
}
|
||||
|
||||
@Override
|
||||
public void loadingDepictions() {
|
||||
public void loadingDepictions(boolean isLoading) {
|
||||
depictionNotFound.setVisibility(GONE);
|
||||
bottomProgressBar.setVisibility(View.VISIBLE);
|
||||
progressBar.setVisibility(GONE);
|
||||
this.isLoading = isLoading;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface SearchDepictionsFragmentContract {
|
|||
/**
|
||||
* load depictions
|
||||
*/
|
||||
void loadingDepictions();
|
||||
void loadingDepictions(boolean isLoading);
|
||||
|
||||
/**
|
||||
* clear adapter
|
||||
|
|
|
|||
|
|
@ -82,19 +82,19 @@ public class SearchDepictionsFragmentPresenter extends CommonsDaggerSupportFragm
|
|||
*/
|
||||
@Override
|
||||
public void updateDepictionList(String query, int pageSize, boolean reInitialise) {
|
||||
this.query = query;
|
||||
view.loadingDepictions();
|
||||
if (reInitialise) {
|
||||
size = 0;
|
||||
}
|
||||
saveQuery();
|
||||
compositeDisposable.add(depictsClient.searchForDepictions(query, 25, offset)
|
||||
.subscribeOn(ioScheduler)
|
||||
.observeOn(mainThreadScheduler)
|
||||
.timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||
.doOnSubscribe(disposable -> saveQuery())
|
||||
.collect(ArrayList<DepictedItem>::new, ArrayList::add)
|
||||
.subscribe(this::handleSuccess, this::handleError));
|
||||
this.query = query;
|
||||
view.loadingDepictions(true);
|
||||
if (reInitialise) {
|
||||
size = 0;
|
||||
}
|
||||
saveQuery();
|
||||
compositeDisposable.add(depictsClient.searchForDepictions(query, 25, offset)
|
||||
.subscribeOn(ioScheduler)
|
||||
.observeOn(mainThreadScheduler)
|
||||
.timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||
.doOnSubscribe(disposable -> saveQuery())
|
||||
.collect(ArrayList<DepictedItem>::new, ArrayList::add)
|
||||
.subscribe(this::handleSuccess, this::handleError));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue