MaterialTextField Documentation

repository·master·Indexed 23 days ago

https://github.com/florent37/materialtextfield

An Android library providing a visually enhanced 'Floating Edit Text' component based on Material Design principles. Includes documentation on Gradle installation, XML layout implementation, and configuration attributes such as mtf_image, mtf_labelColor, and mtf_animationDuration.

Tokens
566
Snippets
2
Records
3
Agent score
31%

What's inside MaterialTextField

  1. Use MaterialTextField in XML layouts

    master

    To implement the floating edit text effect, wrap a standard EditText inside a com.github.florent37.materialtextfield.MaterialTextField component.

    Note: You must provide a drawable to the app:mtf_image attribute for the component to function correctly.

    <com.github.florent37.materialtextfield.MaterialTextField
            android:layout_width="300dp"
            android:layout_height="wrap_content"
            app:mtf_labelColor="#666"
            app:mtf_image="@drawable/ic_mail_grey600_24dp"
            >
    
            <EditText
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:hint="Password"
                 android:textColor="#333"
                 android:textSize="15sp" />
    
    </com.github.florent37.materialtextfield.MaterialTextField>
  2. Reference MaterialTextField XML attributes

    master

    The following attributes are available for configuring the MaterialTextField component:

    AttributeDescription
    app:mtf_cardCollapsedHeightSets the height of the card when it is in a collapsed state.
    app:mtf_imageA drawable resource to be displayed as an icon.
    app:mtf_animationDurationThe duration of the animations (in milliseconds).
    app:mtf_labelColorThe color of the floating label.
    app:mtf_openKeyboardOnFocusBoolean determining if the keyboard should open when the field is focused.
    app:mtf_hasFocusBoolean to manually set the focus state (added in v1.0.6).