Commit Graph

41 Commits

Author SHA1 Message Date
Samuel Fufa
37432444fc Initial setup for widgets in Search
LiveSearchManager creates AppWidgetHost when user starts a new search session and destroys it when user returns to home. In addition, it also manages the creation and caching of PlaceholderSearchWidget which can be used to create AppWidgetHostViews.
Bug: 168321831
Test: Manual

Change-Id: I06a893028e55aa6e0702a4f1cd7a2edbb1f61671
2020-11-07 10:07:33 -06:00
Hyunyoung Song
6b670d62df Good riddance UserEventDispatcher [1/n]
Bug: 165675920
Change-Id: I237ed4243e1724b3c370c5660673bb3966bf4811
2020-08-24 21:19:09 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
73b5a27b14 Updating some non-final static objects
Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
2019-12-11 13:22:58 -08:00
Tony Wickham
a5fb60aae8 Add system gesture exclusion rects for widget resize handles
Change-Id: I67cae5d4cb27e4db36811f62480e7ab89e79bf49
2019-04-03 21:07:13 +00:00
Sunny Goyal
55bdeed7bb Removing various reflection based animations, to allow for better proguarding
Change-Id: If9df24ea4170e8a3d336057d1c3dc800934fc1ac
2018-09-21 18:21:04 +00:00
Sunny Goyal
f0b6db7fa8 Removing static launcher activity dependency from FirstFrameAnimationHelper
Static dependency does not work in the presence of multiple activities and
when the main activity is not Launcher (eg in fallback recents). Instead
creating FirstFrameAnimatorHelper on demand for individual animations.

Change-Id: I17bb69bbaaca92f0db994fb56fd784302c57d543
2018-08-13 16:10:18 -07:00
Sunny Goyal
849c6a2b18 Removing Launcher activity dependency on various animations
(This cl reverts change-Id: I455edcd17bda83ab51c2c04fa40e66097a4d6975)

Various animations were marked for cancellation when launcher activity is
destroyed. This this does not work with multiple activities (Launcher,
fallback recents, shortcut confirmation). Also since launcher activity
handles configuration changes, the activity is not destroyed often.

Instead associating a target with various animations which automatically
cancels the animations when that target goes away.

Change-Id: I64cd095a28075561a9e20c9dcdeb9f90c18e1047
2018-08-10 13:31:46 -07:00
Sunny Goyal
29947f0b53 No more waiting around for resume
Apply model updates as son as they arrive instead of waiting for onResume.
Various workspace items do not use any configuration dependent resources.
For Widgets, we wait until the host starts lietening before inflating the actual view.

Change-Id: Icb2f5e5940c1ce6c27062ccd34eff87e80af5ab1
2017-12-19 12:50:17 -08:00
Sunny Goyal
3792096688 Allowing the widgetBottomSheet to be dragged
even when the touch is started from outside the panel

Removing various instanceOf checks in onNewIntent and onBackPress
and moving all the corresponding logging in the FloatingView
This simplifies handling of panel specific log and avoids
missing a particular panel type in the if-else statement.

Bug: 64751884
Bug: 64751923
Change-Id: I98f5aae18560a64be73c9efcf495479740d49a00
2017-10-02 16:18:52 -07:00
Sunny Goyal
952e63d006 Fixing custom widgets support:
> Moving the definitions to xml so that it is easier to override in derivative projects
> Fixing verious bind and save logic for custom widgets
> Adding feature flag to easily disable custom widgets

Change-Id: I0e278bc7dd415713029364060ef10842da990be9
2017-09-13 14:04:35 -07:00
Sunny Goyal
988ad27be4 Applying the widget resize changes even when the activity is destroyed
in the middle of the resize interaction.

Bug: 64759853
Change-Id: I65ab7df0426f36fe1121bf055e38fc722822b0f4
2017-08-23 21:19:42 +00:00
Sunny Goyal
87f784c285 Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of
a valid context

Bug: 33032833
Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
2017-01-11 12:52:03 -08:00
Jonathan Miranda
e09bacc1ef Merge "Fixed mw bug where resize frame is off when resizing." into ub-launcher3-master 2017-01-09 19:48:01 +00:00
Jon Miranda
9f33cb2ce2 Bind the out IntRange using its start and end values.
In applyDeltaAndBound, we add the current IntRange values
+ delta param to the outbound IntRange -- but then we only
bind based on the current IntRange values, so the out IntRange
values can end be out of bounds.

Change-Id: Ibbaae8c2c2734107d1fd7ce8a59a4c66d83068ad
2017-01-03 09:38:11 -08:00
Jon Miranda
097a725bb8 Fixed mw bug where resize frame is off when resizing.
When a widget resizes in multi-window mode (ie. user is dragging
the resize frame), the frame is misaligned until the user lets go.
This is because the translation value to center fit the resized
widget is not taken into consideration.

Bug: 32176631
Change-Id: I6f9ee7be12d3266f021796576c771f86f6120246
2016-12-29 17:09:10 -08:00
Jon Miranda
2126691ce2 Fix widget reorder animations in multi-window mode.
The original animation assumed that the views are not
translated and not scaled. In multi-window mode this
assumption is no longer valid, because app widgets are
scaled and translated to fit center within their cells.

Bug: 32176631
Change-Id: Id60c793730d982277c9d91860e9fb0e6a0df7d38
2016-12-20 09:31:47 -08:00
Jon Miranda
26e4d17a73 Resize widget frame now wraps the scaled widget view.
Previous implementation had space between the frame and
the widget ie. letterboxing.

Bug: 32176631
Change-Id: Ie50279f4edb94812120dea492aefa4f18218162f
2016-12-13 08:53:57 -08:00
Jon Miranda
7ae64ffbe1 Scale widgets in multi-window mode.
To keep this CL small and focused, I'm going to create
a separate CL that handles the scaling for the widget in
drag and drop mode.

Bug: 32176631
Change-Id: Id6557d070edb664aa1f4851de7abf494cf8a0677
2016-11-23 10:32:42 -08:00
Sunny Goyal
aa8a871e33 Removing widgetGap and heightGap from cellLayout
This values are always set to 0

Change-Id: Ic317efdc65baa22e915f4766c60c67c116bb94a8
2016-11-20 15:26:26 +05:30
Sunny Goyal
08ca40f976 Refactoring AppWidgetResizeFrame
> Defining the layout in xml
> Simplifying the touch handling calculations

Change-Id: Iccfd82161d1e678d77ad6ff63f76e04ad905f9d8
2016-10-07 15:16:29 -07:00
Sunny Goyal
6ad72f02fd Resize only one widget at a time
> Removing logic to have multiple widgets in resize mode
> Making ResizeFrame a touch controller, so that it fits well with
other touch interaction in drag layer
> Chaning the method names in touch controller, so that it do not
overlaps with the default View methods

Change-Id: I85d4dbdfc82d078781adbce137dfaaea59c9c83d
2016-09-23 16:02:49 -07:00
Sunny Goyal
16466f1bbb Adding UI tests for various bind widget flows
Change-Id: I634302051886baee6b6424f69bc95db860b4823e
2016-03-15 15:34:25 -07:00
Tony Wickham
c338ea74c2 Merge "Clears the widget resize frame when a directional key is pressed." into ub-launcher3-burnaby-polish
am: 187b8f547d

* commit '187b8f547d2112e8d0384cf1c2077beb969dfec6':
  Clears the widget resize frame when a directional key is pressed.
2016-02-12 22:16:32 +00:00
Tony Wickham
71255bb04f Clears the widget resize frame when a directional key is pressed.
Also gives focus to the corresponding widget host view in this case.

Bug: 27130066
Change-Id: I0a564aa7c509450cd1b9cf259c0a009c68ce3e3b
2016-02-12 14:06:32 -08:00
Sunny Goyal
9d4380856f resolved conflicts for e78e3d73 to ub-launcher3-master
Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
2015-09-25 11:50:16 -07:00
Sunny Goyal
e78e3d734b Accessibility fixes
1) Use a different content description for temporary new page
2) Use different accessibility description for add widget toast
3) Announce when an item is deleted
4) Announce when hovering over a drop target
5) Announce state during drag-n-drop and widget resize (similar to seekbar)

Bug: 23573321, 24057944
Change-Id: Icabb317625e70c78e11c0b4f99b9339172d93594
2015-09-25 10:22:47 -07:00
Sunny Goyal
756cd26592 General code refactoring
> Removing utility method for isAttachedToWindow
  > Moving logic to calculate cell size from workspace to DeviceProfile
  > Replacing some constants with xml resource variables
  > Saving the item info using content values for better compatibility with other methods

Change-Id: Idd612633d97a6241cb31148df9466031374bd5a0
2015-08-20 12:56:58 -07:00
Vadim Tryshev
fedca43d39 Moving drag-drop related code into a separate package.
This is per an earlier CR comment "we should probably move all this code to its own package (launcher3.dragndrop) in a separate cl".

I'm not moving DragSource because it's referred from gsa code.

Bug: 22609426
Change-Id: Ia7204dab99c0c395c66b77143a2d60411153f5f3
2015-08-20 07:45:57 -07:00
Sunny Goyal
3c938a7e0d resolved conflicts for merge of 3f7550c1 to ub-launcher3-master
Change-Id: I3bb155473d48832e496a8983f84c20e6e935fa41
2015-08-04 10:33:30 -07:00
Sunny Goyal
233ee964a9 Calculating widget minSpans and spans statically/independent of orientation
> Filtering the widget list and excluding widgets which dont fit the grid
 > setting minSpans for the widget item when binding.

Bug: 22541314
Bug: 22559137
Change-Id: Ieda48b56c95bee0c7ec71dd691af7e23e2d43db6
2015-08-03 16:39:49 -07:00
Sunny Goyal
5d2fc32e6d Several animation calls cleanup
> Using View property instead of strings to avoid extra reflection step
> Using ViewPropertyAnimator when several properties are being animated

Change-Id: I41625643b38b70bac11e2c81d18058ec878d73bd
2015-07-31 13:07:14 -07:00
Adam Cohen
2e6da1539b Refactoring DeviceProfile
-> Pulling out the parts of device profile which can (and need to be)
   initialized and accessed without access to an Activity context,
   ie. the invariant bits.
-> The invariant bits are stored in InvariantDeviceProfile which is
   initialized statically from LauncherAppState.
-> The DeviceProfile contains the Activity context-dependent bits,
   and we will create one of these for each Activity instance, and
   this instance is accessed through the Launcher activity.
-> It's possible that we can continue to refactor this such that
   all appropriate dimensions can be computed without an Activity
   context (by only specifying orientation). This would be an
   extension of this CL and allow us to know exactly how launcher
   will look in both orientations from any context.

Sets the stage for some improvements around b/19514688

Change-Id: Ia7daccf14d8ca2b9cb340b8780b684769e9f1892
2015-05-21 16:16:40 -07:00
Sunny Goyal
ba776d57f4 Updating widget resize frame assets.
> Using a shadow as background and a frame as foreground.
> The handle has baked in shadow which gets wrapped by the
frame shadow

Change-Id: Ib0e305ea735304236b3319e4fde22fb442f5dc0f
2015-05-19 17:17:15 -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
Adam Cohen
5940042d39 Supporting custom widgets provided by launcher
-> This change provides integration for widgets provided by
   the launcher package which can run arbitrary code.

Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
2014-12-05 16:18:41 -08:00
Michael Jurka
34c2e6cf7a Clean up imports 2013-12-13 16:20:53 +01:00
Adam Cohen
283dcbe61b Fixing widget resize handles in RTL
Change-Id: I1c6ccb019cf87570c7d206809b321e901f0d3340
2013-09-26 16:41:58 -07:00
Michael Jurka
414300a79d Clean up unused code
Change-Id: Ie1e927aa0b5304f62cfffaab449abb3133870f80
2013-08-28 15:06:31 +02:00
Adam Cohen
d6e7aa3154 Fix widget resizing (Which stopped working at some point)
-> Also, deferring empty screen removal until after the drop animation
   in order to reduce buggy transitions
-> Also fixing workspace layout on tablet

Change-Id: I1ae9fdaf592262f959424f321efa6df4298f85cc
2013-07-09 15:47:46 -07:00
Daniel Sandler
325dc23624 Launcher2 is now Launcher3.
Changes include
  - moving from com.android.launcher{,2} to
    com.android.launcher3
  - removing wallpapers
  - new temporary icon

Change-Id: I1eabd06059e94a8f3bdf6b620777bd1d2b7c212b
2013-06-05 23:30:20 -04:00