Snap for 7629113 from c3252e6da1 to tm-release
Change-Id: I61d3d8801e179453d833de5ab5a1ee3616bb0630
This commit is contained in:
@@ -70,7 +70,9 @@ public class AllAppsState extends LauncherState {
|
||||
|
||||
@Override
|
||||
protected float getDepthUnchecked(Context context) {
|
||||
return 1f;
|
||||
// The scrim fades in at approximately 50% of the swipe gesture.
|
||||
// This means that the depth should be greater than 1, in order to fully zoom out.
|
||||
return 2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,15 +48,16 @@ import com.android.quickstep.views.RecentsView;
|
||||
public class AnimatorControllerWithResistance {
|
||||
|
||||
private enum RecentsResistanceParams {
|
||||
FROM_APP(0.75f, 0.5f, 1f),
|
||||
FROM_APP_TABLET(0.9f, 0.75f, 1f),
|
||||
FROM_OVERVIEW(1f, 0.75f, 0.5f);
|
||||
FROM_APP(0.75f, 0.5f, 1f, false),
|
||||
FROM_APP_TABLET(1f, 0.7f, 1f, true),
|
||||
FROM_OVERVIEW(1f, 0.75f, 0.5f, false);
|
||||
|
||||
RecentsResistanceParams(float scaleStartResist, float scaleMaxResist,
|
||||
float translationFactor) {
|
||||
float translationFactor, boolean stopScalingAtTop) {
|
||||
this.scaleStartResist = scaleStartResist;
|
||||
this.scaleMaxResist = scaleMaxResist;
|
||||
this.translationFactor = translationFactor;
|
||||
this.stopScalingAtTop = stopScalingAtTop;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,6 +75,12 @@ public class AnimatorControllerWithResistance {
|
||||
* where 0 will keep it centered and 1 will have it barely touch the top of the screen.
|
||||
*/
|
||||
public final float translationFactor;
|
||||
|
||||
/**
|
||||
* Whether to end scaling effect when the scaled down version of TaskView's top reaches the
|
||||
* non-scaled version of TaskView's top.
|
||||
*/
|
||||
public final boolean stopScalingAtTop;
|
||||
}
|
||||
|
||||
private static final TimeInterpolator RECENTS_SCALE_RESIST_INTERPOLATOR = DEACCEL;
|
||||
@@ -161,26 +168,6 @@ public class AnimatorControllerWithResistance {
|
||||
PointF pivot = new PointF();
|
||||
float fullscreenScale = params.recentsOrientedState.getFullScreenScaleAndPivot(
|
||||
startRect, params.dp, pivot);
|
||||
float prevScaleRate = (fullscreenScale - params.startScale)
|
||||
/ (params.dp.heightPx - startRect.bottom);
|
||||
// This is what the scale would be at the end of the drag if we didn't apply resistance.
|
||||
float endScale = params.startScale - prevScaleRate * distanceToCover;
|
||||
// Create an interpolator that resists the scale so the scale doesn't get smaller than
|
||||
// RECENTS_SCALE_MAX_RESIST.
|
||||
float startResist = Utilities.getProgress(params.resistanceParams.scaleStartResist,
|
||||
params.startScale, endScale);
|
||||
float maxResist = Utilities.getProgress(params.resistanceParams.scaleMaxResist,
|
||||
params.startScale, endScale);
|
||||
final TimeInterpolator scaleInterpolator = t -> {
|
||||
if (t < startResist) {
|
||||
return t;
|
||||
}
|
||||
float resistProgress = Utilities.getProgress(t, startResist, 1);
|
||||
resistProgress = RECENTS_SCALE_RESIST_INTERPOLATOR.getInterpolation(resistProgress);
|
||||
return startResist + resistProgress * (maxResist - startResist);
|
||||
};
|
||||
resistAnim.addFloat(params.scaleTarget, params.scaleProperty, params.startScale, endScale,
|
||||
scaleInterpolator);
|
||||
|
||||
// Compute where the task view would be based on the end scale.
|
||||
RectF endRectF = new RectF(startRect);
|
||||
@@ -195,6 +182,32 @@ public class AnimatorControllerWithResistance {
|
||||
resistAnim.addFloat(params.translationTarget, params.translationProperty,
|
||||
params.startTranslation, endTranslation, RECENTS_TRANSLATE_RESIST_INTERPOLATOR);
|
||||
|
||||
float prevScaleRate = (fullscreenScale - params.startScale)
|
||||
/ (params.dp.heightPx - startRect.bottom);
|
||||
// This is what the scale would be at the end of the drag if we didn't apply resistance.
|
||||
float endScale = params.startScale - prevScaleRate * distanceToCover;
|
||||
// Create an interpolator that resists the scale so the scale doesn't get smaller than
|
||||
// RECENTS_SCALE_MAX_RESIST.
|
||||
float startResist = Utilities.getProgress(params.resistanceParams.scaleStartResist,
|
||||
params.startScale, endScale);
|
||||
float maxResist = Utilities.getProgress(params.resistanceParams.scaleMaxResist,
|
||||
params.startScale, endScale);
|
||||
float stopResist =
|
||||
params.resistanceParams.stopScalingAtTop ? 1f - startRect.top / endRectF.top : 1f;
|
||||
final TimeInterpolator scaleInterpolator = t -> {
|
||||
if (t < startResist) {
|
||||
return t;
|
||||
}
|
||||
if (t > stopResist) {
|
||||
return maxResist;
|
||||
}
|
||||
float resistProgress = Utilities.getProgress(t, startResist, stopResist);
|
||||
resistProgress = RECENTS_SCALE_RESIST_INTERPOLATOR.getInterpolation(resistProgress);
|
||||
return startResist + resistProgress * (maxResist - startResist);
|
||||
};
|
||||
resistAnim.addFloat(params.scaleTarget, params.scaleProperty, params.startScale, endScale,
|
||||
scaleInterpolator);
|
||||
|
||||
return resistAnim;
|
||||
}
|
||||
|
||||
|
||||
@@ -1172,7 +1172,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mMovingTaskView = focusedTaskView;
|
||||
removeView(focusedTaskView);
|
||||
mMovingTaskView = null;
|
||||
focusedTaskView.onRecycle();
|
||||
focusedTaskView.resetPersistentViewTransforms();
|
||||
addView(focusedTaskView, mTaskViewStartIndex);
|
||||
setCurrentPage(mTaskViewStartIndex);
|
||||
|
||||
|
||||
@@ -871,6 +871,12 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
setIconAndDimTransitionProgress(iconScale, invert);
|
||||
}
|
||||
|
||||
protected void resetPersistentViewTransforms() {
|
||||
mNonGridTranslationX = mNonGridTranslationY =
|
||||
mGridTranslationX = mGridTranslationY = mBoxTranslationY = 0f;
|
||||
resetViewTransforms();
|
||||
}
|
||||
|
||||
protected void resetViewTransforms() {
|
||||
// fullscreenTranslation and accumulatedTranslation should not be reset, as
|
||||
// resetViewTransforms is called during Quickswitch scrolling.
|
||||
@@ -894,9 +900,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
|
||||
@Override
|
||||
public void onRecycle() {
|
||||
mNonGridTranslationX = mNonGridTranslationY =
|
||||
mGridTranslationX = mGridTranslationY = mBoxTranslationY = 0f;
|
||||
resetViewTransforms();
|
||||
resetPersistentViewTransforms();
|
||||
// Clear any references to the thumbnail (it will be re-read either from the cache or the
|
||||
// system on next bind)
|
||||
mSnapshotView.setThumbnail(mTask, null);
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<string name="long_accessible_way_to_add_shortcut" msgid="2199537273817090740">"షార్ట్కట్ను తరలించడానికి లేదా అనుకూల చర్యలను ఉపయోగించడానికి రెండుసార్లు నొక్కండి & హోల్డ్ చేయండి."</string>
|
||||
<string name="out_of_space" msgid="6692471482459245734">"ఈ మొదటి స్క్రీన్లో స్థలం లేదు"</string>
|
||||
<string name="hotseat_out_of_space" msgid="7448809638125333693">"ఇష్టమైనవి ట్రేలో ఖాళీ లేదు"</string>
|
||||
<string name="all_apps_button_label" msgid="8130441508702294465">"అనువర్తనాల జాబితా"</string>
|
||||
<string name="all_apps_button_label" msgid="8130441508702294465">"యాప్ల జాబితా"</string>
|
||||
<string name="all_apps_button_personal_label" msgid="1315764287305224468">"వ్యక్తిగత యాప్ల జాబితా"</string>
|
||||
<string name="all_apps_button_work_label" msgid="7270707118948892488">"కార్యాలయ యాప్ల జాబితా"</string>
|
||||
<string name="remove_drop_target_label" msgid="7812859488053230776">"తీసివేయి"</string>
|
||||
@@ -83,7 +83,7 @@
|
||||
<string name="permdesc_read_settings" msgid="5833423719057558387">"హోమ్లో సెట్టింగ్లు మరియు సత్వరమార్గాలను చదవడానికి యాప్ను అనుమతిస్తుంది."</string>
|
||||
<string name="permlab_write_settings" msgid="3574213698004620587">"హోమ్ సెట్టింగ్లు మరియు సత్వరమార్గాలను వ్రాయడం"</string>
|
||||
<string name="permdesc_write_settings" msgid="5440712911516509985">"హోమ్లో సెట్టింగ్లు మరియు సత్వరమార్గాలను మార్చడానికి యాప్ను అనుమతిస్తుంది."</string>
|
||||
<string name="msg_no_phone_permission" msgid="9208659281529857371">"ఫోన్ కాల్లను చేసేందుకు <xliff:g id="APP_NAME">%1$s</xliff:g>కి అనుమతి లేదు"</string>
|
||||
<string name="msg_no_phone_permission" msgid="9208659281529857371">"ఫోన్ కాల్స్ను చేసేందుకు <xliff:g id="APP_NAME">%1$s</xliff:g>కి అనుమతి లేదు"</string>
|
||||
<string name="gadget_error_text" msgid="740356548025791839">"విడ్జెట్ను లోడ్ చేయడం సాధ్యం కాలేదు"</string>
|
||||
<string name="gadget_setup_text" msgid="1745356155479272374">"సెటప్ను పూర్తి చేయడానికి ట్యాప్ చేయండి"</string>
|
||||
<string name="uninstall_system_app_text" msgid="4172046090762920660">"ఇది సిస్టమ్ యాప్ మరియు దీన్ని అన్ఇన్స్టాల్ చేయడం సాధ్యపడదు."</string>
|
||||
|
||||
@@ -1298,7 +1298,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
}
|
||||
|
||||
if (!foundCellSpan) {
|
||||
mWorkspace.onNoCellFound(layout);
|
||||
mWorkspace.onNoCellFound(layout, info, /* logInstanceId= */ null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ import android.view.ViewTreeObserver;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.accessibility.AccessibleDragListenerAdapter;
|
||||
import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
@@ -82,6 +84,7 @@ import com.android.launcher3.graphics.DragPreviewProvider;
|
||||
import com.android.launcher3.icons.BitmapRenderer;
|
||||
import com.android.launcher3.icons.FastBitmapDrawable;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
@@ -1604,7 +1607,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
|
||||
// Don't accept the drop if there's no room for the item
|
||||
if (!foundCell) {
|
||||
onNoCellFound(dropTargetLayout);
|
||||
onNoCellFound(dropTargetLayout, d.dragInfo, d.logInstanceId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1906,7 +1909,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
lp.cellX, lp.cellY, item.spanX, item.spanY);
|
||||
} else {
|
||||
if (!returnToOriginalCellToPreventShuffling) {
|
||||
onNoCellFound(dropTargetLayout);
|
||||
onNoCellFound(dropTargetLayout, d.dragInfo, d.logInstanceId);
|
||||
}
|
||||
if (mDragInfo.cell instanceof LauncherAppWidgetHostView) {
|
||||
d.dragView.detachContentView(/* reattachToPreviousParent= */ true);
|
||||
@@ -1974,10 +1977,16 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
}
|
||||
}
|
||||
|
||||
public void onNoCellFound(View dropTargetLayout) {
|
||||
public void onNoCellFound(
|
||||
View dropTargetLayout, ItemInfo itemInfo, @Nullable InstanceId logInstanceId) {
|
||||
int strId = mLauncher.isHotseatLayout(dropTargetLayout)
|
||||
? R.string.hotseat_out_of_space : R.string.out_of_space;
|
||||
Toast.makeText(mLauncher, mLauncher.getString(strId), Toast.LENGTH_SHORT).show();
|
||||
StatsLogManager.StatsLogger logger = mStatsLogManager.logger().withItemInfo(itemInfo);
|
||||
if (logInstanceId != null) {
|
||||
logger = logger.withInstanceId(logInstanceId);
|
||||
}
|
||||
logger.log(LauncherEvent.LAUNCHER_ITEM_DROP_FAILED_INSUFFICIENT_SPACE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -486,7 +486,10 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
LAUNCHER_TURN_ON_WORK_APPS_TAP(838),
|
||||
|
||||
@UiEvent(doc = "User tapped on 'Turn off work apps' button in all apps window.")
|
||||
LAUNCHER_TURN_OFF_WORK_APPS_TAP(839)
|
||||
LAUNCHER_TURN_OFF_WORK_APPS_TAP(839),
|
||||
|
||||
@UiEvent(doc = "Launcher item drop failed since there was not enough room on the screen.")
|
||||
LAUNCHER_ITEM_DROP_FAILED_INSUFFICIENT_SPACE(872)
|
||||
;
|
||||
|
||||
// ADD MORE
|
||||
|
||||
@@ -325,10 +325,10 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
|
||||
return;
|
||||
}
|
||||
if (drawable != null) {
|
||||
// Scale down the preview size if it's wider than the cell.
|
||||
float scale = 1f;
|
||||
if (getWidth() > 0 && getHeight() > 0) {
|
||||
// Scale down the preview size if it's wider than the cell.
|
||||
float maxWidth = getWidth();
|
||||
if (mTargetPreviewWidth > 0) {
|
||||
float maxWidth = mTargetPreviewWidth;
|
||||
float previewWidth = drawable.getIntrinsicWidth() * mPreviewContainerScale;
|
||||
scale = Math.min(maxWidth / previewWidth, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user