gabrielemariotti / cardslib

Android Library to build a UI Card
4.66k stars 1.19k forks source link

CardRecyclerView not showing #488

Open AdityaKamra opened 9 years ago

AdityaKamra commented 9 years ago

Hi Gabriel,

I am trying to make a material card list but nothing is visible. Here is my code: <<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">

<LinearLayout
    android:id="@+id/carddemo_progressContainer"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone"
    android:gravity="center">

    <ProgressBar
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="This is the test Text"
        android:textColor="#000000"
        android:paddingTop="4dip"
        android:singleLine="true"/>

</LinearLayout>

<FrameLayout
    android:id="@+id/carddemo_listContainer"

    android:layout_width="match_parent"
    android:paddingLeft="2dp"
    android:paddingRight="2dp"
    android:layout_height="match_parent">

    <it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="10dp"
        card:list_card_layout_resourceID="@layout/material_card_for_list"
        android:id="@+id/carddemo_recyclerview"/>

    <TextView

        android:id="@android:id/empty"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:textColor="#000000"
        android:textAppearance="?android:textAppearanceMedium"
        android:text="No data..."/>

</FrameLayout>

<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast;

import com.thoughtwings.sportus.R;

import java.util.ArrayList;

import it.gmariotti.cardslib.library.cards.actions.BaseSupplementalAction; import it.gmariotti.cardslib.library.cards.actions.TextSupplementalAction; import it.gmariotti.cardslib.library.cards.material.MaterialLargeImageCard; import it.gmariotti.cardslib.library.internal.Card; import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter; import it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView; import it.gmariotti.cardslib.library.view.CardViewNative;

/**

<it.gmariotti.cardslib.library.view.CardViewNative xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card="http://schemas.android.com/apk/res-auto" android:id="@+id/list_cardId" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/native_recyclerview_card.base" card:card_layout_resourceID="@layout/native_material_largeimage_text_card"/>

screenshot_2015-07-26-22-37-05