Thanks, have been workint this and have the following:
tabsC.addDropListener(e -> {
/// you need to fill this up
I get The Source (e.getDraggedComponent()) and can learn the tabsC
index.
however I can not learn the target index needed to get the underlying
component (tabs.getComponentIndex(e.getDropTarget()) returns -1)
Q. Dropping tab 3 to tab 1, I see visually the tab title text has
changed position. The underlying RadioButton instance has been swapped.
however the object inserted in each of the tabs have not been
reordered.
I see your thought on removing and adding the tab in the right
location, however I would need to know the dropped index to acomplish this.
There seems to be an option to use replace (current, next),
however I need to learn what the dropped index is.
Appreciate any help your team can provide.
Thanks in advance!
});
On Sunday, May 5, 2019 at 12:29:11 AM UTC-4, Shai Almog wrote:
> Didn't have time to try/run this but something like this might work. You'd
> need to remove and re-add the tab in the right location within the drop
> listener so the swipe/animation will work.
> It relied a bit on the internal structure of the tabs component hierarchy
> but not too much:
>
> Form hi = new Form("Tabs", new BorderLayout());
>
> Tabs t = new Tabs();
>
> t.addTab("T1", new Label("Tab 1"));
> t.addTab("T2", new Label("Tab 2"));
> t.addTab("T3", new Label("Tab 3"));
> t.addTab("T4", new Label("Tab 4"));
>
> Container tabsC = t.getTabsContainer();
> tabsC.setDropTarget(true);
> for(Component c : tabsC) {
> c.setDraggable(true);
> }
>
> tabsC.addDropListener(e -> {
> /// you need to fill this up
> });
>
> hi.add(CENTER, t);
>
> hi.show();
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/803c14bd-3de3-4704-afa8-444be9d84acd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.