Add 'Show task description' notification setting

save_or_discard
Alex Baker 8 years ago
parent 4d48c6abbe
commit f0f3f65af2

@ -88,7 +88,7 @@ public class ReminderPreferences extends InjectingPreferenceActivity {
return false;
});
requires(atLeastJellybean(), R.string.p_rmd_notif_actions_enabled, R.string.p_notification_priority);
requires(R.string.notification_shade, atLeastJellybean(), R.string.p_rmd_notif_actions_enabled, R.string.p_notification_priority, R.string.p_rmd_show_description);
requires(atLeastMarshmallow(), R.string.p_doze_notifications);
requires(device.supportsLocationServices(), R.string.geolocation_reminders);

@ -13,6 +13,7 @@ import android.provider.ContactsContract;
import android.support.v4.app.NotificationCompat;
import android.text.TextUtils;
import com.google.common.base.Strings;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DateUtilities;
@ -261,9 +262,10 @@ public class Notifier {
.setWhen(currentTimeMillis())
.setContentTitle(taskTitle)
.setContentText(text)
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(taskDescription.equals("") ? text : taskDescription))
.setContentIntent(PendingIntent.getActivity(context, (int) id, intent, PendingIntent.FLAG_UPDATE_CURRENT));
if (!Strings.isNullOrEmpty(taskDescription) && preferences.getBoolean(R.string.p_rmd_show_description, true)) {
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(taskDescription));
}
if (preferences.useNotificationActions()) {
PendingIntent completeIntent = PendingIntent.getBroadcast(context, (int) id, new Intent(context, CompleteTaskReceiver.class) {{
putExtra(CompleteTaskReceiver.TASK_ID, id);

@ -328,5 +328,6 @@
<string name="debug_unlock_purchases">Unlock purchases</string>
<string name="debug_consume_purchases">Consume purchases</string>
<string name="debug">Debug</string>
<string name="p_rmd_show_description">rmd_show_description</string>
</resources>

@ -854,5 +854,7 @@ File %1$s contained %2$s.\n\n
<string name="widget_settings">Widget settings</string>
<string name="widget_header_settings">Header settings</string>
<string name="widget_row_settings">Row settings</string>
<string name="notification_shade">Notification shade</string>
<string name="notification_description">Show task description</string>
</resources>

@ -12,19 +12,6 @@
android:defaultValue="true"
android:key="@string/p_rmd_enabled"
android:title="@string/enabled" />
<com.todoroo.astrid.ui.MultilineListPreference
android:defaultValue="1"
android:dependency="@string/p_rmd_enabled"
android:entries="@array/notification_priority_entries"
android:entryValues="@array/notification_priority_values"
android:key="@string/p_notification_priority"
android:title="@string/notification_priority" />
<CheckBoxPreference
android:defaultValue="true"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_rmd_notif_actions_enabled"
android:summary="@string/notification_actions_summary"
android:title="@string/notification_actions" />
<RingtonePreference
android:defaultValue="content://settings/system/notification_sound"
android:dependency="@string/p_rmd_enabled"
@ -36,12 +23,6 @@
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_rmd_persistent"
android:summary="@string/persistent_notifications_description"
android:title="@string/persistent_notifications" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="false"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_doze_notifications"
android:summaryOff="@string/doze_notifications_off"
android:summaryOn="@string/doze_notifications_on"
@ -64,6 +45,36 @@
android:summary="@string/rmd_EPr_multiple_maxvolume_desc_true"
android:title="@string/rmd_EPr_multiple_maxvolume_title" />
<PreferenceCategory
android:key="@string/notification_shade"
android:title="@string/notification_shade">
<com.todoroo.astrid.ui.MultilineListPreference
android:defaultValue="1"
android:dependency="@string/p_rmd_enabled"
android:entries="@array/notification_priority_entries"
android:entryValues="@array/notification_priority_values"
android:key="@string/p_notification_priority"
android:title="@string/notification_priority" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_rmd_persistent"
android:summary="@string/persistent_notifications_description"
android:title="@string/persistent_notifications" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_rmd_notif_actions_enabled"
android:summary="@string/notification_actions_summary"
android:title="@string/notification_actions" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_rmd_show_description"
android:title="@string/notification_description" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/led_notification">

Loading…
Cancel
Save