Empty screen if no upload fix (#1940)

* Updated contribution screen to show message for no uploads by default, message gets wiped after any picture is inserted into the list

* Changed string as suggested

* Added margin
This commit is contained in:
Rulino 2018-10-20 17:00:02 +02:00 committed by Vivek Maskara
parent 6bee91496e
commit 2af57fc594
4 changed files with 24 additions and 0 deletions

View file

@ -256,6 +256,9 @@ public class ContributionsActivity
((CursorAdapter) contributionsList.getAdapter()).swapCursor(cursor);
}
if(contributionsList.getAdapter().getCount()>0){
contributionsList.changeEmptyScreen(false);
}
contributionsList.clearSyncMessage();
notifyAndMigrateDataSetObservers();
}

View file

@ -47,6 +47,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
TextView waitingMessage;
@BindView(R.id.loadingContributionsProgressBar)
ProgressBar progressBar;
@BindView(R.id.noDataYet)
TextView noDataYet;
@Inject
@Named("prefs")
@ -79,6 +81,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
waitingMessage.setVisibility(GONE);
}
changeEmptyScreen(true);
changeProgressBarVisibility(true);
return v;
}
@ -95,6 +98,10 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
}
}
public void changeEmptyScreen(boolean isEmpty){
this.noDataYet.setVisibility(isEmpty ? View.VISIBLE : View.GONE);
}
public void changeProgressBarVisibility(boolean isVisible) {
this.progressBar.setVisibility(isVisible ? View.VISIBLE : View.GONE);
}