how to style an activity in android - android

I was surfing on the internet and by chance I got this image ..
http://blog.donnfelker.com/wp-content/uploads/2011/11/qonqr-example.png
So I tried to put a backgroung color to my activity but the problem is that the whole activity is being covered by that color .. what to do if i don't want the colors to be applied on the EditText fields ...?
And please also tell how to get this TextView style as in the image written "Create an account" ?
P.S. I am a newbie .

Try to split your activity into different layouts.and then apply background colors to those layouts.And for edittext you set its different background .

Related

Get text of button with font style in android

Anyone knows how to get the text of any component like textview, button, or edit text with it is current font style.
My issue is that I am getting a normal text with text view.getText() but I want to text with the custom font which I have applied with Typeface.
Thanks in advance
Share your code and what you have done until now in your thread, if you get error include it to your post. Here guide for asking in SO Guide Ask in SO

Getting TextView color in xml

How to get theme text color in layout xml? android:textColor="?attr/editTextColor" works for EditText color but I cannot find value for default text (TextView) color. I want to get text color to use in other elements.
If You Are Using Android Studio, Then Press Ctrl+B or Command+B (For Mac) On The Resource Name You Want to go to. As You are finding colour for textView. Then press ctrl + B, it will redirect you to the default style xml of android. You Can Find Shades There.
I find out default shades from the same source of course as Google has not given is every value of shades for every View.
Reply me back if it really helps you.
Happy Coding.

How to show html code on button in Android and style it

I want to put html codes on buttons as text in my android application and style them.
For ex: I want to create a help button and put "❔" as text to it.
Below is the code I have written in the activity.
Button btHelp=((Button) findViewById(R.id.btHelp));
btHelp.setText(Html.fromHtml("❔"));
But if I want to change the color of it. I tried by giving span and font in the above statement but it is not applying.
Can you please let me know how to give the colors for this. Also let me know if there is any better way to do so.
Thanks,
If you want to change text color, simply use:
btnHelp.setTextColor(Color.parseColor("#FF0000"));
or
btnHelp.setTextColor(Color.RED);
or
btnHelp.setTextColor(getResources().getColor(R.color.red));
But that won't work with emojis like your White Question Mark Ornament. If you want to change that question mark color, you will have to make a drawable file with button drawables (png) that have that question mark with the color you want. You can do that from photoshop or any other program.

Spinner has Grey Text, why? How can I change it to default text colour instead?

I implemented this kind of thing in my app but can't figure out why it turns text grey, like in the photo...
anyone know why? and I how do i change it to default text colour? the spinner in my layout file looks like black text.. but when I run it, it is grey just like in this sample.
http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html
You'll have to create a custom adapter to hook into the creation of the views. Similar SO question with some useful info for you: Change spinner font color
I'm not sure if I really get your question, but if you want to change the text color of the items of the spinner, just add android:textColor="your color here" to the TextView of row.xml.
yeah I think my question was flawed.. seems like maybe this light grey is default color.. but it looks horrible (unreadable almost) on my galaxy s2.. on emulator it looks ok, but a little light..
it is first spinner i ever created...
so I solved it by hard-coding a darker grey... but I don't like hard coding because I am unsure if some android devices would skin the background of the spinner to some color that makes a dark grey unreadable?

Android change TextField outline/boarder color

I have a text field, and on Android 2.2, when it is in focus or being used, it highlights it and puts an orange boarder around it.
The orange really doesn't look good with the other colors in my app, so I am wondering if there is any way to change that to a different color...
Thanks in advance.
You can write selectors for your textview using which you can change the appearance of your textview when it is selected.
You can refer to this:
http://developer.android.com/reference/android/content/res/ColorStateList.html

Categories

Resources