android-cardview

CardView won't ripple on click

允我心安 提交于 2019-12-23 23:33:45
问题 In my android app I have a recyclerview containing card views. However for some reason when I long press the cardview the ripple effect appears but if I just click it, then the ripple effect doesn't appear. Any suggestions? CardView Item Layout <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/card_view" android:layout_width="fill

Horizontal Scrolling Cards just like Recent Apps of Lollipop in Android?

旧城冷巷雨未停 提交于 2019-12-23 21:05:19
问题 I found a library, this library supports vertical scrolling cards, I want to change this library according to my needs (Horizontal scrolling). Can anyone suggest how to implement Cards just like the mentioned library cards horizontally. 回答1: Guys I just found a library , which helped me to solve this issue. Carousel Library Best Library I found which I customized for my project: https://github.com/applm/CarouselWidget Other helpful libraries: https://github.com/davidschreiber/FancyCoverFlow

RecyclerView Adapter is repeating values at wrong places

为君一笑 提交于 2019-12-23 13:00:39
问题 I am displaying 17 CardViews. I am using RecyclerView to achieve the same. Each CardView shows a common data (format). Depending on data received from a JSON file, a card may display some additional rows. . The following image shows 2 CardViews (in focus) displaying the additional data, the rest displaying the common data. It appears correctly. But then when I scroll down to bottom of the View, the last CardView is not suppose to display any row, but it does copy one from one of the 2 we saw

Setting the background image of a CardView inside RecyclerView causes the program to crash when scrolling

℡╲_俬逩灬. 提交于 2019-12-23 11:14:14
问题 I have a RecyclerView containing a list of CardViews with information that is pulled from a server, some cards have only a background color but some contains a background image. If the cards all have just background colors, the RecyclerView behaves accordingly (I am able to set the margins and corner radius as well). However, if any one card contains a background image, a crash will happen when I try to scroll up/down the list (although the background image will load without the previously

LinearLayout flagged if used in CardView

三世轮回 提交于 2019-12-23 07:05:19
问题 I have used a LinearLayout in a CardView to get a kind of social media login button look and it all runs fine, but Android Studio flags Element LinearLayout is not allowed here . I was wondering why this may be the case? My xml is this : <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_below="@id/cv_fb" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardElevation="3dp" > <LinearLayout android:id="@

RecyclerView With CardView

强颜欢笑 提交于 2019-12-23 02:14:26
问题 I am using RecyclerView + CardView to list all the countries from A-Z like I have here But I want them to line up next to each other so save space like this What is the best way to achieve this? CardAdapter public class CardAdapter extends RecyclerView.Adapter<CardAdapter.ViewHolder> { List<Nationality> mItems; public CardAdapter() { super(); mItems = new ArrayList<Nationality>(); Nationality movie = new Nationality(); movie.setThumbnail(R.drawable.afghanistan); movie.setName("Afghanistan");

Android scrolling function in cardView + RecyclerView layout

心已入冬 提交于 2019-12-22 12:22:29
问题 In my application I have first the cardview and then RecyclerView. Using my existing code I am able to scroll the whole page. But I want that I can also scroll only the card view items. Currently when I try to scroll cardview the complete layout is scrolled. My current code:- <android.support.design.widget.AppBarLayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:theme="@style/ThemeOverlay

Ripples not showing with selectableItemBackground as foreground on a CardView with a Android 5.0 device

瘦欲@ 提交于 2019-12-22 03:48:37
问题 I'm running this on a Nexus 5. Here's part of the code for my CardView: CardView cardView = new CardView(getActivity()); cardView.setRadius(4); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 400); lp.setMargins(32, 16, 32, 16); cardView.setLayoutParams(lp); cardView.setContentPadding(50, 50, 50, 50); ... cardView.setForeground(selectedItemDrawable); And here's how I get the selectedItemDrawable: int[] attrs = new int[] { R.attr

AsyncTask loading image RecyclerView

孤街浪徒 提交于 2019-12-21 17:56:19
问题 I'm trying to create an app similar to that one: An app with some images and description (cardview) in a recyclerview First at all i load all the information for my CardView from a database Title of the image, Description and the URL from the image. When i put all that information in the RecyclerView, (title and description) shows correctly, but for the image I create a AsyncTask class to load the images from the URL and let the user don't wait to much time waiting for the app to response. If

How to bring imageView in front of cardview ? When both are of Relative Layout childs

こ雲淡風輕ζ 提交于 2019-12-21 07:25:12
问题 I have a layout XML: <?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:id="@+id/containor" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff6da" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android