Android Question is there such a view in b4x?

ilan

Expert
Licensed User
Longtime User
hi,

i would like to implement something like this with b4a. is there something like this i could use ?

i know tabstrip but tabstrip will show all tabs in 1 page i would like to have 20-30 tabs (for each month) and move them like in the video where the selected tab is always in the center

is this possible?

thanx

 

sorex

Expert
Licensed User
Longtime User
shouldn't be hard to implement.

at the top 3 labels that you reuse and put in a panel with touch events.

at the bottom your 20 panels that you slide in based on the top action
or 2 that you reuse if you use layout files, will be slower tho since you need to recreate the content and adjust the states.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
by the way isn't that nearly the same as that sliding panels example?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can do it with TabStrip.
1. Set the scroll offset to 33%x:
B4X:
Dim jo As JavaObject = TabStrip1
Dim offset As Int = 33%x
jo.GetFieldJO("tabStrip").RunMethod("setScrollOffset", Array(offset))
2. Set the width of all headers to 33%x:
B4X:
For Each v As View In GetAllTabLabels(TabStrip1)
   v.Width = 33%x
Next
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
You can do it with TabStrip.
1. Set the scroll offset to 33%x:
B4X:
Dim jo As JavaObject = TabStrip1
Dim offset As Int = 33%x
jo.GetFieldJO("tabStrip").RunMethod("setScrollOffset", Array(offset))
2. Set the width of all headers to 33%x:
B4X:
For Each v As View In GetAllTabLabels(TabStrip1)
   v.Width = 33%x
Next

wow thanx i will try it out :)
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
You can do it with TabStrip.
1. Set the scroll offset to 33%x:
B4X:
Dim jo As JavaObject = TabStrip1
Dim offset As Int = 33%x
jo.GetFieldJO("tabStrip").RunMethod("setScrollOffset", Array(offset))
2. Set the width of all headers to 33%x:
B4X:
For Each v As View In GetAllTabLabels(TabStrip1)
   v.Width = 33%x
Next

hi erel, i had not time to get to test this code.
i just have tried it and i am not getting the result i wanted.

i get the same result as i would not add this code.

maybe i am doing something wrong? :(


Sorry my mistake, it works perfect!! thank you very much :)
 
Last edited:
Upvote 0
Top