Commit Graph

335 Commits

Author SHA1 Message Date
Sunny Goyal
ac00cba35c Simplifying workspace layout
Instead of creating workspace view larger than the screen size (so that it can be
zoomed out), restricting the size to the parent size and bypassing the drag events
directly to Workspace (since the workspace is smaller when zoomed out, it might not
qualify for all events otherwise).

Change-Id: I45e213dd6d16bec5feb6e7cf90bc6f7de4c6d305
2017-11-13 16:00:06 -08:00
Sunny Goyal
5bc6b6f14c Consolidating various interpolators
Change-Id: I9588eee3552001b162a1e8d5ccefcfb44d221880
2017-10-26 16:38:55 -07:00
Sunny Goyal
4d519f2568 Enable overview state restore
> Reapplying CellLayout state when new pages are added (page bind comes after restore)
> Removing support for different scroll range for freescroll (the calculations were not
  consistant with maxScroll)

Bug: 67678570
Change-Id: Ic1911de1b707f2f6940e7040f07ca7e733e2ef2a
2017-10-24 10:39:24 -07:00
Sunny Goyal
c99cb174c3 Moving some state specific logic to subclass of LauncherState
Bug: 67678570
Change-Id: I1316f91c9f19bd572e4a0da67a22fa8921e1dcf9
2017-10-20 13:56:47 -07:00
Sunny Goyal
b72d8b2c8b Using common fling detection logic for notification and all-apps
> Refactoring SwipeDetector to both allow vertical and horizontal swipes
> Using SwipeDetector and common overscroll effect for notification swipes
  instead of a separate logic

Change-Id: Ib706ee179811ade59ddb68184e1c202365d147c4
2017-07-20 01:33:10 -07:00
Tony
a361c7204f Ensure mCurrentPage is valid after page is removed
Specific case this addresses: removing work profile
- Removing work profile causes workspace to be rebound
- This means pages are removed and re-added
- As icons are added back to the pages, they use the
  context of the current page to ensure theming is
  correct (see ag/1919636)
- Without this change, the current page could be null,
  causing a crash. Now we make sure the index is valid.

Bug: 62699220
Change-Id: I0aa1d0c2c6150c51dacb2eb860e4dacd183b3505
2017-07-04 09:43:06 -07:00
Hyunyoung Song
3f5a11f3a5 Add user event logging for page rearrangement and LEFT/RIGHT swipes
1. Call logOverviewRearrange logging call ONLY when the order actually changed
2. Call logActionOnContainer when containers are swiped.
Bug: 32457561
Bug: 32457561

06-30 11:23:04.082  6585  6585 D UserEvent: action:SWIPE direction=LEFT
06-30 11:23:04.082  6585  6585 D UserEvent:  Source child:WORKSPACE id=2
06-30 11:23:04.082  6585  6585 D UserEvent:  Elapsed container 50436 ms session 50436 ms action 0 ms
06-30 11:23:04.082  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:04.082  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:08.266  6585  6585 D UserEvent: action:SWIPE direction=LEFT
06-30 11:23:08.266  6585  6585 D UserEvent:  Source child:WORKSPACE id=1
06-30 11:23:08.266  6585  6585 D UserEvent:  Elapsed container 54620 ms session 54620 ms action 0 ms
06-30 11:23:08.266  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:08.266  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:10.742  6585  6585 D UserEvent: action:SWIPE direction=LEFT
06-30 11:23:10.742  6585  6585 D UserEvent:  Source child:WORKSPACE id=0
06-30 11:23:10.742  6585  6585 D UserEvent:  Elapsed container 57096 ms session 57096 ms action 0 ms
06-30 11:23:10.742  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:10.742  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:17.286  6585  6585 D UserEvent: action:SWIPE direction=RIGHT
06-30 11:23:17.286  6585  6585 D UserEvent:  Source child:WORKSPACE id=-1
06-30 11:23:17.286  6585  6585 D UserEvent:  Elapsed container 63639 ms session 63639 ms action 0 ms
06-30 11:23:17.286  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:17.286  6585  6585 D UserEvent:  isInMultiWindowMode false
06-30 11:23:19.879  6585  6585 D UserEvent: action:SWIPE direction=RIGHT
06-30 11:23:19.879  6585  6585 D UserEvent:  Source child:WORKSPACE id=0
06-30 11:23:19.879  6585  6585 D UserEvent:  Elapsed container 66233 ms session 66233 ms action 0 ms
06-30 11:23:19.879  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:19.879  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:23.811  6585  6585 D UserEvent: action:SWIPE direction=RIGHT
06-30 11:23:23.811  6585  6585 D UserEvent:  Source child:WORKSPACE id=1
06-30 11:23:23.811  6585  6585 D UserEvent:  Elapsed container 70165 ms session 70165 ms action 0 ms
06-30 11:23:23.811  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:23.811  6585  6585 D UserEvent:  isInMultiWindowMode false


Change-Id: I11a48ee44aaa87863e76ccf2b46f499c28e96748
2017-06-30 13:59:38 -07:00
Adam Cohen
8d769d6620 Revert edge glow effect and restore damped overscroll
Bug 62628421

Change-Id: Iab6ac567e98e63ade34de8817c3ae1f58c25ba19
2017-06-27 09:29:34 -07:00
Sunny Goyal
65d9ceb383 Disabling page fling while the overlay is moving
Bug: 37959201
Change-Id: I2278a46d10bc81855e10f97e669460e0d0b93daa
2017-05-08 12:10:32 -07:00
Sunny Goyal
9b29ca5add Defining HomeScreenElementTheme for elements which appear on top of
wallpaper

> Using HomeScreenElementTheme for workspace items
> Fixing view inflation where wrong layout inflater was being used

Change-Id: I92e278dbfb609ad7af9c2f47351f23f03cf12049
2017-02-17 11:37:30 -08:00
Sunny Goyal
9e76f682f3 Removing wrapper around ViewPropertyAnimator, and using ObjectAnimator
instead

Bug: 35218222
Change-Id: Ic714cf7d20989cb45f07712e8a6f6659d0e3f30d
2017-02-16 11:19:01 -08:00
Sunny Goyal
76dbf6fafd Fixing onPageBeginTransition not being called when scrolling overlay
Bug: 33693546
Change-Id: If212a196648fbb2c725ca4800a157ec24f278ca8
2017-01-04 09:29:16 -08:00
Mario Bertschler
83d40e0608 Merge "Fixes a bug where the user ends in freescroll state even for regular workspace mode." into ub-launcher3-master 2016-12-29 23:33:01 +00:00
Mario Bertschler
dcc26fc693 Fixes a bug where the user ends in freescroll state even for regular workspace mode.
The bug happened while reordering pages in overview mode and clicking the back button.
The fix is to check the precodition in enableFreeScroll if we are in a valid state for enabling freescroll (currently only overview mode).

Bug: 33347786
Change-Id: Icc3005fd431569e2b9e3f52d2249de8ba8d13eab
2016-12-29 12:03:35 -08:00
Sunny Goyal
a52ecb0390 Removing all compatibility code below Lollipop
Bug: 32745285
Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
2016-12-16 15:05:09 -08:00
Jon Miranda
6a85817dfc Don't add focusables when getDescendantFocusability is FOCUS_BLOCK_DESCENDANTS.
Bug: 32315286
Change-Id: I6fc6600fc9cbf83f720d9e6e878735076cd52cf1
2016-10-27 14:14:31 -07:00
Sunny Goyal
9ccafbff26 Removing custom dispatchDraw logic and letting the system handle
selecting appropriate children for drawing.

> System already skips children which are outside the bounds. Originally
this logic was added because workspace layout is larger than the screen, and
we need to selectivly skip more children. But over time we have added many
special conditions and at present workspace actually draws more children than
needed at any given time.
> Fixing bug, where onBeginPageMoving was getting called during folder open

Bug: 12116740
Change-Id: Idee18ee9cd9d348ebc4dfd82f4ff6df14e0d22d2
2016-10-26 17:14:12 -07:00
Tony Wickham
6982de2485 resolve merge conflicts of 2fd0208 to ub-launcher3-master
Change-Id: I20ad6eaace81786be080e28d6eb551908add6d90
2016-10-12 14:38:43 -07:00
Tony
2fd0208605 Use Launcher.getLauncher(Context) instead of type-casting.
Bug: 32010039
Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
2016-10-07 12:50:01 -07:00
Hyunyoung Song
0de011705b Code sanitization
- Removed bad method/class name typos

Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
2016-10-06 10:57:29 -07:00
Sunny Goyal
fe770c9feb Cleaning up restore instance state logic
Restore instance state is only used for first binding. But in case of restore,
the binding happens synchronously, so there is not need to store the bundle
in a global variable

Change-Id: Ibc496bcd7c0d171056b8afc69f2c4d9a1270d40c
2016-09-28 11:35:13 -07:00
Sunny Goyal
4ff424abf9 Fixing overlay scroll state not getting reset properly when
scrolling is was cancelled

Bug: 30834333
Change-Id: I3605cd2dd939057905d297b5a25ce8669d578125
2016-08-12 13:14:56 -07:00
Sunny Goyal
6178f13e2d Moving the QSB out of the cell layout to the Drag layer
This allows better edge matching for the QSB. The QSB position
is kept synchronized with the page scroll and all-apps transition.
But its not visible in spring loaded and overview mode

Change-Id: I4e6723607ea966ee672273a9ca67c792fd6b5661
2016-07-13 12:37:08 -07:00
Sunny Goyal
53fe1f26d3 Updating page indicator content description to indicate click target
for apps list

Bug: 29777235
Change-Id: Ia3dc20db7ec06455429389de5752b9bcfff15555
2016-07-08 08:49:34 -07:00
Hyunyoung Song
7744169812 Extend all apps pull up activation area to page indicator view
b/29752599

Change-Id: I3ee5efefa98defbc8f386895753946efe79708b4
Background: page indicator's background is where the caret symbol is.
2016-06-27 23:51:36 -07:00
Sunny Goyal
d0a6ae7f64 Accessibility fixes and updates
> Adding custom actions on the page indicator to go to overview mode
> Disabling custom actions on the first page
> Disabling 'move page left' on the second page

Change-Id: Ib8154f70cb3f93e663a881357c6c46c33253887f
2016-06-22 14:17:34 -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
Sunny Goyal
7c786f75d1 Allowing the first screen to expand to the screen edge
This allows the QSB to extend all the way to the edge
Change-Id: I43c6e21e44fef7fffe6fb12b7afb95549b68679f
2016-06-06 16:41:57 -07:00
Sunny Goyal
da4fe1a624 Moving the QSB to the workspace grid.
The QSB will only be resent on the first screen of the workspace
covering the full width of the first row. If will not be movable.
The first screen of the workspace will not be movable.
The searchDropTargetBar no longer contains the QSB (it can be
renamed in aseparate cl).

Refactoring all QSB related logic by moving it to a custom view
inflated only using xml.
Change-Id: Icb4fd6eb855df1af15f685961c38351bf4fd4f4a
2016-05-27 18:23:29 -07:00
Sunny Goyal
c487bd34ac Making page indicator an abstract class and implementing some common methods.
Change-Id: I06613428c54f1f086090580db8242cf81f7fb128
2016-05-20 12:49:59 -07:00
Sunny Goyal
c64cfdd8fa Updating the folder page indicator to be more like the
framework page indicator (used in quick settings)

The active page is indicated with the accent color. During scroll
the active indicator expands to 2 dots corresponding to the visible pages.

Change-Id: Iaf57836b642cf87e5eed98048ecca7dd8e7643a4
2016-05-18 17:50:34 -07:00
Tony Wickham
f549dab31d Add PageIndicator interface and custom PageIndicatorLine view.
- The current PageIndicator has been renamed to PageIndicatorDots
  and PageIndicatorMarker has been renamed to PageIndicatorDot.
- PageIndicatorDots and PageIndicatorLine implement PageIndicator.
- PageIndicatorLine uses scroll progress and number of pages to
  draw a line of the correct size and position.
- All of these page indicator files are now in a pageindicators package.

Bug: 27227498

Change-Id: I9230d2e0600ce583989bd31d0b0e252b148d15c2
2016-05-17 18:53:57 -07:00
Tony Wickham
8f7ead3e94 Update page when scrolling/flinging in free-scroll.
Bug: 28054048
Change-Id: Ic22e7e717c3ead52dd6fb7495c37be3837e11030
2016-05-12 16:28:24 -07:00
Sunny Goyal
534058492f Removing some deprecated callbacks
Change-Id: I3361383fe19faa64d862bbf879edb8c09937dc6f
2016-04-14 12:30:40 -07:00
Sunny Goyal
9f44d7dc3a Revert "Updating current page when changing the frescroll mode"
This reverts commit debf81470d.

Change-Id: Ib5b60c21be2d112c6c6e453168cb5bf01a7bd971
2016-04-07 20:06:54 +00:00
Sunny Goyal
debf81470d Updating current page when changing the frescroll mode
Bug: 28054048
Change-Id: I081db915445b60f96607d4a0c30ffc8ab476fe24
2016-04-06 18:42:31 -07:00
Tony Wickham
95cdb3a021 Remove scrim on highlighted spring-loaded panel.
Bug: 27135377
Change-Id: I470955ed082a45ae7dc5f8fdd1f3decb2b573dbc
2016-03-16 11:09:09 -07:00
Tony Wickham
dadb304b46 Pinch to zoom out into overview mode.
There are 3 classes coordinating the gesture: PinchToOverviewListener,
PinchThresholdManager, and PinchAnimationManager.
- PTOL listens for the pinch gesture on DragLayer.
- When a pinch is detected, the PTOL keeps track of the interpolated
  progress and passes it along to both the PTM and PAM.
- The PTM uses the progress to determine whether a new threshold has
  been passed, and tells the PAM to animate it if so.
- The PAM uses the progress to animate things like workspace scale
  throughout the pinch.
- If the pinch ends early, the PTOL uses the last passed threshold to
  determine whether to animate to workspace or overview, and tells
  PAM to perform the animation at the same velocity as the pinch.

Bug: 24414635
Change-Id: I9e53706c705f8b2982409bf7c223d8d0e9618bf0
2016-03-04 16:52:54 -08:00
Sunny Goyal
e670159cfe Merge "Fixing homescreen getting blank when returning from the overlay" into ub-launcher3-calgary 2016-03-01 01:07:39 +00:00
Sunny Goyal
061380a04d Fixing scrollTo getting called even though the gesture was handled by an overlay
Change-Id: Ia46c4ef3db8a3ae4fa615625b7b983d7e461c797
2016-02-29 15:15:39 -08:00
Sunny Goyal
ee68816be8 Fixing homescreen getting blank when returning from the overlay
Change-Id: Ie11b92cd59c90e71b9b58eeede742ef0c5b28380
2016-02-26 08:47:21 -08:00
Sunny Goyal
c86df470ab Adding overlay interaction support
> Sending unboundX to the overlay which is the total untranslated X and not just deltaX from last frame
> Handling overlay callback and translating workspace accordingly

Change-Id: I3bd8d9efac738e9ce131758f0e5ff1b9c1d6a8fc
2016-02-25 10:01:13 -08:00
Adam Cohen
f9c184a619 Refactor FolderIcon to separate the preview effect into it's own class
-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
2016-02-12 17:28:31 -08:00
Sunny Goyal
4ffec48dec Making some view properties exported.
These will be visible in hierarchy viewer

Change-Id: I940724a7f61d67b8502d77be203a94875bc92668
2016-02-09 11:29:34 -08:00
Sunny Goyal
75c7c5ae28 resolve merge conflicts of 6362683acb to ub-launcher3-calgary.
Change-Id: Id48bf33912bf927121356a08b8501ee0070bfdc7
2016-01-27 16:55:50 -08:00
Sunny Goyal
8bf6f311e8 Removing unnecessary new object creation in dispatchDraw
dispatchDraw was calling getVisiblePages which in turn calls
getDescendantCoordRelativeToParent and created multiple new abjects

Change-Id: I401fec076183979d30dfdbbdc02a57bd79f3886d
2016-01-23 14:42:25 -08:00
Sunny Goyal
92899800b7 Fixing custom content screen not aligned properly in landscape
am: ecdc24f6f6

* commit 'ecdc24f6f667319db56a16dd7d1efda16dfe662e':
  Fixing custom content screen not aligned properly in landscape
2016-01-12 18:45:48 +00:00
Sunny Goyal
ecdc24f6f6 Fixing custom content screen not aligned properly in landscape
Bug: 26413100
Change-Id: I1a111c9d2b0dfdfbc3cbd566e5784a1ed2bb6719
2016-01-12 10:35:55 -08:00
Sunny Goyal
08442b84a2 Preserving the open folder state across rotation
Bug: 24900496
Change-Id: Ie1318b82b497957b99603b11ec338dd50d51b962
2015-12-08 14:14:26 -08:00
Sunny Goyal
4740e6ce15 Merge "Keeping the focus indicator on the widget view, while a child is focused" into ub-launcher3-burnaby-polish
am: 093a58cc77

* commit '093a58cc776be2a3cd5aed9d14df9c78a35af052':
  Keeping the focus indicator on the widget view, while a child is focused
2015-12-01 23:36:37 +00:00