Launcher2: [SQUASH] Backports from caf/jb_rel

Scaling PagedView fling constants by density (issue 5594666)

Change-Id: I3f37b820fb9864091a02a51b354f10f9a0fa2ac7
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/PagedView.java
	src/com/android/launcher2/Workspace.java

Reduce peak memory use in PagedView
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/PagedView.java

Make All Apps<-->Workspace transition smoother

- grouping workspace/all apps anims into one
animator set, prevents blip when one of them ends
early and its end anim handler does lots of work
mid-animation
- updating pivots for all apps zoom if layout
changes
- avoid running unnecessary animations on
workspace pages
- prevent unnecessary reloading of pages in
All Apps

Change-Id: I53a75f7c4c7d254057e2f8f4fd17711e8862256dSigned-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/Launcher.java
	src/com/android/launcher2/Workspace.java

Small optimizations for the All Apps transition

- don't set properties in animations if they don't
change
- don't recalculate visible pages on every frame
- don't require scroll indicator to be an
ImageView

Change-Id: I099b29e677da2d0e401f677d47cdb8b5df51224e

simplifying code to prevent drawing off-screen

On certain graphics drivers, if you draw to a off-
screen buffer that's not used, it can lead to
poor performance. We were running into this in
launcher; when setChildrenLayersEnabled was called
on a CellLayout, that triggered a re-draw of that
CellLayout's hardware layer, even if that
CellLayout wasn't visible. This CL changes
PagedView so that pages that aren't going to be
rendered are set to View.INVISIBLE, preventing
re-drawing of their hardware layer.

Revert "Launcher2: Improve launcher app launching performance"

This reverts commit ab0f2a1b9a814036dd2bea6f6674af58759c77f5.

Delete dead code

Change-Id: Iabe9cf9a4254ce4d90849f6fb9bd82a043beba2a
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/AppsCustomizePagedView.java

Speeding up AllApps click feedback

Change-Id: Ia16845b16d369bea610bb908d9a9f4805d4a1d54

Using ViewPropertyAnimator for animations

Replacing some use of fastInvalidate/setFast*
methods with ViewPropertyAnimator animations

Change-Id: Id5a8934b38d9ae3a95b6dccb431f9787839d2927

Remove use of setFast* properties

Change-Id: Ibfae0eed65d384789929829d6a24379561934eb4

Fix occasional odd scrolling behavior

Change-Id: I4cbcd17ab0bc2212d9591098d9aac6ca3ce6ed7d

Stripping out code path that we have no intention of using

Change-Id: I89cc6b1760a9fd8c051857699724435eef6c8b14

Fixing subtle animation jank when dropping icon on adjacent page

-> The old path of the icon wasn't correct from a motion standpoint

Change-Id: Icb4b06b5cd5649e983d43953ff369d1d8d8cdee2

Fix RuntimeException in LauncherViewPropertyAnimator

Bug #5869237

Change-Id: Ib1466ea7aaabc1c42626789d7c8ef48134b49bfd

Removing dead code

Change-Id: I712144b0beb81387efd4c4b59087594e9832d116

Cleaning up animation code

- replacing ValueAnimators with ObjectAnimators
- using ViewPropertyAnimator for All Apps->Workspace transition
- add multiple listener support to LauncherViewPropertyAnimator

Change-Id: I794dab6138fb23c5be963e2eb562965b5de857cf

Speed up All Apps -> Workspace transition

- use HW layers on Views whose alpha is faded
- don't run animation end code until the entire launcher
transition is finished
- be more aggressive about making workspace pages visible
after an animation, potential fix for Bug #5867739

Change-Id: I52a088e551c1636a67725629640286b885070f32
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/Launcher.java
	src/com/android/launcher2/Workspace.java

Showing page indicator while dragging (Bug: 5117192)

Change-Id: I3c8180b2166f3961fbb9529c5de187b4b7b561cf

Fixing two regressions in which side pages were not drawn or oriented correctly.

Change-Id: Ib936d7701c8962fc04e6fed2e3d624291fe8fc46

Simplify code for All Apps touch feedback

Change-Id: I5a2ab81a140cdbd619434b266e16b8a938f5990c

Locking pressed state for AllApps icons.

- Setting workaround for transition state bug until b/5897600 is fixed.

Change-Id: Icb29a4cd7bfaf527a9db5b853e7fb24c63b58b30
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/AppsCustomizePagedView.java

Fix issue where launcher didn't return to workspace on screen off (issue 5628744)

Change-Id: Ic058cf7a803d2fe7be98325138cd5bd52a96cd9c

Improving widget transitions:

-> When a widget has no configuration activity, we bind
   and inflate it when the user picks it up. This allows
   us to smoothly transition between it's preview and
   some actual state of the widget when it is dropped.
-> When a widget has a configuration activity, we delay
   the above process until the configuration activity
   has been run at which time we transition between
   the preview and the actual widget.

Change-Id: I5265cd98400d70e5e75c3dcd21e322ed0b352d7b
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/AppsCustomizePagedView.java

Fixing bugs with new widget adding

-> widget ids were being reused in some cases
-> widgets could be added before springloaded mode was entered

Change-Id: Iaf3bffc49d4ec2de4b63db1b5cfb52b8544e9c2b

Revert "Speed up All Apps -> Workspace transition"

Temp fix for 5976264

This reverts commit 9433fa7ebad74320e39bfac6161a68bc850fe161.

Change-Id: Ic49ffc818b9b233b3717b52a5f77eaac1e001f5b
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/Workspace.java

Revert "Revert "Speed up All Apps -> Workspace transition""

- also, undo enabling hardware layers for
    scroll indicator, which could have caused
    slowness
- fix bug where scroll indicator was not seen
    after the first visit to all apps
- eliminate a some needless hardware layer redraws
- making items under All Apps invisible when we're
    in All Apps
- making workspace spaces invisible if their alpha is 0
    to prevent more hardware layer rebuilding

This reverts commit 9753d13c7bda09c1203c611ac6717021037f39c3.

Change-Id: Ib908ae0b456b2d4b8a171991a95f20aea4749da1
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/PagedView.java
	src/com/android/launcher2/Workspace.java

Allow touches to fall through AllApps nearing end of transition (Bug: 5991846, 6016062, 5991846)

- Also updating mTransitionProgress so control when drops succeed

Change-Id: I2f672c64f0a87249dcf7d254f963b8b2710c849f

Cancel scroll indicator fade during allapps/workspace transition

Change-Id: I8661c17adbf0a129730b44641930fb68ba9afed6

Animating the drag view scale up and down when dragging items.

Change-Id: Ic97d74a14964c6bdc23305b2d378b13a1f2e3664
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/DragView.java

Fading out workspace when dragging to higlight dragged object.

Change-Id: I540ce145168a65a029d820d6c14a1e3070f8a5b0

Animating the widget previews on drag from AppsCustomize.

Change-Id: I223d66bb447c40e6870be46bb27f107f0e428a95

Tweaking pickup animation, vibration and removing glow from drag view.

Change-Id: I8c9741e8b63ca9a0fc4af90e178dbb02fa912d83
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/DragController.java

Fixing issue where dragview was jagged when scaled.

Change-Id: Ibc4b6e023428f39464f015726a22c2ec5130e63b

Fixing bug where widget preview wasn't fully updated upon drop

-> The prebound widget is now added to the DragLayer to ensure
   that it goes through all necessary measure/layout/attach etc.

Change-Id: I53ca32e88fcbc2211d2747c3b067816c0d518e30

Fixing issue where you can not swipe AllApps while transitioning to AllApps. (Bug 6389985)

Change-Id: Idce57a6a3fffffa800d33c1b5b528d36174bb511

Fixing build.

Change-Id: Ibd16316801a4078d80484f8e04507508d6f7a905

Fix build
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Fix NPE

Bug: 6329157
Change-Id: Idd2db78890d196bcbfbe93640e07a96037638341

Allowing dragging to edge and holding to continue skipping pages.

Change-Id: I254f267e2ed04980925f71b7c96c2cac11f350ec
Signed-off-by: LuisCruz <ljc2491@gmail.com>

Conflicts:
	src/com/android/launcher2/DragController.java

Always remove drag view immediately when cancelling drag. (Bug: 6119112)

Change-Id: Ib0a829c5bee834700e29dba8538c83b773d017b2