B4A Library TablePanel - Adds swipe navigation to B4XTable

Erel

Administrator
Staff member
Licensed User
With TablePanel class, the user can switch pages by swiping right or left over the bottom of the table.

Usage:

Initialize TablePanel and load the layout to TablePanel instead of the activity:
B4X:
tp.Initialize(Me, "tp", Activity)
tp.base.LoadLayout("1")
Handle the swipe event:
B4X:
Sub tp_Swipe (DeltaX As Float, DeltaY As Float)
   If DeltaX < 0 And btnNext.Enabled Then btnNext_Click
   If DeltaX > 0 And btnPrev.Enabled Then btnPrev_Click
End Sub
Depends on ViewsEx v1.30+.
 

Attachments

Mahares

Well Known Member
Licensed User
For what it is worth, I have replaced this line in Tablepanel class module:
B4X:
If dx > 5dip And TouchYStart >  0.7 * base.Height
With the below line to have the full screen as a swipe area as opposed to only the bottom 30% of the screen:
B4X:
If dx > 5dip And TouchYStart >  0 Then  'you can swipe anywhwere on the screen
Is there a way to use the Activity.Title area for a swipe instead of the activity itself, in order to avoid clicking accidentally on a cell when trying to swipe?
Thank you
'
 

Erel

Administrator
Staff member
Licensed User
With the below line to have the full screen as a swipe area as opposed to only the bottom 30% of the screen:
The downside is that the user will not be able to horizontally scroll the columns.

in order to avoid clicking accidentally on a cell when trying to swipe?
You can reduce dx > 5dip to make it more sensitive. I don't see how you can detect swipes over the action bar, it will also be difficult for the user to do. It is more convenient to swipe over the bottom of the screen.
 

Alexis Martial

Member
Licensed User
The downside is that the user will not be able to horizontally scroll the columns.


You can reduce dx > 5dip to make it more sensitive. I don't see how you can detect swipes over the action bar, it will also be difficult for the user to do. It is more convenient to swipe over the bottom of the screen.
Works nice, thanks !

However, would be better if:
- the TouchPanelCreator cover exactly the BXTable except the header
- the TablePanel sized to the BXTable, so will not interact with other part of the layout

After I got my app in alpha version up and running I will try to work out something.

Thanks again.
 
Top