Example #1
0
  /** Positions the media view using the given offset (on the y axis) */
  private void offsetMediaView(boolean viewerVisible, float offset) {
    if (viewerVisible) {
      // finally position the viewer
      viewer.setTranslationY(-offset);
      viewer.setVisibility(View.VISIBLE);

      // position the repost badge, if it is visible
      if (repostHint.getVisibility() == View.VISIBLE) {
        repostHint.setTranslationY(viewer.getPaddingTop() - repostHint.getPivotY() - offset);
      }
    } else {
      viewer.setVisibility(View.INVISIBLE);
    }
  }