android-recyclerview

Toolbar inside CardView to create a popup menu (overflow icon)

六眼飞鱼酱① 提交于 2019-12-17 22:08:57
问题 I have a list that looks like google play in a recyclerview with cardview, and works perfect. I need to add a popup menu (with overflow icon), like this: which is the best way to do this ? I researched and found that there are 2 options: 1 - with a toolbar inside the cardview layout. is there a performanece problem with this solution ? 2 - with a imagebutton or imageview with a icon of the overflow, that when you click the menu is created. I need a solution to be compatible with >= API 10

Ripple effect over a RecyclerView item containing ImageView

帅比萌擦擦* 提交于 2019-12-17 21:49:14
问题 I have a RecyclerView that expands the following grid item : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/children_tile_border" android:layout_marginTop="@dimen/children_tile_border" android:clickable="true" android:focusable="true" android:background="?selectableItemBackground" tools:ignore="RtlHardcoded"> <com

Android Horizontal RecyclerView scroll Direction

丶灬走出姿态 提交于 2019-12-17 21:42:39
问题 I made a Horizontal RecyclerView and it works fine(thanks to this) but the direction of scroll and data are expand from left to right; then How can I change the RecyclerView scroll direction like in the picture below? My Code: StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager( 2, //The number of Columns in the grid LinearLayoutManager.HORIZONTAL); 回答1: Assuming you use LinearLayoutManager in your RecyclerView, then you can pass true as third argument in

Span multiple columns with RecyclerView

风格不统一 提交于 2019-12-17 21:40:08
问题 So what I am trying to go for is having a staggered layout but the first item in the list needs to span two columns. The first two rows are also a fixed height. I have everything working except the first item spanning two columns. I am using the RecyclerView.Adapter with the StaggeredGridLayoutManager. Doesn't seem like it is out of the box functionality. I assume I can make a custom layout manager I'm just not sure where to start. I have tried searching but I can't find anything about how to

Is there any simple implementation or tutorial to implement RecyclerView in android?

狂风中的少年 提交于 2019-12-17 21:32:42
问题 I am trying to port my existing project to material design but am unable to understand the implementation of RecyclerView. My old code uses a ListView but I want GMail app like lists. I have read tons of tutorials but most of them either skip the ItemDecoration part or the ClickListener part. Different tutorials have entirely different implementations and code varies to the point that I am unable to understand where to put what. I am struggling in the following, which I compiled by reading

how i highlighted item in first launch of app in recycle

心已入冬 提交于 2019-12-17 21:22:44
问题 I have integrated item is highlighted in the first launch of the app in my project. I'll use to save the selected item on the click of the adapter in the SQL database and set the value in the first launch of the app, but it does not change the background and text color. please help me in solving the issue and suggest me the right way public class LoadVehicleTypeAdapter extends RecyclerView.Adapter<LoadVehicleTypeAdapter.CarTypesHolder> { private List<TaxiTypeResponse.Message>

How do I make my button which is fixed at the bottom of a layout scroll, once the recyclerview on top grows in size

为君一笑 提交于 2019-12-17 21:10:40
问题 I have a very basic yet difficult issue where I have a button fixed at the bottom of the view, but below recyclerview container. Once the container size grows, I want the button to go below the recyclerview (scrollable) instead of being fixed at the bottom of the view.Is there a way to achieve this? I have looked online for a couple of ideas but didn't find anything quite like it yet. i am basically using <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout

RecyclerView in Fragment - No Adapter Attached, Skipping Layout

本小妞迷上赌 提交于 2019-12-17 20:53:18
问题 I have an odd situation, I have an Activity hosting a TabLayout/Viewpager that populates data based on changes to a Firebase Database. Unfortunately, the RecyclerView is not being populated, and I am receiving the error below in my logcat. I believe the fragment is being loaded even when it is not on screen, which is causing an error in the population of the RecyclerView . It is also weird as the RecyclerView does populate when I rotate the screen: 12-13 21:31:40.013 12490-12490/com

view full screen image when item from recycler view clicks

我只是一个虾纸丫 提交于 2019-12-17 20:33:19
问题 I am new to android.I have a RecyclerView which shows list of images from a json.I want to do showing image full screen when item from RecyclerView clicks.Also it should be able to zoom in and out.(Like gallery).Zooming functionalty is done using Photoview Library.But viewing full screen a item is not done.Adapter class code is attached below.Please anyone help me to do this. @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { final MyHolder myHolder =

Is there any way to pass data from Fragment to it's Adapter's onBindViewHolder?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 20:33:14
问题 I have a RecyclerView in my Fragment and I want to pass data from the Fragment to MyAdapter. Please, tell me if there is any way to do this or if there is a better way to do this. public class Monday extends Fragment { protected RecyclerView mRecyclerView; protected RecyclerView.Adapter mAdapter; protected RecyclerView.LayoutManager mLayoutManager; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R