Customized and RoundedEditText

Overview

CustomEditText

A Collection of features are wrapped into single UI element. By adding a line code in xml, able to access these features,rectangular view with corner radius, font color etc.

Features

1.EditText shape -> rounded corner with radius and changing BG color, Border color.
2.Clear icon visibility when typing
3.Font change via xml
4.Password visibility icon when inputtype in password mode.
5.Change the password toggle color.
6.Add country code in prefix (+91)
7.Change prefix textcolor.

the above features are done through xml file.

Screenshot

Implementation

Using Gradle:


dependencies {
    implementation 'com.libizo:customedittext:1.0.6'
}


Import as Module

Download the below .aar file and add as module into your project

[Donwload module])https://github.com/Rajagopalr3/CustomEditText/blob/master/customedittext-1.0.4.aar


dependencies {
     implementation project(':customedittext')
}

Add this into settings.gradle file:
include ':customedittext'

XML

 <com.libizo.CustomEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:hint="First Name"
            android:inputType="phone"
            android:text="9876543210"
            app:libIZO_setPrefix="+91"
            app:libIZO_setPrefixTextColor="#FF4081"
            app:libIZO_clearIconTint="#8f1f15"
            app:libIZO_setBorderColor="#8f1f15"
            app:libIZO_setBorderView="true"
            app:libIZO_setClearIconVisible="true"
            app:libIZO_setCornerRadius="4dp"
            app:libIZO_setStrokeWidth="2dp"/>

                      

Set Font

Add your font files into assets folder. In string.xml files find your font files like below

    <string name="DroidSansBold">DroidSans-Bold.ttf</string>
    

Attributes

Attributes Description Default Value
libIZO_setBorderView if true rectangle view enabled false in default
libIZO_setBorderColor set border color of edittext grey color in default
libIZO_setStrokeWidth set border width in dp 1 dp in default
libIZO_setBackgroundColor set BG color of edittext transparent color in default
libIZO_setCornerRadius set corner radius of edittextview 1 dp in default
libIZO_setFont set font name in string android's default font
libIZO_setClearIconVisible if true clear icon is enabled false in default
libIZO_clearIconTint set clear icon tint color grey color in default
libIZO_hideShowPasswordIconTint set password icon tint color grey color in default
libIZO_setPrefix set the country code as prefix empty in default
libIZO_setPrefixTextColor set prefix text color default color

License


Copyright 2017 Rajagopal

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.

You might also like...
An extension of Android's TextView, EditText and Button that let's you use the font of your choice

AnyTextView (deprecated) Note: AnyTextView is no longer being maintained. I recommend replacing AnyTextView with the Calligraphy library instead. Frus

Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.
Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

MaskFormatter MaskFormatter adds mask functionality to your EditText. It will prevent user from inserting not allowed signs, and format input as well.

Simple extension for account suggestion and auto completion.

AccountAutoCompleteEditText Just a simple implementation for use of auto complete text view with device account suggestion Usage Just simply put an cu

A simple and flexible Checked TextView or Checkable TextView
A simple and flexible Checked TextView or Checkable TextView

CheckableTextView Checkable TextView [KOTLIN] ⚡ A simple and flexible Checked TextView or Checkable TextView written in Kotlin ⚡ What's New Animation

Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText

Simple Linkable Text Simple way to create link text, such as @username or #hashtag, in Android TextView and EditText Installation Gradle Add dependenc

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.

⚠️ Archived: this repository is no longer going to be maintained. SectionedRecyclerViewAdapter An Adapter that allows a RecyclerView to be split into

A simple library for hide and show text with animation.
A simple library for hide and show text with animation.

ViewMore TextView ViewMore TextView allows you to use a TextView by hiding the content of the text by a number of established lines and to display all

Micro Template 📃 A very tiny and simple text templating library for Kotlin.

Micro Template 📃 A very tiny and simple text templating library for Kotlin. It has very limited features, so it's intended to be used for short templ

Mentions-TextView - Make Mentions and hashtags clickable in Textview
Mentions-TextView - Make Mentions and hashtags clickable in Textview

Mentions Textview Custome Textview with Mentions and hashtags being clickable. D

Comments
  • Getting Runtime exception while implementing library

    Getting Runtime exception while implementing library

    I've added the give example code in my layout filr, but got following error on runtime:

    03-12 21:38:25.757 9166-9166/kaushal28.challenge E/AndroidRuntime: FATAL EXCEPTION: main Process: kaushal28.challenge, PID: 9166 java.lang.RuntimeException: Unable to start activity ComponentInfo{kaushal28.challenge/kaushal28.challenge.signupActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.libIZO.CustomEditText at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.libIZO.CustomEditText Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.libIZO.CustomEditText Caused by: java.lang.ClassNotFoundException: Didn't find class "com.libIZO.CustomEditText" on path: DexPathList[[zip file "/data/app/kaushal28.challenge-2/base.apk"],nativeLibraryDirectories=[/data/app/kaushal28.challenge-2/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.view.LayoutInflater.createView(LayoutInflater.java:609) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.rInflate(LayoutInflater.java:861) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:426) at android.view.LayoutInflater.inflate(LayoutInflater.java:377) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at kaushal28.challenge.signupActivity.onCreate(signupActivity.java:11) at android.app.Activity.performCreate(Activity.java:6679) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

    opened by Kaushal28 3
  • crash when setError and touch for first time

    crash when setError and touch for first time

    hi dear friend. i have problem with your editText.

    when iam set error to editText and click for first touch app crashed

    // this line set error viewUserConfirmPasswordHolder.error = reason

    stackTrace: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.drawable.Drawable.getIntrinsicWidth()' on a null object reference at com.libizo.CustomEditText$1.onTouch(CustomEditText.java:118) at android.view.View.dispatchTouchEvent(View.java:10008) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:447) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871) at android.app.Activity.dispatchTouchEvent(Activity.java:3213) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:409) at android.view.View.dispatchPointerEvent(View.java:10232) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4856) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4717) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4249) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4302) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4268) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4395) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4276) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4452) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4249) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4302) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4268) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4276) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4249) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6676) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6650) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6611) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6803) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:356) at android.os.Looper.loop(Looper.java:138) at android.app.ActivityThread.main(ActivityThread.java:6523) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal. 11-30 21:43:29.728 30707-30707/info.flura.flura E/AndroidRuntime: FATAL EXCEPTION: main Process: info.flura.flura, PID: 30707 java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.drawable.Drawable.getIntrinsicWidth()' on a null object reference at com.libizo.CustomEditText$1.onTouch(CustomEditText.java:118) at android.view.View.dispatchTouchEvent(View.java:10008) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:447) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871) at android.app.Activity.dispatchTouchEvent(Activity.java:3213) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:409) at android.view.View.dispatchPointerEvent(View.java:10232) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4856) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4717) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4249) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4302) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4268) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4395) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4276) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4452) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4249) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4302) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4268) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4276) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4249) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6676) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6650) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6611) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6803) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:356) at android.os.Looper.loop(Looper.java:138) 11-30 21:43:29.729 30707-30707/info.flura.flura E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6523) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

    opened by mehdiyari 2
  • Calls two times to setOnEditorActionListener

    Calls two times to setOnEditorActionListener

    I have a CustomEditText with the following attributes:

    <com.libizo.CustomEditText android:layout_margin="16dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/colorDark" android:hint="@string/search_hint" android:padding="10dp" app:libIZO_clearIconTint="@color/colorDark" app:libIZO_setClearIconVisible="true" android:fontFamily="@font/cc_montserrat" app:libIZO_setBackgroundColor="@color/colorWhite" app:libIZO_setBorderView="true" app:libIZO_setCornerRadius="8dp" app:libIZO_setBorderColor="@color/colorTransparent" android:imeOptions="actionSearch" android:inputType="text" android:id="@+id/fs_cet_search"/>

    For some reason, the method setOnEditorActionListener is being called twice, when pressing the "Search" button on the keyboard

    Search button appears because of

    android:imeOptions="actionSearch" android:inputType="text"

    The issue is the actionSearch. If I use a button to do the search, it does the method once because of course setOnEditorActionListener isn't being called. We are using the onClickListener of the button.

    opened by MKiperszmid 1
Owner
Raja Gopal
Android Developer|Passionate Developer
Raja Gopal
AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URLs (http://), Phone and Email automatically detecting and ability to handle clicks.

AutoLinkTextView Deprecated Please use the new version of AutoLinkTextView AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URL

Arman 1.1k Nov 23, 2022
Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android

Chips EditText Library Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I deve

kpbird 381 Nov 20, 2022
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
A TextView that automatically fit its font and line count based on its available size and content

AutoFitTextView A TextView that automatically fit its font and line count based on its available size and content This code is heavily based on this S

null 899 Jan 2, 2023
MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview.

MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview.

Feras Alnatsheh 1k Dec 20, 2022
Include MatchTextView and MatchButton..Come..you will like it

Android MatchView This project is learned from (https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh) . Thanks for liaohuqiu.. I like the animat

Roger 858 Dec 7, 2022
Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.

Android-RobotoTextView Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the bran

Evgeny Shishkin 782 Nov 12, 2022
Android library contain custom realisation of EditText component for masking and formatting input text

Masked-Edittext Masked-Edittext android library EditText widget wrapper add masking and formatting input text functionality. Install Maven <dependency

Evgeny Safronov 600 Nov 29, 2022
library to implement and render emojis For Android

Release Notes SuperNova-Emoji SuperNova-Emoji is a library to implement and render emojis. Minimum SDK Level: 9 (2.3) Contact Java Usage To use defaul

Hani Al-momani 360 Jan 3, 2023
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

Ali Muzaffar 439 Nov 29, 2022