Home » Android » colors – android Theme.Holo.Dialog changing blue lines to orange

colors – android Theme.Holo.Dialog changing blue lines to orange

Posted by: admin April 23, 2020 Leave a comment


Default color for lines on Android theme Theme.Holo.Dialog are blue.
I’d like to know how to change this to any other color.
Orange in my case

I can change text or background etc.. orveriding the theme with a custom style.xml

   <style name="Theme.MyTheme" parent="@android:style/Theme.Holo.Dialog" >
        <item name="android:textColor">@color/coloroscuro</item>
        <item name="android:textColorHint">@color/coloroscuro</item>

but I don’t know wich property manages the color of the lines

I mean the blue lines that the theme has by default like the ones shown on this other question:

How to Android Holo Theme style dialog box buttons


How to&Answers:

There is a library which does exactly what you need – easy styling of dialogs in Holo theme:



Just dug around in the source for you – unfortunately the Divider line in the dialog layouts is a view with a hard coded color background that doesn’t reference any themes:

<View android:id="@+id/titleDividerTop"
  android:background="@android:color/holo_blue_light" />

So if you want to change the color you’ll have to layout your own, custom, dialog box. to make it easier, it wouldn’t hurt to just copy from the android source base and customize it to your needs, but you might also get a lot more than you need.


one trick is using dialog with no title bar, hence android not draw the line, then adding title and the line yourself in dialog`s layout xml file!
for example:

<style name="myDialogStyle" parent="android:style/Theme.Holo.Dialog">
    <item name="android:windowNoTitle">true</item>

in manifest use:

        android:theme="@style/myDialogStyle" >

and in your Mydialog layout define title and line yourself with your desired color and style!