Fix divider touchable region am: 8eb8a32

am: 5a15a0d

* commit '5a15a0dd1225141533ff9ccb23a9c68255d885fc':
  Fix divider touchable region

Change-Id: If3eb98a836cdc97c8149c648251d44705855cec3
This commit is contained in:
Jorim Jaggi
2016-04-06 01:31:16 +00:00
committed by android-build-merger

View File

@@ -240,16 +240,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
protected void onAttachedToWindow() {
super.onAttachedToWindow();
EventBus.getDefault().register(this);
getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
getViewTreeObserver().removeOnGlobalLayoutListener(this);
mWindowManagerProxy.setTouchRegion(new Rect(mHandle.getLeft(), mHandle.getTop(),
mHandle.getLeft() + mHandle.getWidth(),
mHandle.getTop() + mHandle.getHeight()));
}
});
}
@Override
@@ -274,6 +264,15 @@ public class DividerView extends FrameLayout implements OnTouchListener,
return super.onApplyWindowInsets(insets);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (changed) {
mWindowManagerProxy.setTouchRegion(new Rect(mHandle.getLeft(), mHandle.getTop(),
mHandle.getRight(), mHandle.getBottom()));
}
}
public void setWindowManager(DividerWindowManager windowManager) {
mWindowManager = windowManager;
}