recyclerview-layout

RecyclerView expandable cardView

我是研究僧i 提交于 2019-12-04 00:34:27
问题 I make small project with RecyclerView with CardView items inside. I created expandable card (expanded by pressing on small button inside the card). Each card always contain visible part (id:top_layout) and expandable part (id:expandable_part_layout). Problem is that when I expand last item or item which after expand has bottom edge below bottom edge of RecyclerView (some part of item or expanded item is invisible to user) the RecyclerView should scroll up all items to show whole item that I

Android: How do I return to newly created RecyclerView list?

痞子三分冷 提交于 2019-12-02 18:15:42
问题 I create a RecyclerView list with a default layout. I then add one new item to the list and the layout updates to show the new item. I then navigate to a previous activity. When I return to the RecyclerView activity I am returned to the generic, default list and my new item in the RecyclerView list is gone. So how do I return to the RecyclerView and the new item that I created rather than the generic list? Do I need to add some code that says if the size of the adapter is > 0 then don't

How to make a page indicator for horizontal recyclerview

早过忘川 提交于 2019-12-02 15:37:17
Any idea how to create a page indicator for recyclerview list ? You can add an indicator by using RecyclerView.ItemDecoration. Just draw some lines or circles at the bottom and use layoutManager.findFirstVisibleItemPosition() to get the current active item. Since pagers tend to fill the whole width this is an accruate way of getting the displayed item. This also allows us to calculate the scrolling distance by comparing the childs left edge to the parents. Below you find a sample decoration that draws some lines and animates between them public class LinePagerIndicatorDecoration extends

Android: How do I return to newly created RecyclerView list?

走远了吗. 提交于 2019-12-02 11:32:14
I create a RecyclerView list with a default layout. I then add one new item to the list and the layout updates to show the new item. I then navigate to a previous activity. When I return to the RecyclerView activity I am returned to the generic, default list and my new item in the RecyclerView list is gone. So how do I return to the RecyclerView and the new item that I created rather than the generic list? Do I need to add some code that says if the size of the adapter is > 0 then don't create a new list use the existing one? And should I be doing the test in the RecyclerView activity or in

how i highlighted item in first launch of app in recycle

徘徊边缘 提交于 2019-12-02 08:29:01
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> CarTypesModelsList; private Context mContext; VehicleTypeView vehicleTypeView; int I=-1; int idd=0; Activity activity;

How to get clicks on RecyclerView (NOT the children)

懵懂的女人 提交于 2019-12-01 14:57:33
问题 Is there any way to set an onClickListener on a RecyclerView ? I have a RecyclerView with some children in it, and setting an OnClickListener on the parent RecyclerView . However, the onClick doesn't fire when I click on that view. See sample code below -- we want to get clicks on the parent, NOT the children. In this scenario we don't care about clicks on the items. I have tried doing setFocusable(false) , setClickable(false) , and setOnClickListener(null) on the children to no avail. In any

RecyclerView expandable cardView

China☆狼群 提交于 2019-12-01 03:31:10
I make small project with RecyclerView with CardView items inside. I created expandable card (expanded by pressing on small button inside the card). Each card always contain visible part (id:top_layout) and expandable part (id:expandable_part_layout). Problem is that when I expand last item or item which after expand has bottom edge below bottom edge of RecyclerView (some part of item or expanded item is invisible to user) the RecyclerView should scroll up all items to show whole item that I expanded. I tried use scrollToPosition and similar methods to scroll to end of expanded card but

How to properly set elevation value to recyclerview?

一个人想着一个人 提交于 2019-12-01 02:37:25
I am working on grid layout using recyclerview in android. The grid occupies a portion of the screen and has a shadow. To get the desired shadow effect I am using an elevation value of 12 dp. But it does not seem to work as I cannot see any elevation (shadow) of the grid. Why is this happening? Does recyclerview not support elevation? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:id="@+id/activity_grid_layout" android:background="

How to get view from RecyclerView at specific adapter position and get values from those views?

你说的曾经没有我的故事 提交于 2019-11-30 21:15:45
I have RecyclerView having an ImageView and a TextView for each row layout.In ViewHolder in RecyclerViewAdapter, I have click listener as v.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Images i=list.get(getAdapterPosition()); i.setFlag(!i.getFlag()); list.set(getAdapterPosition(),(i)); notifyDataSetChanged(); } }); In that click listener I am changing Boolean flag such that it can show either an item is selected or not. Depending on it's value I want to Traverse entire ArrayList by checking for(int i=0; i<images.size(); i++){ if(images.get(i).getFlag(

RIpple effect on RecyclerView not working on light tap

两盒软妹~` 提交于 2019-11-30 10:28:30
I have tried to implement the ripple effect on my RecyclerView. Here's my layout for it : <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card" android:layout_marginTop="7dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardCornerRadius="5dp" android:clickable="true" card_view:cardElevation="5dp" android:focusable="true" android:foreground="?android:attr