Android Open Source - Swipeable-Cards Simple Card Stack Adapter






From Project

Back to project page Swipeable-Cards.

License

The source code is released under:

Apache License

If you think the Android project Swipeable-Cards listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.andtinder.view;
/*  w  w w  .  ja  va 2 s .com*/
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.andtinder.R;
import com.andtinder.model.CardModel;

public final class SimpleCardStackAdapter extends CardStackAdapter {

  public SimpleCardStackAdapter(Context mContext) {
    super(mContext);
  }

  @Override
  public View getCardView(int position, CardModel model, View convertView, ViewGroup parent) {
    if(convertView == null) {
      LayoutInflater inflater = LayoutInflater.from(getContext());
      convertView = inflater.inflate(R.layout.std_card_inner, parent, false);
      assert convertView != null;
    }

    ((ImageView) convertView.findViewById(R.id.image)).setImageDrawable(model.getCardImageDrawable());
    ((TextView) convertView.findViewById(R.id.title)).setText(model.getTitle());
    ((TextView) convertView.findViewById(R.id.description)).setText(model.getDescription());

    return convertView;
  }
}




Java Source Code List

com.andtinder.Utils.java
com.andtinder.demo.MainActivity.java
com.andtinder.model.CardModel.java
com.andtinder.model.Likes.java
com.andtinder.model.Orientations.java
com.andtinder.view.BaseCardStackAdapter.java
com.andtinder.view.CardContainer.java
com.andtinder.view.CardStackAdapter.java
com.andtinder.view.SimpleCardStackAdapter.java