Hello, thanks for this excellent component. ๐
I'm having a small problem with the hidePanel() method. Looking at the source code, I see that for obvious reasons, the panel sets its visibility to GONE once the slideableView is measured (and therefore not null), as seen in the hidePane method:
public void hidePane() {
if (mSlideableView == null) {
return;
}
mSlideableView.setVisibility(View.GONE);
requestLayout();
}
I have my SlidingUpPanel in a base class (it's a complex layout, that also contains a Navigational Drawer and a View Pager, and Fragments, etc.).
It all works ok, until I've been requested to hide the panel upon startup, so it will only be seen after the user starts certain actions.
So, my before even checking the source code I added mPanel.hidePane() after I create it. Of course it didn't work (because wellโฆ views are probably not laid out yet and can't be measured).
For the record, I am using
I've tried adding the following code in different places:
Handler h = new Handler();
h.post(new Runnable() {
@Override
public void run() {
mSlidingUpPanelLayout.hidePane();
}
});
To no avail.
I've tried it in:
- BaseActivity
- onCreate (after the findViewById(R.id.sliding_layout); and such)
- onResume()
- MyActivity extends BaseActivity
- onCreate
- onResume
- onStart
It never works, because mSlideableView is null during that time (I've added logging to see if this was the case).
I've even tried runOnUiThread just in case.
If, after everything is up, I go to another MyActivity, the panel is hidden, and everything works. Even if I force hidePane and showPane from a button action.
Any ideas how can this be accomplished?