Giuseppe
Giuseppe

Reputation: 1089

Android: UI old interface

For some Activity I'm using @Theme/Dialog, but this appears like old UI 2.3. If I set the Theme of the Activity in the Manifest as Holo/Dialog, then this work fine, but of course this will not work with older devices.

How to force Holo Theme when available?

I tried with a custom MyTheme, but all the activity that have @android:style/Theme.Dialog, continue to appear like old theme.

My activity look like below:

 <activity
        android:name=".audio.TempoManager"
        android:label="Tempo Manager"
        android:theme="@android:style/Theme.Dialog" />

if I change it to @android:style/Theme.Holo.Dialog then on old device the activities will not be open as dialog but as simple activity.

Upvotes: 1

Views: 1651

Answers (2)

kdehairy
kdehairy

Reputation: 2730

refer to this blog post. it answers your question: holo-everywhere

mainly:
1. you write a theme.xml file defining a MyTheme in res/values/ for all pre-3.0 android versions. 2. write a themes.xml file defining the MyTheme in res/values-v11/ for 3.0+ android versions.
3. in the AndroidManifest.xml define the application theme to be MyTheme.

the first theme inherits from @android:style/Theme.
the second theme inherits from @android:style/Theme.Holo.

Upvotes: 2

Broak
Broak

Reputation: 4187

If ICS is available on the device it will default to Holo,

If you want to create for instance the ICS font universally on all devices you will need to provide the ttf font file asset and use it in a custom textview and/or buttons etc..

Upvotes: 0

Related Questions