code: private void onPhotoInPagerSelected(int position) {
          Photo photo = pagerAdapter.getPhoto(position);
          if (photo == null) {
              views.pagerTitle.setText(null);
          } else {
              SpannableBuilder title = new SpannableBuilder(DemoActivity.this);
  
              title.append(photo.getTitle()).append("\n")
                      .createStyle().setColorResId(R.color.text_secondary_light).apply()
                      .append(R.string.demo_photo_by).append(" ")
                      .append(photo.getOwner().getUsername());
              views.pagerTitle.setText(title.build());
          }
      }
docs: Setting up photo title for current pager position.