Commit Graph

21 Commits

Author SHA1 Message Date
Shamali P
927dd27ece Update the widget previews to use the container sizes
Additionally, adjusts the margins on sides, to make space for displaying
multiple previews side by side.

As a result of this change, previews aren't cropped anymore (indirectly
also fixing b/317366201).

There is one more follow up pending - to limit the height of
recommendations in two pane sheet to only visible area to keep the
suggestions quick to look and concise. It will also help with better
scroll experience when size is same across pages.

* http://screencast/cast/NTQ0Njc4ODgyNjc5MTkzNnxjYzZiYTU2Ny02Yw
* http://screencast/cast/NTk4ODMyMDkxOTE1ODc4NHw3NzdlNTgxZS1kMw
* http://screencast/cast/NTYxOTc5NjIxNjM4MTQ0MHxiMjQ2Njc3OC0zOQ
* http://screencast/cast/NDk4MjIxNjI0MDEzNjE5MnxjY2IwYmIxNi00Mw

Bug: 319152349
Flag: N/A
Test: Image test and table utils test
Change-Id: I07465bd4d84597b560a2b998ff1ccbf9867c0192
2024-03-12 23:47:07 +00:00
Federico Baron
c8aeb682cc Revert "Fix padding/margin for widgets in widgetpicker"
This reverts commit 3cc8de1268.

Reason for revert: when adding this extra margin to widget_cell it has the unintended effect of making text width available for the widgets shorter than it originally was (E.g Dynamic Colors becomes Dynamic Co...). Adding padding to widgets_table_container.xml instead seems to be a better solution to this issue.

Change-Id: I90b850a43aca573a26131a96d5d8f5fbde8b5f6e
2023-06-20 18:57:17 +00:00
fbaron
3cc8de1268 Fix padding/margin for widgets in widgetpicker
Fix: 287079143
Test: Verify that the there's enough margin in between widgets and their container in widget picker
Change-Id: I6c8cbf075541d6db734fbbc5c0e2386b41c7edac
2023-06-14 11:27:48 -07:00
Steven Ng
ae6b34811b WidgetCell & LiveWidgetPreview cleanup
The fixes are:
1. For widgets shown in TableRow, aligns them center vertically.
   This is useful when widgets of different height are shown in
   the same row.
2. Remove background color from WidgetCell
3. Re-enable swipe in FullWidgetsSheet
4. Use the WidgetCell image as the single & long press area because
   1. Previews are now scaled to their default size. The touch area
      should already be larger for widgets that are bigger than 2.4
      cells
   2. WidgetCells also render description. If the user long press the
      description area, the drag view will not align in the middle of
      the user touch / drag area.

Test: Drag-n-drop widgets from FullWidgetsSheet, BottomWidgetsSheet
      and pin widget flow.
      In FullWidgetsSheet, swipe left and right to switch work /
      personal tab.

Video: https://drive.google.com/file/d/1Ur7PwF1a7iwGGRTZczfc0BSVu-Ta6-Vm/view?usp=sharing

Bug: 179797520
Change-Id: I6fe4bc88d1e1b35b1819d8d7f046105f5ed27043
2021-03-08 21:22:08 +00:00
Steven Ng
11773f47d2 Show widget previews in their expected cell sizes
1. Show widget previews in their expected cell sizes.
2. Update the bottom picker to use a table layout rather than
a horizontal scrollbar.
3. Move the title and cell size description to the bottom of
the preview.

Test: Run AddConfigWidgetTest
      Manually open full and bottom widgets picker and observe
      widget previews.
      Video: https://drive.google.com/file/d/1K8A8hK5B4FgPTsX3cb-Yt4a_VjI0pk-w/view?usp=sharing
Bug: 179797520
Change-Id: I938612cb2e2477ce4a3a2d6c8891a0a36fc0978c
2021-02-26 17:47:32 +00:00
Sunny Goyal
c65a0085d7 Adding support for showing the widget preview based on the provided RemoteViews
Bug: 35811129
Change-Id: I336e48cd00cfec2e617ac73bd8a81419b0944aa7
2017-03-17 11:25:29 -07:00
Sunny Goyal
d5d5e22715 Updating widget tray theme
Using standard theme attributes rather than custom color codes, so
that it plays nice with system theme changes.

Bug: 34819119
Bug: 34897402
Bug: 21446746
Change-Id: I265fba3ceae8873650fd09e4704838d313155e83
2017-02-09 10:16:22 -08:00
Sunny Goyal
a2441e88ff Updating widget preview generation to not embed any badge.
Instead drawing badge in the view directly.

This will allow us to reuse the same preview when we do not want to draw
badges. This also simplified badging of shortcut config activities.

Change-Id: I9c07c33bf9c2b8ef81a00026b1d42587868c906f
2017-01-19 14:00:40 -08:00
Andrew Sapperstein
abef55a1c1 Update Launcher to use theme colors.
Instead of using hard-coded variants of colors, use the theme color
that corresponds (colorAccent, colorPrimary, etc).

Updated:
- "Search for more apps" text
- App info drop target hover color
- PageIndicatorDots
- All apps & widget scroll bar & scroll popup colors
- All apps section text color
- widget picker background color

TODO:
- widget picker header color

BUG: 28625102
Change-Id: I74b543ff71b8caef8cd950c8183ac84c759cb4d5
2016-06-20 11:46:44 -07:00
Sunny Goyal
f52abd7758 Widget cell improvement
> Using a custom view for preview, instead of extensing image view
> Preventing relayout when applying preview
> Removing unnecessary method calls

Bug: 21133230
Change-Id: Iab12fa1e5c871ee43a9fb0e6b6af897fecfb345f
2015-05-19 11:51:23 -07:00
Hyunyoung Song
b2751ba524 Changing the text sizes in the widget tray based on feedback from UX
Change-Id: Ide984049a326a6629269e90be3468a53a9dc60e3
2015-05-14 18:02:15 -07:00
Hyunyoung Song
5cd1d92f6c Fixing several layout issues.
- N7/N9 indented area should not block scroll view
- separator at the end of the widget cell should not show up on the last item.

Not covered in this CL:
- Guarantee that last item is showing only 20~40%. Right now, the
hand picked constant works for N5,6,7,9

b/20338324
b/20763871

Change-Id: I274ab95c6c3e2fc8be8ceafb2e8172c0174a41a5
2015-05-12 15:40:09 -07:00
Hyunyoung Song
4b69f2ca91 Ensure that clipping widget size is 20~40% of its width on every devices
b/20338324
b/20763871

Change-Id: I69114cb6dfec95c473313a440a6db76a052e5601
2015-05-11 14:55:07 -07:00
Hyunyoung Song
ffae07e447 WidgetTray UI - change text color for the section and widget name
Change-Id: I8ce966d151bc62a9eb23ca3fa8c13c3aeb0c7f37
2015-05-01 10:55:53 -07:00
Hyunyoung Song
f17a1c9ad9 Widget tray alignment according to UX spec
- Fixing an issue where widget preview is not loaded do to faulty
canceling of loading async task when view is detached from the window.

b/20338334

Change-Id: I1e3bd6b6cdafda8d1e0a7a0e87c8089100c341a7
2015-04-27 17:01:32 -07:00
Hyunyoung Song
b99ff3e832 Add drop animation / Toast to widgettray
- show instruction toast on clicking the widget
- Add animation when widget drops on the workspace.
Added WidgetHostViewLoader to handle short press and assign widget
host view to enable animation

b/19897708

Change-Id: Iec36d72cb21bf09343d0beeb31a09bf8b0cb5e0d
2015-04-23 15:17:50 -07:00
Hyunyoung Song
475784a4eb Widgettray UI tweak that introduces bounding box around the widgets.
Note: waiting on more polished UX spec right now.
But until then, these padding and dimensions are what is used to get the
bounding box around the widgets.

Change-Id: I7a6a5fa04bbdb135b39291cb671b9a719fcdc4fc
2015-04-22 13:59:20 -07:00
Hyunyoung Song
4cea4c8302 WidgetTray UI tweak
- set fixed image view width
- fade in when widget bitmap populates
- widget dimension is next to the widget name text.
- elevation of the widgets content and the reveal view is the same

b/19897708

Change-Id: Ia656144412e7d63a491ce67ff15fb58c05d9a9d9
2015-04-19 19:25:49 -07:00
Hyunyoung Song
4e8fb91cf1 WidgetTray improvement
UI
- Fixing the issue of widget row not rendering
- Moved the resetting of previous bitmap to the start of onBind
instead of the onDetachedWindow.

Performance
- WidgetModel do not have to keep packageName list around.

Will com in immediate follow up CLs
- use lowRes widgets bitmap before fully loading the fullRes one.
- application icons are fully loaded in background thread.

b/19897708

Change-Id: I5b3b43a5c543a5135c395f90df32e66d57dc86e0
2015-04-13 15:58:30 -07:00
Hyunyoung Song
a23dab9c64 WidgetTray UI improvement
- Long application title should be ellipsized
- Disable the drawable when the view is no longer attached to the window
- Save the PackageItemInfo to the WidgetModel once full res icon bitmap is loaded

b/19897708

Change-Id: I96f260f9d165b206905a127fcee9879556c3d0c4
2015-04-09 16:54:31 -07:00
Hyunyoung Song
3f471440a8 WidgetTray revamp work
- RecyclerView is rendering
- Animation is connected
- Drag and drop is now handled
- UI tweaking: background, margins, more to come.
- Flicker and preview not loading issue:
  fixed height for the horizontal scroll view.
- Shortcuts are added
- Widget Preview loading should support shortPress for drop
- UI tweaks left: overlay of arrow when there are more items to scroll
- icons are added in the section header
- Sorting of widget sections and widget horizontal list
- Adding all the padding constants to dimen.xml file
- RecyclerView should only support one view type

For items to be addressed in follow up patches OR CLs,
TODO is added to the comment.

b/19897708

Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc
2015-04-08 19:01:34 -07:00