mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Fixes for floating search bar (e.g. background protection).
- Adds background protection for the search bar - Views animating based on keyboard now support manual swipes. Bug: 213954333 Bug: 259004115 Bug: 251460671 Test: Manual Change-Id: I055766126fb46a8e8b48907e442c9e54aaa4badf
This commit is contained in:
@@ -53,10 +53,21 @@ public class KeyboardInsetAnimationCallback extends WindowInsetsAnimation.Callba
|
||||
mView.setTranslationY(mInitialTranslation);
|
||||
return windowInsets;
|
||||
}
|
||||
float progress = list.get(0).getInterpolatedFraction();
|
||||
WindowInsetsAnimation animation = list.get(0);
|
||||
|
||||
mView.setTranslationY(
|
||||
Utilities.mapRange(progress, mInitialTranslation, mTerminalTranslation));
|
||||
if (animation.getDurationMillis() > -1) {
|
||||
float progress = animation.getInterpolatedFraction();
|
||||
mView.setTranslationY(
|
||||
Utilities.mapRange(progress, mInitialTranslation, mTerminalTranslation));
|
||||
} else {
|
||||
// Manually controlled animation: Set translation to keyboard height.
|
||||
int translationY = -windowInsets.getInsets(WindowInsets.Type.ime()).bottom;
|
||||
if (mView.getParent() instanceof View) {
|
||||
// Offset any translation of the parent (e.g. All Apps parallax).
|
||||
translationY -= ((View) mView.getParent()).getTranslationY();
|
||||
}
|
||||
mView.setTranslationY(translationY);
|
||||
}
|
||||
|
||||
return windowInsets;
|
||||
}
|
||||
@@ -73,6 +84,7 @@ public class KeyboardInsetAnimationCallback extends WindowInsetsAnimation.Callba
|
||||
|
||||
@Override
|
||||
public void onEnd(WindowInsetsAnimation animation) {
|
||||
mView.setTranslationY(mTerminalTranslation);
|
||||
if (mView instanceof KeyboardInsetListener) {
|
||||
((KeyboardInsetListener) mView).onTranslationEnd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user