Git Product home page Git Product logo

awesometextinputlayout's Introduction

AwesomeTextInputLayout Download API

An EditText decorator inspired by the EditText fields in Add New Contact screen of Google's Contact App. EditText is surrounded by a rounded rectangle border. Whenever the edit text receives focus and is empty, Hint is travelled to the top and be part of the border. When it loses focus and still is empty Hint travels back to the original position

Demo

gif of AwesomeTextInputLayout

Adding to project

Gradle

Add below code to your root build.gradle file (if you have multiple modules and only one of them require AwesomeTextInputLayout, add the jcenter() repository only in that module's build.gradle).

allprojects {
    repositories {
        jcenter()
    }
}

And add the following dependency code to your module's build.gradle file.

dependencies {
    implementation "ss.anoop:awesome-textinput-layout:${latest-version}"
}

AwesomeTextInputLayout is added a the immediate parent of the EditText you want to decorate. Below is a simple example

Usage

<ss.anoop.awesometextinputlayout.AwesomeTextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:borderColor="#5300e8"
        app:borderWidth="2dp"
        app:cornerRadius="8dp"
        android:padding="16dp">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Name" />

    </ss.anoop.awesometextinputlayout.AwesomeTextInputLayout>

Customization

Table below describes the properties available to customize the AwesomeTextInputLayout.

Property Name Format Description
borderColor color It defines the color of the border
borderWidth dimension defines the width of border (border stroke width)
cornerRadius dimension defines corner radius of border
padding dimension use padding to adjust the space between border and EditText
animationDuration integer defines the time for the hint animation
animatedTextSize dimension defines the text size of hint when edit text is in focus

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐

License

Copyright 2020 anoop44 (Anoop)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

awesometextinputlayout's People

Contributors

anoop44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

awesometextinputlayout's Issues

Duplicate

This feature or custom behavior is already there in Material Components.

You can use "Outlined Box", from here

P.S: My concern why re-inventing the wheel and there will be lot of edge cases that must have already been addressed in Material Components.

Labels are not displayed when setting a default text

In certain conditions, I have pre-filled fields with something similar to my_field.setText(my_text). But when doing so, the label is not pushed at the top like when writing in an empty field.

PS: manually deleting pre-filled content to add it back works.

passwordToggleEnabled not honored

Hi,

When switching from com.google.android.material.textfield.TextInputLayout to ss.anoop.awesometextinputlayout.AwesomeTextInputLayout the eye icon for toggling password to plain text is not displayed by using app:passwordToggleEnabled="true"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.