[Refactor] Extract work profile related logic from AllAppsContainerView to WorkProfileManager

Bug: 195623679
Test: presubmit
Change-Id: I9954fb40034d1804aaf19f0778f95477e48ccc8f
This commit is contained in:
y
2021-08-31 20:24:33 -07:00
committed by sfufa@google.com
parent 7f693253c8
commit eb52419282
7 changed files with 313 additions and 147 deletions

View File

@@ -65,7 +65,32 @@ public class KeyboardInsetAnimationCallback extends WindowInsetsAnimation.Callba
public WindowInsetsAnimation.Bounds onStart(WindowInsetsAnimation animation,
WindowInsetsAnimation.Bounds bounds) {
mTerminalTranslation = mView.getTranslationY();
mView.setTranslationY(mInitialTranslation);
if (mView instanceof KeyboardInsetListener) {
((KeyboardInsetListener) mView).onTranslationStart();
}
return super.onStart(animation, bounds);
}
@Override
public void onEnd(WindowInsetsAnimation animation) {
if (mView instanceof KeyboardInsetListener) {
((KeyboardInsetListener) mView).onTranslationEnd();
}
super.onEnd(animation);
}
/**
* Interface Allowing views to listen for keyboard translation events
*/
public interface KeyboardInsetListener {
/**
* Called from {@link KeyboardInsetAnimationCallback#onStart}
*/
void onTranslationStart();
/**
* Called from {@link KeyboardInsetAnimationCallback#onEnd}
*/
void onTranslationEnd();
}
}