Add gtask and custom filter nav drawer icons

pull/281/head
Alex Baker 11 years ago
parent 3e81e1def4
commit bd4aa2eb2b

@ -15,6 +15,7 @@ import com.todoroo.astrid.data.StoreObject;
import org.tasks.R;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.ResourceResolver;
import java.util.ArrayList;
import java.util.List;
@ -32,10 +33,12 @@ public final class CustomFilterExposer {
static final String TOKEN_FILTER_ID = "id"; //$NON-NLS-1$
private final StoreObjectDao storeObjectDao;
private ResourceResolver resourceResolver;
private final Context context;
@Inject
public CustomFilterExposer(@ForApplication Context context, StoreObjectDao storeObjectDao) {
public CustomFilterExposer(ResourceResolver resourceResolver, @ForApplication Context context, StoreObjectDao storeObjectDao) {
this.resourceResolver = resourceResolver;
this.context = context;
this.storeObjectDao = storeObjectDao;
}
@ -43,11 +46,13 @@ public final class CustomFilterExposer {
public List<Filter> getFilters() {
final List<Filter> list = new ArrayList<>();
final int filter = resourceResolver.getResource(R.attr.ic_action_filter);
storeObjectDao.getSavedFilters(new Callback<StoreObject>() {
@Override
public void apply(StoreObject savedFilter) {
Filter f = SavedFilter.load(savedFilter);
f.icon = filter;
Intent deleteIntent = new Intent(context, DeleteFilterActivity.class);
deleteIntent.putExtra(TOKEN_FILTER_ID, savedFilter.getId());
f.contextMenuLabels = new String[] { context.getString(R.string.BFE_Saved_delete) };

@ -26,6 +26,7 @@ import com.todoroo.astrid.data.Task;
import org.tasks.R;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.ResourceResolver;
import java.util.List;
@ -44,12 +45,14 @@ public class GtasksFilterExposer {
private final GtasksListService gtasksListService;
private final GtasksPreferenceService gtasksPreferenceService;
private ResourceResolver resourceResolver;
private final Context context;
private final GtasksMetadata gtasksMetadata;
@Inject
public GtasksFilterExposer(@ForApplication Context context, GtasksListService gtasksListService,
public GtasksFilterExposer(ResourceResolver resourceResolver, @ForApplication Context context, GtasksListService gtasksListService,
GtasksPreferenceService gtasksPreferenceService, GtasksMetadata gtasksMetadata) {
this.resourceResolver = resourceResolver;
this.context = context;
this.gtasksListService = gtasksListService;
this.gtasksPreferenceService = gtasksPreferenceService;
@ -62,9 +65,13 @@ public class GtasksFilterExposer {
return emptyList();
}
int cloud = resourceResolver.getResource(R.attr.ic_action_cloud);
List<Filter> listFilters = newArrayList();
for (GtasksList list : gtasksListService.getLists()) {
listFilters.add(filterFromList(gtasksMetadata, context, list));
Filter filter = filterFromList(gtasksMetadata, context, list);
filter.icon = cloud;
listFilters.add(filter);
}
return listFilters;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

@ -55,6 +55,8 @@
<attr name="importance_background_selected" format="reference" />
<attr name="fab_icon" format="reference" />
<attr name="toolbarSeparatorHeight" format="dimension" />
<attr name="ic_action_filter" format="reference"/>
<attr name="ic_action_cloud" format="reference"/>
<declare-styleable name="DateAndTimePicker">
<attr name="shortcutLabels" format="reference" />

@ -65,6 +65,8 @@
<item name="ic_action_history">@drawable/ic_history_black_24dp</item>
<item name="ic_action_uncategorized">@drawable/ic_label_outline_black_24dp</item>
<item name="ic_action_label">@drawable/ic_label_black_24dp</item>
<item name="ic_action_filter">@drawable/ic_filter_list_black_24dp</item>
<item name="ic_action_cloud">@drawable/ic_cloud_queue_black_24dp</item>
</style>
<style name="Tasks.Dark">
@ -106,6 +108,8 @@
<item name="ic_action_history">@drawable/ic_history_white_24dp</item>
<item name="ic_action_uncategorized">@drawable/ic_label_outline_white_24dp</item>
<item name="ic_action_label">@drawable/ic_label_white_24dp</item>
<item name="ic_action_filter">@drawable/ic_filter_list_white_24dp</item>
<item name="ic_action_cloud">@drawable/ic_cloud_queue_white_24dp</item>
</style>
<style name="ActionBar.TitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">

Loading…
Cancel
Save