Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Holo theme for Android application

I have a simple login screen with username and password.

I'd like it to show the EditText fields in the same way as you see in the Holo theme on Ice Cream Sandwich and Honeycomb.

In my manifest file I have

<application
   android:icon="@drawable/ic_launcher"
   android:label="@string/app_name" 
   android:theme="@android:style/Theme.Holo">

Shouldn't the text fields now look different e.g. have no top, left and right borders?

Mine seem to look the exact same. I'm sure I'm doing something very basically wrong but any suggestions welcome.

This is what I see in the emulator: Screen Shot 2012-04-23 at 03.08.16

I was expecting more like this: http://developer.android.com/design/building-blocks/text-fields.html

like image 763
Derek Organ Avatar asked Apr 23 '12 02:04

Derek Organ


2 Answers

The original Android Holo Theme is just for API Level 11+. But there is an open source project called HoloEverywhere.

Take a look at this. This should solve your Problems.

So if you refere it as an Library you can set your Theme like this:

android:theme=“@style/Theme.Holo
// or if you want to use the Holo light theme:
android:theme=“@style/Theme.Holo.Light
like image 110
Ahmad Avatar answered Nov 17 '22 04:11

Ahmad


Try doing it on a per-activity basis. That's how I've always done it. It looks to me like the theme is not taking effect at all in your screenshot. Theme.Holo is dark. The white theme is Theme.Holo.Light.

<activity
        android:name=".login"
        android:label="@string/login"
        android:noHistory="true"
        android:theme="@android:style/Theme.Holo.Light"/>

<activity
        android:name=".Preferences"
        android:theme="@android:style/Theme.Holo.Light" >

etc rather than in the app level

Also, to correct Ahmad, Holo is available from Honeycomb and on, or 11+.

like image 43
The Holo Dev Avatar answered Nov 17 '22 03:11

The Holo Dev