Collapsing Menu in Android - android

I want to display menu items in a GridView-like container on top of the screen with scrollable content below. On scroll I want the GridView to shrink and resize and lock on top of the screen. In other words, imagine a CollapsingToolbarLayout where instead of an expanded image there's a Grid of menu items and instead of the collapsed toolbar there's a single bar of menu items.
Expanded:
Collapsed:
Is it possible to achieve this behavior? What would be the easiest way to do so? Any libs? I would necessarily need to use a GridView, as the number of entries is limited I'm quite flexible in building the layout. Thanks for any tips and hints.

Yes. Try to create two different linear layouts. One for collapsed and one for expanded state. Then manipulate them with setVisibility()
Fill the layouts with apropriate data in onCreate.
If you don't know the exact amout of elements you want to hold inside you expandable field(is is not fixed), consider using something like gridView

Related

Android: Arranging apps which widgets do I use: GridLayout / GridView

I understand the items that are visible to the user will be loaded when using GridView. Does this also applied when using GridLayout?
I currently working on laying out the applications' icon like the applications screen does. When user pressed the icon of the application they are allowed to arrange the icon in an unoccupied space.
At the moment, I don't know which widgets is preferred to use. If GridLayout behave the same as GridView, I would stick with that so no need to change the code.
If you want to be able to drag icons to rearrange them I would consider using GridLayout with RecyclerView. Take a look at Drag and Swipe with RecyclerView
Part Two: Handles, Grids, and Custom Animations.
If you are unfamiliar with RecyclerView and ItemTouchHelper then also look at Part One first

Hide Layout/View on ListView scroll up

Excuse my terrible paint skills, but that's a picture of my proposed layout.
I would like the blue part to be a RelativeLayout. Underneath the blue RelativeLayout is a ViewPager with Tabs, each tab containing a ListView.
What I'd like to do is be able to hide the blue layout as the user scrolls down the ListView, and reappear as the user scrolls up to the top of the ListView.
How can I achieve this?
Please have a look at this library ParallaxScroll
It very easy to implement and it supports both scrollviews, listviews wtc
I use the following to browse for new libraries etc..enjoy :D
You need to use lockable scroll view by this you can put your whole layout into it and lock the scroll at the specific location points on the screen

Which layout and control is suitable for sliding window where icons will be appearing in Android

I am developing an application where i need icons to be floating on my panel. I am not sure which control and layout will be suitable for this. I am attaching an image to make you understand what i mean. I want the same two column icon based layout. And if i will scroll down it should be in a sliding way and scroll down. Please let me know which layout and control is suitable for sliding window where icons will be appearing in Android. I am new bie so i am sorry if its not a good question.
If you have a fixed number of items, you could simply use LinearLayouts (with a ScrollView as the root view of the layout). If you have a large number of items or you don't know in advance how many items you will have, use a GridView (and do not place it inside of a ScrollView).

Pin layout on top of Listview

I need to pin the layout filtering.xml to the top of ListView, but this layout needs to be on the top of this list still, it should be considered as one of the items of the ListView and during the scrolling down should this layout hide.
I tried to use the method addHeaderView with this layout filtering.xml, but then it is considered really as one of the items with only one single touch listener.
Any suggestions?
Not sure if I understand your question but maybe you should use layout inflation to remove the view when you are scrolling?
Or create 2 listviews on top of each other?

ANDROID, what layout elements should I use?

I need to make an android layout like this one.
tile background all over the screen.
top menu which, overlays the background ( note the shadow ).
some sort of a table with text options, maybe pictures, which can be scrolled up and down.
bottom menu, which appears by sliding up after a menu button is hit.
What kind of layout elements do you think I should use for that?
Thanks!
I think you should first learn about the Android Layout and XML layout design, then you can easily prepare this layout as well.
Relative Layout will be the better layout as compare to other layouts like Linear Layout and Table Layout.
To display middle part that is showing textual description may contains ListView (ListView because as you have mentioned Text Options should scroll up and down), but it depends on your requirement.
The RelativeLayout is the most flexible, and I think you can make all this with a minimal hierarchy view depth.
My approach would be to use a RelativeLayout. The Top Menu bar could be a custom class which extends a LinearLayout and this can be used in the RelativeLayout (in fact in any screen you have to provide UI consistency). Similarly, the bottom menu would be a custom control containing the appropriate animations. The rest of the screen would be contained in a ScrollView, possibly containing a TableLayout. I have something very similar using a MapView in the main screen and it works fine.

Categories

Resources