Skip to content

Commit

Permalink
– refactored the recent code changes a little
Browse files Browse the repository at this point in the history
  • Loading branch information
uruba committed Nov 30, 2015
1 parent 032ed63 commit 2b562ea
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ private void fetchMeetupList() {
}

private void fetchMeetupList(boolean notifyUser) {
if (menuSearchItem != null) {
menuSearchItem.setVisible(false);
}
showLoadingOverlay();

new FetchJsoupDataTask(this, URL.MEETUP_LIST, notifyUser).execute();
Expand Down Expand Up @@ -162,9 +159,6 @@ public void processData(Document data, boolean notifyUser) {

listAdapter.setDataCollection(new ArrayList<>(meetups));

if (menuSearchItem != null) {
menuSearchItem.setVisible(true);
}
hideLoadingOverlay();

if (notifyUser) {
Expand All @@ -175,15 +169,28 @@ public void processData(Document data, boolean notifyUser) {

@Override
public void handleIOException(IOException e) {
if (menuSearchItem != null && meetups.size() > 0) {
menuSearchItem.setVisible(true);
}
hideLoadingOverlay();

Snackbar.make(fragmentWrapper, this.getResources().getString(R.string.download_error_IOException), Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}

@Override
protected void showLoadingOverlay() {
if (menuSearchItem != null) {
menuSearchItem.setVisible(false);
}
super.showLoadingOverlay();
}

@Override
protected void hideLoadingOverlay() {
if (menuSearchItem != null && meetups.size() > 0) {
menuSearchItem.setVisible(true);
}
super.hideLoadingOverlay();
}

@Override
public boolean onQueryTextSubmit(String query) {
return false;
Expand Down

0 comments on commit 2b562ea

Please sign in to comment.