Commit baecf17b authored by Adrien Maglo's avatar Adrien Maglo

SlidingPane: fix the pane positioning if a pane moving function was called before the first layout

parent c97d261c
......@@ -541,21 +541,36 @@ public class SlidingPaneLayout extends ViewGroup {
}
private boolean closePane(View pane, int initialVelocity) {
if (mFirstLayout || smoothSlideTo(0.f, initialVelocity))
if (mFirstLayout) {
mState = STATE_CLOSED;
return true;
return false;
}
else if (smoothSlideTo(0.f, initialVelocity))
return true;
else
return false;
}
private boolean openPaneEntirely(View pane, int initialVelocity) {
if (mFirstLayout || smoothSlideTo(1.f, initialVelocity))
if (mFirstLayout) {
mState = STATE_OPENED_ENTIRELY;
return true;
return false;
}
else if (smoothSlideTo(1.f, initialVelocity))
return true;
else
return false;
}
private boolean openPane(View pane, int initialVelocity) {
if (mFirstLayout || smoothSlideTo(1 - (float)mOverhangSize / mSlideRange, initialVelocity))
if (mFirstLayout) {
mState = STATE_OPENED;
return true;
return false;
}
else if (smoothSlideTo(1 - (float)mOverhangSize / mSlideRange, initialVelocity))
return true;
else
return false;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment