diff --git a/build.gradle b/build.gradle index 76f0f8705..b8c3bc5e7 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ android { buildToolsVersion "22.0.1" defaultConfig { - versionCode 365 + versionCode 366 versionName "4.7.13" minSdkVersion 7 targetSdkVersion 22 diff --git a/src/googleplay/res/values-v8/bools.xml b/src/googleplay/res/values-v8/bools.xml index 195f21eec..b85930031 100644 --- a/src/googleplay/res/values-v8/bools.xml +++ b/src/googleplay/res/values-v8/bools.xml @@ -1,4 +1,5 @@ true + true \ No newline at end of file diff --git a/src/main/java/org/tasks/Notifier.java b/src/main/java/org/tasks/Notifier.java index b7e35b113..136f20f4b 100644 --- a/src/main/java/org/tasks/Notifier.java +++ b/src/main/java/org/tasks/Notifier.java @@ -67,7 +67,7 @@ public class Notifier { this.preferences = preferences; } - public void triggerFilterNotification(String title, String query) { + public void triggerFilterNotification(String title, String query, String valuesForNewTasks) { TodorooCursor taskTodorooCursor = null; int count; try { @@ -90,7 +90,7 @@ public class Notifier { String subtitle = context.getString(R.string.task_count, count); - showFilterNotification(title, subtitle, query); + showFilterNotification(title, subtitle, query, valuesForNewTasks); } public void triggerTaskNotification(long id, int type) { @@ -167,10 +167,10 @@ public class Notifier { return true; } - private void showFilterNotification(final String title, String subtitle, final String query) { + private void showFilterNotification(final String title, String subtitle, final String query, final String valuesForNewTasks) { PendingIntent pendingIntent = PendingIntent.getActivity(context, (title + query).hashCode(), new Intent(context, TaskListActivity.class) {{ setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_MULTIPLE_TASK); - putExtra(TaskListActivity.TOKEN_SWITCH_TO_FILTER, new Filter(title, query, null)); + putExtra(TaskListActivity.TOKEN_SWITCH_TO_FILTER, new Filter(title, query, AndroidUtilities.contentValuesFromSerializedString(valuesForNewTasks))); }}, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder builder = new NotificationCompat.Builder(context) diff --git a/src/main/java/org/tasks/activities/FilterSelectionActivity.java b/src/main/java/org/tasks/activities/FilterSelectionActivity.java index 5fb30b2a5..5fa2bb32d 100644 --- a/src/main/java/org/tasks/activities/FilterSelectionActivity.java +++ b/src/main/java/org/tasks/activities/FilterSelectionActivity.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AlertDialog; +import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.adapter.FilterAdapter; import com.todoroo.astrid.api.Filter; @@ -19,6 +20,7 @@ public class FilterSelectionActivity extends InjectingFragmentActivity { public static final String EXTRA_FILTER_NAME = "extra_filter_name"; public static final String EXTRA_FILTER_SQL = "extra_filter_query"; + public static final String EXTRA_FILTER_VALUES = "extra_filter_values"; @Inject FilterProvider filterProvider; @Inject FilterCounter filterCounter; @@ -38,6 +40,9 @@ public class FilterSelectionActivity extends InjectingFragmentActivity { setResult(RESULT_OK, new Intent() {{ putExtra(EXTRA_FILTER_NAME, selectedFilter.listingTitle); putExtra(EXTRA_FILTER_SQL, selectedFilter.getSqlQuery()); + if (selectedFilter.valuesForNewTasks != null) { + putExtra(EXTRA_FILTER_VALUES, AndroidUtilities.contentValuesToSerializedString(selectedFilter.valuesForNewTasks)); + } }}); dialog.dismiss(); } diff --git a/src/main/java/org/tasks/preferences/BasicPreferences.java b/src/main/java/org/tasks/preferences/BasicPreferences.java index 6bb882019..a6a2d55c9 100644 --- a/src/main/java/org/tasks/preferences/BasicPreferences.java +++ b/src/main/java/org/tasks/preferences/BasicPreferences.java @@ -31,6 +31,9 @@ public class BasicPreferences extends InjectingPreferenceActivity { if (!getResources().getBoolean(R.bool.sync_enabled)) { getPreferenceScreen().removePreference(findPreference(getString(R.string.synchronization))); } + if (getResources().getBoolean(R.bool.tasker_available)) { + addPreferencesFromResource(R.xml.preferences_addons); + } setupActivity(R.string.EPr_appearance_header, AppearancePreferences.class); setupActivity(R.string.notifications, ReminderPreferences.class); setupActivity(R.string.EPr_manage_header, OldTaskPreferences.class); diff --git a/src/main/java/org/tasks/receivers/ListNotificationReceiver.java b/src/main/java/org/tasks/receivers/ListNotificationReceiver.java index b391e3b52..f7cbc7e1c 100644 --- a/src/main/java/org/tasks/receivers/ListNotificationReceiver.java +++ b/src/main/java/org/tasks/receivers/ListNotificationReceiver.java @@ -21,6 +21,7 @@ public class ListNotificationReceiver extends InjectingBroadcastReceiver { public static final String EXTRA_FILTER_TITLE = "extra_filter_title"; public static final String EXTRA_FILTER_QUERY = "extra_filter_query"; + public static final String EXTRA_FILTER_VALUES = "extra_filter_values"; @Inject Notifier notifier; @@ -35,7 +36,8 @@ public class ListNotificationReceiver extends InjectingBroadcastReceiver { public void run() { notifier.triggerFilterNotification( intent.getStringExtra(EXTRA_FILTER_TITLE), - intent.getStringExtra(EXTRA_FILTER_QUERY)); + intent.getStringExtra(EXTRA_FILTER_QUERY), + intent.getStringExtra(EXTRA_FILTER_VALUES)); } }); } diff --git a/src/main/res/values/bools.xml b/src/main/res/values/bools.xml index d501f82a1..5e2235556 100644 --- a/src/main/res/values/bools.xml +++ b/src/main/res/values/bools.xml @@ -6,4 +6,5 @@ false true false + false \ No newline at end of file diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 9c2c5ec56..9e6653279 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -125,6 +125,7 @@ Show completed Reverse %s Tasks + Get Plug-ins diff --git a/src/main/res/xml/preferences_addons.xml b/src/main/res/xml/preferences_addons.xml new file mode 100644 index 000000000..70b6d6306 --- /dev/null +++ b/src/main/res/xml/preferences_addons.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file