android-cardview

Anchor an floating button on a cardview

半城伤御伤魂 提交于 2019-12-11 08:07:25
问题 I try to anchor an floating button on a cardview without success. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <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

How to create custom image buttons in Android studio?

穿精又带淫゛_ 提交于 2019-12-11 07:33:06
问题 How to create image buttons like this one in android studio? Does it need dependencies? or are there any other methods? 回答1: It can be done by various ways. Its just depends upon how you customize your layout. you can do that by.... 1- Linear layout with with white background with 1 image view and 1 textview inside... 2- using frame layout with image view and Text view. 3- the view in your image is a recycler view with cardviews. for using recycler and card you need support design

Gap between CardViews increases on scrolling

心不动则不痛 提交于 2019-12-11 05:55:58
问题 I'm using CarViews with RecyclerView and it looks fine when loaded but once when the list is scrolled the gap between the CardViews increases and there shows only one card in the view at a time. Here is my CardView.xml <LinearLayout 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"> <android.support.v7.widget.CardView android:id="@+id/conversationCard" android

view.GONE in Recyclerview still keeps space

北城余情 提交于 2019-12-11 05:21:20
问题 I searched on the web and fount that there's a difference between view.invisible and view.gone, the vie.gone must disappear without keeping the space but it doesn't happen to me, how can I fix it? please help, check out the links of the two pictures. Picture of the result on the Android Emulator: https://i.stack.imgur.com/AC1Xr.png Database: https://i.stack.imgur.com/Pwhno.png @Override protected void onStart() { super.onStart(); final FirebaseRecyclerAdapter<MyReading, MyReadingViewHolder>

Android - clicking on a widget inside a clickable cardview

戏子无情 提交于 2019-12-11 04:12:42
问题 After fighting and eventually implementing this: RecyclerView onClick I manage to make the cardviews clickable and long-clickable. This is working well, or maybe too well, because I also want a certain widget inside the cardview to be clickable so when clicking on it, the cardview should ignore the click, what happens now is that both the widget and the cardview, consume the click. Here is the code: The recyclerview: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

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

Cardslib's CardView OnCardClickListener's onClick method not being called

给你一囗甜甜゛ 提交于 2019-12-11 02:08:21
问题 I am using this library in my app: Card Library : Guide and created a card as shown in the example. Now I need to handle a click event, but I receive an error when instantiating the following: new Card.OnCardClickListener , which says OnCardClickListener is abstract: cannot be instantiated . In my Activity I have this code: Card card = new Card(getBaseContext());//getContext() CardHeader header = new CardHeader(getBaseContext()); card.addCardHeader(header); final CardViewNative cardView =

Android - CardView background always grey

对着背影说爱祢 提交于 2019-12-10 22:14:26
问题 I am trying to change the CardView color programmatically. This is my CardView: <android.support.v7.widget.CardView android:id="@+id/createsub_card" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="10dp"> and this is how I set the background color: CardView card = (CardView) findViewById(R.id.createsub_card); card.setCardBackgroundColor(sub.getColor()); where sub.getColor() returns in this specific case this color: <color name="color_black">

Flipping CardView in RecyclerView

筅森魡賤 提交于 2019-12-10 18:16:06
问题 I am trying to implement a CardView flip in a RecyclerView. I just cannot figure out a simple solution. I have a working CardView where i can display a list of card using the recycler view. The problem is, how to show the back of the card if user click the card. I want to use animation and change the front of the card to the back of the card. Can someone give a simple animation and example of the card layout. My current example is pretty much copy of this example where a new activity is being

How to set CardView attributes in style.xml file in android

坚强是说给别人听的谎言 提交于 2019-12-10 17:17:04
问题 I have set a style for my CardView in style.xml file but its giving me error on compile time for app:cardCornerRadius , app:cardElevation , app:cardPreventCornerOverlap and app:contentPadding attributes. What is the correct way to set style for a CardView in Android? Below is some of my code: <style name="CardViewStyle" parent="CardView"> <item name="android:layout_marginBottom">@dimen/cardMarginVertical</item> <item name="android:layout_marginTop">@dimen/cardMarginVertical</item> <item name=