Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/318087

Change subject: Update and improve widget designs.
......................................................................

Update and improve widget designs.

- There's no reason for the Search widget to take up 4x1 amount of space
  on the screen, so I made it 1x1 by default, but also made it resizable.
- The Featured Article widget still takes up 4x1 space, but is now
  resizable to take up less space, with the text becoming ellipsized if
  necessary.
- Both widgets now use the package icon.

Bug: T100047
Bug: T128356
Change-Id: I904c5d05cb734652ba97814a489f50c16bb04389
---
M app/src/main/res/drawable/widget_shape_inner.xml
M app/src/main/res/layout/widget_featured_page.xml
M app/src/main/res/layout/widget_search.xml
M app/src/main/res/values/colors.xml
M app/src/main/res/xml/widget_featured_page.xml
M app/src/main/res/xml/widget_search.xml
6 files changed, 39 insertions(+), 46 deletions(-)


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

diff --git a/app/src/main/res/drawable/widget_shape_inner.xml 
b/app/src/main/res/drawable/widget_shape_inner.xml
index b217d20..c16394e 100644
--- a/app/src/main/res/drawable/widget_shape_inner.xml
+++ b/app/src/main/res/drawable/widget_shape_inner.xml
@@ -2,5 +2,5 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android";
     android:shape="rectangle">
     <solid android:color="@color/widget_background"/>
-    <corners android:topRightRadius="@dimen/corner_radius" 
android:bottomRightRadius="@dimen/corner_radius"/>
+    <corners android:radius="@dimen/corner_radius"/>
 </shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/widget_featured_page.xml 
b/app/src/main/res/layout/widget_featured_page.xml
index 6dccca5..e640058 100644
--- a/app/src/main/res/layout/widget_featured_page.xml
+++ b/app/src/main/res/layout/widget_featured_page.xml
@@ -4,22 +4,20 @@
     xmlns:tools="http://schemas.android.com/tools";
     android:id="@+id/widget_container"
     android:layout_width="match_parent"
-    android:layout_height="72dp"
+    android:layout_height="wrap_content"
     android:background="@drawable/widget_shape_background">
     <ImageView
         android:layout_width="48dp"
         android:layout_height="48dp"
-        android:layout_marginLeft="12dp"
-        android:layout_marginRight="12dp"
-        android:layout_marginTop="2dp"
-        android:src="@drawable/w_nav_mark"
+        android:layout_marginLeft="4dp"
+        android:layout_marginRight="4dp"
+        android:src="@mipmap/launcher"
         android:contentDescription="@null"
         android:layout_gravity="center_vertical"/>
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:paddingLeft="16dp"
-        android:paddingRight="16dp"
+        android:layout_height="wrap_content"
+        android:padding="8dp"
         android:gravity="center_vertical"
         android:background="@drawable/widget_shape_inner"
         android:orientation="vertical">
@@ -29,8 +27,9 @@
             style="@style/RtlAwareTextView"
             android:layout_marginBottom="2dp"
             android:text="@string/widget_title_featured_page"
+            android:maxLines="1"
             android:ellipsize="end"
-            android:textColor="@color/widget_title_text"
+            android:textColor="@color/dark_gray"
             />
         <TextView
             android:id="@+id/widget_content_text"
@@ -38,7 +37,7 @@
             android:layout_height="wrap_content"
             style="@style/RtlAwareTextView"
             android:textAppearance="?android:attr/textAppearanceMedium"
-            android:textColor="@color/widget_content_text"
+            android:textColor="@color/darkest_gray"
             android:maxLines="2"
             android:ellipsize="end"
             tools:text="Sample content"
diff --git a/app/src/main/res/layout/widget_search.xml 
b/app/src/main/res/layout/widget_search.xml
index 414456e..c0352c4 100644
--- a/app/src/main/res/layout/widget_search.xml
+++ b/app/src/main/res/layout/widget_search.xml
@@ -1,35 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android";
     android:id="@+id/widget_container"
     android:layout_width="match_parent"
-    android:layout_height="50dp"
-    android:background="@drawable/widget_shape_background">
+    android:layout_height="wrap_content"
+    android:padding="4dp"
+    android:orientation="vertical"
+    android:gravity="center"
+    android:background="@drawable/widget_shape_inner">
+
     <ImageView
         android:layout_width="32dp"
         android:layout_height="32dp"
-        android:layout_marginTop="2dp"
-        android:layout_marginLeft="12dp"
-        android:layout_marginRight="12dp"
-        android:src="@drawable/w_nav_mark"
-        android:contentDescription="@null"
-        android:layout_gravity="center_vertical"/>
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:paddingLeft="16dp"
-        android:paddingRight="16dp"
-        android:background="@drawable/widget_shape_inner">
-        <TextView
-            android:id="@+id/widget_content_text"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical"
-            android:layout_marginTop="1dp"
-            android:text="@string/search_hint"
-            android:textSize="20sp"
-            android:textColor="@color/widget_title_text"
-            android:ellipsize="end"
-            />
-    </LinearLayout>
+        android:layout_marginBottom="2dp"
+        android:src="@mipmap/launcher"
+        android:contentDescription="@null" />
+
+    <TextView
+        android:id="@+id/widget_content_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/search_hint"
+        android:textColor="@color/darkest_gray"
+        android:gravity="center"
+        android:ellipsize="end" />
+
 </LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 7072a2b..cb5b158 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -95,9 +95,7 @@
     <color name="syntax_highlight_template_light">#a0a0a0</color>
     <color name="syntax_highlight_template_dark">#505050</color>
 
-    <color name="widget_background">#80ffffff</color>
-    <color name="widget_title_text">#606060</color>
-    <color name="widget_content_text">#303030</color>
+    <color name="widget_background">#a0ffffff</color>
 
     <color name="feed_text_primary_light">#222</color>
     <color name="feed_text_primary_dark">#ddd</color>
diff --git a/app/src/main/res/xml/widget_featured_page.xml 
b/app/src/main/res/xml/widget_featured_page.xml
index 0fedb43..939271f 100644
--- a/app/src/main/res/xml/widget_featured_page.xml
+++ b/app/src/main/res/xml/widget_featured_page.xml
@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <appwidget-provider
     xmlns:android="http://schemas.android.com/apk/res/android";
-    android:minWidth="280dp"
-    android:updatePeriodMillis="43200000"
+    android:minWidth="260dp"
     android:minHeight="64dp"
+    android:minResizeWidth="100dp"
+    android:resizeMode="horizontal|vertical"
+    android:updatePeriodMillis="43200000"
     android:initialLayout="@layout/widget_featured_page">
 </appwidget-provider>
\ No newline at end of file
diff --git a/app/src/main/res/xml/widget_search.xml 
b/app/src/main/res/xml/widget_search.xml
index 720fb2d..b00ce4e 100644
--- a/app/src/main/res/xml/widget_search.xml
+++ b/app/src/main/res/xml/widget_search.xml
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <appwidget-provider
     xmlns:android="http://schemas.android.com/apk/res/android";
-    android:minWidth="280dp"
-    android:minHeight="32dp"
+    android:minWidth="64dp"
+    android:minHeight="64dp"
+    android:resizeMode="horizontal|vertical"
     android:initialLayout="@layout/widget_search">
 </appwidget-provider>
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I904c5d05cb734652ba97814a489f50c16bb04389
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