EditText appearance

by Mr.No » Tue, 10 Mar 2009 17:06:52 GMT


Sponsored Links
 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
--~--~---------~--~----~------------~-------~--~----~



EditText appearance

by Mr.No » Tue, 10 Mar 2009 18:31:04 GMT


 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
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


EditText appearance

by Tseng » Wed, 11 Mar 2009 19:42:09 GMT


 You could create a colorstate list (xml file in res/drawable), for
example
 http://developer.android.com/reference/android/content/res/ColorStateList.html 

Here is an example i used for textcolors. Should work for HintColors
too!

res/drawabale/myedittextcolors.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android=" http://schemas.android.com/apk/res/android" ;>
    <item
        android:state_focused="true"
        android:state_pressed="false"
                android:color="@android:color/secondary_text_dark" />
    <item
        android:state_focused="true"
        android:state_pressed="true"
                android:color="@android:color/secondary_text_dark" />
    <item
        android:state_focused="false"
        android:state_pressed="true"
                android:color="@android:color/secondary_text_dark" />
    <item
        android:color="@android:color/secondary_text_dark" />
</selector>

Now you only have to assign it to your EditText widget.

Edit the XML and change

android:textColorHint="#FFFFFF"

to

android:textColorHint="@drawable/myedittextcolors"

and it should work. This is usefull if you want to have different
colors depending on the state of the edittext (i.e. if its focused,
clicked, etc).

For one color,
use android:textColorHint="#FFFFFF" or android:textColorHint="@color/
mycustomcolor" if you have defined your color in /res/values/
colors.xml









--~--~---------~--~----~------------~-------~--~----~



EditText appearance

by Mr.No » Thu, 12 Mar 2009 17:36:28 GMT


 thx a lot :)



--~--~---------~--~----~------------~-------~--~----~



EditText appearance

by Mr.No » Thu, 12 Mar 2009 18:06:37 GMT


 Can i assigne a colorstate list to the background?
And how do i change the bordercolor when the edittext gains the focus,
without placing a backgroundimage?

Tseng schrieb:

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Ant not building app properly

Hello,

I have been building an Android app for some time now, and I decided
to start using Ant for building instead of through Eclipse. Building
through Eclipse has always worked flawlessly, but when I started
building with Ant, the builds (that would install in an emulator)
would always be unstable. Ant would always build and install the app
fine, but running the app would cause these serious instability
issues.

Here are a few examples that would occur after building with Ant and
installing the app:

1. The application would force close because of ClassCastExceptions
being thrown. The source of these errors would be traced to casts like
this:

(LinearLayout)findViewById(R.id.my_layout)

In this case, R.id.my_layout (or whatever I called it) would point to
a non-existing resource. Of course, building this in Eclipse would not
show these errors.

2. The wrong string resources would be used in an unpredictable way.

3. Layouts would not load up correctly, also causing random failures
and force-closes.

I believe that the source of these issues is related to how it is
compiling R.java and the way it links it up to resources. I am
unfamiliar as to how it builds resources into apps, so I am at a loss
as to why this is occurring in the first place.

The interesting thing is that if I make some change to the source
code, and do another 'ant compile' or 'ant install', the problems in
the previous build disappear and new resource issues pop up.

After plenty of googling, I could not find anything describing
something similar to this issue. I am concerned that potentially
building via Ant might be exposing issues that I am not aware of, so
besides using Ant, I just want to make sure.

Is this a known issue? I just want to make sure before I attempt to
reproduce the problem on a smaller scale.

My development computer is:

- Mac OS X 10.6.5
- from java -version:

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)

I'm just using the default JVM for this.

- building against Android + Google APIs, API 8 revision 2.


Thank you very much,
Brian

-- 

2. Simple Database not so simple

Hey guys i am making a database application which is very much similar
to notepad application.
The only difference is that this application has 3 fields.
I am getting the famous Force Close error
The following is the error log :-
eclipse.buildId=M20100211-1343
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IN
Command-line arguments:  -os linux -ws gtk -arch x86


Error
Tue Dec 28 10:40:55 IST 2010
Unable to read /home/robin/android-sdk-linux_x86/AndroidManifest.xml:
java.io.FileNotFoundException: /home/robin/android-sdk-linux_x86/
AndroidManifest.xml (No such file or directory)

com.android.sdklib.io.StreamException: java.io.FileNotFoundException: /
home/robin/android-sdk-linux_x86/AndroidManifest.xml (No such file or
directory)
at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:92)
at
com.android.sdklib.xml.AndroidManifestParser.parse(AndroidManifestParser.java:
608)
at
com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parse(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.extractNamesFromAndroidManifest(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.access
$16(Unknown Source)
at
com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage
$3.widgetSelected(Unknown Source)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:
228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.internal.handlers.WizardHandler
$New.executeHandler(WizardHandler.java:253)
at
org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:
273)
at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:
294)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:
476)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:
508)
at
org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:
169)
at
org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:
241)
at
org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:
157)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:
584)
at org.eclipse.jface.action.ActionContributionItem.access
$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem
$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:
332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:
113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:
110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:
79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.io.FileNotFoundException: /home/robin/android-sdk-
linux_x86/AndroidManifest.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:90)
... 48 more


 If you want to know the code then also let me know .
It is more or less same as the notepad application with some tweaking

-- 

3. example on asynctask class..

4. How to pass date object from one activity to other?

5. MMS Messages

6. Send email via ACTION SEND intent

7. How to handel Listview click events