Skip to content
Snippets Groups Projects
Commit 0c2005f9 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

TwoPaneLayout: remove clipping logic

Change-Id: I04f5bfdf99429959944ed9449bbdceae8058b9e6
parent 0d6b2ee5
No related branches found
No related tags found
No related merge requests found
...@@ -211,21 +211,6 @@ public class TwoPaneLayout extends ViewGroup implements Openable { ...@@ -211,21 +211,6 @@ public class TwoPaneLayout extends ViewGroup implements Openable {
sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
} }
void updateObscuredViewsVisibility(View panel) {
boolean visibility = !mCanSlide || !isOpened;
for (int i = 0, childCount = getChildCount(); i < childCount; i++) {
final View child = getChildAt(i);
if (child == panel) {
// There are still more children above the panel but they won't be affected.
break;
} else if (child.getVisibility() == GONE) {
continue;
}
child.setVisibility(visibility ? VISIBLE : INVISIBLE);
}
}
@Override @Override
protected void onAttachedToWindow() { protected void onAttachedToWindow() {
super.onAttachedToWindow(); super.onAttachedToWindow();
...@@ -515,10 +500,6 @@ public class TwoPaneLayout extends ViewGroup implements Openable { ...@@ -515,10 +500,6 @@ public class TwoPaneLayout extends ViewGroup implements Openable {
nextXStart += child.getWidth() + Math.abs(nextXOffset); nextXStart += child.getWidth() + Math.abs(nextXOffset);
} }
if (mFirstLayout) {
updateObscuredViewsVisibility(mSlideableView);
}
mFirstLayout = false; mFirstLayout = false;
} }
...@@ -616,30 +597,6 @@ public class TwoPaneLayout extends ViewGroup implements Openable { ...@@ -616,30 +597,6 @@ public class TwoPaneLayout extends ViewGroup implements Openable {
return mCanSlide; return mCanSlide;
} }
@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
boolean result;
final int save = canvas.save();
if (mCanSlide && !lp.slideable && mSlideableView != null) {
// Clip against the slider; no sense drawing what will immediately be covered.
canvas.getClipBounds(mTmpRect);
if (isLayoutRtlSupport()) {
mTmpRect.left = Math.max(mTmpRect.left, mSlideableView.getRight());
} else {
mTmpRect.right = Math.min(mTmpRect.right, mSlideableView.getLeft());
}
canvas.clipRect(mTmpRect);
}
result = super.drawChild(canvas, child, drawingTime);
canvas.restoreToCount(save);
return result;
}
/** /**
* @param opened position to switch to * @param opened position to switch to
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment