Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.

Overview

TextFieldBoxes

Build Status JitPack Android Arsenal API GitHub issues GitHub forks GitHub stars GitHub license

Animation

A new Material Design text field that comes in a box, based on Google Material Design guidelines.

🇨🇳 中文看这里

Buy Me a Coffee at ko-fi.com

UPDATE NOTICE

1.4.5 Release

  • Fix attr/counterTextColor name conflict (#97 #99 #105). The counterTextColor property is now renamed to mCounterTextColor.

1.4.4 Release

  • Layout updated to support bigger clear icon and end icons (#72).

1.4.3 Release

Requirements

  • Android 4.0.3 IceCreamSandwich (API lv 15) or greater
  • Your favorite IDE

Installation

In order to use it, you need to include it in your project.

Gradle:

allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
}
dependencies {
    compile 'com.github.HITGIF:TextFieldBoxes:1.4.5'
}

Maven:

<repositories>
    <repository>
         <id>jitpack.io</id>
         <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.HITGIF</groupId>
    <artifactId>TextFieldBoxes</artifactId>
    <version>1.4.5</version>
</dependency>

SBT:

resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.4.5"

Leiningen:

:repositories [["jitpack" "https://jitpack.io"]]
:dependencies [[com.github.hitgif/textfieldboxes "1.4.5"]]

Usage

Table of Contents

  1. Basic
  2. Enable / Disable
  3. Helper Text & Error Text
  4. Prefix & Suffix
  5. Max & Min Characters
  6. Icon Signifier
  7. End Icon
  8. Clear Button
  9. Custom Colors
  10. Dense Spacing
  11. Always Show Hint
  12. Text Change Watcher
  13. Dark Theme
  14. Manual Validate Error

1. Basic

Add studio.carbonylgroup.textfieldboxes.TextFieldBoxes that contains a studio.carbonylgroup.textfieldboxes.ExtendedEditText to your layout:

...
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    android:id="@+id/text_field_boxes"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:labelText="Label"
    >

    <studio.carbonylgroup.textfieldboxes.ExtendedEditText
        android:id="@+id/extended_edit_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        />

</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
...

NOTE that app:labelText is optional from release 1.3.6.

2. Enable / Disable

app:enabled in xml or setEnabled(boolean enabled) in Java.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:enabled="false"
    >

3. Helper Text & Error Text

NOTE: setting helper or error text to anything not empty will make the bottom view (which contains the helper label) visible and increase the height of the TextFieldBoxes. So if you want to always keep the bottom view visible (height increased), set the helper text to " " when there should be nothing.

helper text: app:helperText in xml or setHelperText(String helperText) in Java.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:helperText="Helper is here"
    >

error text: setError(String errorText, boolean giveFocus) in Java.

Param giveFocus determines whether the field will gain focus when set error on. If true, the field gains focus immediately.

NOTE: Error will be removed when the text changes (input or delete).

setError("Error message");

4. Prefix & Suffix

! NOTE: Prifix and Suffix attributes should be set to ExtendedEditText.

Use app:prefix in xml or setPrefix(String prefix) in Java to set the unselectable prefix text at the start of the field.

Use app:suffix in xml or setSuffix(String suffix) in Java to set the unselectable suffix text at the end of the field.

<studio.carbonylgroup.textfieldboxes.ExtendedEditText
    ...
    app:prefix="$ "
    >

<studio.carbonylgroup.textfieldboxes.ExtendedEditText
    ...
    app:suffix="\@gmail.com"
    >

5. Max & Min Characters

NOTE: setting max or min character will make the bottom view (which contains the counter label) visible and increase the height of the TextFieldBoxes.

Use app:maxCharacters in xml or setMaxCharacters(int maxCharacters) in java code to set the max characters count. Use removeMaxCharacters() in java code to remove the limit.

Use app:minCharacters in xml or setMinCharacters(int minCharacters) in java code to set the min characters count. Use removeMinCharacters() in java code to remove the limit.

The color of the bottom line will turn to errorColor (red by default) when exceeding max or min characters limit. 0, as default, means no max or min characters limit.

NOTE: Space and line feed will NOT count.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:maxCharacters="10"
    app:minCharacters="5"
    >

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:maxCharacters="5"
    >

6. Icon Signifier

Use app:iconSignifier in xml or setIconSignifier(Int resourceID) to set the icon that is shown in front of the TextFieldBoxes if you want there to be one.

You can use setIsResponsiveIconColor(boolean isrResponsiveIconColor) in Java code to set whether the icon will change its color when gaining or losing focus as the label text and the bottomLine do. NOTE that if true, the icon's color will always be HighlightColor (the same as the bottomLine) that will turn gray when losing focus. If false, the icon will always be in primaryColor.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:iconSignifier="@drawable/ic_vpn_key_black_24dp"
    >

7. End Icon

Use app:endIcon in xml or setEndIcon(Int resourceID) to set the icon of the ImageButton that is shown at the end of the field if you want there to be one.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:endIcon="@drawable/ic_mic_black_24dp"
    >

To make it useful (trigger voice input, dropdown event), you would like to use getEndIconImageButton() in Java code to set, for example, what will happen when it's clicked (with .setOnClickListener()), or anything else you want.

final TextFieldBoxes textFieldBoxes = findViewById(R.id.text_field_boxes);
textFieldBoxes.getEndIconImageButton().setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        // What you want to do when it's clicked
    }
});

8. Clear Button

Use app:hasClearButton in xml or setHasClearButton(boolean hasClearButton) to set whether to show the clear button.

If true, a clear button will be shown at the end when there are characters (ANY character) entered in the field.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:hasClearButton="true"
    >

9. Custom Colors

Primary Color will be used for the color of the underline, the floating label text and the icon signifier when HAVING focus. You can use app:primaryColor in xml or setPrimaryColor(int colorRes) in Java. Current theme Primary Color by default.

Secondary Color will be used for the color of the underline, the floating label text and the icon signifier when NOT HAVING focus. You can use app:secondaryColor in xml or setSecondaryColor(int colorRes) in Java. Current theme textColorTertiary by default.

Error Color will be used for the color that indicates error (e.g. exceeding max characters, setError()). You can use app:errorColor in xml or setErrorColor(int colorRes) in Java. A400 red by default.

Helper Text Color will be used for the color of the helper text. You can use app:helperTextColor in xml or setHelperTextColor(int colorRes) in Java. 54% black by default.

Panel Background Color will be used for the color of panel at the back. You can use app:panelBackgroundColor in xml or setPanelBackgroundColor(int colorRes) in Java. 6% black by default. NOTE that the default color, as in the guideline, is the black (#000000) color with the transparency of 6%, so when you're customizing and want it to still be transparent you have to set a color with transparency.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:primaryColor="#1B5E20"
    app:errorColor="#ddaa00"
    app:helperTextColor="#795548"
    app:panelBackgroundColor="#ffe8e8"
    >

Ripple Color will be used for the ripple effect when the view is clicked. You can customize it in your styles.xml by adding the following:

<style name="TextFieldBoxes">
    <item name="android:colorControlHighlight" tools:targetApi="lollipop">YOUR_COLOR</item>
</style>

then set this as the theme for your TextFieldBoxes:

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    android:theme="@style/TextFieldBoxes"
    >

10. Dense Spacing

You can make the layout compact by using a dense verticle spacing to improve user experience in some cases.

Use app:useDenseSpacing in xml or setUseDenseSpacing(boolean useDenseSpacing) to set whether the field uses a dense spacing between its elements.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:useDenseSpacing="true"
    >

11. Always Show Hint

Sometimes you may want the label and the hint to show different messages, but need the hint to always be shown (instead being blocked by the label when losing focus).

Use app:alwaysShowHint in xml or setAlwaysShowHint(boolean alwaysShowHint) to set whether the label is fixed at top when there's a hint in the EditText.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:alwaysShowHint="true"
    >

12. Text Change Watcher

It is strongly recommanded to use setSimpleTextChangeWatcher() to listen the event of changing text instead of addTextChangedListener().

This has the following advantages:

  1. You don't need to implement beforeTextChanged() and onTextChanged() method when unnecessary.
  2. Avoids potential unexpected behavior, by guaranteeing your code to run after the default processes (remove error, update counter text, etc.) are finished.
  3. When the view is recycled, no manual remove call is needed.

e.g.

final TextFieldBoxes textFieldBoxes = findViewById(R.id.text_field_boxes);
textFieldBoxes.setSimpleTextChangeWatcher(new SimpleTextChangedWatcher() {
    @Override
    public void onTextChanged(String theNewText, boolean isError) {
        // What you want to do when text changes
    }
});

13. Dark Theme

TextFieldBoxes use the color attributes within the current theme and will automatically change its color to fit the dark theme without additional settings.

14. Manual Validate Error

By default, the error state of the field is validated each time the text changes and also at time of construction. This means a field with a minimum length requirement will start in the Error state.

Setting app:manualValidateError to true will make the field validate error only when validate() is called.

<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
    ...
    app:manualValidateError="true"
    >
final TextFieldBoxes textFieldBoxes = findViewById(R.id.text_field_boxes);
// The error state will only be updated when this is called
textFieldBoxes.validate()

All Attributes

ExtendedEditText

Texts
Attribute Description
app:prefix Prefix Text
app:suffix Suffix Text
Colors
Attribute Description Default
app:prefixTextColor Prefix text color Current theme textColorTertiary
app:suffixTextColor Suffix text color Current theme textColorTertiary

TextFieldBoxes

Texts
Attribute Description
app:labelText Floating label text at the top
app:helperText Helper text at the bottom
Colors
Attribute Description Default
app:helperTextColor Helper text color Current theme textColorTertiary
app:mCounterTextColor Counter text color Current theme textColorTertiary
app:errorColor The color that is used to indicate error (e.g. exceeding max characters, setError()) A400 red
app:primaryColor The color for the underline, the floating label text and the icon signifier when HAVING FOCUS Current theme colorPrimary
app:secondaryColor The color for the underline, the floating label text and the icon signifier when NOT HAVING FOCUS Current theme textColorTertiary
app:panelBackgroundColor The color for the panel at the back 6% Current theme colorForeground
Icons
Attribute Description Default
app:iconSignifier The resource ID of the icon before the TextFieldBoxes 0
app:endIcon The resource ID of the icon at the end of the field 0
app:isResponsiveIconColor whether the icon signifier will change its color when gaining or losing focus as the label and the bottomLine do True
Characters counter
Attribute Description Default
app:maxCharacters Max characters count limit. 0 means no limit 0
app:minCharacters Min characters count limit. 0 means no limit 0
Others
Attribute Description Default
app:enabled Whether the text field is enabled True
app:hasClearButton Whether to show the clear button at the end of the EditText False
app:hasFocus Whether the EditText is having the focus False
app:alwaysShowHint Whether the label is fixed at top when there's a hint in the EditText False
app:useDenseSpacing Whether the field uses a dense spacing between its elements False
app:manualValidateError Whether to validate error state only when validate() is called False

License

Copyright 2020 Mark Wang

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.
Comments
  • Wrap_content height issue

    Wrap_content height issue

    Hello, thanks for your lib, looks really nice :)

    But i found some problem android:layout_height="wrap_content" make view's height matching to parent height. Expected behavior: height corresponds to the height of the EditText's lines

    bug 
    opened by orteney 12
  • Issues with layout

    Issues with layout

    <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
        android:id="@+id/text_field_boxes"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/image_logo"
        android:layout_marginEnd="@dimen/activity_horizontal_margin"
        android:layout_marginStart="@dimen/activity_horizontal_margin"
        app:errorColor="@color/nc_white_color_complete"
        app:helperText=" "
        app:labelText="@string/nc_server_url"
        app:panelBackgroundColor="@color/colorPrimary"
        app:primaryColor="@color/nc_white_color_complete">
    
        <studio.carbonylgroup.textfieldboxes.ExtendedEditText
            android:id="@+id/extended_edit_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:imeOptions="actionDone"
            android:inputType="textUri"
            android:minWidth="5dp"
            android:singleLine="true"
            android:textColor="@color/nc_white_color_complete"/>
    
    </studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
    

    screen shot 2018-01-25 at 15 29 36 screen shot 2018-01-25 at 15 30 02

    One is Android 6. One is Android 7. Notice how on 6 the TextFieldBoxes takes entire height despite being set to wrap_content :-/

    opened by mario 10
  • Use another text widget, for example AutoCompleteTextView

    Use another text widget, for example AutoCompleteTextView

    Thanks for your lib, it's really great to have it.

    I would like to know how I could use it for autocomplete text views? I tried to wrap one inside a TextFieldBoxes but this fails:

    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
        at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.setLabelText(TextFieldBoxes.java:748)
        at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.triggerSetters(TextFieldBoxes.java:718)
        at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:224)
    

    I'm guessing I can't put any widget I want there. Is there a way I could hack this in? Thanks

    enhancement 
    opened by BenoitDuffez 6
  • Change size of the Label text

    Change size of the Label text

    Sometimes the size of the label text is too big and take two lines so when the edit text has the focus it animate to the top it still taking two lines but now there are enough space to fill it in one line

    opened by manuellq 6
  • Will not compile after including the library

    Will not compile after including the library

    After including the library in Android Studio 2.3, targeting SDK 25 by:

    allprojects { repositories { ... maven { url 'https://jitpack.io' } } } dependencies { compile 'com.github.HITGIF:TextFieldBoxes:1.3.8' }

    I got the following error:

    Error:(754) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

    which references a string resource:

    %s%s%s%s

    I THINK the correct way to do this, is either to set formated=false for this string, or specify in the way: %1$s%2$s%3$s%4$s.

    opened by gogoalsoft 5
  • No actions on long click?

    No actions on long click?

    Does ExtendedEditText supports the usual copy, paste and other actions when long clicking? Because absolutely nothing comes up when I long click on an empty ExtendedEditText

    opened by mario 4
  • Compact?

    Compact?

    Any thoughts on supporting the compact Text Fields? How difficult would it be? I think support for these is coming in the design library but it seems to be moving very slowly.

    Thanks

    enhancement 
    opened by KennyGoers 4
  • android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.LayerDrawable

    android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.LayerDrawable

    Hello, I try to use this code in my xml code.

    <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
        android:id="@+id/fg_save_as_file_container"
    
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:labelText="@string/lbl_filename_without_ext"
        app:helperText="@string/lbl_filename_limit_desc"
        app:hasClearButton="true"
        app:minCharacters="2"
        app:maxCharacters="128"
        >
    
        <studio.carbonylgroup.textfieldboxes.ExtendedEditText
            android:id="@+id/fg_save_as_file_filename"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxLines="1"
            android:singleLine="true"
            android:text="" />
    
    </studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
    

    And I got this error.

    FATAL EXCEPTION: main Process: net.sjava.docs, PID: 8749 java.lang.RuntimeException: Unable to start activity ComponentInfo{net.sjava.docs/net.sjava.docs.ui.activities.MainActivity}: android.view.InflateException: Binary XML file line #82: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.LayerDrawable at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2947) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6688) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) Caused by: android.view.InflateException: Binary XML file line #82: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.LayerDrawable Caused by: java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.LayerDrawable at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.setPanelBackgroundColor(TextFieldBoxes.java:697) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:285) at android.view.LayoutInflater.rInflate(LayoutInflater.java:879) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828) at android.view.LayoutInflater.rInflate(LayoutInflater.java:873) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828) at android.view.LayoutInflater.inflate(LayoutInflater.java:525) at android.view.LayoutInflater.inflate(LayoutInflater.java:427) at android.view.LayoutInflater.inflate(LayoutInflater.java:378) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)

    opened by mcsong 4
  • Layout updated to support bigger clear icon and end icons to have 48d…

    Layout updated to support bigger clear icon and end icons to have 48d…

    I was going to work on password visibility toggle, but before we do that we need to increase touch area of icons and change the layout.

    In the current version, icons are 24dp and they are set to align with EditText. That's good to align them, however, when we use a larger icon, the icon is cut from the top. I don't know if it is a bug in the Android framework.

    I replaced the RelativeLayout with a FrameLayout and placed icons on top of that. After that I calculate width of (endIcon/clearIcon or both) and put a fake drawableRight to EditText. This is how TextInputLayout works.

    There are some major changes but it looks similar to what we have and touch are is better now. Let me know if you have any concerns.

    opened by GokhanArik 3
  • Error inflating class android.support.v7.widget.AppCompatImageButton

    Error inflating class android.support.v7.widget.AppCompatImageButton

    When I tried to add TextFieldBoxes and ExtendedEditText to my layout. I got an exception when inflate layout. Could you please have a look? Thank you a lot.

    java.lang.RuntimeException: Unable to start activity ComponentInfo{pcdt.app/pcdt.app.ui.LoginActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474) at android.app.Activity.setContentView(Activity.java:2387) at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)  at android.app.ActivityThread.access$1100(ActivityThread.java:221)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:158)  at android.app.ActivityThread.main(ActivityThread.java:7224)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241) at android.view.LayoutInflater.rInflate(LayoutInflater.java:868) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at android.view.LayoutInflater.inflate(LayoutInflater.java:380)  at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474)  at android.app.Activity.setContentView(Activity.java:2387)  at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19)  at android.app.Activity.performCreate(Activity.java:6876)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)  at android.app.ActivityThread.access$1100(ActivityThread.java:221)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:158)  at android.app.ActivityThread.main(ActivityThread.java:7224)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.view.LayoutInflater.createView(LayoutInflater.java:657) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:847) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360)  at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:868)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.inflate(LayoutInflater.java:527)  at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at android.view.LayoutInflater.inflate(LayoutInflater.java:380)  at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474)  at android.app.Activity.setContentView(Activity.java:2387)  at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19)  at android.app.Activity.performCreate(Activity.java:6876)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)  at android.app.ActivityThread.access$1100(ActivityThread.java:221)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:158)  at android.app.ActivityThread.main(ActivityThread.java:7224)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at android.view.LayoutInflater.createView(LayoutInflater.java:631) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.inflate(LayoutInflater.java:527)  at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360)  at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:868)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.inflate(LayoutInflater.java:527)  at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at android.view.LayoutInflater.inflate(LayoutInflater.java:380)  at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474)  at android.app.Activity.setContentView(Activity.java:2387)  at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19)  at android.app.Activity.performCreate(Activity.java:6876)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)  at android.app.ActivityThread.access$1100(ActivityThread.java:221)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:158)  at android.app.ActivityThread.main(ActivityThread.java:7224)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f03015e a=-1} at android.content.res.TypedArray.getDrawable(TypedArray.java:883) at android.view.View.<init>(View.java:4225) at android.widget.ImageView.<init>(ImageView.java:150) at android.widget.ImageButton.<init>(ImageButton.java:85) at android.widget.ImageButton.<init>(ImageButton.java:81) at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:73) at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:69) at java.lang.reflect.Constructor.newInstance(Native Method)  at android.view.LayoutInflater.createView(LayoutInflater.java:631)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.inflate(LayoutInflater.java:527)  at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360)  at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:868)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)  at android.view.LayoutInflater.inflate(LayoutInflater.java:527)  at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  at android.view.LayoutInflater.inflate(LayoutInflater.java:380)  at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474)  at android.app.Activity.setContentView(Activity.java:2387)  at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19)  at android.app.Activity.performCreate(Activity.java:6876)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)  at android.app.ActivityThread.access$1100(ActivityThread.java:221)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:158)  at android.app.ActivityThread.main(ActivityThread.java:7224)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 

    opened by dinhthaidaica 3
  • Helper is misplaced when embedded in a ScrollView

    Helper is misplaced when embedded in a ScrollView

    The following layout has the following render:

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    
        <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:helperText="helper"
            app:labelText="Label">
    
            <studio.carbonylgroup.textfieldboxes.ExtendedEditText
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
        </studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
    
    </LinearLayout>
    

    screen shot 2018-02-26 at 23 46 13 which is expected, however the following layout (just replace LinearLayout with ScrollView) has the following render:

    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    
        <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:helperText="helper"
            app:labelText="Label">
    
            <studio.carbonylgroup.textfieldboxes.ExtendedEditText
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
        </studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
    
    </ScrollView>
    

    screen shot 2018-02-26 at 23 45 55

    which is not what I expected. Is this a bug?

    opened by BenoitDuffez 3
  • final TextFieldBoxes textFieldBoxes = findViewById(R.id.tfb_line)  return null object

    final TextFieldBoxes textFieldBoxes = findViewById(R.id.tfb_line) return null object

    final TextFieldBoxes textFieldBoxes = findViewById(R.id.tfb_line);

    --------- beginning of crash E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.administrator.banner, PID: 8069 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.administrator.banner/com.example.administrator.banner.TaskEditActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567) 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: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference at android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:117) at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:149) at android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:29) at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:54) at android.support.v7.app.AppCompatDelegateImplV23.(AppCompatDelegateImplV23.java:31) at android.support.v7.app.AppCompatDelegateImplN.(AppCompatDelegateImplN.java:31) at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:198) at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:183) at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519) at android.support.v7.app.AppCompatActivity.findViewById(AppCompatActivity.java:190) at com.example.administrator.banner.TaskEditActivity.(TaskEditActivity.java:34) at java.lang.Class.newInstance(Native Method) at android.app.Instrumentation.newActivity(Instrumentation.java:1078) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557) 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 zhoufuch 0
  • max line not supported

    max line not supported

    hi thank for this library,its very nice. but maxLines attribute not working for this edit text and i was forced to use singleLine attribute. thanks again.

    opened by hrabiian2 1
Releases(1.4.5)
  • 1.4.5(Jun 11, 2019)

  • 1.4.4(Jun 8, 2018)

  • 1.4.3(Apr 8, 2018)

  • 1.4.2(Mar 17, 2018)

  • 1.4.1(Feb 27, 2018)

  • 1.4.0(Feb 27, 2018)

    • Support Dense Layout (Dense Spacing) with app:useDenseSpacing attribute.
    • The label can be fixed at the top when hint is present, with app:alwaysShowHint attribute.
    Source code(tar.gz)
    Source code(zip)
  • 1.3.9(Jan 31, 2018)

  • 1.3.8(Jan 31, 2018)

    • Fix issue #41.
    • Add autocompletion support as addressed in #43. (ExtendedEditText now extends a built-in TextInputAutoCompleteTextView, which extends AppCompatAutoCompleteTextView).
    Source code(tar.gz)
    Source code(zip)
  • 1.3.7(Nov 22, 2017)

  • 1.3.6(Nov 20, 2017)

    • fix issue #34 and reoccurring #14.

    • add getter for onError (#33).

    • the space for the floating label at the top will be removed when labelText is empty (#35).

    Source code(tar.gz)
    Source code(zip)
  • 1.3.5(Nov 4, 2017)

    • fix issue #31 #32.

    • add giveFocus param in setError() for setting whether the field will gain focus when set error on.

    • add secondaryColor for setting the color of the underline, the floating label text and the icon signifier when NOT HAVING focus (opposite to primaryColor).

    • add counterColor for setting the color of the counter text.

    Source code(tar.gz)
    Source code(zip)
  • 1.3.4(Oct 13, 2017)

  • 1.3.3(Sep 26, 2017)

    • add app:isResponsiveIconColor attribute for setting, in xml, whether the icon signifier will change its color when gaining or losing focus in.

    • set icon signifier and end icon with drawable (PR #23).

    Source code(tar.gz)
    Source code(zip)
  • 1.3.2(Sep 24, 2017)

  • 1.3.1(Sep 20, 2017)

  • 1.3.0(Sep 16, 2017)

    • the "EditText" part is now seperated from the TextFieldBoxes. TextFieldBoxes is now a container (just like a TextInputLayout) that should and should only contain one ExtendedEditText that inherents the TextInputEditText.

    • Prefix and Suffix attributes are now belonging to the ExtendedEditText.

    • Text, hint, SingleLine and MaxLines attributes are now removed. Instead, one should set them in the ExtendedEditText with original android: attributes.

    • the bottom view which contains helper and counter labels will now be hidden when it's empty.

    Source code(tar.gz)
    Source code(zip)
  • 1.2.1(Sep 11, 2017)

    • fix Label doesn't go up when using setText() #13
    • fix "match_parent" dont work in constraint layout #12
    • fix Sometimes when click on the view it does not show the cursor #14
    • Add adaptive icon color option #11
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Sep 10, 2017)

    • fix the bug of when height (or width) is set to wrap_content yet fills up the whole space.

    • old hint attribute is renamed to labelText.

    • current hint attribute is for the placeholder text that is shown in the field when there is no text and is on focus.

    • add Clear Button, can be activated with app:hasClearButton in xml or setHasClearButton(boolean hasClearButton) in Java code.

    • add End Icon, can be activated with app:endIcon in xml or setEndIcon(Int resourceID) in Java code. Use getEndIconImageButton() to do something useful with it.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Sep 5, 2017)

  • 1.0.1(Aug 30, 2017)

    • Customizable panel background color
    • Grayscale colors uses transparency of black
    • Improve the way of displaying bottomLine that is according to Material Design Guideline
    Source code(tar.gz)
    Source code(zip)
Owner
Mark Wang
UW SE
Mark Wang
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.

PhotoEditor A Photo Editor library with simple, easy support for image editing using Paints, Text, Filters, Emoji and Sticker like stories. Features D

Burhanuddin Rashid 3.6k Jan 9, 2023
Implementation of Ripple effect from Material Design for Android API 9+

RippleEffect ExpandableLayout provides an easy way to create a view called header with an expandable view. Both view are external layout to allow a ma

Robin Chutaux 4.9k Dec 30, 2022
Cute library to implement SearchView in a Material Design Approach

MaterialSearchView Cute library to implement SearchView in a Material Design Approach. Works from Android API 14 (ICS) and above. #Native version Mayb

Miguel Catalan Bañuls 3.8k Jan 3, 2023
Fast marker clustering library for Google Maps Android API.

Google Maps Clustering for Android A fast marker clustering library for Google Maps Android API. Motivation Why not use Google Maps Android API Utilit

Sharewire 294 Dec 5, 2022
Navigation pattern like in Google News Stand app with transitions

Google-NewsStand-Animation-Android Navigation pattern like in Google News Stand app with transitions Getting Started In your build.gradle dependencies

Hariprasanth S 129 Nov 11, 2022
Circle based animations for Android (min. API 11)

CircularTools Circle based animations for Android (min. API 11) Currently implemented: Circular reveal Circular transform Radial reaction Reveal:YouTu

AutSoft 209 Jul 20, 2022
Web-based media manager with duplication detection, tagging, and more

reelchest ?? ??️ ??️ A basic web-based media manager. Download or upload clips,

Sebastian Aigner 7 Jan 3, 2022
ConfigurNation - Annotation based Kotlin Interfaces for Android SharedPreferences

ConfigurNation Annotation based Kotlin Interfaces for Android SharedPreferences Installation Gradle Dependencies implementation 'com.izikode.izilib:co

Fanis Veizis 4 Jan 19, 2019
RX-based async paradigm, Room, DI (Hilt), Retrofit, MVVM, Jetpack, Lottie, Transitions

CatBreedsApp RxJava, Room, DI (Hilt), Jetpack, Shared element transition. clean MVVM architecture, Retrofit Cats need your help, we want to build an a

Cristian Dumitrache 3 Oct 14, 2022
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 1, 2023
Android library for material scrolling techniques.

material-scrolling Android library for material scrolling techniques. Features Easily implement material scrolling techniques with RecyclerView. Custo

Satoru Fujiwara 601 Nov 29, 2022
Material image loading implementation

MaterialImageLoading Material image loading implementation Sample And have a look on a sample Youtube Video : Youtube Link [] (https://www.youtube.com

Florent CHAMPIGNY 392 Nov 17, 2022
💠Metaphor is the library to easily add Material Motion animations

Metaphor Metaphor is the library to easily add Material Motion animations. Who's using Metaphor? ?? Check out who's using Metaphor Include in your pro

Ranbir Singh 132 Dec 25, 2022
Sophisticated and cool intro with Material Motion Animation

☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer)

Ranbir Singh 34 Sep 8, 2022
☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer or Memory leak)

Material Intro Sophisticated and cool intro with Material Motion Animations. Who's using Material Intro? ?? Check out who's using Material Intro Inclu

Ranbir Singh 34 Sep 8, 2022
Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animations painless.

AnimatableCompose Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animation painless. What you can create from M

Emir Demirli 12 Jan 2, 2023
Default colors and dimens per Material Design guidelines and Android Design guidelines inside one library.

Material Design Dimens Default colors and dimens per Material Design guidelines and Android Design guidelines inside one library. Dimens Pattern: R.di

Dmitry Malkovich 1.4k Jan 3, 2023
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html

Material Bottom Navigation Library Lightweight Bottom Navigation library component inspired by the Google Material Design Guidelines at https://www.go

Alessandro Crugnola 1.4k Dec 18, 2022