android-cardview

White border around dark themed CardViews

偶尔善良 提交于 2019-12-10 16:51:32
问题 I have a custom control that extends CardView. I am adding it to a linear layout so that I can create a grid of cards. I'm not using a ListView or RecyclerView. I wanted to set up a gap between the cards within the linear layout, so I defined a margin. THe card layout is using the dark theme. My application is using the default material theme (dark). I'm testing on a Pixel C, Android 6.0.1. <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns

How do I decrease the space between cards in a CardView within a RecyclerView?

牧云@^-^@ 提交于 2019-12-10 16:22:58
问题 I'm working on a layout for the main screen of my app. I'm using a RecyclerView with a grid layout and a CardView within that. I'm trying to decrease the space between each card. A screenshot is below (with layout outlines turned on) as well as my layout files. How can I get each card to be a bit closer to each other vertically as well as horizontally? I've been playing around with margins a lot and I just can't seem to find the right margin or padding value to do this. Thanks for any help!

Element LinearLayout is not allowed in CardView

♀尐吖头ヾ 提交于 2019-12-10 03:14:19
问题 Note: PLEASE READ THE QUESTION before mark it as duplicate! I've mentioned that the similar question has not solved my problem. I am using android.support.v7.widget.CardView for my layout xml. However when I place a LinearLayout within the CardView , Android Studio gives me the following error " Element LinearLayout is not allowed here ". In fact ANY types of widgets (like TextView) would cause this error, I have tried solutions from LinearLayout flagged if used in CardView link, which was to

create view over cardview in android

家住魔仙堡 提交于 2019-12-10 00:59:01
问题 I want to create this layout this is a cardview (gray view) and imageview(blue view) for that i use this code <FrameLayout 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="match_parent" android:background="@color/abc_search_url_text_normal" android:orientation="vertical"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="100dp"

Make RecyclerView to wrap its content when using CardView with square ImageView

余生颓废 提交于 2019-12-09 23:39:22
问题 I am trying to achieve following structure (image below). As you can see there are two sections with RecyclerView s and CardView s in it. These two sections are divided by two TextView s with Button s. Each section should match screen width (minus indent between cards). Each CardView has square ImageView in it. So the height of CardView itself depend on screen width: card_height = screen_width - indent_between_cards + space_for_card_text . To achieve this behaviour I use simple

ImageView scaleType=“fitXY” is not working in pre-lollipop device inside the Cardview | Android

故事扮演 提交于 2019-12-09 12:38:24
问题 I have ImageView which is inside the CardView as below in my code. My ImageView scaleType="fitXY" is not working on pre-lollipop devices.But it looks better on Lollipop devices. Please look at below images. As we see in above image there is white padding around the imageview which i want to remove, I want to look alike image on both pre-lolipop and post lolipop devices. Please help me to short out from the problem. Thanks :) <android.support.v7.widget.CardView android:layout_width="match

How to add OnClickListner to CardView?

霸气de小男生 提交于 2019-12-09 06:35:23
问题 I am working with RecyclerView and CardView . I want to attach OnClickListner to each card. I tried with many answers available on stackoverflow, but they are not working for me. So far I have tried - public class SubjectAdapter extends RecyclerView.Adapter<SubjectAdapter.ViewHolder> implements View.OnClickListener, View.OnLongClickListener{ private static final String LOGCAT = "SubjectAdapter"; private final Context mContext; List<Subject> SubjectsList; public SubjectAdapter(Context context)

Trouble getting Android Support V7 CardView Library to work

北城以北 提交于 2019-12-08 17:56:12
问题 I'm using IntelliJ/Android Studio with Ant build (not Gradle at the moment), and am trying to use android-support-v7-cardview.jar but I continue to get android.view.InflateException: Binary XML file line #19: Error inflating class android.support.v7.widget.CardView java.lang.NoClassDefFoundError: android.support.v7.cardview.R$styleable I am not using m2repository with the aar file, but am using the cardview at location sdk/extras/android/support/v7 I have gotten it to work by using the

Cardview's data are changed while srolling RecyclerView

好久不见. 提交于 2019-12-08 11:22:56
问题 I'm a beginning android developer. I have made an app with CardView, but when I scrolling RecyclerView, it's changing its content. Please, help me) Video: http://sendvid.com/60ui8cay My code: RecyclerViewActivity.java: import android.app.ActionBar; import android.app.Activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.CardView; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView;

Text appearance, inside TextView and CardView

ぐ巨炮叔叔 提交于 2019-12-08 09:39:40
问题 When I use TextView to display a text, and set the background color for a example to grey, then the displayed text looks absorbed by this background color. So my idea was to add the TextView to CardView, give the Cardview the backgroundColor, and set the elevation of TextView higher then CardView, but it is still the same. I even tried to add in CardView a Layout with Textview inside and set the elevation of the Layout higher. I want the displayed text floating above the View. Do someone have