android-cardview

CardView with different corner radius

混江龙づ霸主 提交于 2020-02-20 08:07:03
问题 I have the following CardView and I want to set different radius for each corner in the card. Is it possible to change them by XML or programmaticaly? Thanks in advance. <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:layout_marginLeft="16dp" android:layout_marginTop="5dp" android

Clicking CardView to load a fragment

孤人 提交于 2020-02-08 01:33:08
问题 I'm having trouble with implementing clickable cards with my RecyclerView. I want to get the position of which card was clicked and then load the proper fragment. I did take a look at this post and spent almost 30 minutes trying to make sense of the code and implementing it myself but I gave up when I realized how many mistakes were in the snippet. Here is my adapter class. public class RVAdapter extends RecyclerView.Adapter<RVAdapter.PersonViewHolder> { public static CardView cv; public

Clicking CardView to load a fragment

懵懂的女人 提交于 2020-02-08 01:30:14
问题 I'm having trouble with implementing clickable cards with my RecyclerView. I want to get the position of which card was clicked and then load the proper fragment. I did take a look at this post and spent almost 30 minutes trying to make sense of the code and implementing it myself but I gave up when I realized how many mistakes were in the snippet. Here is my adapter class. public class RVAdapter extends RecyclerView.Adapter<RVAdapter.PersonViewHolder> { public static CardView cv; public

Android Card UI : card resize (gabrielemariotti)

不想你离开。 提交于 2020-01-25 11:43:06
问题 I'm making an android app with cards UI, by using the library: https://github.com/gabrielemariotti/cardslib I want to make a custom card which will be smaller than the default card size. Is there any way to do this? 回答1: The default card has a min height. You can override this value in your dimens.xml: <dimen name="card_base_empty_height">96dp</dimen> 来源: https://stackoverflow.com/questions/25907697/android-card-ui-card-resize-gabrielemariotti

how to update a specific item (cardview) in recyclerview OnActivityResult

荒凉一梦 提交于 2020-01-24 19:40:25
问题 I have a Fragment inside MainActivty, and inside this Fragment RecyclerView of Articles with cardView (inside this card i have like button and like counter) and when the user click on the cardView will open DetailsActivity that and I want when onBackPressed to update just this item depends on the data changed (like button and like counter) in DetailsActivity how to update just this Item ? sorry for bad English! 回答1: First update the data of that specific position item of adapter. After that

how to update a specific item (cardview) in recyclerview OnActivityResult

两盒软妹~` 提交于 2020-01-24 19:40:06
问题 I have a Fragment inside MainActivty, and inside this Fragment RecyclerView of Articles with cardView (inside this card i have like button and like counter) and when the user click on the cardView will open DetailsActivity that and I want when onBackPressed to update just this item depends on the data changed (like button and like counter) in DetailsActivity how to update just this Item ? sorry for bad English! 回答1: First update the data of that specific position item of adapter. After that

cardBackgroundColor and cardCornerRadius not working in AndroidX

守給你的承諾、 提交于 2020-01-24 10:33:04
问题 I'm struggling with CardView corner radius and background color with AndroidX libraries. I've defined my layout as below: <?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="@dimen/retail_card_width" card_view:cardCornerRadius="@dimen

Cards not shows in CardView

六月ゝ 毕业季﹏ 提交于 2020-01-21 10:12:30
问题 I have a simple CardView inside a RecyclerView but I can't see any cards appearing. Here's my current code: MainActivity.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:background="@color/colorPrimaryDark"> <include

How to make span count and icon size automatic

空扰寡人 提交于 2020-01-21 06:13:24
问题 I am using recycler view with card view to show icons in my application. I am not able to figure out how to resize the app icons and increase/decrease the span count automatically depending on the screen size. Here is what I am doing to display it and the spen count is fixed to 3. RecyclerView mrv = (RecyclerView) findViewById(R.id.recyclerview_id); RecyclerViewAdapter myAdapter = new RecyclerViewAdapter(this, lsStore); mrv.setLayoutManager(new GridLayoutManager(this, 3)); mrv.setAdapter

How to make span count and icon size automatic

时光总嘲笑我的痴心妄想 提交于 2020-01-21 06:08:30
问题 I am using recycler view with card view to show icons in my application. I am not able to figure out how to resize the app icons and increase/decrease the span count automatically depending on the screen size. Here is what I am doing to display it and the spen count is fixed to 3. RecyclerView mrv = (RecyclerView) findViewById(R.id.recyclerview_id); RecyclerViewAdapter myAdapter = new RecyclerViewAdapter(this, lsStore); mrv.setLayoutManager(new GridLayoutManager(this, 3)); mrv.setAdapter