Search code examples
androidthemesandroid-edittextandroid-4.0-ice-cream-sandwich

Mixing Android widget old & new themes


I'm starting my second Android app and find that I would like to mostly use HOLO dark theme for app.

EXCEPT for the EditTexts, I would prefer to use the old Gingerbread style ones (looking closer to iOS) with some rounded corner.

I'm a bit lost as to how I can achieve this. If anyone could drop some hints or links that would be HIGHLY appreciated


Solution

  • In your Theme:

    <style name="myTheme"  parent="android:Theme.Holo">
    <item name="editTextStyle">@style/MyWidget.EditText</item>
    </style>
    
    <style name="MyWidget.EditText" parent="android:Widget.EditText">
            <item name="android:background">@drawable/edit_text</item>
    </style>
    

    Now you can get the referenced drawable from Github(from the Gingerbread branch of the framework)