0

Im new to android and practicing with an UI like googleplay apps, this is default view of the list : enter image description here

when i scroll the list view up , the action bar got scrolled up and disappeared , basically my English is too bad and i dont know how or which keyword i must use in google search to get the result like this (as you see it looks like the action bar is inside the listview ) enter image description here

please show me how or give me an example to learn, thank you !

user3193307
  • 503
  • 1
  • 4
  • 8
  • 2
    Guess it is a gridview... – Sreedhu Madhu Oct 31 '14 at 03:55
  • 2
    I think it is GridView with material design : http://www.google.com/design/spec/material-design/introduction.html#introduction-principles – Haresh Chhelana Oct 31 '14 at 03:59
  • 1
    Basically You are/He is asking about the actionbar's hiding on scroll up the view, but not the Gridview itself. For an instance sample (before Lolipop), you should have a look at this: http://www.techrepublic.com/article/pro-tip-maximize-android-screen-real-estate-by-showing-and-hiding-the-action-bar/ From Lolipop, Android introduce new RecycleView (which, i guess, is the GridView here), and the new ToolBar which is playing the roll of the so-called Action Bar. You may want to try to search about using it first! Cheer Vietnamese Developer! – Nguyễn Hoài Nam Oct 31 '14 at 04:01
  • 1
    I found a more-helpful URL for you: http://stackoverflow.com/questions/26655448/android-lollipop-toolbar-scolling – Nguyễn Hoài Nam Oct 31 '14 at 04:08
  • Thank you all especially @Nguyễn Hoài Nam you are totally right, may i have your contact , just for exchanging exp . thanks again – user3193307 Oct 31 '14 at 04:21
  • You can email me here: 8x8BJm5ueQh3@meltmail.com This is a temporary email, will be automatically deleted after 3 hours :). – Nguyễn Hoài Nam Oct 31 '14 at 04:43

2 Answers2

0

you can define your layout structure like following :

<FrameLayout>

    <GridView or RecyclerView/>

    <MenuBar id="menuBar2" visibility="gone"/>

</FrameLayout>

to making the grid be able to scroll with the TitleBar and MenuBar, we should add a Header with GridView, of course RecyclerView would be easier to do this than GridView. the Header layout's structure would be like this :

<LinearLayout orientation="vertical">

    <TitleBar/>

    <MenuBar id="menuBar1"/>

</LinearLayout>

Once the menuBar1 fully scroll off to invisible, display the menuBar2, also synchronizing the menu state between both. The menuBar2 will appearing on top of that LinearLayout. when user scrolling to top and the menuBar1 just visible, hide the menuBar2.

how to determine if a View is fully invisible? the View.getLocalVisibleRect() would tell for this.

Community
  • 1
  • 1
VinceStyling
  • 3,707
  • 3
  • 29
  • 44
0

Check How do the animation hiding the ActionBar and keeping tabs?

It suggests that you use https://github.com/ksoichiro/Android-ObservableScrollView.

Community
  • 1
  • 1
Rui Santos
  • 537
  • 3
  • 15