android-cardview

Advantage and disadvantage of CardView

萝らか妹 提交于 2019-12-04 15:50:31
问题 What are the advantages and drawbacks of CardView , other than the shadow or elevation, what is the benefit in performance and looks? What is done using CardView can also be done using a combination of other layouts. 回答1: Advantage of Cardview is definitely its default implementation of the shadow and the rounded corners, in simple words Cardview is just a FrameLayout with shadow and rounded corners. You can do almost the same stuff with a Cardview that you can do with a Framelayout (as

ConstraintLayout in Cardview adding white space

和自甴很熟 提交于 2019-12-04 12:32:54
I am trying to create a CardView that has a ConstraintLayout to organize some TextView . Sometimes it'll display as intended, but sometimes, it'll add extra white space such as when a keyboard is closed and ruin the layout. I have a GIF below showing the CardView working and not working in the same span of time. A code snippet for the relevant CardView is below. I use wrap_content to try to keep the CardView at the size I want, but it still expands. <android.support.v7.widget.CardView android:id="@+id/cardView_game_cash" android:layout_width="0dp" android:layout_height="wrap_content" android

AsyncTask loading image RecyclerView

孤人 提交于 2019-12-04 11:13:53
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 the user scroll slowly the images are loaded correctly and all is fine, but if i scroll to fast i have

Elevation animation on click on CardView

无人久伴 提交于 2019-12-04 10:41:53
问题 I want to add the elevation animation to my android.support.v7.widget.CardView , just like the material style Button s do. I've tried to set a StateListAnimator : android:stateListAnimator="@anim/selector_raise" which points to my selector in res/anim : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" android:state_pressed="true"> <objectAnimator android:duration="@android:integer/config

ViewPager inside CardView inside RecyclerView Android

左心房为你撑大大i 提交于 2019-12-04 10:01:45
问题 I'm trying to design something very similar to this design from the Material Design website. So basically, I have a list of CardViews that each of them has multiple views that user can swipe between them. (First card on the image) I started by implementing a simple recyclerview that contains CardView and for each cardview I implemented a FragmentStatePagerAdapter that contains multiple fragments that user can swipe through and it works (kind of). The issue that I'm facing is very similar to

How to disable the shadow around card view in android

萝らか妹 提交于 2019-12-04 09:51:23
问题 Hello I am am working on demo application in which i am using the card view of support library. By default it is adding shadow around it. I want to remove this shadow & should looks like simple. I tried this that is not working for me. CardView cardView = (CardView) v.findViewById(R.id.cardView); cardView.setElevation(0); After doing these I am getting crash 11-06 15:12:17.018: E/AndroidRuntime(24315): FATAL EXCEPTION: main 11-06 15:12:17.018: E/AndroidRuntime(24315): Process: com.xyz, PID:

Fragment cannot be converted to context?

元气小坏坏 提交于 2019-12-04 06:52:06
问题 I am developing an Android app with Recyclerview + Cardview with GridLayout in this I got the error as in the title. Reminders.java (Fragment Class) public class Reminders extends Fragment { private OnFragmentInteractionListener mListener; List<reminder> lstreminder; public Reminders() { } public static Reminders newInstance(String param1, String param2) { Reminders fragment = new Reminders(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; } @Override public void

how to make Recyclerview & Cardview onClick fetch syncronized data from server

徘徊边缘 提交于 2019-12-04 06:09:40
问题 i have some question with my recyclerview and cardview. This is the cases : 1. I've database with 3 values (name, image, description) 2. In my activity, i've recyclerview and cardview, they only show an image and the name of image. This is my activity : package com.example.mrm.myapplication; public class Child_Tab1 extends Activity { List<GetDataAdapter> GetDataAdapter1; RecyclerView recyclerView; RecyclerView.LayoutManager recyclerViewlayaoutManager; RecyclerView.Adapter recyclerViewadapter;

Unable to remove extra space between CardView items - Scrollable RecyclerView

↘锁芯ラ 提交于 2019-12-04 03:29:49
问题 Folks, I am out of options while attempting to removing extra space between cardview items in my recyclerview below is the current output. Please suggest. <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#303030" android:id="@+id/cv" android:layout_marginTop="2dip" android:layout_marginBottom="2dip" card_view:cardUseCompatPadding="true" card_view:cardElevation="5dp" android:foreground="?android:attr

Android RecyclerView LayoutManager Exception

江枫思渺然 提交于 2019-12-04 01:16:08
Hi I'm having an issue with the new Android Lollipop RecyclerView It keeps crashing with the following exception: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView$LayoutManager.onMeasure(android.support.v7.widget.RecyclerView$Recycler, android.support.v7.widget.RecyclerView$State, int, int)' on a null object reference Full stack trace can found here The code used to initiate the RecyclerView is the same mostly the same as the tutorial, however for some reason this still complains. Any help would be greatly appreciated. The code can be accessed at: gist here and