mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Translate the taskbar icons to match nav handle shape.
- We need to reset icon alignment whenever icon layout bound changes. This fixes the issue where we build an icon alignment animator before any of the views are laid out. - Separated animation logic between. createTransientAnimToIsStashed and createAnimToIsStashed * The values still require a bit more tuning but this gets us a lot closer to spec for many of the motion polish. Bug: 267806083 Bug: 246634367 Bug: 246635237 Test: manual Change-Id: Id122134b22ef4e418ce632e4a8137239dc8bb313
This commit is contained in:
@@ -58,6 +58,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
private static final String TAG = TaskbarView.class.getSimpleName();
|
||||
|
||||
private static final float TASKBAR_BACKGROUND_LUMINANCE = 0.30f;
|
||||
private static final Rect sTmpRect = new Rect();
|
||||
|
||||
public int mThemeIconsBackground;
|
||||
|
||||
private final int[] mTempOutLocation = new int[2];
|
||||
@@ -339,6 +341,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
(right - navSpaceNeeded) - iconEnd;
|
||||
iconEnd += offset;
|
||||
}
|
||||
|
||||
sTmpRect.set(mIconLayoutBounds);
|
||||
|
||||
// Layout the children
|
||||
mIconLayoutBounds.right = iconEnd;
|
||||
mIconLayoutBounds.top = (bottom - top - mIconTouchSize) / 2;
|
||||
@@ -379,6 +384,10 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
mIconLayoutBounds.right = center + distanceFromCenter;
|
||||
mIconLayoutBounds.left = center - distanceFromCenter;
|
||||
}
|
||||
|
||||
if (!sTmpRect.equals(mIconLayoutBounds)) {
|
||||
mControllerCallbacks.notifyIconLayoutBoundsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user