I have a TextInputLayout with a dynamic hint. The length of the hint is between 6-10 characters and the length of the input is always smaller (3-5 characters).
Because the length of the Hint string will be different I want to set the layout_width to depend on the length of the hint.
If I just set android:layout_width="wrap_content" it will take the width of the input, not the length of the hint.
This is my code so far:
<android.support.design.widget.TextInputLayout
android:layout_width="95dp"
android:layout_height="wrap_content"
android:background="@drawable/textinput_gray_alt"
local:hintTextAppearance="@style/TextAppearance.App.TextInputLayout">
<android.support.design.widget.TextInputEditText
android:id="@+id/quantityEditFirstValue"
android:fontFamily="@drawable/RobotoMedium"
android:textSize="16sp"
android:background="@null"
android:textColor="@color/tundora"
android:inputType="numberDecimal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:maxLength="7"
local:MvxBind="Text FirstQuantityValue; Hint FirstQuantity.Unit; TextColor NativeColor(FirstQuantityTextColor)"/>
</android.support.design.widget.TextInputLayout>
