Android Question Scrolling BreadCrumb

DawningTruth

Active Member
Licensed User
I am finding that my breadcrumbs are becoming too large to fit on the screen. I would like to make the breadcrumb horizontally scrollable using CustomListView but am stumped. Can someone please guide me?

Here is my current unsuccessful attempt.

Not too sure what to use for the object parameter:
clv_ScrollingBreadCrumb.Add(CreateBreadCrumbItem(),)

Need help here too:
Private Sub CreateBreadCrumbItem() As B4XView

'Create BreadCrumb
    
    Dim scrollingBreadCrumbs As CustomB4XBreadCrumb =  'How do I create the breadcrumb here
    
    'How do I add the breadcrumb to the panel'   
.....

PS: If there is a simpler way to attain the same objective using CustomB4XBreadCrumb, happy to explore that option too.
 

epiCode

Active Member
Licensed User
check out TextCrumb

It does not use CLV but it will give you an idea of how you can implement the same using CLV.
In your case there is no CustomB4XBreadcrumb but simple text you have to add to CLV at each level.
 
Upvote 0

DawningTruth

Active Member
Licensed User
check out TextCrumb

It does not use CLV but it will give you an idea of how you can implement the same using CLV.
In your case there is no CustomB4XBreadcrumb but simple text you have to add to CLV at each level.
Thx, I did look at that option. Ideally, I would prefer to continue using the CustomB4XBreadCrumb module as the code is already written for this module.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
I would prefer to continue using the CustomB4XBreadCrumb module as the code is already written for this module.
The view is unfortunately not designed for this, I tried to create a modified version, but the total width never matches the items that should be displayed, I could not figure out where the problem lies.
 
Upvote 0

DawningTruth

Active Member
Licensed User
The view is unfortunately not designed for this, I tried to create a modified version, but the total width never matches the items that should be displayed, I could not figure out where the problem lies.
Ok thx. I suppose I will have to rethink the whole approach then. Any thoughts on how you ended up tackling the solution?
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Any thoughts on how you ended up tackling the solution?
B4X:
    Dim xpnl As B4XView = xui.CreatePanel("")
    xpnl.SetLayoutAnimated(0,0,0,Root.Width,CustomListView1.AsView.Height)
    xpnl.LoadLayout("frm_BreadLayout")
    CustomListView1.Add(xpnl,"")
    
    
    Dim lst_Items As List
    lst_Items.Initialize
    
    For i = 0 To 20 -1
        lst_Items.Add(i+1)
    Next
    
    B4XBreadCrumbCustom1.Items = lst_Items
    
    CustomListView1.ResizeItem(0,B4XBreadCrumbCustom1.FullItemWidth)
    CustomListView1.GetPanel(0).Width = B4XBreadCrumbCustom1.FullItemWidth
    B4XBreadCrumbCustom1.Base_Resize(B4XBreadCrumbCustom1.FullItemWidth,B4XBreadCrumbCustom1.mBase.Height)
 

Attachments

  • Test.zip
    34.2 KB · Views: 174
Upvote 0

juan vaejo

New Member
I am finding that my breadcrumbs are becoming too large to fit on the screen. I would like to make the breadcrumb horizontally scrollable using 192.168.100.1 192.168.1.1 CustomListView but am stumped. Can someone please guide me?

Here is my current unsuccessful attempt.

Not too sure what to use for the object parameter:
clv_ScrollingBreadCrumb.Add(CreateBreadCrumbItem(),)

Need help here too:
Private Sub CreateBreadCrumbItem() As B4XView

'Create BreadCrumb
   
    Dim scrollingBreadCrumbs As CustomB4XBreadCrumb =  'How do I create the breadcrumb here
   
    'How do I add the breadcrumb to the panel'  
.....

PS: If there is a simpler way to attain the same objective using CustomB4XBreadCrumb, happy to explore that option too.
I'm interested in this code how did you work it out ?
 
Upvote 0

DawningTruth

Active Member
Licensed User
I'm interested in this code how did you work it out ?
Alexander's example above will explain to you how it is done.

Here is the modified code from his B4X Main Page. I basically just added the event and changed the names of the breadcrumbs.

Modified B4X Main Page:
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region

'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip

Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI

    Private CustomListView1 As CustomListView
    Private B4XBreadCrumbCustom1 As B4XBreadCrumbCustom
End Sub

Public Sub Initialize
    
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("frm_main")
    
    Dim xpnl As B4XView = xui.CreatePanel("")
    xpnl.SetLayoutAnimated(0,0,0,Root.Width,CustomListView1.AsView.Height)
    xpnl.LoadLayout("frm_BreadLayout")
    CustomListView1.Add(xpnl,"")
    
    
    Dim lst_Items As List
    lst_Items.Initialize
    
'    For i = 0 To 20 -1
'        lst_Items.Add(i+1)
'       
'    Next
    
    lst_Items.Add("long item 1")
    lst_Items.Add("long item 2")
    lst_Items.Add("long item 3")
    lst_Items.Add("long item 4")
    lst_Items.Add("long item 5")
    
    B4XBreadCrumbCustom1.Items = lst_Items
    
    CustomListView1.ResizeItem(0,B4XBreadCrumbCustom1.FullItemWidth)
    CustomListView1.GetPanel(0).Width = B4XBreadCrumbCustom1.FullItemWidth
    B4XBreadCrumbCustom1.Base_Resize(B4XBreadCrumbCustom1.FullItemWidth,B4XBreadCrumbCustom1.mBase.Height)
    
End Sub


Private Sub B4XBreadCrumbCustom1_CrumbClick (Crumbs As List)
    
    Log("BreadCrumb Click")
    
End Sub
 
Upvote 0
Top