Android Question SecondDrawer ScrollTo Selected Item

Sgdva

Member
Licensed User
Background:
I need to scroll in a fragment view to an element in a quick way. I am using the Design support library with the second drawer option, however, whenever I scroll on it and click, it only scrolls to the first tab, and not to the one selected.
Problem:
I have not found a way on how to call the "ScrollTo" event in this second drawer.
Code:
I am not sure if it worths on how I created the second drawer, but this is what I have so far:
B4X:
Sub Activity_Create(FirstTime As Boolean)
...
ObjNavDrawer.AddSecondaryDrawer(150dip, ObjNavDrawer.GRAVITY_END)
...
End Sub

Further thoughts

I am trying to get the second drawer through the properties of ObjNavDrawer, however, I have not found a way to do so

Attached you may find the gif on the general idea and background of the problem
 

Attachments

  • prueba.gif
    prueba.gif
    500.4 KB · Views: 144
  • ishikawa.zip
    204.3 KB · Views: 119

Sgdva

Member
Licensed User
Can you create a small example project, zip it up and post it in this thread @Sgdva?
I've not had that issue using DesignSupport.
@Peter Simpson I do not have problems on uploading the actual version (attached in the first post)
Edited:
I just realized that I did a mistake when closing the drawer:

B4X:
Sub ObjNavDrawer_NavigationItemSelected (MenuItem As ACMenuItem, DrawerGravity As Int)

...
    If MenuItem.id < 100 Then ' 1. If MenuItem.id < 100
    Checked_Item(ObjNavDrawer)
    Else ' 1. If MenuItem.id < 100
    ViewPagerMain.GotoPage(MenuItem.Id - 100, True)
    End If ' 1. If MenuItem.id < 100
    ObjNavDrawer.CloseDrawers
End Sub
I needed to indicate to the viewpager where to go when the menu id is selected, not as a scrolling command
 
Last edited:
Upvote 0
Top