Page MenuHomePhabricator

Improve existing widgets with current functionality
Closed, ResolvedPublic

Assigned To
Authored By
JTannerWMF
Jan 10 2024, 5:38 PM
Referenced Files
F42950811: Screenshot_20240321-100630.png
Mar 21 2024, 2:22 PM
F42950804: Screenshot_20240321-100607.png
Mar 21 2024, 2:22 PM
F42949776: image.png
Mar 21 2024, 1:59 PM
F41734315: Group 8.png
Jan 31 2024, 10:23 AM
Restricted File
Jan 29 2024, 4:23 PM
Restricted File
Jan 29 2024, 4:23 PM
F41727885: w-alignment-1.png
Jan 29 2024, 10:34 AM
F41727839: Screenshot_20240129-102018 copy 3.png
Jan 29 2024, 10:34 AM

Description

Background and Requirements

Our current widgets are broken. We need new designs that take into consideration the guidelines for Material Design. There will be a separate task for adding new functionality; this task is focused on making our existing widget look better and work as it should. The design should take users with dark mode into consideration.

Widgets to Create
  • Search
  • Featured article
Designs (Figma)

Widget installation

1. Long press
image.png (1×720 px, 168 KB)
2. Search
image.png (1×720 px, 122 KB)
3. Featured article
image.png (1×720 px, 148 KB)
  1. A long press of the app icon reveals the Widgets option. Dragging and dropping the widget will let users place it on one of their app screens.
  2. Wikipedia search is the first widget
  3. It is followed by the featured article widget when scrolling down

Search widget

4. 5x1
image.png (1×720 px, 206 KB)
5. 4x1
image.png (1×720 px, 211 KB)
6. 3x1
image.png (1×720 px, 220 KB)
8. 2x1
image.png (1×720 px, 224 KB)
  1. By default, the search widget takes up an entire app icon row (5 columns).
    • The entire widget is 1 tap target. Tapping the widget anywhere leads to the search in the app with an active keyboard.
  2. The widget can be resized to use 4 columns. Depending on the device's width, the search bar (white area) fills the widget space.
  3. The widget can be resized to use 3 columns
  4. The minimum width of the widget is 2 columns. If 2 columns are used, the magnifying glass is positioned at the right of the widget (margin-right: 16dp)

Featured article widget

9.
image.png (1×720 px, 230 KB)
10.
image.png (1×720 px, 234 KB)
11.
image.png (1×720 px, 241 KB)
12.
image.png (1×720 px, 241 KB)
13.
image.png (1×720 px, 243 KB)
  1. The featured article widget also takes up 5 columns.
    • The entire widget is one tap target, leading directly to the featured article.
    • If there is no article description, the first paragraph of the article is used instead.
    • If there is no article image, the text fills the entire width of the widget.
  2. Resizing: Both the article title and title description are truncated after 1 line with an ellipsis (...). The example shows how the widget behaves resized at 4 columns.
  3. It uses the same behavior described in 10 when the widget uses 3 columns.
  4. The image illustrates how the widget is displayed without an article image.

Vision (rough)

14. List view
image.png (1×720 px, 287 KB)
15. Spotlight
image.png (1×720 px, 460 KB)
  1. The long-term vision for these widgets is to be more interactive.
    • This example features a list view, that could e.g. feature explore feed contents from "Because you read" or "Trending".
    • It also features direct access to "Voice search" and "Places".
  2. The spotlight view could feature content from "On this day" or "Featured article". The designs for the second widget phase are in progress. If any groundwork can be laid now while working on the basic widgets from this task, that’d be great, but it is not necessary.
Task dependency

T353471

Event Timeline

JTannerWMF created this task.
JTannerWMF updated the task description. (Show Details)
scblr updated the task description. (Show Details)

We got one report through the support email.

pro-L2NqQZTW.jpeg (2×1 px, 1 MB)

Thanks @Dbrant – top work so far! 🎯

1) Increase the size of the W to 32dp * 32dp for both widgets.

Screenshot_20240129-101445 copy.png (2×1 px, 610 KB)

2)

Design (top) vs Implementation (bottom)
aligmnent widgets.png (2×720 px, 668 KB)

Apply all design specs from Figma

  • Make sure that the search circle and the featured are always right-aligned
  • The featured article widget has a 12dp right margin, and the search has a 16dp right margin

3) Search circle measures 40dp * 40dp. Also, the search field is 40dp high:

Screenshot_20240129-101854.png (2×1 px, 673 KB)
 
Screenshot_20240129-102018 copy 3.png (2×1 px, 673 KB)

4) Make sure the W in both 2-column variants is left aligned and consistent with the 3-column (and more) variants. Use the left margin of the 3+ column-variants (16dp) as a reference to improve the 2-column variants.

w-alignment-1.png (2×720 px, 798 KB)

5) Add widget preview copy from designs:

{F41728793}{F41728795}

Search: The fastest way to search Wikipedia

Featured article: The best articles Wikipedia has to offer

@scblr
https://github.com/wikimedia/apps-android-wikipedia/actions/runs/7712400814

👍 👍 👍

  • Added preview descriptions to widgets.
  • Alignment should be improved when changing between 2-column and 3-column variants.
  • The Search widget will now request a 5-column default size, same as the Featured Page widget.
  • The W logo is definitely 32dp (and the Search field is 40dp) as designed, but may have some variation on different screens.

Thanks @Dbrant! Yeah as you pointed out – everything looks smaller than designed on my device, which is a bit of a bummer.

Design vs Implementation 👇

Group 8.png (1×1 px, 560 KB)

But yeah, I guess then we can’t do much about that! Great work! 👏

@ABorbaWMF – please check the designs on multiple devices and in dark/light mode environments. Thanks!

Widget installation

2. Search
image.png (1×720 px, 122 KB)
3. Featured article
image.png (1×720 px, 148 KB)

I’ve just translated the new descriptions, but am I right that the texts visible in the screenshots (“Search Wikipedia” and “Williamsburg bridge / Suspension bridge”) are currently not translatable? They probably should be. (The old widgets displayed just the W letter, which is more or less language-agnostic.)

I’ve just translated the new descriptions, but am I right that the texts visible in the screenshots (“Search Wikipedia” and “Williamsburg bridge / Suspension bridge”) are currently not translatable? They probably should be. (The old widgets displayed just the W letter, which is more or less language-agnostic.)

Thanks! Unfortunately the Android system requires those previews to be static images (!), at least on Android <12, so there's no practical way to localize them.
As we iterate on our upcoming further work on widgets (T355142) we will incorporate more/better ways of localizing the previews.

Thanks! Unfortunately the Android system requires those previews to be static images (!),

What does “static images” mean? Can they be generated on build? Can they maybe even be SVGs? Not being able to use values.xml is unfortunate and inconvenient, but doesn’t necessarily have to prevent i18n. (However, if a better solution is in sight, it’s okay if you don’t spend hours finding out how to localize the current one.)

What does “static images” mean? Can they be generated on build? Can they maybe even be SVGs? Not being able to use values.xml is unfortunate and inconvenient, but doesn’t necessarily have to prevent i18n. (However, if a better solution is in sight, it’s okay if you don’t spend hours finding out how to localize the current one.)

Android 12 and greater supports fully localizable widget previews (using the same Views as the widget itself), so we will likely focus on that, and leave the static images for legacy devices.

I'm a total stranger to your way of working for application development. It also seems that the teams are quite different for Android and IOS. However, I wanted to bring up a use case from a user (@Baidax). I happened to read their comments about how a 1x1 widget (image) broke with the improved versions of the widgets. Is it possible to support the 1x1 use case?

image.png (398×348 px, 38 KB)

I'm a total stranger to your way of working for application development. It also seems that the teams are quite different for Android and IOS. However, I wanted to bring up a use case from a user (@Baidax). I happened to read their comments about how a 1x1 widget (image) broke with the improved versions of the widgets. Is it possible to support the 1x1 use case?

Thanks for the note!
The widgets are not really intended for a 1x1 use case. For this kind of case, it's better to use an App Shortcut. These shortcuts are accessible by long-pressing the app icon and seeing a list of selectable shortcuts. Then you can long-press one of the shortcuts (such as Search), and drop it as a separate icon on your home screen:

Screenshot_20240321-100607.png (2×1 px, 129 KB)
Screenshot_20240321-100630.png (2×1 px, 105 KB)

The widgets are not really intended for a 1x1 use case. For this kind of case, it's better to use an App Shortcut.

App shortcuts are supported in Android 7.1+. The app currently supports Android 5.0+ (API level 21+). What about users using Lollipop, Marshmallow or Nougat 7.0?

These shortcuts are accessible by long-pressing the app icon and seeing a list of selectable shortcuts. Then you can long-press one of the shortcuts (such as Search), and drop it as a separate icon on your home screen:

I’ve never thought of long-pressing and dragging those options; Google apparently doesn’t do a great job making it discoverable. 🙁

What does “static images” mean? Can they be generated on build? Can they maybe even be SVGs? Not being able to use values.xml is unfortunate and inconvenient, but doesn’t necessarily have to prevent i18n. (However, if a better solution is in sight, it’s okay if you don’t spend hours finding out how to localize the current one.)

Android 12 and greater supports fully localizable widget previews (using the same Views as the widget itself), so we will likely focus on that, and leave the static images for legacy devices.

Is it impossible to localize the previews on Android 5–11? Android 12 isn’t all that old (released in 2021), many people (especially in the Global South) may have older phones.