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

Bug: 195623679
Test: presubmit
Change-Id: I9954fb40034d1804aaf19f0778f95477e48ccc8f
This commit is contained in:
y authored and sfufa@google.com committed 2021-09-22 16:35:56 -07:00
1 parent 7f693253c8
commit eb52419282
7 files changed
+313 -147

No files matched your search

@@ -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();
}
}