android-cardview

CardView inside RecyclerView has extra margins

£可爱£侵袭症+ 提交于 2019-11-27 13:05:22
I am using a CardView as element inside a RecyclerView. When doing so android automatically generates margins between the cardView and the screen and between different cardViews. <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/galleryCardBGColor" app:cardCornerRadius="2dp" > <android.support.v7.widget.RecyclerView android:id="@+id/my_recycler_view" android:layout_width="match_parent" android:layout

How to add colored border on cardview?

旧城冷巷雨未停 提交于 2019-11-27 12:03:16
问题 I am new to Android and this is my first question here. I am trying to add a colored vertical border at the beginning of the cardview. How can I achieve it on xml ? I tried adding it with empty textview but it is messing up the whole cardview itself. Please check the picture link posted below for example. Colored Border on Cardview activity_main.xml <android.support.v7.widget.CardView android:layout_width="fill_parent" android:layout_height="wrap_content" card_view:contentPadding="16dp" card

Cardview - white border around card

青春壹個敷衍的年華 提交于 2019-11-27 11:03:35
问题 I am using a cardview as the root of a custom view I am writing. I using the v7 support library. My XML looks like this: <?xml version="1.0" encoding="utf-8"?> <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:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginRight="6dp" card_view:cardElevation="0dp"> <LinearLayout android:layout_width="match

No shadow/elevation underneath second card if there are two card in the layout. Why?

旧时模样 提交于 2019-11-27 09:52:47
I have 2 cards in a single RelativeLayout . The problem is that there is no elevation or shadow underneath the second card. See the screenshot here: screenshot Here's what I have done in the xml file: <?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:layout_height="match_parent" android:background="@color/colorPrimary" xmlns:app="http://schemas.android.com/apk/res-auto" android:paddingBottom="@dimen/activity_vertical_margin" android

What is the best practice to group items into CardView?

独自空忆成欢 提交于 2019-11-27 09:36:49
问题 CardView usually used to decorate exactly one element. But sometimes you need to wrap into this widget several items. Like in Inbox app, for example. So what is the best way to do this? It can be implemented via custom LayoutManager or even custom ItemDecoration. Implementation of custom LayoutManager is not an easy task(with full support of animations, item decorations, etc). In the second option, the drawing of the boundaries must be implemented manually, ignoring CardView(and Android-L

How to implement setOnScrollListener in RecyclerView

◇◆丶佛笑我妖孽 提交于 2019-11-27 06:58:11
How Do I show progress bar at bottom when user reached to items those are visible in a list. I have written a code in which i am getting data using web service, now i would like to populate partial records, because i have around 630 records in my JSON. Here is my whole code which i am using to get data from JSON and to populate into RecyclerView. Here is how my JSON looks, but real JSON contains over 600 records: http://walldroidhd.com/api.php Can someone guide me where i have to make changes in my code ? I want to populate more records whenever user do scroll to bottom using progressbar,

Parent click event not firing when recyclerview clicked

吃可爱长大的小学妹 提交于 2019-11-27 06:39:33
问题 I have a RecyclerView which is in a CardView that has a couple of TextViews. The CardView has a OnClickListener set and is fired off when clicking on the TextViews, but does not fire when clicking on the RecyclerView. Here is what the CardView looks like: <?xml version="1.0" encoding="utf-8"?> <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_view" android:layout_width=

recyclerview is not fit for all screen sizes

时间秒杀一切 提交于 2019-11-27 02:13:37
I am using recylerview and gridlayout manager with cardviews for each row, my row view(childview) is not responsive at all. I want to show 15 cardviews in such a way that in portrait mode all my 15 childview should be visible and my recyclerview should not be scrollable whereas in landscape mode it should act vise versa( should be scrollable) I have tried many soultions suggested on SO but nothing seems to be working. current behaviour on different screen sizes are as follows In the above attached screen shot ,the 3rd column, 4th and 5th row are not visible In the above given screen my ui fits

How to add swipe functionality on Android CardView?

一世执手 提交于 2019-11-27 00:58:29
问题 I have a single CardView that contains two TextViews and two ImageViews. I want to be able to swipe left and right to "dismiss". I actually want swipe right to send an Intent but that can be done later. For now, I want to be able to dismiss the CardView by swiping left or right. I also want the animation of swiping. I tried using romannurik's SwipeDismissTouchListener but the CardView does not respond to swiping. If anyone has a better solution than romannurik's custom listener, please share.

CardView not showing Shadow in Android L

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 23:57:20
My Cardview inside Listview is not showing shadow in Android L(Nexus 5). Also the round edges are not properly shown. Here is the code for Listview's Adapter View : <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res/com.example.myapp" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <android.support.v7.widget.CardView xmlns:card