Детали элемента карты RecyclerView не отображаются на устройствах до леденцов.

введите здесь описание изображения

Итак, вот проблема: RecyclerView может отображать сведения об элементе на устройствах Lollipop. Но тот же apk, когда я открывал на устройствах до Lollipop. Вид карты с подробностями не отображается. В чем будет проблема.

RecyclerView (адаптер и ViewHolder)

public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.CustomViewHolder> {
private LayoutInflater inflater;
private List<Story> passedData;
public Context context;

public CustomViewHolder onCreateViewHolder(ViewGroup viewGroup, int i)


    inflater = LayoutInflater.from(viewGroup.getContext());
    View v = inflater.inflate(R.layout.item_view, viewGroup, false);

    CustomViewHolder holder = new CustomViewHolder(v);

    return holder;
}

@Override
public void onBindViewHolder(CustomViewHolder holder, int i) {
    Story s = passedData.get(i);
    holder.title.setText(s.title);
    holder.subTitle.setText(s.subTitle);
    holder.thumbNail.setImageResource(s.thumbimageId);

    setAnimation(holder.container, i);


}

@Override
public int getItemCount() {
    return passedData.size();
}

public class CustomViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

    CardView container;

    TextView title;
    TextView subTitle;
    ImageView thumbNail;
    Typeface tf_regular;

    public CustomViewHolder(View itemView) {
        super(itemView);
        itemView.setOnClickListener(this);
        this.title = (TextView) itemView.findViewById(R.id.storyTitle);
        this.subTitle = (TextView) itemView.findViewById(R.id.storySubTitle);
        this.container = (CardView) itemView.findViewById(R.id.containerView);
        this.thumbNail = (ImageView) itemView.findViewById(R.id.thumbnail);


        tf_regular = Typeface.createFromAsset(context.getAssets(), "fonts/Bertica-Regular.ttf");
        this.title.setTypeface(tf_regular);


    }

styles.xml

<resources>

<!-- Base application theme. -->

<style name="AppTheme" parent="AppTheme.Base">
    <!-- Customize your theme here. -->

</style>

<style name="AppTheme.Base" parent="Theme.AppCompat.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/toolBarBackground</item>

    <item name="colorPrimaryDark">@color/statusBarColor</item>
    <item name="android:windowBackground">@color/gray</item>
    <item name="android:textColorPrimary">@color/textPrimaryColor</item>
    <item name="android:textColorSecondary">@color/textPrimaryColor</item>


</style>

v21/styles.xml

<?xml version="1.0" encoding="utf-8"?>

<style name="AppTheme" parent="AppTheme.Base">

    <item name="android:colorPrimary">@color/toolBarBackground</item>

    <item name="android:colorPrimaryDark">@color/statusBarColor</item>
    <item name="android:windowBackground">@color/gray</item>
    <item name="android:textColorPrimary">@color/textPrimaryColor</item>
    <item name="android:textColorSecondary">@color/textPrimaryColor</item>

</style>

<style name="customPopUpTheme" parent="ThemeOverlay.AppCompat.Light">

    <item name="android:textColor">@color/toolBarBackground</item>
</style>

AndroidManifest.xml

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    android:name=".MyApplication">

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
      </application>

Спасибо за вашу помощь.


comment
опубликуйте код того, как вы получаете доступ к RecyclerView и cardView из xml   -  person nitesh    schedule 03.09.2015
comment
@nitesh также добавил код recyclerView..   -  person Dinesh Sunny    schedule 03.09.2015


Ответы (1)


Я РЕШИЛ ЭТО. По сути, у меня был волновой эффект при просмотре карты. Он не работал на устройствах до леденцов. Я удалил свой волновой эффект, и тогда это прелесть :)

person Dinesh Sunny    schedule 03.09.2015