diff options
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 369d80d77..25e57495b 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -43,6 +43,7 @@ import android.util.AttributeSet; import android.util.Log; import android.util.Property; import android.util.SparseArray; +import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewDebug; @@ -64,7 +65,6 @@ import com.android.launcher3.anim.AnimationLayerSet; import com.android.launcher3.badge.FolderBadgeInfo; import com.android.launcher3.compat.AppWidgetManagerCompat; import com.android.launcher3.config.FeatureFlags; -import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragOptions; @@ -529,8 +529,6 @@ public class Workspace extends PagedView // Set the wallpaper dimensions when Launcher starts up setWallpaperDimension(); - - setEdgeGlowColor(getResources().getColor(R.color.workspace_edge_effect_color)); } @Override @@ -623,7 +621,7 @@ public class Workspace extends PagedView if (qsb == null) { // In transposed layout, we add the QSB in the Grid. As workspace does not touch the // edges, we do not need a full width QSB. - qsb = mLauncher.getLayoutInflater().inflate( + qsb = LayoutInflater.from(getContext()).inflate( mLauncher.getDeviceProfile().isVerticalBarLayout() ? R.layout.qsb_container : R.layout.qsb_blocker_view, firstPage, false); @@ -709,7 +707,7 @@ public class Workspace extends PagedView // Inflate the cell layout, but do not add it automatically so that we can get the newly // created CellLayout. - CellLayout newScreen = (CellLayout) mLauncher.getLayoutInflater().inflate( + CellLayout newScreen = (CellLayout) LayoutInflater.from(getContext()).inflate( R.layout.workspace_screen, this, false /* attachToRoot */); newScreen.setOnLongClickListener(mLongClickListener); newScreen.setOnClickListener(mLauncher); @@ -727,7 +725,7 @@ public class Workspace extends PagedView public void createCustomContentContainer() { CellLayout customScreen = (CellLayout) - mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, this, false); + LayoutInflater.from(getContext()).inflate(R.layout.workspace_screen, this, false); customScreen.disableDragTarget(); customScreen.disableJailContent(); @@ -1465,6 +1463,13 @@ public class Workspace extends PagedView } } + @Override + protected boolean shouldFlingForVelocity(int velocityX) { + // When the overlay is moving, the fling or settle transition is controlled by the overlay. + return Float.compare(mOverlayTranslation, 0) == 0 && + super.shouldFlingForVelocity(velocityX); + } + private final Interpolator mAlphaInterpolator = new DecelerateInterpolator(3f); /** @@ -2618,7 +2623,7 @@ public class Workspace extends PagedView CellLayout parentCell = getParentCellLayoutForView(cell); if (parentCell != null) { parentCell.removeView(cell); - } else if (ProviderConfig.IS_DOGFOOD_BUILD) { + } else if (FeatureFlags.IS_DOGFOOD_BUILD) { throw new NullPointerException("mDragInfo.cell has null parent"); } addInScreen(cell, container, screenId, mTargetCell[0], mTargetCell[1], @@ -2951,7 +2956,7 @@ public class Workspace extends PagedView ItemInfo item = d.dragInfo; if (item == null) { - if (ProviderConfig.IS_DOGFOOD_BUILD) { + if (FeatureFlags.IS_DOGFOOD_BUILD) { throw new NullPointerException("DragObject has null info"); } return; @@ -3608,7 +3613,7 @@ public class Workspace extends PagedView mDragInfo.container, mDragInfo.screenId); if (cellLayout != null) { cellLayout.onDropChild(mDragInfo.cell); - } else if (ProviderConfig.IS_DOGFOOD_BUILD) { + } else if (FeatureFlags.IS_DOGFOOD_BUILD) { throw new RuntimeException("Invalid state: cellLayout == null in " + "Workspace#onDropCompleted. Please file a bug. "); }; @@ -3634,7 +3639,7 @@ public class Workspace extends PagedView CellLayout parentCell = getParentCellLayoutForView(v); if (parentCell != null) { parentCell.removeView(v); - } else if (ProviderConfig.IS_DOGFOOD_BUILD) { + } else if (FeatureFlags.IS_DOGFOOD_BUILD) { // When an app is uninstalled using the drop target, we wait until resume to remove // the icon. We also remove all the corresponding items from the workspace at // {@link Launcher#bindComponentsRemoved}. That call can come before or after |