cardview

image in cardview with top radius not showing corner radius

点点圈 提交于 2019-12-13 03:46:58
问题 I have recyclerView which insides cardView that has ImageView and it takes 70% height of its. So I have given corner radius to cardView. The bottom of cardView radius is shown but the problem is the top part which is covered by image is not taking the corner radius of cardView. I tried these questions : question , question. But still the problem remains the same. xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res

Getting error inflating CardView despite of using last version

旧时模样 提交于 2019-12-11 22:08:19
问题 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 ; dependencies { implementation fileTree(include: ['*.jar

how to create Horizontal scroll-able CardView

北战南征 提交于 2019-12-11 02:43:31
问题 Hi I am try to create a page as below, I have a drawer layout and in the home screen I want to display notifications as in the screen shot. I am trying to do it by CardView but I didn't got any tutorial explaining how I can achieve this in CardView . I got tutorials for Cardview in the listView but not for my requirement. Can anybody tell me how I can achieve this?. What all the possible options I have for this in android? 回答1: Search for RecyclerView in android, and Cardview. The below

How to display latest post on top instead of bottom in recyclerview / cardlayout in firebase android?

為{幸葍}努か 提交于 2019-12-07 11:53:53
问题 I am totally new to Java and Firebase, working in a college project. Making something like an ecommerce app but not literally (somewhat similar). To the point, my newly inserted data are at bottom as default, I need to get them at the top. Tried every possible answers at stackoverflow. youtube and google results - in vain. To be honest, I'm totally a starter and have no knowledge where and how to integrate them together. Codes i'm working are posted with this question. Thanks in advance.

How to Pass Position of RecyclerView to Activity?

左心房为你撑大大i 提交于 2019-12-07 09:46:22
问题 I am trying to pass position of recyclerview to another activity where I am calliing retrofit Interface. Can I pass position of Recyclerview item so I can load different post from api @Override public void onBindViewHolder(TagAdapter.Tag_ViewHolder holder, final int position) { holder.tagName.setText(Tags.get(position)); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (position < 8){ int pos = (int) getItemId(position) + 1; Intent

创建Material Design风格的Android应用--创建列表和卡片

青春壹個敷衍的年華 提交于 2019-12-06 08:59:42
上次说过使用主题,应用Material Design的样式,同时卡片布局也是Material Design的重要组成部分,今天来写写。 引言 在程序中创建复杂的Material Design 样式的 List和Card,可以使用RecyclerView和CardView组件,这两个组件是在最新的support v7包(version 21)中提供的。因此需要引入依赖包: dependencies { compile 'com.android.support:appcompat-v7:+' compile 'com.android.support:cardview-v7:+' compile 'com.android.support:recyclerview-v7:+' } 创建List RecylerView组件是一个更加高效灵活的ListView。这个组件时一个显示大数据集的容器,可以有效的滚动,保持显示一定数量的视图。使用RecyclerView组件,当你有数据集,并且数据集的元素在运行时根据用户的操作或者网络事件改变。 RecylerView类简化大数据集的显示和处理,通过提供: 布局管理者控制元素定位。 在通用的元素上操作上显示默认的动画,比如移除和增加元素。 使用RecyclerView组件,你需要指定一个Adapter和布局管理器

Android RecyclerView: Super Fast ListView 超级快速的Lis

℡╲_俬逩灬. 提交于 2019-12-06 08:59:22
Android RecyclerView: Super Fast ListView 原文来自我的微信公众号: longkai_1991 先上图,看效果: 前几天刚release完公司的一个项目,有了点时间,于是就想找一些有意思的东西学习一下,顺便运用在项目之中。看到iOS的同事们在谈论iOS8的xx特性时,我突然也有想在公司项目的下一个版本中添加Android L版本的特性。 六月底的时候收看Google io时,当时对Android新的设计语言,Material Design,没什么太大的好感,感觉色彩一坨一坨的,好难看的样子,当时觉得亮点就是新的ART运行时环境和一些酷炫的动画效果。再后来,8月初的时候,自己出于好奇真的拿Nexus 5安装了一个L的预览版,体验很差...好多软件都还是holo的,反正觉得不是很期待就是啦。 回到重点,下载好最新的SDK,你会发现在 ANDROID_HOME/extras/android/m2repository/com/android/support 下面多了不少兼容库, cardview , support-annotations , recyclerview-v7 ,眼前一亮吧~这回,Google真的是拿出了好多东西呀,赞,尤其是cardview和recyclerview这两个新的控件,这个在Google最新的Material

CardView(卡片式布局)

你离开我真会死。 提交于 2019-12-06 05:37:07
CardView是Android5.0之后出现的,用它可以实现上图所展现的圆角效果、阴影效果。实现方式直接看代码: 第一步: compile 'com.android.support:cardview-v7:25.0.1' //gradle导入CardView支持包 第二步: <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="150dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" app:cardBackgroundColor="#FF8800" app:cardCornerRadius="10dp" app:cardElevation="8dp"> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:gravity="center" android:text="测试文本" android

How to display latest post on top instead of bottom in recyclerview / cardlayout in firebase android?

最后都变了- 提交于 2019-12-06 03:47:50
I am totally new to Java and Firebase, working in a college project. Making something like an ecommerce app but not literally (somewhat similar). To the point, my newly inserted data are at bottom as default, I need to get them at the top. Tried every possible answers at stackoverflow. youtube and google results - in vain. To be honest, I'm totally a starter and have no knowledge where and how to integrate them together. Codes i'm working are posted with this question. Thanks in advance. Sorry I have no logs because I don't even know how to put (already answered) code together, far post them

Android RecyclerView&CardView实现瀑布流效果

扶醉桌前 提交于 2019-12-05 05:29:18
所需要的库及库工程 库: android-support-v7-recyclerview.jar :v21.x android-support-v4.jar :v21.x 库工程: android-support-v7-appcompat:v21.x android-support-v7- cardview 注意:cardView必须使用库工程,而不能使用jar包,原因是其引用了自定义属性 但是,如果必须要使用cardView而不导入工程,建议使用cardview源码,主要步骤如下 : ①将自定义attr,color,dimens,styles拷贝至工程目录下 ②修改源码中的 import android.support.v7.cardview.R; 成当前工程的R资源 ③认真完成以上2步骤 效果预览 Activity文件 package st.app.base.rcp; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.support.v7.internal.view.menu