hint

how to make hint disappear when edittext is touched?

喜夏-厌秋 提交于 2019-11-28 20:08:10
In my application in android are many EditText fields. And I ran into a problem with hint. It is not disappearing when EditText is focused, but it disappears when I start to write something. How can this problem be fixed? Because I need the hint to disappear when the EditText field is touched. It is for example: <EditText android:layout_width="260dp" android:layout_height="30dp" android:ems="10" android:inputType="text" android:id="@+id/driv_lic_num_reg" android:hint="@string/driver_license_numb" android:textColor="@color/black" android:textColorHint="@color/grey_hint" android:background="

Android EditText for password with android:hint

Deadly 提交于 2019-11-28 17:44:48
Just noticed that android:password has been deprecated , and we should be using android:inputType. Was experimenting with it by setting in my xml android:inputType="textPassword" Indeed it behaves like android:password="true" for EditText, but it seems that if I use android:inputType, android:hint will not work. The EditText will be blank. There is no such issues when using android:password with android:hint. Am I missing something here about android:inputType? mango Hint is displayed correctly with android:inputType="textPassword" and android:gravity="center" if you set also android:ellipsize

determine whether point lies inside triangle

一世执手 提交于 2019-11-28 15:48:11
The program needs to read the values of three coordinates P1(x1,y1) P2(x2,y2) P3(x3,y3) as well as another coordinate P(x,y) and determine whether this point is inside a triangle formed from the 3 point above. The proper way to do this is by calculating the barycentric coordinates of the fourth point given the three points of your triangle. The formula to compute them is given at the end of the section "Converting to barycentric coordinates", but I hope to provide a less mathematics-intense explanation here. Assume, for simplicity, that you have a struct, point , that has values x and y . You

I want a more personalized BalloonHint (Background color/Rounded Corner/transparency)

≯℡__Kan透↙ 提交于 2019-11-28 14:22:06
When using TballoonHint , I need it more personalized in colors, shape, transparency and animated appearance, how can I do that? Create your own descendant of TBalloonHint or THintWindow . Override the NCPaint method to draw the outer edges (non-client area) and CalcHintRect (if needed), and provide your own Paint method to draw the interior as you'd like it to appear. Then assign it to Application.HintWindowClass in your .dpr file just before the call to Application.Run . Here's a (very minimal) example that does nothing but paint the standard hint window with a green background. Save this as

Android: EditText hint in single line

走远了吗. 提交于 2019-11-28 10:45:49
For setting the Single Line in EditText we use android:singleLine="true" but I want to set the single line for the Hint Text, it is large and I want to show it in a one line like: http://google.myopenid.stackoverflow.com I am using the following code: <EditText android:id="@+id/editText1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/defaultUrl" android:singleLine="true" /> Note: defaultUrl is dynamic and very long URL. You can use android:ellipsize="end" android:maxLines="1" to show your hint text in single line but you wont be able to see the

NetBeans / Java / New hint: Thread.sleep called in loop

柔情痞子 提交于 2019-11-28 05:40:42
In NetBeans, there's a new hint that says: Thread.sleep called in loop. Question 1: How/when can it be a problem to sleep in a loop? Question 2: If it's a problem, what should I do instead? UPDATE: Question 3: Here's some code. Tell me in this case if I should be using something else instead of Thread.Sleep in a loop. In short, this is used by a server which listens for client TCP connections. The sleep is used here in case the max number of sessions with clients is reached. In this situation, I want the application to wait until a free session becomes available. public class SessionManager {

EditText hint doesn't show

北城以北 提交于 2019-11-27 19:15:00
My EditText configured as follows won't show the hint: <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> It works if I set android:gravity="left" or if I remove android:scrollHorizontally and android:singleLine attributes, which is not desirable. Any suggestions? using android:ellipsize="end" fixed it for me Weird bug !! (but Android has a lot of these weirdo bug) In Lollipop version the default text and hint text color is white for EditText . So we

Android EditText view Floating Hint in Material Design

别说谁变了你拦得住时间么 提交于 2019-11-27 10:46:19
Does API 21 provide a method to use the following feature: http://www.google.com/design/spec/components/text-fields.html#text-fields-floating-labels I'm trying to float the EditText hints. Thanks! arpit Floating hint EditText: Add below dependency in gradle: compile 'com.android.support:design:22.2.0' In layout: <android.support.design.widget.TextInputLayout android:id="@+id/text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/editText" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint=

Android EditText for password with android:hint

心不动则不痛 提交于 2019-11-27 10:42:05
问题 Just noticed that android:password has been deprecated , and we should be using android:inputType. Was experimenting with it by setting in my xml android:inputType="textPassword" Indeed it behaves like android:password="true" for EditText, but it seems that if I use android:inputType, android:hint will not work. The EditText will be blank. There is no such issues when using android:password with android:hint. Am I missing something here about android:inputType? 回答1: Hint is displayed

I want a more personalized BalloonHint (Background color/Rounded Corner/transparency)

你。 提交于 2019-11-27 08:27:24
问题 When using TballoonHint , I need it more personalized in colors, shape, transparency and animated appearance, how can I do that? 回答1: Create your own descendant of TBalloonHint or THintWindow . Override the NCPaint method to draw the outer edges (non-client area) and CalcHintRect (if needed), and provide your own Paint method to draw the interior as you'd like it to appear. Then assign it to Application.HintWindowClass in your .dpr file just before the call to Application.Run . Here's a (very