|
|
|
@ -18,6 +18,7 @@ import javax.inject.Inject;
|
|
|
|
|
|
|
|
|
|
public class FilterSelectionActivity extends InjectingAppCompatActivity {
|
|
|
|
|
|
|
|
|
|
public static final String EXTRA_RETURN_FILTER = "extra_include_filter";
|
|
|
|
|
public static final String EXTRA_FILTER = "extra_filter";
|
|
|
|
|
public static final String EXTRA_FILTER_NAME = "extra_filter_name";
|
|
|
|
|
public static final String EXTRA_FILTER_SQL = "extra_filter_query";
|
|
|
|
@ -32,6 +33,8 @@ public class FilterSelectionActivity extends InjectingAppCompatActivity {
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
|
|
|
|
|
final boolean returnFilter = getIntent().getBooleanExtra(EXTRA_RETURN_FILTER, false);
|
|
|
|
|
|
|
|
|
|
activityPreferences.applyTheme();
|
|
|
|
|
|
|
|
|
|
final FilterAdapter filterAdapter = new FilterAdapter(filterProvider, filterCounter, this, null, false);
|
|
|
|
@ -43,7 +46,9 @@ public class FilterSelectionActivity extends InjectingAppCompatActivity {
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
final Filter selectedFilter = (Filter) filterAdapter.getItem(which);
|
|
|
|
|
setResult(RESULT_OK, new Intent() {{
|
|
|
|
|
putExtra(EXTRA_FILTER, selectedFilter);
|
|
|
|
|
if (returnFilter) {
|
|
|
|
|
putExtra(EXTRA_FILTER, selectedFilter);
|
|
|
|
|
}
|
|
|
|
|
putExtra(EXTRA_FILTER_NAME, selectedFilter.listingTitle);
|
|
|
|
|
putExtra(EXTRA_FILTER_SQL, selectedFilter.getSqlQuery());
|
|
|
|
|
if (selectedFilter.valuesForNewTasks != null) {
|
|
|
|
|