Fix date and time dialog backgrounds

pull/384/head
Alex Baker 9 years ago
parent ca2c830ac7
commit f763c242d6

@ -6,7 +6,7 @@
<activity
android:name=".activities.DonationActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
</application>

@ -40,13 +40,13 @@
<activity
android:name=".activities.DonationActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<service android:name=".location.GeofenceTransitionsIntentService"/>
<activity
android:name="com.todoroo.astrid.gtasks.auth.GtasksLoginActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name="com.todoroo.astrid.gtasks.GtasksPreferences"
@ -55,7 +55,7 @@
<activity
android:name=".activities.ClearGtaskDataActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<service
android:name=".scheduling.GtasksBackgroundService"

@ -112,20 +112,20 @@
<activity
android:name=".activities.SortActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.FilterSelectionActivity"
android:exported="true"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.AddAttachmentActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.CameraActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<!-- Activity that displays task list -->
<activity
@ -310,21 +310,21 @@
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:taskAffinity=""
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".reminders.SnoozeActivity"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:taskAffinity=""
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".reminders.NotificationActivity"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:taskAffinity=""
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<!-- tags -->
@ -374,7 +374,7 @@
<activity
android:name="com.todoroo.astrid.gcal.CalendarReminderActivity"
android:theme="@style/TranslucentDialog"/>
android:theme="@style/DialogBase"/>
<receiver android:name="com.todoroo.astrid.gcal.CalendarAlarmReceiver" />
@ -386,38 +386,38 @@
<activity
android:name=".activities.ClearAllDataActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.ResetPreferencesActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.PurgeDeletedActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.DeleteCompletedActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.DeleteCompletedEventsActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".activities.DeleteAllCalendarEventsActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<!-- backup -->
<activity
android:name="org.tasks.activities.ExportTaskActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name="org.tasks.activities.ImportTaskActivity"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<!-- premium -->
<activity
android:name="com.todoroo.astrid.files.AACRecordingActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/TranslucentDialog" />
android:theme="@style/DialogBase" />
<activity
android:name=".files.MyFilePickerActivity"
@ -431,7 +431,7 @@
<activity
android:name=".files.FileExplore"
android:theme="@style/TranslucentDialog"/>
android:theme="@style/DialogBase"/>
<receiver android:name="com.todoroo.astrid.timers.TimerTaskCompleteListener">
<intent-filter>
@ -448,7 +448,7 @@
<activity
android:name=".voice.VoiceCommandActivity"
android:theme="@style/TranslucentDialog">
android:theme="@style/DialogBase">
<intent-filter>
<action android:name="com.google.android.gm.action.AUTO_SEND"/>

@ -34,8 +34,6 @@ public class DateAndTimePickerActivity extends InjectingAppCompatActivity implem
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
preferences.applyTheme();
initial = new DateTime(getIntent().getLongExtra(EXTRA_TIMESTAMP, currentTimeMillis()));
if (savedInstanceState != null) {
@ -50,9 +48,7 @@ public class DateAndTimePickerActivity extends InjectingAppCompatActivity implem
if (datePickerDialog == null) {
datePickerDialog = new MyDatePickerDialog();
datePickerDialog.initialize(null, initial.getYear(), initial.getMonthOfYear() - 1, initial.getDayOfMonth());
if (preferences.isDarkTheme()) {
datePickerDialog.setAccentColor(getResources().getColor(R.color.black_text_hint));
}
datePickerDialog.setAccentColor(getResources().getColor(preferences.isDarkTheme() ? R.color.black_text_hint : R.color.primary));
datePickerDialog.show(fragmentManager, FRAG_TAG_DATE_PICKER);
}
datePickerDialog.setOnCancelListener(this);

@ -31,8 +31,6 @@ public class DatePickerActivity extends InjectingAppCompatActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
preferences.applyTheme();
long timestamp = getIntent().getLongExtra(EXTRA_TIMESTAMP, currentTimeMillis());
DateTime initial = (timestamp > 0 ? new DateTime(timestamp) : new DateTime()).startOfDay();
@ -41,9 +39,7 @@ public class DatePickerActivity extends InjectingAppCompatActivity
if (dialog == null) {
dialog = new MyDatePickerDialog();
dialog.initialize(null, initial.getYear(), initial.getMonthOfYear() - 1, initial.getDayOfMonth());
if (preferences.isDarkTheme()) {
dialog.setAccentColor(getResources().getColor(R.color.black_text_hint));
}
dialog.setAccentColor(getResources().getColor(preferences.isDarkTheme() ? R.color.black_text_hint : R.color.primary));
dialog.show(fragmentManager, FRAG_TAG_DATE_PICKER);
}
dialog.setOnDismissListener(this);

@ -36,8 +36,6 @@ public class TimePickerActivity extends InjectingAppCompatActivity implements Ti
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
preferences.applyTheme();
initial = new DateTime(getIntent().getLongExtra(EXTRA_TIMESTAMP, currentTimeMillis()));
FragmentManager fragmentManager = getFragmentManager();
@ -45,9 +43,7 @@ public class TimePickerActivity extends InjectingAppCompatActivity implements Ti
if (dialog == null) {
dialog = new MyTimePickerDialog();
dialog.initialize(null, initial.getHourOfDay(), initial.getMinuteOfHour(), 0, DateFormat.is24HourFormat(this));
if (preferences.isDarkTheme()) {
dialog.setAccentColor(getResources().getColor(R.color.black_text_hint));
}
dialog.setAccentColor(getResources().getColor(preferences.isDarkTheme() ? R.color.black_text_hint : R.color.primary));
dialog.show(fragmentManager, FRAG_TAG_TIME_PICKER);
}
dialog.setOnDismissListener(this);

@ -29,11 +29,11 @@ public class ActivityPreferences extends Preferences {
}
public void applyTheme() {
applyTheme(isDarkTheme() ? R.style.TasksDark : R.style.Tasks);
applyTheme(getTheme());
}
public void applyDialogTheme() {
applyTheme(isDarkTheme() ? R.style.TasksDialogDark : R.style.TasksDialog);
applyTheme(getDialogTheme());
}
public void applyStatusBarColor() {
@ -53,10 +53,6 @@ public class ActivityPreferences extends Preferences {
window.setStatusBarColor(resources.getColor(color));
}
public void applyTranslucentDialogTheme() {
applyTheme(R.style.ReminderDialog);
}
private void applyTheme(int theme) {
activity.setTheme(theme);
activity.getWindow().setFormat(PixelFormat.RGBA_8888);

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<inset
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/reminder_dialog_background"
android:insetRight="10dp"
android:insetLeft="10dp">
</inset>

@ -1,14 +1,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TranslucentDialog" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
<!-- ========================================================== General -->
<style name="SpinnerNoPadding" parent="Widget.AppCompat.TextView.SpinnerItem">
@ -36,15 +27,6 @@
<item name="android:textColor">?attr/asTextColor</item>
</style>
<!--================================================== Custom Dialogs == -->
<style name="ReminderDialog" parent="Theme.AppCompat.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/reminder_dialog_inset_background</item>
<item name="android:windowIsTranslucent">true</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
</style>
<!--=============================================== TaskListActivity == -->
<style name="ListView">

@ -42,12 +42,15 @@
<item name="alertDialogTheme">@style/TasksDialogDark</item>
</style>
<style name="TasksDialogDark" parent="@style/Theme.AppCompat.Dialog">
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<style name="DialogBaseDark" parent="@style/Theme.AppCompat.Dialog">
<item name="colorPrimary">@android:color/black</item>
<item name="colorPrimaryDark">@android:color/black</item>
<item name="colorAccent">@android:color/white</item>
</style>
<style name="TasksDialogDark" parent="DialogBaseDark">
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
<item name="asTextColor">@android:color/white</item>
<item name="asListDividerColor">#dddddd</item>

@ -41,12 +41,15 @@
<item name="alertDialogTheme">@style/TasksDialog</item>
</style>
<style name="TasksDialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<style name="DialogBase" parent="Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/primary</item>
</style>
<style name="TasksDialog" parent="DialogBase">
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
<item name="asTextColor">@android:color/black</item>
<item name="asListDividerColor">#dddddd</item>

Loading…
Cancel
Save