Skip to content

Feature Request - Add baseline alignment support to TextInputLayout #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hkurokawa opened this issue Dec 20, 2016 · 3 comments
Closed
Assignees

Comments

@hkurokawa
Copy link

Overview

Context, problem or idea, solution or next step

Since 24.2.0, there is no way to align the baseline of the EditText surrounded by a TextInputLayout with the baseline of another component. I believe there are many situations where baseline alignment is required, such as showing an icon on the left of the input field, showing a unit label on the right of the field, and so on.

I am wondering if TextInputLayout could return the baseline position of its child with the getBaseline() method, the behaviour would be consistent and it would be helpful to many developers.

Thanks.

Screenshots/Video (if possible)

N/A

Stack trace (if possible)

N/A

Reproduction steps

In the below layout, @id/my_edit_text and @id/my_unit_label are not aligned on their baseline.

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <android.support.design.widget.TextInputLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/my_edit_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text" />

    </android.support.design.widget.TextInputLayout>

    <TextView
        android:id="@+id/my_unit_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/unit_label"/>
</LinearLayout>

Version number

25.1.0

Operating system and device

All Android OS and Android devices

Related issues

https://code.google.com/p/android/issues/detail?id=224553

@jestelle
Copy link

This is something we're interested in too and are working towards addressing. No promises on how quickly, but it's on our radar.

@raphaelbgr
Copy link

This would be really awesome, I'm trying to align two spinners with an EditText inside a TextInputLayout too.

screen

@reemhalamish
Copy link

Any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants