B4J Tutorial [ABMaterial] new component ABMTimeLine 1.09

ABMTimeline is a component to present a time line of events. Using the ABMTimeLineElement you can create events, with some assets like images.

Update: Ignore this, I've found a more recent version, but it requires a rewrite of the wrapper
This component is build based on an older version of Timeline.js and has less features that the current version. But it was the last free version I could use.

I also added an extra event '_Clicked' so when the user clicks on the slide, you can react to it (e.g. show a lot more info in a ModalSheet.



B4X:
Dim timeline As ABMTimeLine
timeline.Initialize(page, "timeline", 600, "alain.json","Alains Timeline", "A timeline by Alain Bailleul", "")
timeline.Language = "nl"
 
Dim date1 As ABMTimeLineElement
date1.Initialize("id1", "2016,04,26,16,00,00", "2016,04,26,16,42,00", "event 1", "My event number 1")
date1.SetAsset("../images/about1.png", "../images/about1.png", "OneTwo", "An image")
timeline.AddElement(date1)
     
Dim date2 As ABMTimeLineElement
date2.Initialize("id2", "2016,04,26,17,00,00", "2016,04,26,17,15,00", "event 2", "My event number 2") 
timeline.AddElement(date2)
 
page.Cell(2,1).AddComponent(timeline)

B4X:
Sub timeline_Clicked(Target As String, slideid As String)
   Log(slideid)
   Dim timeline As ABMTimeLine = page.Component("timeline")
   Dim date As ABMTimeLineElement = timeline.GetElement(slideid)
   Log(date.Headline)
End Sub
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…