Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

sameCenterHorizontalAs not work #28

Open
sorosunrain opened this issue Jul 12, 2017 · 0 comments
Open

sameCenterHorizontalAs not work #28

sorosunrain opened this issue Jul 12, 2017 · 0 comments

Comments

@sorosunrain
Copy link

sorosunrain commented Jul 12, 2017

@OverRide
public Float getCalculatedValueX(View viewToMove) {
if(horizontal) {

        final float x = viewCalculator.finalPositionLeftOfView(otherView);
        final float myWidth = viewToMove.getWidth() / 2f;
        final float hisWidth = viewCalculator.finalWidthOfView(otherView) / 2f;

        if (myWidth > hisWidth) {
            return x - myWidth + hisWidth;
        } else {
            return x - hisWidth + myWidth;                       [HERE]
        }
    } else return null;
}

does 'return x - hisWidth + myWidth' -> 'return x + hisWidth + myWidth' ?
I think + is right.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant