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

Change subject: Final design tweaks to disk usage view.
......................................................................

Final design tweaks to disk usage view.

Bug: T173082
Change-Id: I9c3c5efa17f30128a82e94411a376b465b0dcadc
---
M app/src/main/java/org/wikipedia/offline/DiskUsageView.java
M app/src/main/res/drawable/shape_circle_outline.xml
M app/src/main/res/layout/view_disk_usage.xml
M app/src/main/res/values-qq/strings.xml
M app/src/main/res/values/attrs.xml
M app/src/main/res/values/strings.xml
M app/src/main/res/values/styles_dark.xml
M app/src/main/res/values/styles_light.xml
8 files changed, 83 insertions(+), 43 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/offline/DiskUsageView.java 
b/app/src/main/java/org/wikipedia/offline/DiskUsageView.java
index 0530cdb..d8afb7c 100644
--- a/app/src/main/java/org/wikipedia/offline/DiskUsageView.java
+++ b/app/src/main/java/org/wikipedia/offline/DiskUsageView.java
@@ -21,14 +21,12 @@
 
 public class DiskUsageView extends LinearLayout {
     @BindView(R.id.view_disk_usage_size_text) TextView sizeText;
-    @BindView(R.id.view_disk_usage_text_app) TextView usageAppText;
     @BindView(R.id.view_disk_usage_text_free) TextView usageFreeText;
     @BindView(R.id.view_disk_usage_bar_other) View otherBar;
+    @BindView(R.id.view_disk_usage_bar_other_separator) View otherSeparator;
     @BindView(R.id.view_disk_usage_bar_used) View usedBar;
+    @BindView(R.id.view_disk_usage_bar_used_separator) View usedSeparator;
     @BindView(R.id.view_disk_usage_bar_free) View freeBar;
-    @BindView(R.id.view_disk_usage_dot_other) View otherDot;
-    @BindView(R.id.view_disk_usage_dot_used) View usedDot;
-    @BindView(R.id.view_disk_usage_dot_free) View freeDot;
 
     public DiskUsageView(Context context) {
         super(context);
@@ -61,16 +59,17 @@
         sizeText.setText(getResources().getString(R.string.storage_size, 
usedGB));
         
usageFreeText.setText(getResources().getString(R.string.storage_size_free, 
availableGB));
 
-        setUsageBarWeight(otherBar, otherGB);
-        setUsageBarWeight(freeBar, availableGB);
         setUsageBarWeight(usedBar, usedGB);
+        usedSeparator.setVisibility(usedGB > 0f ? VISIBLE : GONE);
+        setUsageBarWeight(otherBar, otherGB);
+        otherSeparator.setVisibility(otherGB > 0f ? VISIBLE : GONE);
+        setUsageBarWeight(freeBar, availableGB);
     }
 
     private void init() {
         inflate(getContext(), R.layout.view_disk_usage, this);
         ButterKnife.bind(this);
         setOrientation(VERTICAL);
-        usageAppText.setText(R.string.app_name);
         update(0);
     }
 
diff --git a/app/src/main/res/drawable/shape_circle_outline.xml 
b/app/src/main/res/drawable/shape_circle_outline.xml
index 61d0024..1eafa54 100644
--- a/app/src/main/res/drawable/shape_circle_outline.xml
+++ b/app/src/main/res/drawable/shape_circle_outline.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android";
     android:shape="oval">
+    <solid android:color="@android:color/transparent"/>
     <stroke android:width="0.5dp" android:color="@color/base50"/>
 </shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_disk_usage.xml 
b/app/src/main/res/layout/view_disk_usage.xml
index dd9f3ce..122a506 100644
--- a/app/src/main/res/layout/view_disk_usage.xml
+++ b/app/src/main/res/layout/view_disk_usage.xml
@@ -32,7 +32,6 @@
             android:layout_marginRight="8dp"
             android:textSize="12sp"
             android:textColor="?attr/primary_text_color"
-            android:fontFamily="sans-serif-medium"
             android:text="@string/storage_used_by_compilations"/>
 
     </LinearLayout>
@@ -50,31 +49,33 @@
             android:layout_width="0dp"
             android:layout_height="match_parent"
             android:layout_weight="1"
-            android:background="?attr/primary_text_color"/>
+            android:background="?attr/chart_shade1"/>
 
         <View
+            android:id="@+id/view_disk_usage_bar_used_separator"
             android:layout_width="0.5dp"
             android:layout_height="match_parent"
-            android:background="@color/base100"/>
+            android:background="@color/base70"/>
 
         <View
             android:id="@+id/view_disk_usage_bar_other"
             android:layout_width="0dp"
             android:layout_height="match_parent"
             android:layout_weight="2"
-            android:background="?attr/other_apps_space_used_color"/>
+            android:background="?attr/chart_shade4"/>
 
         <View
+            android:id="@+id/view_disk_usage_bar_other_separator"
             android:layout_width="0.5dp"
             android:layout_height="match_parent"
-            android:background="@color/base100"/>
+            android:background="@color/base70"/>
 
         <View
             android:id="@+id/view_disk_usage_bar_free"
             android:layout_width="0dp"
             android:layout_height="match_parent"
             android:layout_weight="3"
-            android:background="?attr/paper_color"/>
+            android:background="?attr/chart_shade7"/>
 
     </LinearLayout>
 
@@ -82,16 +83,25 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
-        <android.support.v7.widget.AppCompatImageView
-            android:id="@+id/view_disk_usage_dot_used"
+        <FrameLayout
             android:layout_width="8dp"
             android:layout_height="8dp"
-            android:layout_gravity="center_vertical"
-            android:background="@drawable/shape_circle"
-            android:src="@drawable/shape_circle_outline"
-            android:contentDescription="@null"
-            app:tint="?attr/primary_text_color"
-            app:tintMode="src_in"/>
+            android:layout_gravity="center_vertical">
+            <android.support.v7.widget.AppCompatImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:src="@drawable/shape_circle"
+                android:contentDescription="@null"
+                app:tint="?attr/chart_shade1"
+                app:tintMode="src_in"/>
+            <android.support.v7.widget.AppCompatImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:src="@drawable/shape_circle_outline"
+                android:contentDescription="@null"
+                app:tint="?attr/chart_shade5"
+                app:tintMode="src_in"/>
+        </FrameLayout>
 
         <TextView
             android:id="@+id/view_disk_usage_text_app"
@@ -101,7 +111,7 @@
             android:layout_marginRight="8dp"
             android:textColor="?attr/primary_text_color"
             android:textSize="12sp"
-            tools:text="Wikipedia"/>
+            android:text="@string/offline_library_title"/>
 
     </LinearLayout>
 
@@ -109,16 +119,25 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
-        <android.support.v7.widget.AppCompatImageView
-            android:id="@+id/view_disk_usage_dot_other"
+        <FrameLayout
             android:layout_width="8dp"
             android:layout_height="8dp"
-            android:layout_gravity="center_vertical"
-            android:background="@drawable/shape_circle"
-            android:src="@drawable/shape_circle_outline"
-            android:contentDescription="@null"
-            app:tint="?attr/other_apps_space_used_color"
-            app:tintMode="src_in"/>
+            android:layout_gravity="center_vertical">
+            <android.support.v7.widget.AppCompatImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:src="@drawable/shape_circle"
+                android:contentDescription="@null"
+                app:tint="?attr/chart_shade4"
+                app:tintMode="src_in"/>
+            <android.support.v7.widget.AppCompatImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:src="@drawable/shape_circle_outline"
+                android:contentDescription="@null"
+                app:tint="?attr/chart_shade5"
+                app:tintMode="src_in"/>
+        </FrameLayout>
 
         <TextView
             android:layout_width="wrap_content"
@@ -135,16 +154,25 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
-        <android.support.v7.widget.AppCompatImageView
-            android:id="@+id/view_disk_usage_dot_free"
+        <FrameLayout
             android:layout_width="8dp"
             android:layout_height="8dp"
-            android:layout_gravity="center_vertical"
-            android:background="@drawable/shape_circle"
-            android:src="@drawable/shape_circle_outline"
-            android:contentDescription="@null"
-            app:tint="?attr/paper_color"
-            app:tintMode="src_in"/>
+            android:layout_gravity="center_vertical">
+            <android.support.v7.widget.AppCompatImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:src="@drawable/shape_circle"
+                android:contentDescription="@null"
+                app:tint="?attr/chart_shade7"
+                app:tintMode="src_in"/>
+            <android.support.v7.widget.AppCompatImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:src="@drawable/shape_circle_outline"
+                android:contentDescription="@null"
+                app:tint="?attr/chart_shade5"
+                app:tintMode="src_in"/>
+        </FrameLayout>
 
         <TextView
             android:id="@+id/view_disk_usage_text_free"
diff --git a/app/src/main/res/values-qq/strings.xml 
b/app/src/main/res/values-qq/strings.xml
index ae9d9b1..e7e6049 100644
--- a/app/src/main/res/values-qq/strings.xml
+++ b/app/src/main/res/values-qq/strings.xml
@@ -443,7 +443,7 @@
   <string name="remote_compilation_download">Menu label for downloading a 
selected article pack.</string>
   <string name="storage_size">Label that says how much space on the device is 
used by the Wikipedia app. The %.2f symbol is replaced with the number in 
gigabytes.</string>
   <string name="storage_size_free">Label that says how much free space is 
available on the device. The %.2f symbol is replaced with the number in 
gigabytes.</string>
-  <string name="storage_used_by_compilations">Label that appears next to the 
number of gigabytes used by the Wikipedia app.</string>
+  <string name="storage_used_by_compilations">Label that appears next to the 
number of gigabytes used by all the downloaded packs in the user\'s Offline 
Library.</string>
   <string name="storage_other_apps">Legend label for the amount of space used 
by other applications on the device.</string>
   <string name="offline_compilation_download_progress_text">Information about 
an offline article pack download in progress. The %1$.2f symbol represents the 
number of GB downloaded and the %2$.2f symbol represents the total size of the 
file.</string>
   <plurals name="offline_compilation_download_time_remaining">
diff --git a/app/src/main/res/values/attrs.xml 
b/app/src/main/res/values/attrs.xml
index c668e7f..2ae422b 100644
--- a/app/src/main/res/values/attrs.xml
+++ b/app/src/main/res/values/attrs.xml
@@ -27,7 +27,11 @@
     <attr name="secondary_text_color" format="color" />
     <attr name="section_title_color" format="color" />
     <attr name="paper_color" format="color" />
-    <attr name="other_apps_space_used_color" format="color" />
+
+    <attr name="chart_shade1" format="color" />
+    <attr name="chart_shade4" format="color" />
+    <attr name="chart_shade5" format="color" />
+    <attr name="chart_shade7" format="color" />
 
     <declare-styleable name="CabSearchView">
         <attr name="cabEnabled" format="boolean" />
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 4201e8b..1d136db 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -496,7 +496,7 @@
     <string name="remote_compilation_download">Download</string>
     <string name="storage_size">%.2f GB</string>
     <string name="storage_size_free">%.2f GB free</string>
-    <string name="storage_used_by_compilations">used by Wikipedia</string>
+    <string name="storage_used_by_compilations">used by Offline 
Library</string>
     <string name="storage_other_apps">Other applications</string>
     <string name="offline_compilation_download_progress_text">%1$.2f GB / 
%2$.2f GB</string>
     <plurals name="offline_compilation_download_time_remaining">
diff --git a/app/src/main/res/values/styles_dark.xml 
b/app/src/main/res/values/styles_dark.xml
index 8fb617c..15a7c9e 100644
--- a/app/src/main/res/values/styles_dark.xml
+++ b/app/src/main/res/values/styles_dark.xml
@@ -58,7 +58,11 @@
         <item name="primary_text_color">@color/base90</item>
         <item name="secondary_text_color">@color/base70</item>
         <item name="section_title_color">@color/base90</item>
-        <item name="other_apps_space_used_color">@color/base30</item>
+
+        <item name="chart_shade1">@color/base100</item>
+        <item name="chart_shade4">@color/base50</item>
+        <item name="chart_shade5">@color/base30</item>
+        <item name="chart_shade7">@color/base10</item>
 
         <!-- Background for cards, lists, and controls -->
         <item name="paper_color">@color/base14</item>
diff --git a/app/src/main/res/values/styles_light.xml 
b/app/src/main/res/values/styles_light.xml
index 00b3080..2f305a7 100644
--- a/app/src/main/res/values/styles_light.xml
+++ b/app/src/main/res/values/styles_light.xml
@@ -58,7 +58,11 @@
         <item name="primary_text_color">@color/base10</item>
         <item name="secondary_text_color">@color/base30</item>
         <item name="section_title_color">@color/base20</item>
-        <item name="other_apps_space_used_color">@color/base30</item>
+
+        <item name="chart_shade1">@color/base10</item>
+        <item name="chart_shade4">@color/base50</item>
+        <item name="chart_shade5">@color/base70</item>
+        <item name="chart_shade7">@color/base100</item>
 
         <!-- Background for cards, lists, and controls -->
         <item name="paper_color">@color/base100</item>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c3c5efa17f30128a82e94411a376b465b0dcadc
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to