@Override public int getBaseline (){ return mInputView.getBaseline(); }
public class CTextInputLayout extends TextInputLayout { public CTextInputLayout(Context context) { super(context); } public CTextInputLayout(Context context, AttributeSet attrs) { super(context, attrs); } public CTextInputLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public int getBaseline() { EditText editText = getEditText(); return editText.getPaddingTop() + editText.getBaseline(); } }
public class CTextInputLayout extends TextInputLayout { public CTextInputLayout(Context context) { super(context); } public CTextInputLayout(Context context, AttributeSet attrs) { super(context, attrs); } public CTextInputLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public int getBaseline() { EditText editText = getEditText(); return editText.getPaddingTop() + editText.getBaseline(); } }
private void initializeSelectorWheel() { initializeSelectorWheelIndices(); int[] selectorIndices = mSelectorIndices; int totalTextHeight = selectorIndices.length * mTextSize; float totalTextGapHeight = (getBottom() - getTop()) - totalTextHeight; float textGapCount = selectorIndices.length; mSelectorTextGapHeight = (int) (totalTextGapHeight / textGapCount + 0.5f); mSelectorElementHeight = mTextSize + mSelectorTextGapHeight; // 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(); }
private void initializeSelectorWheel() { initializeSelectorWheelIndices(); int[] selectorIndices = mSelectorIndices; int totalTextHeight = selectorIndices.length * mTextSize; float totalTextGapHeight = (getBottom() - getTop()) - totalTextHeight; float textGapCount = selectorIndices.length; mSelectorTextGapHeight = (int) (totalTextGapHeight / textGapCount + 0.5f); mSelectorElementHeight = mTextSize + mSelectorTextGapHeight; // 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(); }
if (isHorizontalMode()) { x = mCurrentScrollOffset; y = mSelectedText.getBaseline() + mSelectedText.getTop(); if (mRealWheelItemCount < DEFAULT_WHEEL_ITEM_COUNT) { canvas.clipRect(mLeftDividerLeft, 0, mRightDividerRight, getBottom());