android-cardview

Touch feedback with RecyclerView and CardView

社会主义新天地 提交于 2019-11-26 23:52:55
问题 I would love to enable touch feedback for my Open-Source library. I've created a RecyclerView and a CardView . The CardView contains different areas with different onClick actions. Now I would love to trigger the Ripple effect if a user clicks anywhere in the card, but I'm not able to achieve this behavior. This is my listitem, You can find it on GitHub too: https://github.com/mikepenz/AboutLibraries/blob/master/library/src/main/res/layout/listitem_opensource.xml <RelativeLayout android

Android-L CardView Visual Touch Feedback

£可爱£侵袭症+ 提交于 2019-11-26 23:47:17
could anybody explain to me how to implement some of the visual touch feedback that was demonstrated at Google I/O 2014 within a CardView. Here is how I am using the CardView in XML, there is probably something small that I am missing, so I just wondered if anyone could help me?. <!-- A CardView --> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/CardView_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" card

How to know when the RecyclerView has finished laying down the items?

狂风中的少年 提交于 2019-11-26 22:36:14
问题 I have a RecyclerView that is inside a CardView . The CardView has a height of 500dp, but I want to shorten this height if the RecyclerView is smaller. So I wonder if there is any listener that is called when the RecyclerView has finished laying down its items for the first time, making it possible to set the RecyclerView 's height to the CardView 's height (if smaller than 500dp). 回答1: I also needed to execute code after my recycler view finished inflating all elements. I tried checking in

Make ImageView fit width of CardView

北慕城南 提交于 2019-11-26 22:35:21
问题 I have a CardView with rounded corners, I want to have an ImageView at the top like shown in the example taken from the material design guidelines below. <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_width="wrap_content" android:layout_height="wrap_content" card_view:cardCornerRadius="4dp"> <!-- ... --> </android.support.v7.widget.CardView> Then inside the CardView I have this ImageView <ImageView

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

百般思念 提交于 2019-11-26 22:19:02
问题 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:/

How do I get the position selected in a RecyclerView?

别来无恙 提交于 2019-11-26 22:03:30
I am experimenting with the support library's recyclerview and cards. I have a recyclerview of cards. Each card has an 'x' icon at the top right corner to remove it: The card xml, list_item.xml : <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/taskDesc" android:layout_width="wrap_content"

How to use RecyclerView and CardView

白昼怎懂夜的黑 提交于 2019-11-26 21:56:59
问题 I don't have much experience in android development and try to implement RecyclerView in my application. The version of android studio does not have Android L neither there is option to install. Everytime it says android.support.widget.v7.RecyclerView in not used and disabled it from import packages. I give refrences in layout file also in Gradle.build but my problem is still there anyone help please? 回答1: Follow this line CardView and RecyclerView in Material Design http://icetea09.com/blog

RecyclerView items don't fill width

守給你的承諾、 提交于 2019-11-26 21:24:09
问题 I have designed a layout with map fragment and recyclerView. Each recyclerView item is cardview (I have specified give the xml layout). The problem is RecyclerView item doesn't fill screen width. img here I tried to change layout_width to fill_parent , match_parent ... but it can't help Here is the layout for each item <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget

Error inflating class and android.support.v7.widget.CardView

陌路散爱 提交于 2019-11-26 20:45:47
I want to use CardView in my project, but when I run my application, I get the following error. I'm using Eclipse . Error: Error inflating class and android.support.v7.widget.CardView The graphical view of my xml file says 'The following classes could not be instantiated: - android.support.v7.widget.CardView (Open Class, Show Error Log) See the Error Log (Window > Show View) for more details.' Please help. This is the layout for my fragment where I have used CardView <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android

Android CardView remove padding

三世轮回 提交于 2019-11-26 19:57:36
问题 how do I get rid of this strange padding in the layout below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@color/ColorPrimaryDark"> <android.support.v7.widget.CardView android:layout_width="fill_parent" android:layout_height="wrap_content" card