cardview

RecyclerView overlapping without shadow

橙三吉。 提交于 2019-12-04 19:32:43
问题 I want to develop List like this picture I had used to RecylerView ItemDecorator for overlap. But it's overlapping without shadow. the screen & decorator code is below public class OverlapDecoration extends RecyclerView.ItemDecoration { private final static int vertOverlap = -50; @Override public void getItemOffsets (Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { outRect.set(0, 0, 0, vertOverlap); } } card_layout.xml <LinearLayout xmlns:android="http://schemas

How to define margin of CardView

情到浓时终转凉″ 提交于 2019-12-04 09:45:32
What is the default margin of Support CardView so I can define margin for my situation? <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_horizontal" card_view:cardUseCompatPadding="true" card_view:cardCornerRadius="4dp" card_view:cardElevation="2dp"> How to define margin of CardView? Use attribute android:layout_marginLeft , android:layout

Android 5.0+(RecycleView、CardView、Palette)

两盒软妹~` 提交于 2019-12-04 05:19:42
Android L 开发者预览支持库提供两个新的Widgets,RecyclerView和CardView。使用这两个Widgets可以显示复杂的Listview和卡片布局,这两个Widgets默认使用Material design。 RecyclerView RecyclerView是一个更高级柔性版本的Listview,RecyclerView是一个能包含很多视图的容器,它能完美的处理循环和滚动。在item动态变化的Listview使用RecyclerView。 RecyclerView使用很简单,因为它提供了: 1、定位item的布局管理器 2、常见的item操作默认动画 你能够灵活的为RecyclerView自定义布局管理器和动画。 使用RecyclerView,必须使用指定一个adapter、定义一个布局管理器。创建adapter必须继承自RecyclerView.Adapter。实施的细节需要看数据类型和需要的视图。 RecyclerView widget RecyclerView 提供了 LayoutManager,RecylerView 不负责子 View 的布局 目前提供了 LinearLayoutManager(显示垂直或水平滚动列表中的条目。) GridLayoutManager(在一个网格显示项) StaggeredGridLayoutManager

RecyclerView overlapping without shadow

懵懂的女人 提交于 2019-12-03 12:14:16
I want to develop List like this picture I had used to RecylerView ItemDecorator for overlap. But it's overlapping without shadow. the screen & decorator code is below public class OverlapDecoration extends RecyclerView.ItemDecoration { private final static int vertOverlap = -50; @Override public void getItemOffsets (Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { outRect.set(0, 0, 0, vertOverlap); } } card_layout.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"

Parent click event not firing when recyclerview clicked

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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="match_parent" android:layout_height="match_parent

Drawable as Background for CardView

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: the CardView ( android.support.v7.cardview ) stays white even though I set a backround drawable via android:backround - The documentation gives me the feeling that it should work. No Idea what I am doing wrong here. 回答1: I know this is an old question, but I have a simple solution - just make the first child of your CardView an ImageView and specify the scale type to fitXY . You can get rid of the extra CardView padding by setting cardElevation and cardMaxElevation to 0dp : 回答2: Make Cardview will host one viewgroup for eg relative layout in

Getting error inflating CardView despite of using last version

匿名 (未验证) 提交于 2019-12-03 01:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem which is wasting my time. I was working on my project very well until yesterday. When I started to work last morning I have faced this problem ; "Binary XML file line #2: Error inflating class android.support.v7.widget.CardView" I have suddennly googled and I have seen that some other people faced either. But answers about these problem is not my solution. It hasnt fixed my problem. Pls save my day :) here is my gradle ; here is my logcat; Process: com.orderfood.teknomerkez.orderfood, PID: 14852 android.view.InflateException

Android: How to keep corner radius while setting a background drawable?

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: <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="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/activity_vertical_margin" card_view:cardCornerRadius="12dp" card_view:cardElevation="12dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> ..... </android.support.v7.widget.CardView> This is

“android:elevation=” doesn&#039;t work on devices pre-Lollipop with compile API21

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use "android: elevation =" in my application but once I run it does not appear in the device with android 4.1.2 gradle apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.alvaro.proyectocaronte" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs',

Android CardView简单介绍

匿名 (未验证) 提交于 2019-12-03 00:30:01
一、介绍:CardView可以实现卡片布局,拥有圆角和阴影效果 1.导入包 implementation 'com.android.support:cardview-v7:27.1.1' 一般配合RecyclerView ,和Glide(图片加载库)使用 implementation 'com.android.support:recyclerview-v7:27.1.1' /*图片加载库*/ compile 'com.github.bumptech.glide:glide:3.7.0' 2.基本用法,其实也是一个FrameLayout布局 <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" app:cardCornerRadius="4dp" android:elevation="5dp"> <TextView android:id="@+id/info_text" android:layout