iangclifton / androidfloatlabel Goto Github PK
View Code? Open in Web Editor NEWLibrary project with a custom view that implements the Float Label pattern
License: Apache License 2.0
Library project with a custom view that implements the Float Label pattern
License: Apache License 2.0
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?
Would be awesome i think =)
For now I use the steps below to integrate (via local maven repository)
(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'
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":
There is a few ic_launcher icons in the library I'm not sure what else.
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.
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
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 ?????
Great Lib.
i am unable to use androidedit.setError("invalid data");
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.
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.
I have directly changed for inputType in <merge>
but not working.
How can i set inputType="number"
for EditText.?
Is there any way to change color with XML tag or dynamically with some specific method?
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.
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
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?
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" />
I fork your project and make it support API 9+.
I don't think it's necessary to make a pull request and merge it but i think the support could be useful for some people.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.