M Mahares Expert Licensed User Longtime User Jan 29, 2017 #1 I like to delete some tabs and reinstate them when the app calls for it, but since you cannot delete tabs, or hide them, I can disable a tabstrip label. When I swipe a finger to position to a different tab, is there away to skip the disabled label and its page via Reflection or Javaobject and jump to the next enabled page without stopping at the disabled one. Thank you.
I like to delete some tabs and reinstate them when the app calls for it, but since you cannot delete tabs, or hide them, I can disable a tabstrip label. When I swipe a finger to position to a different tab, is there away to skip the disabled label and its page via Reflection or Javaobject and jump to the next enabled page without stopping at the disabled one. Thank you.
Erel B4X founder Staff member Licensed User Longtime User Jan 30, 2017 #2 You can use the PageSelected event. Skip to a different page when a "disabled" page is selected. Upvote 0
M Mahares Expert Licensed User Longtime User Jan 30, 2017 #3 Erel said: ou can use the PageSelected event. Skip to a different page when a "disabled" page is selected. Click to expand... I am aware of that and did that but here is the dilemma: I have 7 labels as follows: ENABLED0 DIASBLED1 ENABLED2 DISABLED3 DISABLED4 ENABLED5 ENABLED6 Once I am positioned at ENABLED5, I can swipe right to go to ENABLED6, but if I swipe left to go back to ENABLED2, it gets stuck at ENABLED5 and does not move, unless I physically click ENABLED2. Last edited: Jan 30, 2017 Upvote 0
Erel said: ou can use the PageSelected event. Skip to a different page when a "disabled" page is selected. Click to expand... I am aware of that and did that but here is the dilemma: I have 7 labels as follows: ENABLED0 DIASBLED1 ENABLED2 DISABLED3 DISABLED4 ENABLED5 ENABLED6 Once I am positioned at ENABLED5, I can swipe right to go to ENABLED6, but if I swipe left to go back to ENABLED2, it gets stuck at ENABLED5 and does not move, unless I physically click ENABLED2.
Erel B4X founder Staff member Licensed User Longtime User Jan 31, 2017 #4 1. Add two global variables: Code: Copy Private CurrentPage As Int Private Pages As List 2. Set the enabled and disabled pages: Code: Copy Pages = Array(True, False, False, True, False, False) 'True = Enabled Code: Copy Sub TabStrip1_PageSelected (Position As Int) Dim FixedPosition As Int = -1 If Pages.Get(Position) = False Then Dim direction As Int = Position - CurrentPage Dim i As Int = Position + direction Do While i >= 0 And i < Pages.Size If Pages.Get(i) = True Then FixedPosition = i Exit End If i = i + direction Loop If FixedPosition = -1 Then FixedPosition = CurrentPage Else FixedPosition = Position End If CurrentPage = FixedPosition TabStrip1.ScrollTo(FixedPosition, True) End Sub Upvote 0
1. Add two global variables: Code: Copy Private CurrentPage As Int Private Pages As List 2. Set the enabled and disabled pages: Code: Copy Pages = Array(True, False, False, True, False, False) 'True = Enabled Code: Copy Sub TabStrip1_PageSelected (Position As Int) Dim FixedPosition As Int = -1 If Pages.Get(Position) = False Then Dim direction As Int = Position - CurrentPage Dim i As Int = Position + direction Do While i >= 0 And i < Pages.Size If Pages.Get(i) = True Then FixedPosition = i Exit End If i = i + direction Loop If FixedPosition = -1 Then FixedPosition = CurrentPage Else FixedPosition = Position End If CurrentPage = FixedPosition TabStrip1.ScrollTo(FixedPosition, True) End Sub