Git Product home page Git Product logo

floatlabelededittext's People

Contributors

aaronrietschlin avatar andreidd avatar andrewgiang avatar heinrisch 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  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  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

floatlabelededittext's Issues

Can't programatically add to existing layout

I'm trying to add it to an existing layout programatically

  private void addEditText(){

        EditText itemText = new EditText(getActivity());
        itemText.setHint(R.string.add_item);
        itemText.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));


        FloatLabeledEditText floatLabeledEditText = new FloatLabeledEditText(getActivity());
        floatLabeledEditText.addView(itemText);
        mItemParent.addView(floatLabeledEditText);
    }

But I got NPE when I do that:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'float android.widget.TextView.getTextSize()' on a null object reference at com.wrapp.floatlabelededittext.FloatLabeledEditText.addView(FloatLabeledEditText.java:106)

Because setAttributes() was not called in the public FloatLabeledEditText(Context context) constructor. Hence, mHintTextView was never initialized and will cause NPE when it's used in addView() method.

Please help.

AAPT error 139

I migrated a project from Eclipse to Android Studio. In my project I'm using Android Maps utils:
compile 'com.google.maps.android:android-maps-utils:0.3+')
But when add FLET generate an AAPT error 139.
I tested creating a simple project only adding FLET and Android Maps Utils and is crashing instantly.
Unfortunately AAPT is not delivering specific details about the error.

Hint Gravity cant change to Right.

-- Orignal in Class
addView(mHintTextView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

-- Replace With
addView(mHintTextView, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);

After that user can change it from app:fletTextAppearance attribute.

Is there any way to change hint programmatically?

I've integrated floatlabelededittext, which works fine. But I need to change text(placeholder) and hint on a button click. As I do change the placeholder and hint on button click, hint is not changing. It shows the hint which I placed in XML layout. Is it possible to change hint from button action programmatically? If yes, can anyone please show me how?

In HTC ONE V, First time it is not working after focus change it is working.

This library is very good . but there is some issue with it, whenever one start typing in FloatLabelEditText , it's hint is not visible. after putting some letters it's float hint is still invisible . after focus changed to another FloatLabelEditText , first FloatLabelEditText hints visible.

this bug is only come whenever one is using first time FloatLabelEditText, after focus change to another FloatLabelEditText , it's working fine.

it should be like , whenever user starts typing the float label should up to edittext.

Wrong working

When I open activity in first time, it looks right
1

When I select first editText, the hint from second editText have dissapeared
2

When I change focus to second field, its hint haven't appeared
3

That issue looks like this (#22), which you have closed

Hint color

Hi,
how can I change the hint color ?

BTW : Awesome lib :)

nineoldandroid dependency as "library-2.4.0.jar"

Hello,

Today I ran into an issue with multiple dex files when I added another library (MaterialDesignLibrary) to my project which was using floatlabelededittext.

Through research I found out that the conflict is from using nineoldandroids as a dependency. I tested and saw that floatlabelededittext leads my project to add "library-2.4.0.jar" in my external libraries when gradle syncs instead of "nineoldandroids-2.4.0.jar" from the other library I'm using.

I'm suspecting that this is the cause of the conflict where dex merger cannot merge them but it still found duplicates thus generating the multiple dex error.

I use "compile 'com.wrapp.floatlabelededittext:library:0.0.5' " in the gradle of my project, but I see from the source code on this github page, this project uses "compile 'com.nineoldandroids:library:2.4.0'".

Does anyone have any idea why there are differences in jar file names?

EDIT:

Now that I test more on it, I do not think it is simply a problem of a jar file name. And I'm not that expert on gradle / android build stuff... Still no idea.

Possibly wrong sample usage code

<com.wrapp.floatlabelededittext.FloatLabeledEditText
android:layout_height="wrap_content"
android:layout_width="match_parent"
float:fletFloatingHint="Test"/>

The text "fletFloatingHint" needs to be changed to "floatingHint" in the sample usage code in the readme.

My code was not compiling when I had it there.
Now that I removed it, it compiles fine.

SomeTimes hint text not showing

screenshot 2014-12-13 17 23 19

When I try to write something and hide keyboard the hint not showing. Could you please fix this issue?

For example if we set text input type as password and background as shape.
Here is my code

  <com.wrapp.floatlabelededittext.FloatLabeledEditText
        android:layout_width="match_parent"
        android:layout_height="@dimen/activity_edit_text_height"
        android:layout_marginBottom="@dimen/activity_small_margin"
        android:background="@drawable/edit_text_bg"
        float:fletPadding="5dp">

        <EditText
            android:id="@+id/login_email"
            android:inputType="textEmailAddress"
            android:gravity="bottom"
            android:layout_gravity="bottom"
            android:hint="@string/your_email_address"
            style="@style/ncv_edit_text_style"/>
    </com.wrapp.floatlabelededittext.FloatLabeledEditText>

    <com.wrapp.floatlabelededittext.FloatLabeledEditText
        android:layout_width="match_parent"
        android:layout_height="@dimen/activity_edit_text_height"
        android:background="@drawable/edit_text_bg"
        float:fletPadding="5dp">

        <EditText
            android:id="@+id/login_password"
            android:inputType="textPassword"
            android:hint="@string/password"
            android:gravity="bottom"
            android:imeOptions="actionDone"
            android:layout_gravity="bottom"
            style="@style/ncv_edit_text_style"/>
    </com.wrapp.floatlabelededittext.FloatLabeledEditText>

style.xml <style name="ncv_edit_text_style">
match_parent
@dimen/activity_edit_text_height
@color/text_color_black
@color/text_color_black
@dimen/activity_text_size_small
@drawable/edit_text_bg
@dimen/activity_edit_text_inner_padding
@dimen/activity_edit_text_inner_padding
@dimen/activity_edit_text_inner_padding
bottom
</style>

edit_text_bg

<solid android:color="@color/ncv_edit_text_solid_color"/>

Isn’t it supported by gradle8.0?

The latest version of gradle I use, whether it is implementation ("com.wrapp.floatlabelededittext:library:0.0.6") or downloading the Float Labeled Edittext » 0.0.6 aar package from the maven warehouse and then importing it(implementation(files("D:\\AndroidStudioProject\\music\\app\\libs\\library-0.0.6.aar")) ),errors are reported.
Is it no longer supported?

Class referenced in the layout file, `com.wrapp.floatlabelededittext.FloatLabeledEditText`, was not found in the project or the libraries
Cannot resolve class com.wrapp.floatlabelededittext.FloatLabeledEditText

Screen Rotate restores incorrect Text

Here is what is happening to me:

I enter these values in their appropriate edittext's

TextView: EditText
Username: Frank
Password: frank19

And after a screen rotate I get this:

TextView: EditText
Username: frank19
Password: frank19

the onSaveInstanceState() and onRestoreInstanceState() don't seem to be functioning properly.

Float label does not work on Gingerbread

Unfortunately the FloatLabel does not work on Gingerbread devices. I've attached a screenshot of an app running in a 2.3.3 emulator which shows the issue. You'll notice the float label is hovering behind the textbox.

device-2014-05-08-214211

The floating label background is not the good one

The floating label background uses the one define in my app theme instead one the edit text one.
This gives something weird, as shown in this picture :

floating label background

The red color behind email is my theme background.

I pull requested this fix, so you can merge it when you want.

New features?

I was reading over the material design spec and found a few other items that would be useful with this library.

First would be the error or below the edit underline text. A setError/setsubText type thing, essentially a label under as well as above.

Second, the hardcoded 33% transparency works well on dark and light, but I'm using in an instance with a medium dark background and there is no way to change the 33%.

Nice Lib.

wrong in text color

i create the fletTextAppearance in style,and set textcolor,when the edittext get focus,flettext's color is right,but the textcolor is not work when lose focus.why? how to solve ?

EditText gets cut off when padding bottom is added

Here is my scenario

  1. My layout.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:padding="@dimen/padding_xxlarge">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.wrapp.floatlabelededittext.FloatLabeledEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/padding_normal"
            app:fletTextAppearance="@style/FloatLabelStyle"
            app:fletPaddingBottom="@dimen/padding_normal">

            <AutoCompleteTextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/txt_email"
                android:hint="@string/email_user_name"
                android:inputType="textEmailAddress"
                android:imeOptions="actionNext" />

        </com.wrapp.floatlabelededittext.FloatLabeledEditText>


        <com.wrapp.floatlabelededittext.FloatLabeledEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/padding_normal"
            app:fletTextAppearance="@style/FloatLabelStyle"
            app:fletPaddingBottom="@dimen/padding_normal">

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/txt_password"
                android:hint="@string/password"
                android:inputType="textPassword"
                android:imeOptions="actionDone"
                android:maxLines="1"
                android:singleLine="true" />

        </com.wrapp.floatlabelededittext.FloatLabeledEditText>


    </LinearLayout>
</ScrollView>
  1. When soft keyboard is up, the result is as follows
    screen shot 2014-12-16 at 6 06 26 pm

But when I remove fletPaddingBottom of password section, everything works fine. So, can't we use fletPaddingBottom in my scenario.

My device Nexus 4 running Android L.
Thanks

Cannot build

Every time I import your project I get this error:

Gradle 'floatlabelededittext' project refresh failed
Error:No such property: POM_ARTIFACT_ID for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer

Please advise.

float:fletImeOptions="actionNext" doesn't work

I'm not really sure if it's a problem or not, but I'm not be able to use actionNext properly in my xml. Here is the code I use, I tried different things but I wasn't successful.

    <!-- Email TextField -->
    <com.wrapp.floatlabelededittext.FloatLabeledEditText
        android:id="@+id/loginEmail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/login_box_top_margin"
        android:layout_marginLeft="@dimen/login_box_left_margin"
        android:layout_marginRight="@dimen/login_box_right_margin"
        float:fletHintTextColor="#333333"
        float:fletTextColor="#000000"
        float:fletFloatingHint="username"
        float:fletImeOptions="actionNext"
        float:fletSingleLine="true"/>

    <!-- Password TextField -->
    <com.wrapp.floatlabelededittext.FloatLabeledEditText
        android:id="@+id/loginPassword"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/login_box_left_margin"
        android:layout_marginRight="@dimen/login_box_right_margin"
        float:fletHintTextColor="#333333"
        float:fletTextColor="#000000"
        float:fletFloatingHint="Password"
        float:fletInputType="textPassword"/>

    <!-- Login Button -->
    <Button
        android:id="@+id/btnLogin"
        android:layout_width="230dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="@dimen/login_box_left_margin"
        android:layout_marginRight="@dimen/login_box_right_margin"
        android:layout_marginBottom="@dimen/login_box_bottom_margin"
        android:text="@string/loginBtnLogin"
        android:textColor="#FFFFFF"/>

I will appreciate your support.
Thanks!

Text overlap on Gingerbead device

The label does overlap on a test device. I read somewhere that this is a known bug, which was fixed in Honycomb. However this should been fixed.

InstanceState in OrientationChange

Hi,

I bought
http://codecanyon.net/item/material-design-ui-android-template-app/9858746?WT.oss_phrase=&WT.oss_rank=30&WT.z_author=CreativeForm&WT.ac=search_list

and when I want to use login example in this template, and change its orientation,the text of both username and password will be password's text. I mean it restores the text of last control to all other controls.

How can I separate savestates of foatlabeledittexts? It restores last flet text to every other, when it changes orientation

Can't Build

Error:Could not get unknown property 'POM_ARTIFACT_ID' for object of type org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer.

Following your advise,i add the library you provide
and add
"compile 'com.wrapp.floatlabelededittext:library:0.0.6'"
to my build.gradle
but it's no use,
em,I don't know how to plain maven....
I don't find the pom.xml
Could you tell me how to resolve the issue plz?
Sincerely appreciate.

wow,i have done .
i have add those in gradle.properties but i don't know whether it is correct or not,but it goes successfuly!

POM_NAME=Local Repository
POM_PACKAGING=aar
POM_ARTIFACT_ID=library

Add to Maven Central

Add this project to Maven central so it can be easily imported into projects.

NineOldAndroids Dependence

Hi,

is there any way to remove the dependence of nineoldAndroid? My project supports the api 14 upwards :/

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.