Android Question SecondDrawer ScrollTo Selected Item

Discussion in 'Android Questions' started by Sgdva, Oct 10, 2018.

  1. Sgdva

    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:
    Code:
    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
     

    Attached Files:

  2. Peter Simpson

    Peter Simpson Expert 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.
     
  3. Sgdva

    Sgdva Member Licensed User

    @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:

    Code:
    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 - 100True)
        
    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: Oct 11, 2018
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice