Nav drawer icons

pull/281/head
Alex Baker 9 years ago
parent 9614c79dae
commit 5970798236

@ -25,6 +25,7 @@ import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem;
import org.tasks.R;
import org.tasks.activities.DonationActivity;
import org.tasks.filters.FilterCounter;
import org.tasks.filters.FilterProvider;
import org.tasks.filters.NavigationDrawerAction;
@ -258,6 +259,11 @@ public class FilterAdapter extends ArrayAdapter<FilterListItem> {
getResource(activity, R.attr.ic_action_help),
new Intent(activity, HelpAndFeedbackActivity.class),
0));
add(new NavigationDrawerAction(
activity.getResources().getString(R.string.TLA_menu_donate),
getResource(activity, R.attr.ic_action_donate),
new Intent(activity, DonationActivity.class),
0));
}
notifyDataSetChanged();

@ -64,13 +64,19 @@ public final class BuiltInFilterExposer {
List<Filter> filters = new ArrayList<>();
if (preferences.getBoolean(R.string.p_show_today_filter, true)) {
filters.add(getTodayFilter(r));
Filter todayFilter = getTodayFilter(r);
todayFilter.icon = resourceResolver.getResource(R.attr.ic_action_calendar_today);
filters.add(todayFilter);
}
if (preferences.getBoolean(R.string.p_show_recently_modified_filter, true)) {
filters.add(getRecentlyModifiedFilter(r));
Filter recentlyModifiedFilter = getRecentlyModifiedFilter(r);
recentlyModifiedFilter.icon = resourceResolver.getResource(R.attr.ic_action_history);
filters.add(recentlyModifiedFilter);
}
if (preferences.getBoolean(R.string.p_show_not_in_list_filter, true)) {
filters.add(getUncategorizedFilter(r));
Filter uncategorizedFilter = getUncategorizedFilter(r);
uncategorizedFilter.icon = resourceResolver.getResource(R.attr.ic_action_uncategorized);
filters.add(uncategorizedFilter);
}
// transmit filter list
return filters;

@ -27,6 +27,7 @@ import com.todoroo.astrid.data.Task;
import org.tasks.R;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.ResourceResolver;
import java.util.ArrayList;
import java.util.List;
@ -44,10 +45,12 @@ public class TagFilterExposer {
public static final String TAG = "tag"; //$NON-NLS-1$
private final TagService tagService;
private ResourceResolver resourceResolver;
private final Context context;
@Inject
public TagFilterExposer(@ForApplication Context context, TagService tagService) {
public TagFilterExposer(ResourceResolver resourceResolver, @ForApplication Context context, TagService tagService) {
this.resourceResolver = resourceResolver;
this.context = context;
this.tagService = tagService;
}
@ -111,9 +114,12 @@ public class TagFilterExposer {
List<Filter> filters = new ArrayList<>();
int label = resourceResolver.getResource(R.attr.ic_action_label);
for (TagData tag : tags) {
Filter f = constructFilter(context, tag);
if (f != null) {
f.icon = label;
filters.add(f);
}
}

@ -67,19 +67,4 @@ public class NavigationDrawerAction extends FilterListItem {
return new NavigationDrawerAction[size];
}
};
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NavigationDrawerAction that = (NavigationDrawerAction) o;
return requestCode == that.requestCode;
}
@Override
public int hashCode() {
return requestCode;
}
}

@ -24,9 +24,6 @@ public class HelpAndFeedbackActivity extends InjectingPreferenceActivity {
putExtra(Intent.EXTRA_SUBJECT, "Tasks Feedback");
putExtra(Intent.EXTRA_TEXT, deviceInfo.getDebugInfo());
}});
if (!deviceInfo.supportsBilling()) {
remove(R.string.TLA_menu_donate);
}
if (!deviceInfo.isPlayStoreAvailable()) {
remove(R.string.rate_tasks);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save