3

I have applied android TextInputLayout,it works fine.But when appears Text Input Layout the Edit text become very slow. as well as I have changed the hint color but its not working.

Layout xml:

 <android.support.design.widget.TextInputLayout
                android:id="@+id/register_input_layout_password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLength="15"
                android:lines="1"
                android:id="@+id/Register_fragment_passwo_field"
                android:hint="Password"
                android:layout_gravity="center_vertical"
                android:paddingLeft="35dp"
                android:textColor="#ffffff"
                android:textColorHint="@android:color/white"
                android:layout_marginTop="5dp" />
            </android.support.design.widget.TextInputLayout>

Dependency : compile 'com.android.support:design:23.0.1'

3 Answers3

0

set this property of TextInputLayout android:textColorHint="@android:color/white" for changing the hint color and can i see your code for finding the why text become very slow.

<android.support.design.widget.TextInputLayout
                    android:id="@+id/register_input_layout_password"
                    android:layout_width="match_parent"
                    android:textColorHint="@android:color/white"
                    android:layout_height="wrap_content">
                <EditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:maxLength="15"
                    android:lines="1"
                    android:id="@+id/Register_fragment_passwo_field"
                    android:hint="Password"
                    android:layout_gravity="center_vertical"
                    android:paddingLeft="35dp"
                    android:textColor="#ffffff"
                    android:textColorHint="@android:color/white"
                    android:layout_marginTop="5dp" />
                </android.support.design.widget.TextInputLayout>
0
   <!-- if You Can Change Color of TextInputLayout Like this-->
    <style name="TextLabel" parent="TextAppearance.AppCompat">
        <!-- Hint color and label color in FALSE state -->
        <item name="android:textColorHint">@color/Color Name</item> 
        <item name="android:textSize">20sp</item>
        <!-- Label color in TRUE state and bar color FALSE and TRUE State -->
        <item name="colorAccent">@color/Color Name</item>
        <item name="colorControlNormal">@color/Color Name</item>
        <item name="colorControlActivated">@color/Color Name</item>
     </style>

If you change animation time then customize EditText like this:

public class FloatingEditText extends FrameLayout{

      animation = new AnimatorSet();
      ObjectAnimator move =
          ObjectAnimator.ofFloat(mHintTextView, "translationY", mHintTextView.getHeight() / 8, 0);
      ObjectAnimator fade;
      if (mEditText.isFocused()) {
        fade = ObjectAnimator.ofFloat(mHintTextView, "alpha", 0, 1);
      } else {
        fade = ObjectAnimator.ofFloat(mHintTextView, "alpha", 0, 0.50f);
      }
      animation.playTogether(move, fade);
}
nikis
  • 11,166
  • 2
  • 35
  • 45
vasupujy
  • 442
  • 2
  • 11
0
 <android.support.design.widget.TextInputLayout
                android:id="@+id/il_second_phone_number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/view_margin_micro"
                android:textColorHighlight="@color/color_darker_gray"
                android:textColorHint="@color/color_darker_gray">

                <EditText
                    android:id="@+id/et_second_phone_number"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/layout_height_normal"
                    android:backgroundTint="@color/color_darker_gray"
                    android:hint="@string/second_phone_number"
                    android:inputType="phone"
                    android:maxLines="1"
                    android:text="@={vm.cPhoneTwo}"
                    android:textColor="@color/color_black" />
            </android.support.design.widget.TextInputLayout>
  • This link wii be help you,"http://stackoverflow.com/questions/30546430/how-to-change-the-floating-label-color-of-textinputlayout" – Mahesh Kedari Dec 16 '16 at 13:14