[android-beginners] EditText Image changing look when given at runtime.

2010-05-05 Thread Alok Kulkarni
Hi guys,
I am having an EditText. If i specify image for the EditText in the layout
XML file (android:background) it looks different and looks different when i
specify it at runtime
EditText et = (EditText)findViewById(R.drawable.et1);
et.setBackgroundDrawable(Main.themes.getDrawable(EDRAWABLES.EditTextBackgroundImage));
Both codes point to the same image. When i specify the image at runtime ,
the EditText leaves a margin at the top and bottom of the cursor in the
edittext which does not happen when i do it in XML.
I have attached the screenshots of both images. Top image is the one drawn
from XML and bottom one is given at runtime.
I am not getting the difference ?
Actually i am facing similar problems with other Widgets too if i change the
logic of specifying the drawable at runtime and not at compile time..
Is this the default SDK behaviour ?
Thanks,
Alok

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
<>

Re: [android-beginners] EditText

2010-02-21 Thread Mark Murphy
André wrote:
> Hello,
> 
> I have a EditText window that fills up most of the screen. But when I
> start typing in it always starts on the left side in the middle. I
> want it to start top left corner. How do I do this?

Set the gravity of the EditText widget to left|top.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in US: 14-18 June 2010: http://bignerdranch.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] EditText

2010-02-21 Thread André
Hello,

I have a EditText window that fills up most of the screen. But when I
start typing in it always starts on the left side in the middle. I
want it to start top left corner. How do I do this?

regards
André

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] EditText field question

2010-02-04 Thread TreKing
On Thu, Feb 4, 2010 at 12:52 PM, Michael Dorin  wrote:

> How could I setup an EditText field such that when it was selected for
> editing, all the text inside is selected so
> that it can be easily deleted.
>

EditText has a selectAll() method that will select the text inside of it.
Just call this wherever you're setting it up before presenting it to the
user.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] EditText field question

2010-02-04 Thread Michael Dorin
How could I setup an EditText field such that when it was selected for
editing, all the text inside is selected so
that it can be easily deleted.

I have tried android:selectAllOnFocus, but it seems my field is only
in focus once...when the activity is started..
it it is displayed selected anyway..even before you select it.

Any thoughts would be appreciated.
-Mike

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] EditText - how to respond to soft keyboard enter?

2009-10-17 Thread erisa

I have a very simple screen consisting of an EditText for entering a
number, a bunch of TextViews that display results based on the number,
and a RadioGroup to select a mode.

What I want is the screen to do is recompute the results when the user
finishes entering a new number either by pressing the enter key on a
real keyboard or the done key on the virtual keyboard.  I assume this
is pretty standard, but if this is not the best practice I would love
to know.  I have an onKeyListener set on the EditText to capture the
enter key.  It works fine with the real keyboard, but it never gets
called by the soft keyboard.

I also have a problem keeping the focus on the edittext after the
enter key is pressed.  It jumps to a radio button, which is not
desired.  I tried executing v.requestFocus() in the listener right
before the "return true", but it is ignored.

Thanks in advance for any help.

Bruce
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText

2009-09-23 Thread Sven Mutscher

Hello,

I have a problem using EditText. What I do is creating an instance using "new" 
(no xml configuration) and then draw it to my Canvas.

What I do not understand is that nothing happens when clicking into the
text box. Normally the focus is on the text box, I get a cursor and the virtual 
keyboard appears, I can make text input etc... !

Creating the EditText element in a layout xml everything works fine. But this 
is not what I want in that case.

Any ideas ?





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText

2009-09-23 Thread deepthought

Hello,

I have a problem using EditText. What I do is creating an instance
using "new" (no xml configuration) and then draw it to my Canvas.

What I do not understand is that nothing happens when clicking into
the
text box. Normally the focus is on the text box, I get a cursor and
the virtual keyboard appears, I can make text input etc... !

Creating the EditText element in a layout xml everything works fine.
But this is not what I want in that case.

Any ideas ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText

2009-06-14 Thread Synapse

How can I change choise from contextual menu of EditText ( Menu that
includes copy/paste funcionality ) ?
Anyone has some piece of code?

Synapse

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText not honoring width attribute

2009-05-24 Thread solid

I have a table layout with multiple TableRow elements each with a
textView (prompt) and an editText element (input)
so my table looks something like below.  Unfortunately The layout is
honored such that all of the EditText fields expand so that all of
them are as big as the largest 1.  None of them are different from
each other even though they each have explicitly different widths.
How do I have them each get their own size definitions?


































--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText appearance

2009-03-10 Thread Mr.No

Hello,
how do i change the size, style, typeface of a hint?
If the EditText gains the focus the border-color changes to orange,
how do i set a other color?

rgds
   Mr.No
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText Unicode or Latin-1

2009-03-05 Thread Mr.No

How do i enable Unicode in for my EditText,
if i enter ö,ä,ü he shows me [ +- ect...

rgds
mr.no
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText Right Align

2008-10-01 Thread Zachary Becker
I couldn't find the xml attribute to align a EditText box to the right side.
I am using it for numbers so I would prefer it be aligned right.

Is there a way to do this, through xml or a function call?

Thanks,

Zach

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText multiline

2008-09-25 Thread Chihau Chau
how i can use EditText with multiline???

-- 
Chihau Chau

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText to String to int

2008-04-24 Thread Kyle

Hi, I've been looking for a way of doing this, maybe it's just my lack
of thought, or maybe I'm just too noob at Java, but I'm trying to get
EditText text (can do this), send to a string (can also do this)
convert to int, add to a global int, and then write the global int to
a TextView. Here is my code:

final int totalCost=0;
btnAddCost.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
final String value = btnAddCost.getText().toString();
totalCost = Integer.parseInt(value);
txtTotalCost.setText("$"+totalCost);
}
});

Eclipse returns an error saying:
The final local variable totalCost cannot be assigned, since it is
defined in an enclosing type

Any ideas? Basically what it is, is a price updater, adds the amount
of money you typed in, to the TextView (txtTotalCost)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText getText() to string for notification

2008-04-22 Thread Kyle

Hi, I have my application set to grab the text from an EditText field,
but for some reason even if I convert it "toString", the returned
string always comes back blank. Here is my code:

Button button;
EditText text;

button = (Button) findViewById(R.id.btnOK);
text = (EditText) findViewById(R.id.txtCustomerName);
final String message = text.getText().toString();
button.setOnClickListener(new Button.OnClickListener() {
  public void onClick(View v) {
Toast.makeText(HelloWorld.this, message,
Toast.LENGTH_SHORT).show();
  }
});

Sorry for the bad code organization, but copy and paste didn't really
work out the way I imagined, Haha. Any help would be great. Also, I
tried searching, but for some reason I just can't find a solution.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---