android-cardview

Update text within card view list?

江枫思渺然 提交于 2019-12-06 04:21:32
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.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content

Android RecyclerView LayoutManager Exception

最后都变了- 提交于 2019-12-05 16:04:09
问题 Hi I'm having an issue with the new Android Lollipop RecyclerView It keeps crashing with the following exception: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView$LayoutManager.onMeasure(android.support.v7.widget.RecyclerView$Recycler, android.support.v7.widget.RecyclerView$State, int, int)' on a null object reference Full stack trace can found here The code used to initiate the RecyclerView is the same mostly the same as the tutorial, however for some reason this

endless recyclerview along with load onscroll from server in recyclerview using cardview to load images and text

╄→гoц情女王★ 提交于 2019-12-05 07:21:15
问题 I have implemented recyclerview using cardview to fetch images and text from my server using this tutorial: http://www.simplifiedcoding.net/android-custom-listview-with-images-using-recyclerview-and-volley/. I have successfully fetched the data and modified the code according to my requirement, now i want to implement swipe to refresh and endless scrolling similar to Instagram application. I have tried a lot of tutorials and SO questions however i am unable to implement any of them. I am

Aligning items in cardview

女生的网名这么多〃 提交于 2019-12-05 04:01:28
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:layout_width="match_parent" android:layout_height="wrap_content" android:text="Order# GAMH2103"

Ripples not showing with selectableItemBackground as foreground on a CardView with a Android 5.0 device

走远了吗. 提交于 2019-12-05 02:52:34
I'm running this on a Nexus 5. Here's part of the code for my CardView: CardView cardView = new CardView(getActivity()); cardView.setRadius(4); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 400); lp.setMargins(32, 16, 32, 16); cardView.setLayoutParams(lp); cardView.setContentPadding(50, 50, 50, 50); ... cardView.setForeground(selectedItemDrawable); And here's how I get the selectedItemDrawable: int[] attrs = new int[] { R.attr.selectableItemBackground }; TypedArray ta = getActivity().obtainStyledAttributes(attrs); selectedItemDrawable = ta

How to make Cardview According to material design in android?

孤街醉人 提交于 2019-12-04 23:55:06
问题 I saw material design guidelines regarding but it little confusion ,while I design my card having Image on left and some text on right of Image.But I did n't satisfy whether it is according to guide line or not ...pls check and tell. and also I want my dummy text paragraph justify. here is my code :- <android.support.v7.widget.CardView style="@style/MyCardViewStyle" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width=

create view over cardview in android

北慕城南 提交于 2019-12-04 23:33:42
I want to create this layout this is a cardview (gray view) and imageview(blue view) for that i use this code <FrameLayout 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:background="@color/abc_search_url_text_normal" android:orientation="vertical"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="100dp" android:layout_alignParentBottom="true" android:layout_gravity="bottom" android:layout_marginBottom="3dp

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

邮差的信 提交于 2019-12-04 22:29:17
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 with recyclerView and cardView. Can you please explain clearly as to where am I supposed to make

RecyclerView overlapping without shadow

橙三吉。 提交于 2019-12-04 19:32:43
问题 I want to develop List like this picture I had used to RecylerView ItemDecorator for overlap. But it's overlapping without shadow. the screen & decorator code is below public class OverlapDecoration extends RecyclerView.ItemDecoration { private final static int vertOverlap = -50; @Override public void getItemOffsets (Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { outRect.set(0, 0, 0, vertOverlap); } } card_layout.xml <LinearLayout xmlns:android="http://schemas

Make RecyclerView to wrap its content when using CardView with square ImageView

北城以北 提交于 2019-12-04 19:17:00
I am trying to achieve following structure (image below). As you can see there are two sections with RecyclerView s and CardView s in it. These two sections are divided by two TextView s with Button s. Each section should match screen width (minus indent between cards). Each CardView has square ImageView in it. So the height of CardView itself depend on screen width: card_height = screen_width - indent_between_cards + space_for_card_text . To achieve this behaviour I use simple SquareImageView , which looks like this: public class SquaredImageView extends ImageView { public SquaredImageView