示例#1
0
 private void setupCardView(View view) {
   mCardContainer = (CardContainer) view.findViewById(R.id.layoutview);
   Resources r = getResources();
   SimpleCardStackAdapter adapter =
       new SimpleCardStackAdapter(getActivity(), responseModelArrayList);
   for (int i = 0; i < responseModelArrayList.size(); i++) {
     adapter.add(new CardModel());
   }
   mCardContainer.setAdapter(adapter);
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.mainlayout);

    mCardContainer = (CardContainer) findViewById(R.id.layoutview);

    BindableCardStackAdapter adapter = new BindableCardStackAdapter(this);
    adapter.registerAdapterDataBinder(new DifferentCardBinder(this));
    adapter.setWrapperBackgroundResource(android.R.color.white);

    ArrayList<Object> cards = new ArrayList<Object>();
    cards.add(new DifferentCard("Title1", "Description goes here"));
    cards.add(new DifferentCard("Title2", "Description goes here"));
    cards.add(new DifferentCard("Title3", "Description goes here"));
    cards.add(new DifferentCard("Title4", "Description goes here"));

    adapter.addAll(cards);

    mCardContainer.setMaxVisible(3);
    mCardContainer.setAdapter(adapter);
    mCardContainer.setOrientation(Orientations.Orientation.Ordered);
  }
示例#3
0
 @Override
 public void showLoading() {
   mCardContainer.setVisibility(View.GONE);
   mProgressBar.setVisibility(View.VISIBLE);
 }
示例#4
0
 @Override
 public void addToCards(PsychNote note) {
   mCustomCardsAdapter.addNotes(note);
   mCardContainer.setAdapter(mCustomCardsAdapter);
 }
示例#5
0
 private void initialiseCards() {
   mCustomCardsAdapter = new CustomCardsAdapter(this);
   mCardContainer.setAdapter(mCustomCardsAdapter);
 }