android-cardview

Unable to get exact circle shape when using card view

帅比萌擦擦* 提交于 2019-12-02 20:09:58
I'm using card view for floating action button in android material design. I'm using following code for get the circle <android.support.v7.widget.CardView android:id="@+id/fab" android:layout_width="38dp" android:layout_height="38dp" android:layout_marginBottom="10dp" android:layout_marginRight="10dp" card_view:background="@color/blue" card_view:cardCornerRadius="19dp" card_view:cardPreventCornerOverlap = "false" card_view:cardElevation="6dp" > </android.support.v7.widget.CardView> I have set corner radius as half of width. but still I can't get the circle shape. I have solved the problem. Now

Center a CardView in a RecyclerView with only one element

人走茶凉 提交于 2019-12-02 20:09:31
I'm using a RecyclerView that contains CardViews with a TextView and a ImageView (Every card represents a city). I also have a onClickListener on every card that leads me to a list of museum in the city. (The RecyclerView is populated by an ArrayList). The list is a RecyclerView composed by the same Cardview that scrolls vertically. When a city has only one museum, how can I display the unique CardView at the center of the screen? This is the activity xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http:/

Override Android-L CardView state_pressed for Older versions of Android

懵懂的女人 提交于 2019-12-02 17:43:21
In the latest Android SDK we now have the new CardView, I have replaced my old CustomCardView with the new version, but when running with this on older versions of Android I see that the state_pressed & state_focused are ugly squares which show up above the CardView... does anyone know how I could emulate the following in the new CardView but only when using older versions of Android? <selector xmlns:android="http://schemas.android.com/apk/res/android" android:enterFadeDuration="150" android:exitFadeDuration="150" > <item android:state_pressed="true" android:drawable="@drawable/card_on_press"/

Why there is no space between CardViews on Lollipop?

陌路散爱 提交于 2019-12-02 14:35:08
I try to use the CardView and it works well below 5.0, but looks strange on Lollipop. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"> <android.support.v7.widget.CardView android:layout_width="match_parent"

how to make Recyclerview & Cardview onClick fetch syncronized data from server

倾然丶 夕夏残阳落幕 提交于 2019-12-02 12:46:44
i have some question with my recyclerview and cardview. This is the cases : 1. I've database with 3 values (name, image, description) 2. In my activity, i've recyclerview and cardview, they only show an image and the name of image. This is my activity : package com.example.mrm.myapplication; public class Child_Tab1 extends Activity { List<GetDataAdapter> GetDataAdapter1; RecyclerView recyclerView; RecyclerView.LayoutManager recyclerViewlayaoutManager; RecyclerView.Adapter recyclerViewadapter; String GET_JSON_DATA_HTTP_URL = "http://www.kinandayu.com/image_content/getAllImage.php"; String JSON

Can't add views or inflate within View Pager inside an Array Adapter

落花浮王杯 提交于 2019-12-02 12:21:28
I used an external library called "Swipe Cards by Diolor" and I attached it to an Array Adapter . Within each card I also need to make a View Pager with bars showing which image the user is currently looking at. The issue I am having is that when I set an OnPageChangeListener on the View Pager it calls method onPageSelected and executed all the code within it. This involves a call to createBars (included below). However, everything in createBars is executed including the barHolder.removeAllView except for the li.inflate statements. I also tried using addView but a similar problem occurs.

Error Android Cardview and Recycler with Volley

我怕爱的太早我们不能终老 提交于 2019-12-02 10:05:05
问题 I have some code to parse JSON data to cardview and recycler with Volley. I want to show json data into my Fragment. I'm getting error but I don't know what is causing it. Anyone maybe can help me please. This my Fragment. public class HomeFragment extends android.support.v4.app.Fragment { private static final String TAG = HomeActivity.class.getSimpleName(); private ArrayList<ListItem> listItems; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

Adding Youtube API with RecyclerView using Firebase in Android

自古美人都是妖i 提交于 2019-12-02 08:20:59
I am building an application in which I want to use Youtube API for running videos but the problem is that the youtube API is copied to all card items where I dont want it to come, I only want a specific post where the video can be played and not on all posts. I am also using RecyclerView and cardView in this application with Firebase as my database.please help me reduce this redundancy problem , I have researched many questions but did not found anything useful. Is there any way by which the video can only be played on some post of cardView and not on all. for example facebook application or

Error Android Cardview and Recycler with Volley

只谈情不闲聊 提交于 2019-12-02 05:01:57
I have some code to parse JSON data to cardview and recycler with Volley. I want to show json data into my Fragment. I'm getting error but I don't know what is causing it. Anyone maybe can help me please. This my Fragment. public class HomeFragment extends android.support.v4.app.Fragment { private static final String TAG = HomeActivity.class.getSimpleName(); private ArrayList<ListItem> listItems; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_home, container, false); ParseData();

How to make a CardView have a clickable&checkable effect, and how to make it dark themed?

偶尔善良 提交于 2019-12-02 02:30:36
问题 Background Before CardView was introduced, I made some selectors on my app to mimic cards, and let the user also choose which theme to use for the app (some prefer a dark theme) : The problem I wanted to make it look&work more natively, so I tried using CardView. Sadly, I fail to understand how to set the CardView have a clickable&checkable effect (the native one of each platform, maybe with a different color), and also have the ability to set it a dark theme. The questions How do I make a