Skip to content
Snippets Groups Projects
Commit 5000367d authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Fixing missing reportDrawFinish method in windowCallbacksCompat" into pi-dev

parents 8b73c112 3eb4d642
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,12 @@ public class WindowCallbacksCompat {
}
};
private final View mView;
public WindowCallbacksCompat(View view) {
mView = view;
}
public void onWindowSizeIsChanging(Rect newBounds, boolean fullscreen, Rect systemInsets,
Rect stableInsets) { }
......@@ -72,12 +78,20 @@ public class WindowCallbacksCompat {
return false;
}
public void onRequestDraw(boolean reportNextDraw) { }
public void onRequestDraw(boolean reportNextDraw) {
if (reportNextDraw) {
reportDrawFinish();
}
}
public void onPostDraw(Canvas canvas) { }
public final boolean addToView(View view) {
ViewRootImpl root = view.getViewRootImpl();
public void reportDrawFinish() {
mView.getViewRootImpl().reportDrawFinish();
}
public boolean attach() {
ViewRootImpl root = mView.getViewRootImpl();
if (root != null) {
root.addWindowCallbacks(mWindowCallbacks);
root.requestInvalidateRootRenderNode();
......@@ -86,8 +100,8 @@ public class WindowCallbacksCompat {
return false;
}
public final void removeFromView(View view) {
ViewRootImpl root = view.getViewRootImpl();
public void detach() {
ViewRootImpl root = mView.getViewRootImpl();
if (root != null) {
root.removeWindowCallbacks(mWindowCallbacks);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment