I have a tabs for a wizard process.
Is it possible to achieve that if certain conditions are not met, avoid proceeding to the next step (avoid switching to the next tab)?
Could I achieve my requirement in the SelectionListener?
I have a tabs for a wizard process.
Is it possible to achieve that if certain conditions are not met, avoid proceeding to the next step (avoid switching to the next tab)?
Could I achieve my requirement in the SelectionListener?
SelectionListeneris problematic as it's a little too late and doesn't provide us with an object we can use.First disable the swipe action by using
setSwipeActivated(false);. Swiping is a bit problematic to block as it provides a preview of the next tab.You can override
setSelectedIndex(int, boolean)to return in such a case. Alternatively you can do something like this:Then use
enableTabs(t, false)to disable all the tabs and usetruelater to re-enable them.