android-cardview

Send click event from RecyclerView to parent ListFragment or ListAdapter

倾然丶 夕夏残阳落幕 提交于 2020-01-06 05:43:18
问题 I have a ListFragment with some ListItems. In one ListItem I have some Views and also a RecyclerView with CardViews. In the CardView is a ImageView. I want to use the RecyclerView to have some pictures in it and I want to scroll the pictures. I also want to zoom the pictures with a two finger-gesture. (Would be nice if someone knows a good step by step tutorial therefor). But I also want to click and longclick on the pictures. I need the click and longclick in my ListArrayAdapter or in my

Modify cardview padding

与世无争的帅哥 提交于 2020-01-06 02:43:07
问题 For card elevation to be visible, I use the attribute card_view:cardUseCompatPadding="true" in cardview XML. It added extra padding on all four sides of the cardview, but I do not need the bottom padding since the card below every card will already have a top padding. So currently it is like double padding between two cards because of top+bottom padding. How to reduce it by half? P.S android:layout_marginBottom="-5dp" doesn't seem to work 回答1: Only use a margin at the bottom for the cards and

Android layout advice (RecyclerView, ViewPager and CardView)

て烟熏妆下的殇ゞ 提交于 2020-01-06 02:37:06
问题 I need some advice to implement a design for my android application. I'm using a RecyclerView to display a list of CardView . No problem with that. But, I need a top section with a ViewPager that display other CardView with horizontal swipping: See http://i.stack.imgur.com/akg2i.png I've read that Viewpager is not very built to be in a RecyclerView , so maybe a better way is to create a ScrollView with a ViewPager inside then a RecyclerView below and disable the scrolling of the RecyclerView

Implementing an RecycleView or CardView items with the same design for eachother

萝らか妹 提交于 2020-01-05 02:55:36
问题 I need to know, when the user clicking on one item(or for example, whatsApp contacts) WhatsApp showing to the user one design with this picture example: here is the recycle view items: and i'm using : http://code.tutsplus.com/tutorials/getting-started-with-recyclerview-and-cardview-on-android--cms-23465 Main-activity: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

How to display a video in a CardView on Android?

这一生的挚爱 提交于 2020-01-04 02:28:08
问题 I'm fairly new to Android and I recently added a CardView to my app to display a few text boxes and images, which work just fine. However, when I tried to display a video the card remains empty. Can someone help me understand what am I doing wrong? I've defined the ImageView like so: <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/card_margin" android:layout_marginLeft="@dimen/card_margin" android

OnClick event on TextView stops RippleEffect on CardView

天涯浪子 提交于 2020-01-03 14:05:24
问题 I have a TextView inside a CardView. When enabling the ripple effect for Lollipop on the CardView by adding a OnClick event and adding the property: android:foreground="?android:attr/selectableItemBackground" It works fine. But after adding a OnClick event to the TextView, the ripple effect still shows up when I click outside of the TextView, but it won't show when clicking on the TextView area. Is there away to show the ripple even when I click the TextView? Here is xml: <RelativeLayout

How to add listView inside cardView android?

坚强是说给别人听的谎言 提交于 2020-01-02 22:38:37
问题 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. 回答1: The best way to do this is using a RecyclerView with a vertical LinearLayoutManager (which will look the the same as

Update text within card view list?

筅森魡賤 提交于 2020-01-02 18:23:13
问题 So I have a recyclerview list of card views.I am trying to update the text time text in each view when the user clicks the card, and then reset it back when time has past. I set up an internal method in recyclerviewadapter but when I call updateTimes (calling from fragment), it does not reset the text back. Can someone instruct me on what I'm doing wrong? import java.util.ArrayList; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.net.Uri; import android

Aligning items in cardview

前提是你 提交于 2020-01-02 02:39:08
问题 I want my card to look like the following I kept my layout like this <android.support.v7.widget.CardView android:layout_gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" card_view:cardCornerRadius="2dp" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView

Android elevation - same values different shadow

喜你入骨 提交于 2020-01-01 12:06:30
问题 I encountered a strange error while setting elevations to items in recycler-view. I have two item types in adapter, first is a kind of dashboard with complex layout with three cardview s. Second one is classic item for data list where each item has cardview as root. each cardview in both layouts is defined as follows First Item Type : <LinearLayout android:id="@+id/root" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support