mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
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:
parent
6bee91496e
commit
2af57fc594
4 changed files with 24 additions and 0 deletions
|
|
@ -256,6 +256,9 @@ public class ContributionsActivity
|
|||
((CursorAdapter) contributionsList.getAdapter()).swapCursor(cursor);
|
||||
}
|
||||
|
||||
if(contributionsList.getAdapter().getCount()>0){
|
||||
contributionsList.changeEmptyScreen(false);
|
||||
}
|
||||
contributionsList.clearSyncMessage();
|
||||
notifyAndMigrateDataSetObservers();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,18 @@
|
|||
android:background="?attr/mainBackground"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noDataYet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/no_uploads"
|
||||
android:gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"
|
||||
android:layout_marginRight="@dimen/tiny_gap"
|
||||
android:layout_marginEnd="@dimen/tiny_gap"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -358,4 +358,6 @@
|
|||
<string name="write_storage_permission_rationale_for_image_share">We need your permission to access the external storage of your device in order to upload images.</string>
|
||||
|
||||
<string name="log_collection_started">Log collection started. Please RESTART the app, perform action that you wish to log, and then tap \'Send Logs\' again</string>
|
||||
<string name="no_uploads">Welcome to Commons!\n
|
||||
Upload your first media by touching the camera or gallery icon above.</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue