Merge "Avoid NPE while drag divider bar" into sc-v2-dev
This commit is contained in:
@@ -137,14 +137,16 @@ public class SplitDecorManager extends WindowlessWindowManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIcon == null) {
|
if (mBackgroundLeash == null) {
|
||||||
// TODO: add fade-in animation.
|
|
||||||
mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
|
mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
|
||||||
RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
|
RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
|
||||||
t.setColor(mBackgroundLeash, getResizingBackgroundColor(resizingTask))
|
t.setColor(mBackgroundLeash, getResizingBackgroundColor(resizingTask))
|
||||||
.setLayer(mBackgroundLeash, SPLIT_DIVIDER_LAYER - 1)
|
.setLayer(mBackgroundLeash, SPLIT_DIVIDER_LAYER - 1)
|
||||||
.show(mBackgroundLeash);
|
.show(mBackgroundLeash);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mIcon == null && resizingTask.topActivityInfo != null) {
|
||||||
|
// TODO: add fade-in animation.
|
||||||
mIcon = mIconProvider.getIcon(resizingTask.topActivityInfo);
|
mIcon = mIconProvider.getIcon(resizingTask.topActivityInfo);
|
||||||
mResizingIconView.setImageDrawable(mIcon);
|
mResizingIconView.setImageDrawable(mIcon);
|
||||||
mResizingIconView.setVisibility(View.VISIBLE);
|
mResizingIconView.setVisibility(View.VISIBLE);
|
||||||
@@ -168,12 +170,16 @@ public class SplitDecorManager extends WindowlessWindowManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mBackgroundLeash != null) {
|
||||||
|
t.remove(mBackgroundLeash);
|
||||||
|
mBackgroundLeash = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (mIcon != null) {
|
if (mIcon != null) {
|
||||||
mResizingIconView.setVisibility(View.GONE);
|
mResizingIconView.setVisibility(View.GONE);
|
||||||
mResizingIconView.setImageDrawable(null);
|
mResizingIconView.setImageDrawable(null);
|
||||||
t.remove(mBackgroundLeash).hide(mIconLeash);
|
t.hide(mIconLeash);
|
||||||
mIcon = null;
|
mIcon = null;
|
||||||
mBackgroundLeash = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user