- private void toLeft(View v, int l, int t, int r, int b, int orientation, int rotation, Rect anchor) {
+ private void center(View v, Rect other, int rotation) {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) v.getLayoutParams();
+ int tw = lp.leftMargin + v.getMeasuredWidth() + lp.rightMargin;
+ int th = lp.topMargin + v.getMeasuredHeight() + lp.bottomMargin;
+ int cx = (other.left + other.right) / 2;
+ int cy = (other.top + other.bottom) / 2;
+ v.layout(cx - tw / 2 + lp.leftMargin,
+ cy - th / 2 + lp.topMargin,
+ cx + tw / 2 - lp.rightMargin,
+ cy + th / 2 - lp.bottomMargin);
+ }
+
+ private void toLeft(View v, Rect other, int rotation) {