android-cardview

CardView layout_width=“match_parent” does not match parent RecyclerView width

梦想与她 提交于 2019-11-26 19:39:32
I have a fragment with contains a RecyclerView with layout_width="match_parent": <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity

Ripple effect on Android Lollipop CardView

被刻印的时光 ゝ 提交于 2019-11-26 19:24:47
I'm trying to get a CardView to display the ripple effect when touched by setting the android:backgound attribute in the activity XML file as described here on the Android Developers page, but it isn't working. No animation at all, but the method in onClick is called. I've also tried creating a ripple.xml file as suggested here , but same result. The CardView as it appears in the activity's XML file: <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="155dp" android:layout_height="230dp" android:elevation="4dp" android

Pull to refresh recyclerview android

吃可爱长大的小学妹 提交于 2019-11-26 19:14:51
问题 Hi I've a tabbed activity, and in the first tab I fetch data from server and show it in a recyclerview within card views. For fetching the data from server I use the volley library. I want to implement the Pull to refresh to load the data (so whenever I pull it has to do the request to the network). And I want also to disable the network request whenever I switch between tabs (because when I change tab focus in my app it starts to fetching data) I want to do the network request only 1 time

CardView inside RecyclerView has extra margins

 ̄綄美尐妖づ 提交于 2019-11-26 18:14:55
问题 I am using a CardView as element inside a RecyclerView. When doing so android automatically generates margins between the cardView and the screen and between different cardViews. <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:background="@color/galleryCardBGColor" app:cardCornerRadius="2dp" > <android.support.v7

Change the background color of CardView programmatically

无人久伴 提交于 2019-11-26 17:58:28
问题 The CardView has an attribute card_view:cardBackgroundColor to define the background color. This attribute works fine. At the same time there isn't a method to change the color dynamically. I've just tried solutions like: mCardView.setBackgroundColor(...); or using a Layout inside the cardView <android.support.v7.widget.CardView> <LinearLayout android:id="@+id/inside_layout"> </android.support.v7.widget.CardView> View insideLayout = mCardView.findViewById(R.id.inside_layout); cardLayout

How to add a recyclerView inside another recyclerView

ⅰ亾dé卋堺 提交于 2019-11-26 16:10:59
I'm planning to develop an app that shows some dynamic data inside a recyclerCardView . So i decided add a recyclerView called CheckBoxRecyclerView inside my main recyclerView . This is my code for my app : My Main Activity : setContentView(R.layout.activity_startup); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); reminderView = (RecyclerView) findViewById(R.id.reminder_recycler_view); RlayoutManager = new LinearLayoutManager(this); reminderView.setLayoutManager(RlayoutManager); setSupportActionBar(toolbar); cardView = (CardView) findViewById(R.id.card_first); cardView

How to create a card toolbar using appcompat v7

那年仲夏 提交于 2019-11-26 15:38:38
问题 I want to create a toolbar like the following image as proposed in the material design guidelines: I can achieve this via using the toolbar with an relative layout: <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <Toolbar/> <LinearLayout android:layout_marginTop="-17dp" /> </RelativeLayout> I am not sure this is the correct way or not. Any help is appreciated. 回答1: Thanks Gabriele for all the help. Here is working code: Activity : public class

How to implement setOnScrollListener in RecyclerView

偶尔善良 提交于 2019-11-26 12:58:43
问题 How Do I show progress bar at bottom when user reached to items those are visible in a list. I have written a code in which i am getting data using web service, now i would like to populate partial records, because i have around 630 records in my JSON. Here is my whole code which i am using to get data from JSON and to populate into RecyclerView. Here is how my JSON looks, but real JSON contains over 600 records: http://walldroidhd.com/api.php Can someone guide me where i have to make changes

CardView not showing Shadow in Android L

痞子三分冷 提交于 2019-11-26 12:20:52
问题 My Cardview inside Listview is not showing shadow in Android L(Nexus 5). Also the round edges are not properly shown. Here is the code for Listview\'s Adapter View : <?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\" xmlns:app=\"http://schemas.android.com/apk/res/com.example.myapp\" android:layout_width=\"match_parent\"

I cant see any FirebaseRecyclerAdapter items on my layout

落爺英雄遲暮 提交于 2019-11-26 12:20:04
问题 Im trying to retrieve data from Firebase database to my layout and i cant see any items of FirebaseRecyclerAdapter in the layout, please help. i followed a tutorial that showed how to do that and when i run the app i doesn\'t see any items but i can scroll. public class Home extends AppCompatActivity { Button logout; FirebaseAuth firebaseAuth; private static final String Tag = \"Home\"; DatabaseReference dbUsers; DatabaseReference db; private RecyclerView mBlogList; FirebaseAuth