Dbrant has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370672 )

Change subject: Add better empty state to Offline Library screen.
......................................................................

Add better empty state to Offline Library screen.

(This is the first introduction of the new "library" and "packs" verbiage,
and can be independent of the Grand Renaming that will follow soon.)

Bug: T172553
Change-Id: I9bd2a83bd940bd713f5c91476643f98938937c21
---
M app/src/main/java/org/wikipedia/offline/LocalCompilationsActivity.java
M app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
A app/src/main/res/drawable/empty_offlinelibrary.png
M app/src/main/res/layout/fragment_local_compilations.xml
M app/src/main/res/values-qq/strings.xml
M app/src/main/res/values/strings.xml
6 files changed, 63 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/72/370672/1

diff --git 
a/app/src/main/java/org/wikipedia/offline/LocalCompilationsActivity.java 
b/app/src/main/java/org/wikipedia/offline/LocalCompilationsActivity.java
index 8be08cd..b54c002 100644
--- a/app/src/main/java/org/wikipedia/offline/LocalCompilationsActivity.java
+++ b/app/src/main/java/org/wikipedia/offline/LocalCompilationsActivity.java
@@ -23,7 +23,7 @@
         setWordmarkVisible(false);
         if (getSupportActionBar() != null) {
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
-            
getSupportActionBar().setTitle(R.string.offline_compilations_title);
+            getSupportActionBar().setTitle(R.string.offline_library_title);
         }
     }
 
diff --git 
a/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java 
b/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
index d72dda4..a77a0a7 100644
--- a/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
+++ b/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
@@ -45,6 +45,7 @@
     @BindView(R.id.compilations_count_text) TextView countText;
     @BindView(R.id.disk_usage_view) DiskUsageView diskUsageView;
     @BindView(R.id.compilation_search_error) WikiErrorView errorView;
+    @BindView(R.id.compilation_empty_container) View emptyContainer;
     private Unbinder unbinder;
 
     private boolean updating;
@@ -131,7 +132,7 @@
         }
     }
 
-    @OnClick(R.id.compilations_add_button) void onAddCompilationClick() {
+    @OnClick({R.id.compilations_add_button, 
R.id.compilation_empty_search_button}) void onAddCompilationClick() {
         startActivity(RemoteCompilationsActivity.newIntent(getContext()));
     }
 
@@ -204,16 +205,19 @@
             progressBar.setVisibility(View.GONE);
             searchEmptyView.setVisibility(View.GONE);
             listContainer.setVisibility(View.GONE);
+            emptyContainer.setVisibility(View.GONE);
             return;
         }
         errorView.setVisibility(View.GONE);
         progressBar.setVisibility(updating ? View.VISIBLE : View.GONE);
         if (TextUtils.isEmpty(searchQuery)) {
             searchEmptyView.setVisibility(View.GONE);
-            listContainer.setVisibility(View.VISIBLE);
+            listContainer.setVisibility(displayedItems.isEmpty() ? View.GONE : 
View.VISIBLE);
+            emptyContainer.setVisibility(displayedItems.isEmpty() ? 
View.VISIBLE : View.GONE);
         } else {
             listContainer.setVisibility(displayedItems.isEmpty() ? View.GONE : 
View.VISIBLE);
             searchEmptyView.setVisibility(displayedItems.isEmpty() ? 
View.VISIBLE : View.GONE);
+            emptyContainer.setVisibility(View.GONE);
         }
     }
 
diff --git a/app/src/main/res/drawable/empty_offlinelibrary.png 
b/app/src/main/res/drawable/empty_offlinelibrary.png
new file mode 100644
index 0000000..00745f4
--- /dev/null
+++ b/app/src/main/res/drawable/empty_offlinelibrary.png
Binary files differ
diff --git a/app/src/main/res/layout/fragment_local_compilations.xml 
b/app/src/main/res/layout/fragment_local_compilations.xml
index 33bd03e..58e076e 100644
--- a/app/src/main/res/layout/fragment_local_compilations.xml
+++ b/app/src/main/res/layout/fragment_local_compilations.xml
@@ -83,6 +83,54 @@
 
         </FrameLayout>
 
+        <LinearLayout
+            android:id="@+id/compilation_empty_container"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:layout_marginTop="32dp">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:textSize="20sp"
+                android:fontFamily="sans-serif-medium"
+                android:textColor="?attr/feed_text_primary_color"
+                android:text="@string/offline_library_empty_title"/>
+
+            <ImageView
+                android:layout_width="168dp"
+                android:layout_height="96dp"
+                android:layout_marginTop="16dp"
+                android:layout_marginBottom="16dp"
+                android:src="@drawable/empty_offlinelibrary"
+                android:layout_gravity="center_horizontal"
+                android:contentDescription="@null"/>
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/activity_horizontal_margin"
+                android:layout_marginRight="@dimen/activity_horizontal_margin"
+                android:gravity="center"
+                android:textSize="16sp"
+                android:fontFamily="sans-serif-medium"
+                android:lineSpacingMultiplier="1.2"
+                android:textColor="?attr/feed_text_tertiary_color"
+                android:text="@string/offline_library_empty_description"/>
+
+            <TextView
+                android:id="@+id/compilation_empty_search_button"
+                style="@style/App.Button.Blue"
+                android:layout_marginTop="8dp"
+                android:layout_gravity="center_horizontal"
+                android:text="@string/offline_library_empty_search"
+                android:layout_marginLeft="0dp"
+                android:layout_marginRight="0dp"/>
+
+        </LinearLayout>
+
         <ProgressBar
             android:id="@+id/compilation_search_progress_bar"
             android:layout_width="wrap_content"
diff --git a/app/src/main/res/values-qq/strings.xml 
b/app/src/main/res/values-qq/strings.xml
index defd790..7a21575 100644
--- a/app/src/main/res/values-qq/strings.xml
+++ b/app/src/main/res/values-qq/strings.xml
@@ -445,6 +445,10 @@
   <string name="compilation_download_cancel_confirm">Confirmation message 
asking if the user really wants to cancel the download.</string>
   <string name="compilation_download_cancel_confirm_yes">Affirmative answer to 
cancel the download.\n{{Identical|Yes}}</string>
   <string name="compilation_download_cancel_confirm_no">Negative answer to 
cancel the download.\n{{Identical|No}}</string>
+  <string name="offline_library_title">Title shown at the top of the activity 
for managing the offline library.</string>
+  <string name="offline_library_empty_title">Message shown when the offline 
library is empty.</string>
+  <string name="offline_library_empty_description">Explanation encouraging the 
user to download an article pack for offline use later.</string>
+  <string name="offline_library_empty_search">Button label for searching the 
list of possible article packs to download.</string>
   <string name="onboarding_skip">Button label to skip the current onboarding 
or tutorial screen.\n{{Identical|Skip}}</string>
   <string name="onboarding_continue">Button label to continue to the next 
onboarding or tutorial screen.\n{{Identical|Continue}}</string>
   <string name="onboarding_get_started">Button label to finish the current 
onboarding or tutorial workflow.\n{{Identical|Get started}}</string>
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index e5cca19..94f109b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -496,6 +496,10 @@
     <string name="compilation_download_cancel_confirm">Are you sure you want 
to cancel downloading this compilation?</string>
     <string name="compilation_download_cancel_confirm_yes">Yes</string>
     <string name="compilation_download_cancel_confirm_no">No</string>
+    <string name="offline_library_title">Offline Library</string>
+    <string name="offline_library_empty_title">Nothing in your Offline 
Library</string>
+    <string name="offline_library_empty_description">Choose a pack of 
Wikipedia articles to download now, for data-free access later.</string>
+    <string name="offline_library_empty_search">Search Offline Library</string>
     <!-- /Offline -->
 
     <!-- Onboarding -->

-- 
To view, visit https://gerrit.wikimedia.org/r/370672
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bd2a83bd940bd713f5c91476643f98938937c21
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <dbr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to