Issue In my application I am using textfield.TextInputLayout and textfield.TextInputEditText as input text, instead of the usual EditText. This is my view: <com.google.android.material.textfield.TextInputLayout android:id=”@+id/inputId” style=”@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_marginStart=”@dimen/fab_margin” android:layout_marginEnd=”@dimen/fab_margin” android:focusedByDefault=”false” android:enabled=”true” android:hint=”@string/userHint” android:textColor=”@color/letter_medium_emphasis” app:boxCornerRadiusBottomEnd=”@dimen/OutLinedBoxCorners” app:boxCornerRadiusBottomStart=”@dimen/OutLinedBoxCorners” app:boxCornerRadiusTopEnd=”@dimen/OutLinedBoxCorners” app:boxCornerRadiusTopStart=”@dimen/OutLinedBoxCorners” app:boxStrokeColor=”@color/letter_medium_emphasis” app:counterEnabled=”true” app:counterMaxLength=”20″
Continue readingTag: android-textinputlayout
How to prevent automatic resizing of MaterialAlertDialogBuilder height when the keyboard is open?
Issue I have built a custom dialog with MaterialAlertDialogBuilder. The dialog has 2 TextInputLayouts. The problem is when I try to write something in the TextInputEditText and when the keyboard is visible, the MaterialAlertDialogBuilder shrinks in height. In XML code:
Continue readingChange underline color and floating hint color of TextInputLayout
Issue I’m using the above property in my TextInputLayout theme to make the underline color of the TextInputLayout green when activated. <item name=”colorControlActivated”>#27e905</item> Its works fine and I get the following result But as you can see colorControlActivated also affects
Continue readingHow to change the cursor color in textinputedittext inside textinputlayout
Issue How to change the cursor color of textinputedittext. I used textcursordrawable but it doesn’t work. Thanks in advance Solution If you want to change only the cursor color, you can use: <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:theme="@style/ThemeOverlay.AppTheme.TextInputEditText.Outlined" ….> with: <style name="ThemeOverlay.AppTheme.TextInputEditText.Outlined" parent="">
Continue readingAndroid TextInputLayout endIconDrawable appears gray instead of image
Issue TextInputLayout endIconDrawable displaying as gray instead of needed image. Only this image renders as gray. I tried the image as png and also imported svg as vector asset. Both are not working as expected. I tried setting image in
Continue readingTextInputEditText Hint remains in the background when the field value is set programmatically
Issue I determine the user’s location and display it in a TextInputEditText field. The hint, however, remains in the background. What am I doing wrong? <com.google.android.material.textfield.TextInputLayout android:id="@+id/textLayoutAutocomplete" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/standort" android:layout_weight="1"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/autocomplete" android:focusableInTouchMode="false" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="text" /> </com.google.android.material.textfield.TextInputLayout>
Continue readingOnClickListener in TextInputEditText wrapped around TextInputLayout
Issue I have got a TextInputEditText wrapped around a TextInputLayout, as Google recommends to do: https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html However, my TextInputEditText has an OnClickListener set on it so when it gets tapped by the User, a DatePickerDialog can popup. My issue is
Continue readingLeft Icon in TextInputLayout
Issue I’m trying to add an Left Icon to my TextInputLayout, but text get over the Icon. When I add a padding, everything move together. I tried with android:drawableLeft=”@drawable/ic_store_white_48dp” android:drawablePadding=”50dp” android:drawableStart=”@drawable/ic_store_white_48dp” But it is not working ! I should implement
Continue readingChange the TextInputLayout outline box color programmatically
Issue I would like to change outline of the TextInputLayout programmatically, but I cannot seem to get it to work. There is an option to do it via XML (question by other SO user using XML), but that is unusable
Continue readingRemove underline from TextInputEditText
Issue I have an android screen which takes email from the user. Below is the snippet of the code, I want to remove the underline which appears below the text. <com.google.android.material.textfield.TextInputLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_margin=”8dp” android:hint=”@string/email” android:textColorHint=”@color/blueBackground” app:boxBackgroundColor=”@color/input_background” app:boxCornerRadiusBottomEnd=”20dp” app:boxCornerRadiusBottomStart=”20dp” app:boxCornerRadiusTopEnd=”20dp”
Continue reading