Commit Graph

111 Commits

Author SHA1 Message Date
Sunny Goyal
5d9fb0e92f Simplifying fast scroller logic
> Using a separate view for drawing the popup. This allows us to use elevation
  property instead of drawing the shadow as bitmap.
> During the thumb animation, invalidating the full track width, instead of
  invalidating the track and thumb separately.
> The thumb path is calculated at 0,0 and drawn using canvas.translate().
   This avoids recalculating the path on every scroll.

Change-Id: I48741e5b4432df0d939016db284d7aaf52cc2aa6
2016-10-10 14:17:16 -07:00
Sunny Goyal
740ac7f00e Refactoring floating view opening/closing logic
> Creating a base view for floating panels with some common methods
> Moving the getOpen method to individual classes
> Moving the folder icon animation logic to folder icon
> Moving all the logic related for opening folder to Folder class

Change-Id: I898dfb6870b857cb921d2729b89618bc43ff2e88
2016-10-10 13:36:03 -07:00
Hyunyoung Song
df7ef68bbf Refactors in UserEventDispatcher
- LaunchSource -> LogContainer

Change-Id: I71bfee992fb1ba7ae80e824d419f7bf8d3020999
2016-10-06 17:52:22 -07:00
Tony Wickham
10236d6ac7 Update pre-drag lifecycle for apps with shortcuts.
- First of all, deferred drag has been renamed to pre-drag
  to avoid confusion with the existing deferred end drag.
- For normal drags, the cycle is still startDrag -->
  onDragStart --> onDrop --> onDropComplete --> onDragEnd.
- Pre-drags have two additional callbacks: onPreDragStart
  and onPreDragEnd. onPreDragStart is called between
  startDrag and onDragStart, and onPreDragEnd is called
  at the same time as onDragStart or onDragEnd.
- If the pre-drag has not transitioned to a full drag before
  onDragEnd, onDragStart and onDropComplete are skipped
  (onDrop is still called to allow the DragView to animate).

Change-Id: Icd7a8f75d5fcc159f9a52758c22ab6eae3edb9e2
2016-10-04 12:26:35 -07:00
Jon Miranda
aca2145f2a Restore AllAppsContainerView UI to match spec.
Did some refactoring with Sunny's help.

Change-Id: Ie4c90c316f1e381829836e11c83eaaedfed4d621
2016-09-26 16:45:10 -07:00
Tony
5eea1e89dd resolve merge conflicts of 6e74e89 to ub-launcher3-master
Change-Id: I34e449ca3a91ee06e1983ac3a83cb7ca53567a91
2016-09-23 19:43:35 -07:00
Tony Wickham
6e74e899d3 Refactor shortcuts drag and drop.
- Instead of creating our own drag view within the container, and
  handling logic to determine when to start a real drag, we start
  the drag immediately and just defer onDragStart().
- To determine when the deferred drag should start, we add a
  DeferDragCondition to DragOptions. The default DeferDragCondition
  never defers a drag, but is overridden for apps with shortcuts
  to defer until the icon is dragged a given distance.
- Because the drag is handled in DragController, including checking
  when to start the deferred drag, DeepShortcutsContainer no longer
  needs to handle touch events and ShortcutsContainerListener has
  been removed.

This change has several immediate benefits:
- The code is much cleaner, because it allows touch handling to be
  done by the DragController through the normal drag flow, without
  recreating logic in ShortcutsContainerListener/DeepShortcutContainer.
- The janky second haptic feedback has been removed (now it vibrates
  when you long press, like everywhere else, but not again when the
  shortcuts close after dragging a distance).
- Drops are animated, instead of just popping the icon back into place.

Bug: 30769920
Bug: 30465972
Bug: 31533078
Change-Id: I679b412b72fbf6c3895d76963311eb5010c8e8db
2016-09-23 18:44:47 -07:00
Jon Miranda
3298d0ff9b Move handling touch logic from AllAppsContainerView to BaseContainerView.
Now both AllAppsContainerView and WidgetsContainerView will be
dismissed when the background is clicked.

Bug: 27130340
Change-Id: Ie8446e4b8908742ddc8a227fe71ea56ec11c2457
2016-09-22 18:39:29 -07:00
Jon Miranda
177ad2bf89 Move TransformingTouchDelegate logic to BaseContainerView.
In ag/1460444 we used TransformingTouchDelegate to extend the
touch target for the widgets list. Now both WidgetsContainerView
and AllAppsContainerView will use the same TransformingTouchDelegate logic
to extend the touch target for their respective lists.

This is part of a larger refactor where in a follow up CL, we will
handle the logic for dismissing WCV and AACV when touching outside
of its content in BaseContainerView. (currently broken in WCV).

Change-Id: I7fddb456bba34a6533f8824da0481d308a8b715e
2016-09-22 10:39:29 -07:00
Tony Wickham
c145b55afa Don't close all apps when touching deep shortcuts container.
am: 946f85060a

Change-Id: I5966cc024c9ac1e60ebb4ded18df8430dbc68513
2016-09-16 18:52:21 +00:00
Tony Wickham
f595f3de0f Merge "Don't close all apps when touching deep shortcuts container." into ub-launcher3-calgary-polish 2016-09-16 18:47:48 +00:00
Hyunyoung Song
4a652835fd Show IME when search query != null after rotation
am: c2fe1147f9

Change-Id: I9b7b139f5675edec9aff4968cef7780b48ff2165
2016-09-09 22:18:36 +00:00
Hyunyoung Song
915d56abc7 Merge "Show IME when search query != null after rotation" into ub-launcher3-calgary-polish 2016-09-09 22:13:33 +00:00
Hyunyoung Song
c2fe1147f9 Show IME when search query != null after rotation
Change-Id: Ia35fba140a5addc21bf347cd63b72dc4e357421e
2016-09-09 15:02:20 -07:00
Tony Wickham
946f85060a Don't close all apps when touching deep shortcuts container.
Bug: 31373894
Change-Id: Ica1d0c2318e8f5d3e45196174c9b495a1c2515cd
2016-09-08 14:20:48 -07:00
Sunny Goyal
94b510cc68 Some drag and drop code refactor:
1) Adding DragOptions to easily extend drap functionality
2) Changing onDragStarted signature to send more information
3) Updating states for dropTargetButton based on drag event directly
4) Removing folder item based on onDragStarted and not startDrag

Change-Id: I65b684e092ddc081d086bfe2c8c1973ed170eaeb
2016-09-01 15:55:13 -07:00
Hyunyoung Song
59a238095e Support user event logging for drag and drop
b/30039490

Supported in this CL:
- DnD: drag from container [WORKSPACE|HOTSEAT|FOLDER|ALLAPPS|WIDGETS|DEEPSHORTCUTS]
       drag to container [HOTSEAT,WORKSPACE,FOLDER,DROPTARGETS]
- Source and target can be [FOLDER_ICON, ICON, DEEPSHORTCUT, WIDGET]
- $ adb shell setprop log.tag.UserEvent DEBUG will turn on debugging

Change-Id: I0b8b879b80e6dce85bbde6e7794f9e0677832603
2016-09-01 12:47:12 -07:00
Hyunyoung Song
96c56b3607 Merge "Pull down should work on search box, even if all apps scroll is not at top. b/30295305" into ub-launcher3-calgary 2016-08-05 21:13:08 +00:00
Hyunyoung Song
58a9c4b7d2 Pull down should work on search box, even if all apps scroll is not at top.
b/30295305

Change-Id: I38bbe47d6e33929c550930c9f157c58fbea203ef
2016-08-05 13:57:21 -07:00
Hyunyoung Song
4ebc3d070f Change NavBar to transparent black
b/30615471

Change-Id: I7885e8a7fd63ee10c9b0107087046730e8acfde9
2016-08-05 10:59:17 -07:00
Hyunyoung Song
dd60ce41b3 Remove two redundant layout pass in AllAppsTransitionController.
Change-Id: I48d043820db962c58e97a09d7888303c1d5bf4ad
2016-07-27 17:08:38 -07:00
Hyunyoung Song
75df256cc1 Merge "Refresh the all apps container search result when apps are installed" into ub-launcher3-calgary 2016-07-25 21:28:23 +00:00
Hyunyoung Song
f66b680239 Refresh the all apps container search result when apps are installed
b/30102209

> After user comes back from the play store after installing
the app that didn't exist when searched, the app will now be
shown in the filtered search result list.

Change-Id: Ia5fe501596127a7401928e5db2d6f425ad753701
2016-07-25 14:24:08 -07:00
Sunny Goyal
ce3fffb5fb Updating the search hint to contain the icon as a span object.
This makes the icon part of the hint text, and removes any need for
custom focus event handling.
Also the icon will now appear at the start of the text  based on the
direction of the text and not the direction of the layout

Change-Id: I06c5cf99492d75b1005c69ec7c521cde0fdab010
2016-07-22 13:17:30 -07:00
Winson
1f06427266 Initial changes to tweak layout.
- Adding DeviceProfile callback for when the launcher layout changes due
  to insets.  This is necessary since there are now different layouts
  depending on which side the navigation bar is on
- Consolidating hotseat and other layout into the device profile 
  launcher layout logic
- Making the all apps icons match the workspace icon height
- Tweaking caret drawable to draw to the bounds specified to simplify
  layout in each orientation
- Fixing minor issue with page indicator shifting in landscape
- Centering overview buttons to the workspace page

Bug: 30021487
Change-Id: I1866bce00b2948f3edd06168c0f88d81207e3f13
2016-07-20 10:17:08 -07:00
Peter Schiller
637e40ad6f Centered typing in search field
Change-Id: Iae46722195d0d06ff88da52df4fa48ca7b157512
2016-07-19 17:30:44 -07:00
Hyunyoung Song
e4be3b3fdb Support gray hotseat background in all apps transition
b/30201515

Change-Id: Ie4b8442ac804b4df94e9673608129e6ffc0c3360
2016-07-18 16:35:10 -07:00
Peter Schiller
9413860349 Account for RTL with search animation
Change-Id: I869c285e7c0e7a3d14c1a897330d04b794390c76
2016-07-14 18:17:08 -07:00
Sunny Goyal
5024503702 Preventing unnecessary layouts on search focus change
Instead of expanding the edittext, using a separate textview
which is shown/hidden as the hint text

Change-Id: Ib4cedeaed9291f972be2ee407c06f4944c983e27
2016-07-14 16:39:48 -07:00
Winson Chung
b029e9fd66 Merge "Cleaning up scrollbar logic to properly calculate stable extents." into ub-launcher3-calgary 2016-07-13 01:04:39 +00:00
Hyunyoung Song
4dd8501a25 Merge "all apps should pull down when there isn't scrollable thumb b/30059445" into ub-launcher3-calgary 2016-07-13 00:36:17 +00:00
Hyunyoung Song
cd4b3003ad all apps should pull down when there isn't scrollable thumb
b/30059445

Change-Id: I4d28b9718746398b078e329cb5a92d5991bc0102
2016-07-12 17:10:38 -07:00
Peter Schiller
e22e607440 Merge "Reset scroll position when all apps is reset" into ub-launcher3-calgary 2016-07-12 22:39:33 +00:00
Hyunyoung Song
ca7f30f7cf Fix all apps becoming clipped when screen is rotated with all apps opened.
b/30040068

Change-Id: I5e89a82310fddd5aa89a8f5d855b2efa526f8244
2016-07-12 15:37:15 -07:00
Peter Schiller
c529c98f11 Reset scroll position when all apps is reset
Change-Id: If0d4aa0f488e3198a17c7649e7ef9bc8a78a0cbc
2016-07-12 15:36:47 -07:00
Winson
b655b88500 Cleaning up scrollbar logic to properly calculate stable extents.
- Removing old logic which assumed that views were the same size,
  especially now we can have variable dividers, etc.
- Simplifying old scroll position logic.
- Removing unnecessary prediction icon layout (same as normal icon)

Bug: 30023608
Change-Id: I39e1126fa586a76a9bdd3ff38cd6e360ac3021e6
2016-07-12 12:16:26 -07:00
Peter Schiller
c2a20ff0a8 Consolidate all the dividers to provide same look and feel
Bug: 30017936
Change-Id: I072cb116dba1df555a63f3f67b730f7f9c3a235a
2016-07-08 15:02:03 -07:00
Peter Schiller
723657c584 Merge "Updating alignment of search input" into ub-launcher3-calgary 2016-07-08 20:54:34 +00:00
Peter Schiller
dcb8259286 Simplified search focus logic
Change-Id: I3f47e73c4a3d34f10e947fda2c7cae09211cc26d
2016-07-08 10:15:51 -07:00
Peter Schiller
243ad3dbf8 Updating alignment of search input
Bug: 30017936
Change-Id: I2f68711762872bc100b41b2b4768d33e2c0cd902
2016-07-07 18:52:51 -07:00
Hyunyoung Song
e28bd7ca86 Set the all apps nav bar to black.
b/29998559

Change-Id: Iba66b390f78fdf25b7eaf912012aabaf7df56476
2016-07-06 22:54:33 +00:00
Peter Schiller
310a988993 Updating all apps to match spec
Change-Id: Ie351fdea2e3b05ca911e6533f0c5d00c17e0847c
2016-06-30 18:09:51 -07:00
Tony Wickham
1bce7fd342 Long-press on an app to reveal its shortcuts.
- Add ShortcutsContainerListener to icons on workspace, folders, and
  all apps. This handles long-press and forwards following touches to
  the DeepShortcutsContainer that is created.
- Drag over shortcut before lifting finger to launch it.
- Shortcuts are rendered in pill-shaped DeepShortcutViews,
  which are inside DeepShortcutContainer on DragLayer.
- The shortcut container orients above or below the icon, and left or
  right-aligns with it. Biases for above + left-align.
- Long press a DeepShortcutPill to drag and pin it to the workspace.

Bug: 28980830
Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
2016-06-29 17:48:46 -07:00
Peter Schiller
8ea6a53654 Fixed inset overscroll
Bug: 29334391
Change-Id: I621f4b78e2c7d80d024ba1f9bcd993ff8a35ed01
2016-06-28 15:13:02 -07:00
Peter Schiller
cbea086284 All Apps header shadow is drawn incorrectly
Bug: 29777304
Change-Id: I9ead05b28d1d57dd6a157126637296a97e3f7058
2016-06-27 18:59:32 -07:00
Hyunyoung Song
1c72b72b21 Add margin to all apps recycler container view
b/29509347
> Last row inside recycler view was obstructed by nav bar
making it difficult to interact with before.

Change-Id: I90f0f402e14230a1757f208f9b92800f10cdb38c
2016-06-22 10:59:07 -07: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
Hyunyoung Song
a9a8a42217 UI fixes to All apps pull up work
b/28917826
- nav bar change to light when top of the all apps container
passes y mid point of the status bar
- apps search edit box change when top of the all apps passes
the bottom of nav bar
- Restrict pull up to work only if the ACTION_DOWN event started
from the hotseat.
- Landscape: reverted old padding and margin. Only the interaction
is different.
- Tuning of the motion spec
- Animation duration respects fling speed more agressively.
- and many more small bugs...

Change-Id: Icde4093c41eeab8c9c6d9dc8b7d57adc3b171349
2016-06-15 16:45:48 -07:00
Hyunyoung Song
f4cbb1428a Fixes to touch handling in all apps pull up work
b/28917826
- Fast scroll bar works even when it's at the top of the recycler view
- Pull down only happens ONLY IF the thumb of the scroll bar is at top
- When container is touched during sliding down animation,
translation should not jump

Change-Id: Ic1d9a4aa77332cc0a7582556f893053003224dd3
2016-06-10 13:26:19 -07:00
Hyunyoung Song
74b5af3529 Fixes to all apps pull up work
b/28917826

- 2+ workspace page also slides up
- pull up touch interaction doesn't trigger only when yslop > xslop
- animation duration should be set independently when all apps button is used.
- workspace state is correctly set (drag and drop from the trays work)
- after lock screen, hotseat is positioned correctly
- Remove initial jump when sliding up
- Improved tuning on sliding
- Alpha value set differently on backbround and content of all apps

Still not fixed:
- Landscape
- Search edit text box styling
- All apps scroll bar

Change-Id: I817094b0f1ada5052ee604539459f556a99cadf1
2016-06-08 17:01:59 -07:00