GithubHelp home page GithubHelp logo

iangclifton / androidfloatlabel Goto Github PK

View Code? Open in Web Editor NEW
468.0 468.0 92.0 1.1 MB

Library project with a custom view that implements the Float Label pattern

License: Apache License 2.0

Java 100.00%

androidfloatlabel's People

Contributors

achuinard avatar edouardouvrard avatar gavindbrown avatar iangclifton 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

androidfloatlabel's Issues

Appending Drawable not possible

I needed to add a drawable to this floatingLabel's right but the native method is not working, i tried to do it like:

myFloatLabel.getEditText().setCompoundDrawables(null, null, getResources().getDrawable(R.drawable.icon), null);

But this has no effect. Is there any way to achieve this?

Submit to maven central

Would be awesome i think =)

For now I use the steps below to integrate (via local maven repository)

  • clone from git
  • run gradle build
  • locate FloatLabel.aar in build folder
  • install locally to maven using command below (1)
  • add (2) to your gradle dependencies

(1)
mvn install:install-file -Dfile=FloatLabel.aar -DgroupId=com.iangclifton.android -DartifactId=floatlabel -Dversion=0.1 -Dpackaging=aar

(2)
compile 'com.iangclifton.android:floatlabel:+@aar'

AndroidFloatLabel-API9 float_label shadowed by edit_text

selection_009

In 2.3 APIver 9 AndroidFloatLabel-API9 float_label shadowed by edit_text , we need remove android:layout_marginTop="-7dp" in EditText I guess!

Possible solution: Looks like we need to implement
layout (without android:layout_marginTop="-7dp"),

layout-v11,
layout-v14 (with android:layout_marginTop="-7dp")

layout folder in the library project !

https://github.com/edouardouvrard/AndroidFloatLabel-API9

without android:layout_marginTop="-7dp":

selection_010

Views really should have unique ID's

When rotating the device, focus is lost because each EditText has the same ID.

In a view with 2 FloatLabel's and the second one focused, focus is granted to the first one on rotation.

FloatLabelEdittext

Is there anyway how to use FloatLabelEdittext dynamically? (not in xml)

I have problem with: floatLabel.setHint("test") - it does not show any hint.

Thank you

android:maxLength="10" Not working

Hi , i am using your library and this is my mobile no field ,
<com.grooveboss.floatlabel.FloatLabel
android:id="@+id/outletmobno_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:hint="Enter your mobile no"
android:inputType="number"
android:maxLength="10"
app:floatLabelColor="#4e7870" />

android:maxLength="10" is not working ?????

Define nextFocus

I am trying to define android:nextFocusDown on my username FloatLabel so it jumps to the pwd FloatLabel when the user hits the Next key. Is this possible? I tried defining custom layouts and I still couldn't get it to function properly.

Methods for setting EditText text

Need some pass-through methods for setting the EditText:

setText(int resid)
setText(char[] text, int start, int len)
setText(int resid, TextView.BufferType type)
setText(CharSequence text)
setText(CharSequence text, TextView.BufferType type)

Plus equivalent methods for setting the text without triggering an animation.

Themes' clash

Hi, the AndroidFloatLabel's theme clashes with my app's theme.

Error:(10, 9) Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@theme value=(@style/MyAppTheme) from AndroidManifest.xml:10:9
is also present at com.iangclifton.android:floatlabel:1.0.1:15:9 value=(@style/AppTheme)
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:6:5 to override

I resolved adding this in my gradle:

android {
useOldManifestMerger true
}

I think it is not an error, but it is my first time with this issue and I want to share my experience in order to help somebody with this beautiful library.

Change color of FloatLabel

how do you change the color of the FloatLabel? I tried doing this

<com.iangclifton.android.floatlabel.FloatLabel
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/title"
            android:layout_marginLeft="26dip"
            android:layout_marginTop="5dip"
            android:layout_marginRight="26dip"
            android:minWidth="200dip"
            app:floatLabelColor="@color/main_app_color"/>

but I get a build error saying

Error:(42) No resource identifier found for attribute 'floatLabelColor' in package

Resource conflict: ic_launcher / app icon in library

After adding your lib to my app dependencies I cannot build my project:

Error:(13, 9) Execution failed for task ':app:processDevDebugManifest'.
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:13:9
    is also present at com.iangclifton.android:floatlabel:1.0.2:12:9 value=(@drawable/ic_launcher)
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:10:5 to override

I'm not sure it is relevant to have a launcher icon in a library. Can you remove it?

labels showing unexpectedly

Hello thanks for the cool library. I am having an issue though. Sometimes the float label shows itself by default when the edit text is empty. There doesn't seem to be any rhyme or reason to it. Sometimes it shows and sometimes it doesn't.

Here is snapshot of the xml file I'm using and a screenshot. As you can see sometimes the label shows and sometimes it doesn't. The only difference I see between the views in the xml file is the input type but setting them all to the same thing has no effect. Any idea whats going on?

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:text="@string/title_payment_method"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <com.iangclifton.android.floatlabel.FloatLabel
        android:id="@+id/name_on_card"
        android:hint="@string/name_on_card"
        android:inputType="textPersonName|textCapWords"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <com.iangclifton.android.floatlabel.FloatLabel
        android:id="@+id/card_number"
        android:hint="@string/card_number"
        android:inputType="number"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <com.iangclifton.android.floatlabel.FloatLabel
        android:id="@+id/security_code"
        android:hint="@string/security_code"
        android:inputType="text"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <com.iangclifton.android.floatlabel.FloatLabel
        android:id="@+id/exp_date"
        android:hint="@string/exp_date"
        android:inputType="text"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

device-2015-03-04-153337

Number editText

Hi,
First of all congrats for this great library.
I have a problem I tried to put android:inputType="number" to the EditText, but seems that this does not work.
The library only limit to text?
Thank you.

Add onFocusChangeListener

It would be great to also be able to change the label when the EditText becomes focused and unfocused. You can see on your linked Dribble post that the label turns grey when unfocused.

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.