Merge "Cancelling quickscrub state incease we missed quickscrub end event" into ub-launcher3-edmonton
diff --git a/Android.mk b/Android.mk
index dbafcbc..ab445ac 100644
--- a/Android.mk
+++ b/Android.mk
@@ -173,7 +173,57 @@
include $(BUILD_PACKAGE)
+#
+# Build rule for Launcher3 Go app with quickstep for Android Go devices.
+#
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+ android-support-v4 \
+ android-support-v7-recyclerview \
+ android-support-dynamic-animation \
+ libSharedSystemUI
+
+LOCAL_SRC_FILES := \
+ $(call all-java-files-under, src) \
+ $(call all-java-files-under, quickstep/src) \
+ $(call all-java-files-under, go/src_flags) \
+ $(call all-proto-files-under, protos) \
+ $(call all-proto-files-under, proto_overrides)
+
+LOCAL_RESOURCE_DIR := \
+ $(LOCAL_PATH)/quickstep/res \
+ $(LOCAL_PATH)/go/res \
+ $(LOCAL_PATH)/res \
+ prebuilts/sdk/current/support/v7/recyclerview/res \
+
+LOCAL_PROGUARD_ENABLED := disabled
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := nano
+LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/ --proto_path=$(LOCAL_PATH)/proto_overrides/
+LOCAL_PROTO_JAVA_OUTPUT_PARAMS := enum_style=java
+
+LOCAL_AAPT_FLAGS := \
+ --auto-add-overlay \
+ --extra-packages android.support.v7.recyclerview \
+
+LOCAL_SDK_VERSION := system_current
+LOCAL_MIN_SDK_VERSION := 26
+LOCAL_PACKAGE_NAME := Launcher3QuickStepGo
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3
+
+LOCAL_FULL_LIBS_MANIFEST_FILES := \
+ $(LOCAL_PATH)/go/AndroidManifest.xml \
+ $(LOCAL_PATH)/AndroidManifest.xml \
+ $(LOCAL_PATH)/AndroidManifest-common.xml
+
+LOCAL_MANIFEST_FILE := quickstep/AndroidManifest.xml
+LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.*
+
+include $(BUILD_PACKAGE)
# ==================================================
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto
index cab20a3..06e6a92 100644
--- a/protos/launcher_log.proto
+++ b/protos/launcher_log.proto
@@ -110,6 +110,8 @@
QUICK_SCRUB_BUTTON = 12;
CLEAR_ALL_BUTTON = 13;
CANCEL_TARGET = 14;
+ TASK_PREVIEW = 15;
+ SPLIT_SCREEN_TARGET = 16;
}
enum TipType {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java
index d86ba6a..1eaa8bc 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java
@@ -18,8 +18,6 @@
import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
-import android.view.View;
-
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
@@ -62,11 +60,6 @@
}
@Override
- public View getFinalFocus(Launcher launcher) {
- return launcher.getAppsView();
- }
-
- @Override
public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
float[] scaleAndTranslation = LauncherState.OVERVIEW.getWorkspaceScaleAndTranslation(
launcher);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
index 0116a8e..9169ffb 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
@@ -83,11 +83,6 @@
DiscoveryBounce.showForOverviewIfNeeded(launcher);
}
- @Override
- public View getFinalFocus(Launcher launcher) {
- return launcher.getOverviewPanel();
- }
-
public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
return new PageAlphaProvider(DEACCEL_2) {
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index e3aabd6..ea27eb2 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -76,15 +76,16 @@
}
PropertySetter setter = config.getPropertySetter(builder);
float[] scaleTranslationYFactor = toState.getOverviewScaleAndTranslationYFactor(mLauncher);
- Interpolator scaleInterpolator = builder.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR);
- setter.setFloat(mRecentsView, SCALE_PROPERTY, scaleTranslationYFactor[0], scaleInterpolator);
- Interpolator transYInterpolator = scaleInterpolator;
+ Interpolator scaleAndTransYInterpolator = builder.getInterpolator(
+ ANIM_OVERVIEW_SCALE, LINEAR);
if (mLauncher.getStateManager().getState() == OVERVIEW && toState == FAST_OVERVIEW) {
- transYInterpolator = Interpolators.clampToProgress(QUICK_SCRUB_START_INTERPOLATOR, 0,
- QUICK_SCRUB_TRANSLATION_Y_FACTOR);
+ scaleAndTransYInterpolator = Interpolators.clampToProgress(
+ QUICK_SCRUB_START_INTERPOLATOR, 0, QUICK_SCRUB_TRANSLATION_Y_FACTOR);
}
+ setter.setFloat(mRecentsView, SCALE_PROPERTY, scaleTranslationYFactor[0],
+ scaleAndTransYInterpolator);
setter.setFloat(mRecentsView, TRANSLATION_Y_FACTOR, scaleTranslationYFactor[1],
- transYInterpolator);
+ scaleAndTransYInterpolator);
setter.setFloat(mRecentsViewContainer, CONTENT_ALPHA, toState.overviewUi ? 1 : 0,
builder.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
diff --git a/quickstep/src/com/android/quickstep/TaskSystemShortcut.java b/quickstep/src/com/android/quickstep/TaskSystemShortcut.java
index 228af8e..f82ff8c 100644
--- a/quickstep/src/com/android/quickstep/TaskSystemShortcut.java
+++ b/quickstep/src/com/android/quickstep/TaskSystemShortcut.java
@@ -16,6 +16,8 @@
package com.android.quickstep;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP;
+
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -35,6 +37,7 @@
import com.android.launcher3.R;
import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.popup.SystemShortcut;
+import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.util.InstantAppResolver;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskThumbnailView;
@@ -166,7 +169,8 @@
Log.w(TAG, "Failed to notify SysUI of split screen: ", e);
return;
}
-
+ activity.getUserEventDispatcher().logActionOnControl(TAP,
+ LauncherLogProto.ControlType.SPLIT_SCREEN_TARGET);
// Add a device profile change listener to kick off animating the side tasks
// once we enter multiwindow mode and relayout
activity.addOnDeviceProfileChangeListener(onDeviceProfileChangeListener);
diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 695e046..d171f69 100644
--- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -273,8 +273,8 @@
| STATE_SCALED_CONTROLLER_APP,
this::notifyTransitionCancelled);
- mStateCallback.addCallback(STATE_LAUNCHER_STARTED | STATE_QUICK_SCRUB_START,
- this::onQuickScrubStart);
+ mStateCallback.addCallback(STATE_LAUNCHER_STARTED | STATE_QUICK_SCRUB_START
+ | STATE_APP_CONTROLLER_RECEIVED, this::onQuickScrubStart);
mStateCallback.addCallback(STATE_LAUNCHER_STARTED | STATE_QUICK_SCRUB_START
| STATE_SCALED_CONTROLLER_RECENTS, this::onFinishedTransitionToQuickScrub);
mStateCallback.addCallback(STATE_LAUNCHER_STARTED | STATE_CURRENT_TASK_FINISHED
diff --git a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
index cc24f1d..a654482 100644
--- a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -227,12 +227,16 @@
dl.getDescendantRectRelativeToSelf(ttv, targetRect.rect);
updateTargetRect(targetRect);
- // Transform the clip relative to the target rect.
- float scale = mTargetRect.width() / mSourceRect.width();
- mSourceWindowClipInsets.left = mSourceWindowClipInsets.left * scale;
- mSourceWindowClipInsets.top = mSourceWindowClipInsets.top * scale;
- mSourceWindowClipInsets.right = mSourceWindowClipInsets.right * scale;
- mSourceWindowClipInsets.bottom = mSourceWindowClipInsets.bottom * scale;
+ if (target == null) {
+ // Transform the clip relative to the target rect. Only do this in the case where we
+ // aren't applying the insets to the app windows (where the clip should be in target app
+ // space)
+ float scale = mTargetRect.width() / mSourceRect.width();
+ mSourceWindowClipInsets.left = mSourceWindowClipInsets.left * scale;
+ mSourceWindowClipInsets.top = mSourceWindowClipInsets.top * scale;
+ mSourceWindowClipInsets.right = mSourceWindowClipInsets.right * scale;
+ mSourceWindowClipInsets.bottom = mSourceWindowClipInsets.bottom * scale;
+ }
}
private void updateStackBoundsToMultiWindowTaskSize(BaseDraggingActivity activity) {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 2f6ce8a..dee15d0 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -271,6 +271,7 @@
.getDimensionPixelSize(R.dimen.recents_empty_message_text_padding);
setWillNotDraw(false);
updateEmptyMessage();
+ setFocusable(false);
}
public boolean isRtl() {
@@ -931,16 +932,6 @@
return true;
}
- @Override
- public void onVisibilityAggregated(boolean isVisible) {
- super.onVisibilityAggregated(isVisible);
- if (isVisible && !isFocused()) {
- // Having focus, even in touch mode, keeps us from losing [Alt+]Tab by preventing
- // switching to keyboard mode.
- requestFocus();
- }
- }
-
private void runDismissAnimation(PendingAnimation pendingAnim) {
AnimatorPlaybackController controller = AnimatorPlaybackController.wrap(
pendingAnim.anim, DISMISS_TASK_DURATION);
@@ -1285,6 +1276,7 @@
private void onChildViewsChanged() {
final int childCount = getChildCount();
mClearAllButton.setVisibility(childCount == 0 ? INVISIBLE : VISIBLE);
+ setFocusable(childCount != 0);
}
public void revealClearAllButton() {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
index 3391214..31c8b64 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
@@ -113,8 +113,15 @@
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
- // Carousel is first in tab order.
- views.add(mRecentsView);
- views.add(mClearAllButton);
+ if (mRecentsView.getChildCount() > 0) {
+ // Carousel is first in tab order.
+ views.add(mRecentsView);
+ views.add(mClearAllButton);
+ }
+ }
+
+ public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
+ return mRecentsView.requestFocus(direction, previouslyFocusedRect) ||
+ super.requestFocus(direction, previouslyFocusedRect);
}
}
\ No newline at end of file
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 631626f..2b760f3 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -45,7 +45,7 @@
<style name="LauncherTheme" parent="@style/BaseLauncherThemeWithCustomAttrs"></style>
- <style name="LauncherThemeDarkText" parent="@style/LauncherTheme">
+ <style name="LauncherTheme.DarkText" parent="@style/LauncherTheme">
<item name="workspaceTextColor">#FF212121</item>
<item name="workspaceShadowColor">@android:color/transparent</item>
<item name="workspaceAmbientShadowColor">@android:color/transparent</item>
@@ -70,6 +70,15 @@
<item name="isMainColorDark">true</item>
</style>
+ <style name="LauncherThemeDark.DarKText" parent="@style/LauncherThemeDark">
+ <item name="workspaceTextColor">#FF212121</item>
+ <item name="workspaceShadowColor">@android:color/transparent</item>
+ <item name="workspaceAmbientShadowColor">@android:color/transparent</item>
+ <item name="workspaceKeyShadowColor">@android:color/transparent</item>
+ <item name="isWorkspaceDarkText">true</item>
+ <item name="workspaceStatusBarScrim">@null</item>
+ </style>
+
<!--
Theme overrides to element on homescreen, i.e., which are drawn on top on wallpaper.
Various foreground colors are overridden to be workspaceTextColor so that they are properly
diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java
index d9e7d20..8af9acc 100644
--- a/src/com/android/launcher3/BaseDraggingActivity.java
+++ b/src/com/android/launcher3/BaseDraggingActivity.java
@@ -90,11 +90,11 @@
protected int getThemeRes(WallpaperColorInfo wallpaperColorInfo) {
if (wallpaperColorInfo.isDark()) {
- return R.style.LauncherThemeDark;
- } else if (wallpaperColorInfo.supportsDarkText()) {
- return R.style.LauncherThemeDarkText;
+ return wallpaperColorInfo.supportsDarkText() ?
+ R.style.LauncherThemeDark_DarKText : R.style.LauncherThemeDark;
} else {
- return R.style.LauncherTheme;
+ return wallpaperColorInfo.supportsDarkText() ?
+ R.style.LauncherTheme_DarkText : R.style.LauncherTheme;
}
}
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 76681f2..5b010dc 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -18,11 +18,11 @@
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
+
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
import android.graphics.Rect;
-import android.view.View;
import android.view.animation.Interpolator;
import com.android.launcher3.states.SpringLoadedState;
@@ -196,10 +196,6 @@
public void onStateDisabled(Launcher launcher) { }
- public View getFinalFocus(Launcher launcher) {
- return launcher.getWorkspace();
- }
-
public int getVisibleElements(Launcher launcher) {
if (launcher.getDeviceProfile().isVerticalBarLayout()) {
return HOTSEAT_ICONS | VERTICAL_SWIPE_INDICATOR;
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index 3fcdee9..b5eef8b 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -17,6 +17,7 @@
package com.android.launcher3;
import static android.view.View.VISIBLE;
+
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE;
@@ -35,7 +36,6 @@
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.IntDef;
-import android.view.View;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -251,7 +251,7 @@
prepareForAtomicAnimation(mState, state, builder);
AnimatorSet animation = createAnimationToNewWorkspaceInternal(
state, builder, onCompleteRunnable);
- Runnable runnable = new StartAnimRunnable(animation, state.getFinalFocus(mLauncher));
+ Runnable runnable = new StartAnimRunnable(animation);
if (delay > 0) {
mUiHandler.postDelayed(runnable, delay);
} else {
@@ -348,20 +348,15 @@
}
@Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- for (int i = mListeners.size() - 1; i >= 0; i--) {
- mListeners.get(i).onStateTransitionComplete(state);
- }
- }
-
- @Override
public void onAnimationSuccess(Animator animator) {
// Run any queued runnables
if (onCompleteRunnable != null) {
onCompleteRunnable.run();
}
onStateTransitionEnd(state);
+ for (int i = mListeners.size() - 1; i >= 0; i--) {
+ mListeners.get(i).onStateTransitionComplete(state);
+ }
}
});
mConfig.setAnimation(animation, state);
@@ -397,6 +392,8 @@
}
UiFactory.onLauncherStateOrResumeChanged(mLauncher);
+
+ mLauncher.getDragLayer().requestFocus();
}
public void onWindowFocusChanged() {
@@ -480,11 +477,9 @@
private class StartAnimRunnable implements Runnable {
private final AnimatorSet mAnim;
- private final View mViewToFocus;
- public StartAnimRunnable(AnimatorSet anim, View viewToFocus) {
+ public StartAnimRunnable(AnimatorSet anim) {
mAnim = anim;
- mViewToFocus = viewToFocus;
}
@Override
@@ -492,9 +487,6 @@
if (mConfig.mCurrentAnimation != mAnim) {
return;
}
- if (mViewToFocus != null) {
- mViewToFocus.requestFocus();
- }
mAnim.start();
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 42e8fde..06eb82e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1552,6 +1552,14 @@
public DragView beginDragShared(View child, DragSource source, ItemInfo dragObject,
DragPreviewProvider previewProvider, DragOptions dragOptions) {
+ float iconScale = 1f;
+ if (child instanceof BubbleTextView) {
+ Drawable icon = ((BubbleTextView) child).getIcon();
+ if (icon instanceof FastBitmapDrawable) {
+ iconScale = ((FastBitmapDrawable) icon).getAnimatedScale();
+ }
+ }
+
child.clearFocus();
child.setPressed(false);
mOutlineProvider = previewProvider;
@@ -1603,7 +1611,7 @@
}
DragView dv = mDragController.startDrag(b, dragLayerX, dragLayerY, source,
- dragObject, dragVisualizeOffset, dragRect, scale, dragOptions);
+ dragObject, dragVisualizeOffset, dragRect, scale * iconScale, scale, dragOptions);
dv.setIntrinsicIconScaleFactor(dragOptions.intrinsicIconScaleFactor);
return dv;
}
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 68ad6e3..72ba418 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -466,9 +466,12 @@
*/
public void addSpringFromFlingUpdateListener(ValueAnimator animator, float velocity) {
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ boolean shouldSpring = true;
+
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
- if (valueAnimator.getAnimatedFraction() >= FLING_ANIMATION_THRESHOLD) {
+ if (shouldSpring
+ && valueAnimator.getAnimatedFraction() >= FLING_ANIMATION_THRESHOLD) {
int searchViewId = getSearchView().getId();
addSpringView(searchViewId);
@@ -481,7 +484,7 @@
}
});
- animator.removeUpdateListener(this);
+ shouldSpring = false;
}
}
});
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 5c6946c..8a216fc 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -138,7 +138,7 @@
*/
public DragView startDrag(Bitmap b, int dragLayerX, int dragLayerY,
DragSource source, ItemInfo dragInfo, Point dragOffset, Rect dragRegion,
- float initialDragViewScale, DragOptions options) {
+ float initialDragViewScale, float dragViewScaleOnDrop, DragOptions options) {
if (PROFILE_DRAWING_DURING_DRAG) {
android.os.Debug.startMethodTracing("Launcher");
}
@@ -169,7 +169,7 @@
final float scaleDps = mIsInPreDrag
? res.getDimensionPixelSize(R.dimen.pre_drag_view_scale) : 0f;
final DragView dragView = mDragObject.dragView = new DragView(mLauncher, b, registrationX,
- registrationY, initialDragViewScale, scaleDps);
+ registrationY, initialDragViewScale, dragViewScaleOnDrop, scaleDps);
dragView.setItemInfo(dragInfo);
mDragObject.dragComplete = false;
if (mOptions.isAccessibleDrag) {
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java
index 1e5f854..551567a 100644
--- a/src/com/android/launcher3/dragndrop/DragView.java
+++ b/src/com/android/launcher3/dragndrop/DragView.java
@@ -89,6 +89,7 @@
private final int mRegistrationX;
private final int mRegistrationY;
private final float mInitialScale;
+ private final float mScaleOnDrop;
private final int[] mTempLoc = new int[2];
private Point mDragVisualizeOffset = null;
@@ -131,7 +132,7 @@
* @param registrationY The y coordinate of the registration point.
*/
public DragView(Launcher launcher, Bitmap bitmap, int registrationX, int registrationY,
- final float initialScale, final float finalScaleDps) {
+ final float initialScale, final float scaleOnDrop, final float finalScaleDps) {
super(launcher);
mLauncher = launcher;
mDragLayer = launcher.getDragLayer();
@@ -180,6 +181,7 @@
mRegistrationY = registrationY;
mInitialScale = initialScale;
+ mScaleOnDrop = scaleOnDrop;
// Force a measure, because Workspace uses getMeasuredHeight() before the layout pass
int ms = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
@@ -596,7 +598,7 @@
public void animateTo(int toTouchX, int toTouchY, Runnable onCompleteRunnable, int duration) {
mTempLoc[0] = toTouchX - mRegistrationX;
mTempLoc[1] = toTouchY - mRegistrationY;
- mDragLayer.animateViewIntoPosition(this, mTempLoc, 1f, mInitialScale, mInitialScale,
+ mDragLayer.animateViewIntoPosition(this, mTempLoc, 1f, mScaleOnDrop, mScaleOnDrop,
DragLayer.ANIMATION_END_DISAPPEAR, onCompleteRunnable, duration);
}
diff --git a/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java b/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java
index bd5c06e..fde220c 100644
--- a/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java
+++ b/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java
@@ -18,7 +18,6 @@
import android.graphics.Rect;
import android.view.View;
-import android.view.View.OnFocusChangeListener;
import com.android.launcher3.PagedView;
@@ -52,8 +51,8 @@
private void computeLocationRelativeToContainer(View child, Rect outRect) {
View parent = (View) child.getParent();
- outRect.left += child.getLeft();
- outRect.top += child.getTop();
+ outRect.left += child.getX();
+ outRect.top += child.getY();
if (parent != mContainer) {
if (parent instanceof PagedView) {
@@ -64,22 +63,4 @@
computeLocationRelativeToContainer(parent, outRect);
}
}
-
- /**
- * Sets the alpha of this FocusIndicatorHelper to 0 when a view with this listener
- * receives focus.
- */
- public View.OnFocusChangeListener getHideIndicatorOnFocusListener() {
- return new OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- if (hasFocus) {
- endCurrentAnimation();
- setCurrentView(null);
- setAlpha(0);
- invalidateDirty();
- }
- }
- };
- }
}
diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java
index aa7d0d5..35f7f88 100644
--- a/src/com/android/launcher3/states/SpringLoadedState.java
+++ b/src/com/android/launcher3/states/SpringLoadedState.java
@@ -19,7 +19,6 @@
import static com.android.launcher3.states.RotationHelper.REQUEST_LOCK;
import android.graphics.Rect;
-import android.view.View;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InstallShortcutReceiver;
@@ -98,9 +97,4 @@
InstallShortcutReceiver.disableAndFlushInstallQueue(
InstallShortcutReceiver.FLAG_DRAG_AND_DROP, launcher);
}
-
- @Override
- public View getFinalFocus(Launcher launcher) {
- return null;
- }
}
diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java
index aa5b785..74ab14f 100644
--- a/src/com/android/launcher3/widget/PendingItemDragHelper.java
+++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java
@@ -149,7 +149,7 @@
// Start the drag
launcher.getDragController().startDrag(preview, dragLayerX, dragLayerY, source, mAddInfo,
- dragOffset, dragRegion, scale, options);
+ dragOffset, dragRegion, scale, scale, options);
}
@Override
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java
index 4a2f544..f7bb254 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java
@@ -19,8 +19,6 @@
import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
-import android.view.View;
-
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
@@ -68,11 +66,6 @@
}
@Override
- public View getFinalFocus(Launcher launcher) {
- return launcher.getAppsView();
- }
-
- @Override
public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
return new float[] { 1f, 0,
-launcher.getAllAppsController().getShiftRange() * PARALLAX_COEFFICIENT};