Beispiel #1
0
  private void updateCards() {
    if (mPlace != null) {
      mViewHolder.Toolbar.setTitle(mPlace.mName);

      if (!TextUtils.isEmpty(mPlace.mImageUrl)) {
        Picasso.with(getContext()).load(mPlace.mImageUrl).into(mViewHolder.ToolbarImage);
      }

      mAdapter.setCards(mPlace.mCards);
    }
  }
Beispiel #2
0
  private void addClickListeners() {
    if (mViewHolder != null) {
      mAdapter.setOnCardClickedListener(
          new CardsAdapter.OnCardClickedListener() {
            @Override
            public void onCardClick(PlaceCard card) {
              IntentManager.startUrlIntent(card.mUrl, getActivity(), mViewHolder.RecyclerView);
            }
          });

      mViewHolder.RefreshButton.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              fetchNewPlace();
            }
          });
    }
  }