RecyclerView Item extend beyond boundaries - android

I have a RecyclerView with a fixed height for its items. These items have a expanding menu that does not fit within the ViewHolder, so I would like for it to extend beyond its parents width and height. You can see the issue here:
Is this even possible to achieve?

I found this question as I faced the same issue with an animation that should expand beyond the RecyclerView item bounds.
#Martin Marconcini's comment suggesting to add android:clipChildren="false" to the RecyclerView helped me a lot.
I had to add it also to the item's layout which is a FrameLayout in my case.
After adding that, my animation successfully expanded beyond it's parents bounds.

Related

Is there a way to stack a CardView within a RecyclerView from the bottom instead of from the top?

I'm a newbie when it comes to Android coding, so please bear with me. I looked this up for quite some time before posting here, so that I don't waste your time with a question that I could have answered myself through some research.
Here's my issue: I have a CardView and I want the items to start popping up from the bottom instead of from the top. For example, something like this.
I found out that you can do this via the "stackFromBottom" XML attribute in ListViews and GridViews, but it doesn't work for CardViews.
I also noticed that you can change a ListView's gravity, but CardView doesn't seem to support that either.
So is there a simple way to populate the CardView in this way?
Any help would be greatly appreciated.
CardView can hold only a single item, so in this case you can have a ViewGroup inside the CardView , and add those items to the ViewGroup.
I'd suggest ConstraintLayout and constraint the first view to the bottom of the layout and next views are constraint to their bottom views so that you can fill them from the bottom.
If your list is big.. You can wrap the ConstraintLayout with ScrollView so that the items can be scrolled; or replace the entire approach by a RecyclerView
Since you said that you are using a recycler view you could use a simple property to accomplish what you need.

Recyclerview doesn't actually Recycle Views?

I read that RecyclerView should never have layout_height="wrap_content" because it won't recycle the views.
I tested this by creating that with 100 items.
I scrolled to the bottom and used layoutInspector. It showed only a couple items under the RecyclerView, not 100. I also tested with a recycerview layout_height=200dp and saw the same result.
It seems the views are still being recycled. Am I misinterpreting what he's saying or are layout_height=wrap_content and layout_height=fixedDp irrelevant to recycling?
android:layout_height values of wrap_content or a fixed height are irrelevant to recycling.
However, android:layout_height="wrap_content" is not a good idea in general for vertically-scrolling widgets, such as a RecyclerView with a vertical LinearLayoutManager. Since the content varies, the size may be unpredictable. Use something else to control the height to be what you want regardless of the content, such as constraining its top and bottom within a ConstraintLayout.

RecyclerView Height Expand and Collaps?

Initially I set Fixed Height of Recyclerview in xml. Then I am Trying to Expand Recyclerview Height and Collaps it cannot be modified properly. Anyone Send the any libraries which is suited for me or How to resolved it.
i think you need this expandable-recycler-view or Expandable Recycle View

How linearly increase and decrease height of Horizontal RecycleView in android

I have Horizontal cyclic ReacycleView. but I want in recycle view's middle item(ImageView) height be greater as compared to other side items.
Recycle view items
That means if any item in the center of RecycleView, it's height should be greater in RecycleView itself.
You can use a different layout for your middle item by implementing getItemViewtype() in your adapter. Similar question and answer here should point you in the right direction.
I created a sample app with this functionality and here is code.
Let me know if you need some explanation.
You need to create A custom layout manager and Item Transformer
CenterLayoutManager
Repository
ScaleTransformer

Horizontal RecyclerView with expandable height

I would like to reproduce this behavior on Android
This is a simple horizontal RecyclerView where all the child items can be expanded with an animation.
https://www.youtube.com/watch?v=JI323jA67x0
But unfortunately, I don't see how to achieve this with standart recyclerview.
I have had multiple ideas, but I don't see how I can achieve in a correct way.
1) modifying the whole recyclerView heigth at runtime, but I need to mesure a children and give it an height with measured dp ?
2) setting visibility to all children TextViews from Visible to Gone, but seems horrible...
3) ???
Thank a lot for any advice.

Categories

Resources