cricklet / Android-PanesLibrary

(deprecated ~2012) Easily create Android apps with multi-pane tablet layouts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change panes size after index change

lsuski opened this issue · comments

Hi,
I'd like to make panes size dependent of current panes configuration, e.g.
I have 4 panes and only 3 visible at time (1-2-3 or 2-3-4), I want first visible pane to be always 0.25 of available size. The problem is that PaneSizer is called only at the beginning and I can't request onMeasure on PaneView (invalidate & requestLayout on PanesLayout doesn't work) while scrolling (or after index changed). Size of pane no. 2 is measured once and when it becomes first visible pane it is partially covered by pane no. 3. Do you have any suggestions how to manage this?

I managed to request panes remeasurement (invoke requestLayout on panes in PanesLayout.setIndex() ) but it doesn't behave correctly beacuse the computation of visible indexes is dependent of panes width and this in turn is dependent ( in my scenario) of visible indexes. I am not sure if is this even possible to manage. I'd appreciate any suggestions about it.

late, but i had the same problem, so i write what i did: when you add a new pane, just set the visiblity of other panes to Gone. I mean 0 is the menu, lets say 2 is the current. then set getPane(1).setVisiblity(View.Gone).