How can I make RecyclerView slide in and out of the screen? - android

I need to achieve the following behavior:
I have an activity with some data and views in it. At the bottom there is a search bar. What I need is to make RecyclerView slide into the screen or just pull it up when you start typing in the search bar. When RecyclerView is on the screen and user keeps scrolling down I need to collapse it back to the starting position.
What would be the right approach to achieve this behavior?

You can use BottomSheetDialog as an option and put there your recycler as a part of its layout.
Here is the design guidelines and here is the implementation.

Related

Using BottomSheetBehavior to show fragments

I'm trying to use the BottomSheetBehavior from Material. The problem is that it is not well described and no enough examples of it are available.
One example on Meduim, but it only shows the basics and very simple implementation.
What I exactly need is something like the one from Material here. But instead of clicking on the menu item to show the BottomSheet, I want to show it when user selects an item from RecyclerView. Also the peek height should show only the first element in the BottomSheet layout until the user pulls it up.
How to get this approach? Are there any useful example?
Make the bottom sheet hidden when you start your activity or fragment by calling bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN).
And in your adapter's onClick, make the bottom sheet visible, by calling bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HALF_EXPANDED)

Sliding Card Design

I am looking for some ideas on how to best achieve this effect. I have two fragments, one containing the map (and all controls) and another fragment that contains my RecyclerView to display the results. In my activity layout I would like to position my map and list fragments exactly how it is shown in this video. The map fragment shall stay aligned with the topmost edge of the list unless the user is actively scrolling the list upwards. The video I recorded should demonstrate what it is I am trying to achieve.
From an explanatory standpoint, I need view and layout ideas. I have already implemented all the necessary callbacks for all user interactions between the two fragments and the activity. One item in particular I am most interested hearing feedback on is how to align two views and then have the lower slide over the view when the user starts scrolling. Notice how the list (when showing) will not scroll downward.
One method I can suggest is to have both the map and the ListView in the same fragment and try this. It's the sliding drawer animation in Play Music.
For the part where touching the map shrinks the list view to a bar on the bottom. I suggest you create animations in the listView to shrink and to expand and call them on event Down and Up respectively. Here is the MotionEvent.

Android - Click Toolbar that is overlayed by a view

Here's my current situation: I can't click on the toolbar because there is a view that is overlapping it intercepting the touch responses. I'll expand: I'm making a music app. In the music app, there is a list of songs that is beneath the toolbar. However, once you click on a song, a panel opens up and slides up over the toolbar and continues into a transparent status bar. Pictures of this will be attached.
Now, obviously because this view is overlapping the toolbar I cannot actually use the toolbar for any touch events. But I need to. I cannot move the view below the toolbar because then my sliding up panel is limited to beneath the toolbar instead of overlapping it. If there is anyway to get around this, please let me know. I'd very much appreciate it.
So, in my current situation, I thought maybe I'd be able to touch the portion of the view that covers the toolbar and send that data to the view that contains the toolbar so I can detect touches on the toolbar. However, I cannot figure out how to do this, or even if it is possible.
My question is: How can I detect touches in the view beneath another view?
Here are the pictures:
Here is the list of songs:
And here is when the song panel is opened(I'm using an image of a tiger for any song that doesn't have art at the moment):
Thanks!
wtf?
You want that your user can touch on the toolbar which is not visible at the moment because its overlapped by another view? What kind of user would expect such a user experience?
I mean:
How does the user even know that he can click on a not visible element ^^
If the user magically knows somehow that he can click, how does he know where exactly he has to click. For example, he could also click on one of the toolbar menu items, but if he clicks a few pixel more left, then he would click on toolbar item 1 instead of toolbar item 2.
However, you have three possibilities:
You can make the overlapping view not clickable by overlappingView.setClickable(false);.
You could add a transparent view with an OnClickListener that has the same width and height as the toolbar over the overlapping view. In the OnClickListener you could simply invoke the desired method like onOptionsItemSelected() (fake the required parameters) or use an EventBus for communication.
Similar to the 2. option add a transparent view, but instead of setting a OnClickListener set a OnTouchListener by extending from View) and forward the MotionEvent to the Toolbar by calling toolbar.onTouchEvent(motionEvent);
If you really want to detect touch events of a view beneath another view you could set onTouchEvent of the foreground view to false. However, I advise you to rethink the layout in order to put the Toolbar on top so the users can see it otherwise they don't know what they are clicking on.

How to implement custom listview with "stacking" feature Android

I want to create a custom listview that scroll horizontally and stacks the last 4 items in the view instead of allowing them to go off screen. The stack should look something like this: . So if a user scrolls all the way to the left they see a regular listview, but as they scroll right, if an item was supposed to go off screen, it is instead stacked behind the last item in the list, with a max of 4 stacks. What's a good basic way to accomplish this? I already found the horizontally scrolling listview library I wanted to use but don't know where to start on the stacking part.

Show Bottom Buttons Bar in ListView while scrolling up and hide when scrolling down

I have a huge listview, with a Bottom bar with three buttons in them. Now, my question is, Is there a way to hide the bottom bar (With Buttons) while scrolling down, and show them up while scrolling up the listview?
Just like how Google+ Handles in the iOS App.
I found another link with the facebook pattern, Android Listview Floating First Row
It has one answer,
It's called the Quick Return pattern, and Roman's explained it in detail along with an example here: https://plus.google.com/u/0/+RomanNurik/posts/1Sb549FvpJt

Categories

Resources