Android Floating Label

Additional

Language
Java
Version
N/A
Created
Feb 28, 2014
Updated
Apr 18, 2017 (Retired)
Owner
Hardik Trivedi (hardik-trivedi)
Contributors
Hardik Trivedi (hardik-trivedi)
hardik-webonise
bryant1410
3
Activity
Badge
Generate
Download
Source code

Announcement

FloatingLabel

FloatingLabel Allows you to create a blow kind of EditText.

To explain the concept well I have taken below image from http://dribbble.com/shots/1254439--GIF-Float-Label-Form-Interaction

Floating Lable project is in initial mode, where a few customization is provided like changing Text color of EditText and Its Lable

<com.hardik.floatinglabel.FloatingLabelView
        android:id="@+id/label1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        floatview:floatHintText="Whatever hint you want to display"
        floatview:textColor="@color/blue"
        floatview:textTypeface="some_custome_font.ttf"/>

Features

Float Hint Text

  • Specifies the text for float hint label
 floatview:floatHintText="@string/app_name"

Float Hint Text Color

  • Specifies text color for float hint label both for focused mode and unfocused mode
 floatview:floatHintTextColorFocused="@color/blue"
        floatview:floatHintTextColorUnFocused="@color/green"

Float Hint Text Style

  • Specifies the text style, bold,normal,italic
 floatview:floatHintTextStyle="bold"

Float Hint Text Gravity

  • Specifies gravity of text left,right,top,bottom
 floatview:floatHintTextGravity="right"

Float Hint Text Size

  • Specifies text size
 floatview:floatHintTextSize="20"

Float Hint Text Custom Typeface

  • Specifies custom font. (It has to be in to the assets folder e.g. /assets/some_font.ttf)
 floatview:floatHintTextTypeface="Ithornet.ttf"

Float Hint Text Background

  • Specifies custom background. You can specify both color and drawable.
 floatview:floatHintTextBackground="@drawable/label_bg"

Actual Text

  • Specifies the text for editable text box
 floatview:text="Label 1"

Actual Text Color

  • Specifies text color for editable text box
 floatview:textColor="@color/red"

Actual Text Style

  • Specifies the text style, bold,normal,italic
 floatview:textStyle="bold"

Actual Text Gravity

  • Specifies gravity of text left,right,top,bottom
 floatview:textGravity="right"

Actual Text Size

  • Specifies text size
 floatview:textSize="20"

Actual Text Custom Typeface

  • Specifies custom font. (It has to be in to the assets folder e.g. /assets/some_font.ttf)
 floatview:textTypeface="Ithornet.ttf"

Actual Text Background

 floatview:textBackground="@drawable/edt_bg"

Actual Text As Password

 floatview:isPassword="true"