pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@gmail.com>
Subject Re: Accordion setSelectedIndex issue
Date Fri, 17 Dec 2010 19:49:55 GMT
I am not in a position to be able to see how this manifests, but it sounds
like it could be this issue  https://issues.apache.org/jira/browse/PIVOT-572

If so, you might be able to hack together a workaround using a CardPane and
maintaining 2 Accordions.  The card pane would show the one that is in a
good visual state while you populate the empty one, then toggle the
CardPane's selection to the newly populated one, and clear the first
accordion ready for the next set of changes.  A very clunky double-buffering
effect...

Or if you want to take a look into the issue itself, you'll probably need
http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
http://svn.apache.org/repos/asf/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java

Chris

On 18 December 2010 01:10, Eugene Kondrashev <eugene.kondrashev@gmail.com>wrote:

> Hi
>
> I faced with issue while refreshing my accordion view.
>
> Let say I have one accordion and one button refreshing accordions data and
> setting index.
>
>
>         nextCompanyButton.getButtonPressListeners().add(new
> ButtonPressListener() {
>
>             @Override
>             public void buttonPressed(Button button) {
>                 companiesAccordion.getPanels().remove(0,
> companiesAccordion.getPanels().getLength());
>
>                 CompanyViewController companyView =
> UIComponents.companyView();
>                 companyView.load(new BeanAdapter(new Company()));
>                 Accordion.setLabel(companyView, "T1");
>                 companiesAccordion.getPanels().add(companyView);
>                 companyView = UIComponents.companyView();
>                 companyView.load(new BeanAdapter(new Company()));
>                 Accordion.setLabel(companyView, "T2");
>                 companiesAccordion.getPanels().add(companyView);
>                 companiesAccordion.setSelectedIndex(1);
>             }
>         });
>
> As you can see, i'm removing all the panels and initing them from the
> scrach.
> So when i'm setting selection index to 0 it is ok no artifacts appears, but
> if it is 1 accrodion is flipping. I mean the accordion area is getting blank
> for a second or half and then is back to normal with right panel selected.
> Seems like that half a second perion selection transition is done. But there
> is no animation on screen.
>
> So finally, I need to refresh my accordion and set correct panel index. Can
> you tell me how can i do that without that flipping affect?
> Perhaps I can turn off that selection animation while refresh or something?
>
> Thanks, Eugene
>

Mime
View raw message