android-cardview

Shared Element Transition on CardView with radius

你离开我真会死。 提交于 2019-11-28 23:12:23
问题 I've been working on this problem for weeks and I'm still unable to solve this problem. So, I have a CardView that contains a LinearLayout with an ImageView. Without that radius Shared Element Transition works seamlessly. However, when I add radius (app:cardCornerRadius="25dp") to that CardView, the Shared Element Transition looks ugly because it remove the radius first and then start the animation . 1st Approach: ObjectAnimator I create ObjectAnimator to animate the radius value on card, and

How to put a CardView attribute in a style?

♀尐吖头ヾ 提交于 2019-11-28 22:18:26
I have: in a file build.gradle (dependencies) dependencies { compile 'com.android.support:cardview-v7:21.0.+' } in a file styles.xml (styles definition) <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto"> <style name="CardViewStyle"> <item name="android:layout_margin">5dip</item> <item name="card_view:cardCornerRadius">4dp</item> <item name="card_view:cardElevation">4dp</item> </style> </resources> But compiler complains: Error: No resource found that matches the given name: attr 'card_view:cardCornerRadius'. How do I

Add clickListner for button inside a cardView populated using a recyclerView

牧云@^-^@ 提交于 2019-11-28 21:33:45
问题 I have a cardView card_contents.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="150dp" android:layout_marginTop="10dp" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:id="@+id/card_view"> <RelativeLayout android:layout_width="match

How to set the padding for CardView widget in Android L

落爺英雄遲暮 提交于 2019-11-28 21:20:49
问题 I'm using android:paddingLeft and android:paddingTop to set the padding for the new CardView widget but it doesn't work. I can set the margin for all the controls inside the CardView as a workaround but that's a pain if there are too many controls. How to set padding for the new cardview widget? <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_gravity="center" android:layout_width="match_parent" android

How do I expand CardViews to show more detail like Google Keep cards?

故事扮演 提交于 2019-11-28 20:36:50
问题 I have some CardViews in my app and I want them to function like the cards in Google Keep. For example, when I click on a card that has text, it expands (with the animation) into another view. If you're not sure what I mean, create a note on the Google Keep Android app, tap on the card that appears when the note is created. This is exactly what I want to happen in my app. How do I go about doing this? 回答1: New in Lollipop! Activity + Fragment Transitions By declaring "shared elements" that

Unnecessary padding in CardView?

▼魔方 西西 提交于 2019-11-28 18:37:53
I have implemented CardView in my app and everything works fine except there is a little padding around the image if I put radius to the card. It appears like this: But in android docs and in this article the image takes the entire cardview, so can u help me achieve that. My layout file is like: <?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:padding="8dp">

Cardview - white border around card

删除回忆录丶 提交于 2019-11-28 17:51:05
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_parent" android:layout_height="match_parent" android:orientation="vertical"> <!-- some other views --> <

Transparent background on CardView - Android

与世无争的帅哥 提交于 2019-11-28 16:56:04
问题 I want to do transparent background on CardView. I know backgroundColor but i have image on my Layout. Do you know how do it? Or something which work as cardview but i will set a transparent background? Regards 回答1: Setup your CardView to use the cardBackgroundColor attribute to remove color and cardElevation attribute to remove the drop shadow. For example: <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com

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

我怕爱的太早我们不能终老 提交于 2019-11-28 16:54:20
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 thanks It depends by your layout. If you would like a layout like this, with a Toolbar you can achieve it

Expand and collapse CardView

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 16:18:01
问题 What is the proper way to expand a CardView? 回答1: Use an expandable list view with cardview or even You can use wrap content as height of cardview and use textview inside it below title, so on click make the textview visible and vice-versa . but isn't it bad design ? nope it isn't if you give some transition or animation when it's expanded or collapsed If you want to see some default transition then just write android:animateLayoutChanges="true" in parent layout . 回答2: If you are using