color/colorPrimary
is some orange color I want header has it. But I succeded to change header text color which is easy . I would like to change color of header background. This is what I have so far:
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:textColorPrimary">@color/colorPrimary</item>
<item name="android:windowTitleBackgroundStyle">@style/dialog_title_style</item>
<item name="android:alertDialogStyle">@style/AlertDialog_Sphinx</item>
<item name="colorAccent">@color/colorPrimary</item>
</style>
<style name="dialog_title_style" >
<item name="android:background">@color/colorPrimary</item>
<item name="android:padding">100dp</item>
</style>
<style name="AlertDialog_Sphinx">
<item name="android:fullDark">@color/colorPrimary</item>
<item name="android:topDark">@color/colorPrimary</item>
<item name="android:centerDark">@color/colorPrimary</item>
<item name="android:bottomDark">@color/colorPrimary</item>
<item name="android:fullBright">@color/colorPrimary</item>
<item name="android:topBright">@color/colorPrimary</item>
<item name="android:centerBright">@color/colorPrimary</item>
<item name="android:bottomBright">@color/colorPrimary</item>
<item name="android:bottomMedium">@color/colorPrimary</item>
<item name="android:centerMedium">@color/colorPrimary</item>
</style>
public class MyDialogFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder=new AlertDialog.Builder(getActivity(), R.style.AppCompatAlertDialogStyle).setTitle("Naslov")
.setMessage("Poruka......................................................")
.setIcon(android.R.drawable.ic_menu_help)
.setPositiveButton("OK",null);
return builder.create();
}
}
I'm using support version of AlertDialog.(23.1.0) This way dialog look more like dialog on newer version of android(Material Design)
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
I want that header is of color/colorPrimary (orange) background.