0

this is from my xml file :

<android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/editTextDonorName"
            android:inputType="textPersonName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Name" />
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Category"
            style="@style/InputLabel" />
    <Spinner
        android:id="@+id/editTextCategory"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:hint="Category"
        android:inputType="text"
        android:padding="10dp" />
    </android.support.design.widget.TextInputLayout>

this is what I get when I select the spinner https://i.stack.imgur.com/dm8Ts.jpg

So, as you can see, the editTextDonorName is still in active state and as if it is still selected. I want it to not be and to change the color of the textView "Category" when the spinner is selected.

1 Answers1

1

Inside your spinner's click listener add requestFocus(); That will make the edit text lose focus and go back to the colour you want.

Nikos Hidalgo
  • 3,666
  • 9
  • 25
  • 39