B4A Library AHViewPager library - Sliding panels now perfect

Discussion in 'Additional libraries, classes and official updates' started by corwin42, Jan 18, 2012.

  1. BarryW

    BarryW Active Member Licensed User

    any sample for fixtab?
     
  2. corwin42

    corwin42 Expert Licensed User

    Use the Fixed Tab example of the DesignSupport library. The Tab objects in the AHViewPager library are deprecated and I can't support them anymore.
     
    DonManfred likes this.
  3. woniol

    woniol Active Member Licensed User

    Hi,
    Did You manage to make some progress on adding CoordinatorLayout and CollapsingToolbarLayout feature to the DesignSupport library?
     
  4. corwin42

    corwin42 Expert Licensed User

    Yes but it is still far away from stable and usable.
     
  5. konradwalsh

    konradwalsh Active Member Licensed User

    Hello
    I have read every post on this thread and the design support thread. On the design support thread someone asks a similar question but they were told ot open a post here.. I dont see it


    I am using the sample Navigation View

    I amended the for loop[ to name the pages with my titles as such
    Code:
    Dim titles(3As String = Array As String ("Midweek""Weekend""Others")

        
    Dim p(3)  As Panel
        
    For i = 0 To 2
            
    'Create a panel for the page with a random color.
        
            p(i).Initialize(
    "")
            p(i).Color = 
    Colors.Gray
            
    Dim pageName As String
            pageName = titles(i)    
            PC.AddPage(p(i), pageName)    
            subMenu.AddWithGroup2(
    3100+i, 100+i, pageName, xml.GetDrawable("ic_bookmark_black_24dp"))
        
    Next

    I want to load each panel with a layout file. But I want to be able to use scrollview.
    This is what I am trying with:

    Code:
    p(0).LoadLayout("midweekScoll")
        midweekScroll.Panel.LoadLayout(
    "midweek")
        midweekScroll.Panel.Height = panContent.Top + panContent.Height
        midweekScroll.Panel.Width =  
    75%y
    I see my midweek layout show up but I cant scoll up or down on it.

    It seems that I somehow need to attach my scrollview to the ViewPager control..


    please advise what I am doing wrong





    edit: I somehow posted this is a different thread.. I deleted that thread and posted it here
     
  6. corwin42

    corwin42 Expert Licensed User

    I guess that your scrollview panel is just too small. What is
    panContent.Top + panContent.Height?
     
  7. konradwalsh

    konradwalsh Active Member Licensed User

    Thanks for providing assistance.

    panContent is a panel within the layout file midweek. as that panel is the full size of the layout, I wanted to have the scroll view match.

    The thing is, I can see the layout, I just cant veritcally scroll.
     
  8. klaus

    klaus Expert Licensed User

    If you cannot scroll, I suppose that there is something wrong here:
    midweekScroll.Panel.Height = panContent.Top + panContent.Height
     
  9. konradwalsh

    konradwalsh Active Member Licensed User

    ok, I have removed that line now to make sure and I still have this issue.

    it now looks like this:
    Code:
    p(0).LoadLayout("midweekScoll")
    midweekScroll.Panel.LoadLayout(
    "midweek")

    what I believe I am doing here is loading a scroll view into the ViewPager Panel
    and then loading my layout into the scrollview
     
  10. klaus

    klaus Expert Licensed User

    I meant that the height value is wrong.
    Have you tried to set it to a big value to see what happens.
    Another thought, does the ViewPager consume the scrolling?
     
  11. konradwalsh

    konradwalsh Active Member Licensed User

    OK.. so I went into my layout for midweekScroll. If I remove the anchor points and set it to top and left
    I can now scroll both ways.. but it doesn't fill the page. And scrolls only half way down the content



    maybe i need to use Addview instead of loading a layout file..
     

    Attached Files:

    Last edited: Feb 2, 2017
  12. konradwalsh

    konradwalsh Active Member Licensed User

    And.... here is the solution:

    Code:
    midweekScroll.Initialize(4500dip)
    p(
    0).AddView(midweekScroll,1,1,100%x,4500)
      midweekScroll.Panel.LoadLayout(
    "midweek")
    seems you must use addview instead of the way I was doing it..

    but raises a different problem for me..

    Notice the HEIGHT of the scroll view and panel.. I have set these like this because setting p(0).height or VP.Height gives errors

    ANy thoughts
     
  13. victormedranop

    victormedranop Well-Known Member Licensed User

    Hi, I try this amazing lib. But I have a question :
    I read from a database the amount of panel a need to create, created dynamically
    but I cant choose or does not knw how to delete and specific panel from de sliding group.

    any one?

    Thanks,

    Victor
     
  14. corwin42

    corwin42 Expert Licensed User

    Code:
    AHPageContainer.DeletePage()
     
    victormedranop likes this.
  15. victormedranop

    victormedranop Well-Known Member Licensed User

    :(:(:(:(:(:mad::confused::D
    thanks, Still learning !!!

    Victor
     
  16. corwin42

    corwin42 Expert Licensed User

    No problem. I learn new stuff every day, too. :D
     
  17. victormedranop

    victormedranop Well-Known Member Licensed User

    I was looking for this !!!!!
     
  18. victormedranop

    victormedranop Well-Known Member Licensed User

    What about a bullet to idenfied that there is more panels to the left.
    can be possible ?
     
  19. corwin42

    corwin42 Expert Licensed User

    There is no special view for this but you can create it very easily on your own. Just update the bullets in the PageChanged event.
     
  20. Manuel Martinez

    Manuel Martinez Member Licensed User

    Hi Victor,

    I hope that help you.

    As @corwin42 said, the color is updated in the PageChanged event, you can always change there size and position as you need.

    I use AHviewPager(3.0) and DesignSupport(2.10) libraries
     

    Attached Files:

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