android-cardview

Android CardView with ListView inside - onTouchListener on CardView not working

旧街凉风 提交于 2019-12-08 01:54:32
问题 I have a cardview with a listview inside. I will need the click item in list view too and I want to be able to move the entire cardview using the ontouchlistener too. I have set a onTouchListener on the cardview but it doesn't work. Code: Put this in build.gradle: compile 'com.android.support:cardview-v7:22.0+' MainActivity: package com.XXXXXXXX.testontouch; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.CardView; import android

Android: support features don't appear in android L

妖精的绣舞 提交于 2019-12-07 21:44:25
问题 I use Android Studio 2.0 . I have used RecyclerView and CardView which render properly on kitkat but when the app is run on SAMSUNG A5 with android 5.1.1 (lollipop) the RecyclerView doesn't scroll and my CardView doesn't have elevation and corner. I tried solutions suggested in SO such as adding card_view:cardUseCompatPadding="true" and adding margin. Even changed xmlns:card_view="http://schemas.android.com/apk/res-auto" to xmlns:card_view="http://schemas.android.com/tools" But these didn't

CardView shadow not rendered when converted to bitmap

痞子三分冷 提交于 2019-12-07 04:22:12
问题 THE PROBLEM I'm try to save a view group (which has a CardView as one of its childern) as a PNG file. To achieve this, I inflate the view group and populate the views with required information Load an image to an image view via Glide Add a ViewTreeObserver.OnGlobalLayoutListener to the ViewTreeObserver of the image view and pass the entire (parent) view that is going to be shared to a method that converts the view to a bitmap when image view's bottom is greater than zero (image view's height

Elevated RecyclerView items get progressively deformed (elevation changes)

老子叫甜甜 提交于 2019-12-07 01:54:18
问题 Any idea why RecyclerView items get deformed , each consecutive item gets worse? UPDATE: I'm using CardViews and now there's no view "deformation" but the shadow/elevation height changes. It seems that elevation gets higher depending on where on the screen the item is located vertically, the shadow grows as the item gets scrolled down. Please see the video here: https://youtu.be/nROYq8rpUMs. I've set up a new project leaving only the code necessary to demonstrate the issue: MainActivity.java

Android: How can I load more data in the background in recyclerView

血红的双手。 提交于 2019-12-06 15:21:53
问题 I am creating a new android app, I have nearly completed the first screen. However, as soon as I reach the bottom of the screen, instead of loading new data, the app throws me right to the beginning of the page. The API that I'm using will send the next page when I send a request for the second page. Can you please tell me how can I make the app such that, it automatically sends the request for the second page, before the user reaches the end of the first page. I'm using volley library along

Android: support features don't appear in android L

醉酒当歌 提交于 2019-12-06 12:09:44
I use Android Studio 2.0 . I have used RecyclerView and CardView which render properly on kitkat but when the app is run on SAMSUNG A5 with android 5.1.1 (lollipop) the RecyclerView doesn't scroll and my CardView doesn't have elevation and corner. I tried solutions suggested in SO such as adding card_view:cardUseCompatPadding="true" and adding margin. Even changed xmlns:card_view="http://schemas.android.com/apk/res-auto" to xmlns:card_view="http://schemas.android.com/tools" But these didn't work This is my RecyclerView: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget

How to add listView inside cardView android?

ε祈祈猫儿з 提交于 2019-12-06 11:36:09
Forgive me for any mistakes. I'm a beginner. Can anyone please explain how to create a listview inside a cardview layout in android. Example settings app in android 6.0 I wanna create a scrollable cardview layout with listview items in each cardview layout. I have searched enough online and nothing seems to help me. If you have any solution this it would be helpful for me. The best way to do this is using a RecyclerView with a vertical LinearLayoutManager (which will look the the same as a ListView but with better performance) and a fixed size inside your CardView . The xml for your CardView

Is it possible to use CardView to make shadow for Floating Action Button?

风流意气都作罢 提交于 2019-12-06 09:25:55
I know CardView is not made for this, but in theory if cardCornerRadius = view_size / 2 it should result in circle. Am I missing something? Drawing real, animated shadows is not that difficult and you can try to achieve Lollipop's effect on any Android down to Froyo. Here's how it works: Draw your view to an offscreen bitmap using LightingColorFilter(0,0) Blur that bitmap using ScriptIntrisincBlur. Set the blur radius to your elevation value. Draw that blurred bitmap beneath your floating action button. For an example implementation see: Shadow generator, blurs views: https://github.com

ConstraintLayout in Cardview adding white space

故事扮演 提交于 2019-12-06 08:09:26
问题 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

Android scrolling function in cardView + RecyclerView layout

半世苍凉 提交于 2019-12-06 05:03:41
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.AppCompat.Dark.ActionBar"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id