I am trying to set transparency to hint colour of floating edittext by setting its alpha value to 0.3.But its not working.I don't see any alpha change in hint colour of editext.
Below is the code
<android.support.design.widget.TextInputLayout
android:id="@+id/input_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/mobile_email"
android:layout_marginLeft="@dimen/dp15"
android:layout_marginRight="@dimen/dp15">
<EditText
android:id="@+id/number"
android:layout_width="match_parent"
android:layout_height="40dp"
android:textColor="@color/numxtcolor"
android:alpha="0.3"
android:hint="@string/mobilehint"
android:textSize="@dimen/sp16"
android:inputType="number"/>
</android.support.design.widget.TextInputLayout>
mobilenumber.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
mobilenumber.setAlpha(1);
} else {
if (TextUtils.isEmpty(mobilenumber.getText().toString())) {
mobilenumber.setAlpha(0.3f);
}
}
mobilenumber.invalidate();
}
});