4

I have two textinputlayout one in activty and one in bottom sheet dialog, both have same style but the look different, when i focus on the textinputlayout in the activity the stroke become in primary color, and the second textinputlayout in the bottom sheet dialogstay grey when I focused both have same thing

my app style is Theme.MaterialComponents.Light.NoActionBar this is the one in the activity

    <com.google.android.material.textfield.TextInputLayout
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColorHint="@color/colorGrey">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/add_contact_name_et"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="שם"
            android:inputType="text"
            android:singleLine="true"
            android:textColor="@color/colorBlack" />
    </com.google.android.material.textfield.TextInputLayout>

and this is in bottom sheet dialog

    <com.google.android.material.textfield.TextInputLayout
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColorHint="@color/colorGrey">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/add_task_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text"
            android:hint="משימה חדשה"
            android:textSize="18dp"
            android:maxLines="3"
            android:textColor="@color/colorBlack"/>
koby
  • 73
  • 2
  • 6
  • Check out the top answer in this post: https://stackoverflow.com/questions/43852562/round-corner-for-bottomsheetdialogfragment?noredirect=1 . And set attribute @color/#yourcolor in the the style AppBottomSheetDialogTheme – CanonicalBear Oct 18 '19 at 05:35
  • Were you able to solve this? – Shrikant Nov 12 '19 at 07:16
  • @Shrikant the below answer by Reza solves it. Just ensure your styles has something similar or the given attributes are present e.g. `` – Hmerman6006 Aug 01 '23 at 09:00

1 Answers1

1
<com.google.android.material.textfield.TextInputLayout
 android:id="@+id/id"
 style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:hint="@string/hint"
 app:boxStrokeColor="@color/color" <-- changes the stroke color
 app:hintTextColor="@color/color"> <-- changes the hint text color
Reza
  • 906
  • 2
  • 15
  • 29