Change cursor color of a TextInputLayout.OutlinedBox of Theme.MaterialComponents

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 reading

How 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 reading

TextInputEditText 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 reading

Left 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 reading

Remove 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