Question: Is it possible to change the text of the floating hint depending on whether the text is floating over or is inside an `EditText`? 

For example, when the field is empty, I would like to see text "Your name", and when the hint is floating, I would like to see text "Name". 

This is how it looks now:

```
<android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                >

                <EditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Your name"
                    android:textColorHint="@color/dark_grey"
                    android:textColor="@color/dark_grey"
                    android:background="@drawable/edittext_bg"
                    >
                    <requestFocus/>
                </EditText>

</android.support.design.widget.TextInputLayout>

```

Answer: 
It will be done with help of TextInputLayout and EditText's onFocusChangeListener,

```
textInputLayoutEmail.setHint("Enter your Email id");

editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                textInputLayoutEmail.setHint("Email");
            }
        });

```

Remove hint from EditText in xml file,

```
<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColorHint="@color/dark_grey"
        android:textColor="@color/dark_grey"
        android:background="@drawable/edittext_bg">

        <requestFocus />
    </EditText>

</android.support.design.widget.TextInputLayout>

```
```
EditText.addTextChangedListener(new TextWatcher() {
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            // TODO Auto-generated method stub              
        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
            // TODO Auto-generated method stub      
        }
        @Override
        public void afterTextChanged(Editable s) {
            EditText.setHint("Name");    
        }
    });

```