Exemple #1
0
 @Override
 public int getItemCount() {
   if (currentCategoryView == CategoryDialogFragment.ALL_CATEGORIES) {
     return BlocSpotApplication.getSharedDataSource().getAllPointsOfInterest().size();
   } else {
     return BlocSpotApplication.getSharedDataSource()
         .getPointsOfInterestForCategory(currentCategoryView)
         .size();
   }
 }
Exemple #2
0
    void update(PointOfInterest pointOfInterest, OnPointOfInterestClickListener listener) {
      this.pointOfInterest = pointOfInterest;
      title.setText(pointOfInterest.getTitle());
      address.setText(pointOfInterest.getAddress());
      visited.setChecked(pointOfInterest.isVisited());
      this.listener = listener;

      String categoryName =
          BlocSpotApplication.getSharedDataSource()
              .getPOIfromDBwithTitle(pointOfInterest.getTitle())
              .getPoiCategory();
      int color =
          BlocSpotApplication.getSharedDataSource()
              .getCategoryFromDBWithCategoryName(categoryName)
              .getColor();

      wrapper.setBackgroundColor(color);
    }
Exemple #3
0
 @Override
 public void onBindViewHolder(ItemAdapter.ItemAdapterViewHolder itemAdapterViewHolder, int i) {
   DataSource sharedDataSource = BlocSpotApplication.getSharedDataSource();
   if (currentCategoryView == CategoryDialogFragment.ALL_CATEGORIES) {
     itemAdapterViewHolder.update(sharedDataSource.getAllPointsOfInterest().get(i), listener);
   } else {
     itemAdapterViewHolder.update(
         sharedDataSource.getPointsOfInterestForCategory(currentCategoryView).get(i), listener);
   }
 }