I have activities with custom style, I want my activity with a custom title bar so I created below style:
<style name="costum_titlebar">
<item name="android:background">@color/titlebar_background</item>
</style>
<style name="CustomTheme" parent="android:Theme">
<item name="android:windowTitleSize">@dimen/titlebar_size</item>
<item name="android:windowTitleBackgroundStyle">@style/costum_titlebar</item>
</style>
In manifest I use:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomTheme" >
In the activity I use:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
this.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.setting_activity_titlebar);
So far it's good and works fine, I have activity with my custom title bar.
Now I want to use datePickerDialog. The problem is that dialog looks old:
But I want it to look like this:
I also have this style:
<style name="AppBaseTheme" parent="android:Theme.Light">
So I used it to create DatePickerDialog like this:
new DatePickerDialog(getActivity(),R.style.AppBaseTheme, this, year, month, day);
But the theme won't apply.
Just for a test, I create a second app with default style and just one button to open date picker, so the datepicker
Looks like what I want. Both apps have android:minSdkVersion="8"
I think the problem is with custom titlebar, so how I can get my custom titlebar and datepicker with desired style?
EDIT:
I Changed android:minSdkVersion="11"
with
<style name="datePickerTheme" parent="@android:style/Widget.Holo.DatePicker"></style>
and
new DatePickerDialog(getActivity(),R.style.datePickerTheme, this, year, month, day);
But the Result still is the same.
See Question&Answers more detail:
os