Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8a44c68 authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "Fix NumberPicker text positioning."

parents 1666dc60 eeafd429
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1208,7 +1208,10 @@ public class NumberPicker extends LinearLayout {
        float textGapCount = selectorIndices.length - 1;
        int selectorTextGapHeight = (int) (totalTextGapHeight / textGapCount + 0.5f);
        mSelectorElementHeight = mTextSize + selectorTextGapHeight;
        mInitialScrollOffset = mTextSize - 3 * (mSelectorElementHeight % 2);
        // Ensure that the middle item is positioned the same as the text in mInputText
        int editTextTextPosition = mInputText.getBaseline() + mInputText.getTop();
        mInitialScrollOffset = editTextTextPosition -
                (mSelectorElementHeight * SELECTOR_MIDDLE_ITEM_INDEX);
        mCurrentScrollOffset = mInitialScrollOffset;
        updateInputTextView();
    }