@Override
 protected void onLayout(boolean changed, int l, int t, int r, int b) {
   super.onLayout(changed, l, t, r, b);
   if (changed && mWrappedView != null) {
     sTempRect.left = (int) mWrappedView.getPivotX();
     sTempRect.top = (int) mWrappedView.getPivotY();
     offsetDescendantRectToMyCoords(mWrappedView, sTempRect);
     setPivotX(sTempRect.left);
     setPivotY(sTempRect.top);
   }
 }
Exemplo n.º 2
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);
    }
  }
Exemplo n.º 3
0
 public static float getPivotY(View view) {
   return view.getPivotY();
 }
Exemplo n.º 4
0
 @Override
 public float getPivotY(View view) {
   return view.getPivotY();
 }