android-cardview

How to override standart padding in CardView while using cardUseCompatPadding?

佐手、 提交于 2020-01-01 11:54:10
问题 When I use cardUseCompatPadding to show shadow in my card view, top padding is bigger than left one. How to make both padding equal, because my ribbon looking not beautiful, it's bigger on top? Thanks. <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <!-- Green triangles for badge --> <FrameLayout android:id="@+id/ribbon_parts" android:layout_width="58dp" android:layout_height="58dp" android:background="@drawable/ic_ribbon_parts" android:visibility="gone"

Android CardView with rounded corners displays grey corners

不羁的心 提交于 2020-01-01 07:35:08
问题 I'm inflating a custom layout with CardView inside the layout. The rounded corners are displayed as expected but I also get grey background behind the corners. The code is simple, uses a CardView with corner radius and a background color. I've tried setting transparent background but doesn't work. However, if i set another opaque color, it is displayed in corners. Code is attached. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android

android: RecyclerView inside a ScrollView (or parallax)

假如想象 提交于 2020-01-01 05:21:11
问题 I have a fragment with 2 cardviews with multiple controls within. below the second cardview I have a recyclerview , this works perfect . the problem is that the recyclerview starts very bottom of the screen , and scroll the recylcerview is very small . previously used a listview, and this kept me fit your content and thus make scroll across the screen at once, but with recylclerview can not. How to make when I scroll in the recyclerview, controls go up like parallax effect? EDIT: more clear,

Swipe effect like inshorts news app

不羁岁月 提交于 2020-01-01 03:39:10
问题 link check this news app, i want to develop like this. i want swipe up/down side effect.. i tried this code,but not correctly swiping as i want. in this code when i swipe up/down,only the text is changing not a layout. public class ArticlesActivity extends Activity implements GestureDetector.OnGestureListener{ ImageView image,imageArticle; TextView tv1,tv2,tv3; private GestureDetector gd; LinearLayout layout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Collapsing CardView inside RecyclerView when animating

狂风中的少年 提交于 2019-12-31 10:34:11
问题 What I'm trying to do I have a CardView with a supporting text on the bottom that is GONE by default. I want to make this section of the card visible only when the user clicks the "action arrow", as shown on the image below: I know I can achieve that by simply setting that View visibility to VISIBLE , but I also want to animate the expand and the collapse events. The problem and what I've tried so far To do that I've used the android:animateLayoutChanges="true" property on my CardView xml,

How to add CardView attributes to app theme?

只谈情不闲聊 提交于 2019-12-30 06:12:08
问题 My question is similar to "How to put a CardView attribute in a style", but I need to go deeper. I'm using AppCompat theme, and my styles looks like style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/toolbar_color</item> <item name="android:listViewStyle">@style/CustomListView</item> </style> and I create separate style for CardView <style name="CustomCardView" parent="CardView"> <item name="cardBackgroundColor">@color/card_background</item>

“RecyclerView: No Adapter attached; skipping layout” for recyclerview in fragment [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-30 06:07:17
问题 This question already has answers here : recyclerview No adapter attached; skipping layout (30 answers) Closed 3 years ago . I'm getting this error but I don't know what is causing it...perhaps something to do with the fact that this is being initialized in a fragment and not in the activity itself. Edit: included StatsAdapter code public class StatsFragment extends Fragment { private RecyclerView mRecyclerView; private LinearLayoutManager mLinearLayoutManager; private RecyclerView.Adapter

Exception : android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.CardView

断了今生、忘了曾经 提交于 2019-12-29 06:21:08
问题 I am using CardView of support library in my android app. I tried 4-5 hours to resolve this but i could not get success. I have added CardView as a library in my project & v7 appcompat also <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="match_parent" android:layout_margin="5dp" android:orientation="horizontal" app:cardCornerRadius="4dp"

How to show CardView containing ads randomly but not before 3 cards and not after 7 cards?

倖福魔咒の 提交于 2019-12-29 02:06:51
问题 I'm following this tutorial to show cards and integrate Tinder-like swipe feature. In-between the cards I want to show ads and for that I'm using AdMob . Here's the code: @Layout(R.layout.ad_cards_view) public class AdCards { @View(R.id.adView) NativeExpressAdView nativeExpressAdView; private Context mContext; private SwipePlaceHolderView mSwipeView; public AdCards (Context context, SwipePlaceHolderView swipePlaceHolderView) { mContext = context; mSwipeView = swipePlaceHolderView; } @Resolve

Cardview shadow not appearing in lollipop devices?

ぃ、小莉子 提交于 2019-12-28 04:00:16
问题 Am using the cardview in my android app. However the shadow is not showing. Here is the xml layout The default optionsmenu shadow also not showing. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ECEDF0" android:orientation="vertical"