New icons, icon generator script, night mode logic
Added new icons, both holo light and holo dark, taken from https://google.github.io/material-design-icons/ Added script to generate pngs from svgs. Makes icons for all sizes and themes given. Includes modified svgs to use as source. Added some night-mode logic[1] to use icons. Remove ic_menu_manage Script generates holo-light icons using: Color: #333333 Enabled: 60% opacity Disabled: 30% opacity The following icons (and _dark versions) added to mdpi, hdpi, xhdpi, xxhdip. ic_action_accept.png ic_action_camera.png ic_action_cancel.png ic_action_email.png ic_action_import_export.png ic_action_mic.png ic_action_replay.png ic_action_search.png ic_action_settings.png ic_action_storage.png ic_action_time.png ic_dialog_alert.png ic_dialog_info.png ic_menu_add.png ic_menu_edit.png ic_menu_mark.png ic_menu_marked.png ic_menu_night.png ic_menu_night_checked.png ic_menu_refresh.png ic_menu_send.png ic_menu_sort_by_size.png ic_menu_statistics.png ic_menu_refresh (from ic_sync_24px.svg) ic_action_whiteboard_enable_light (from ic_brush_24px.svg) ic_menu_revert (from ic_undo_24px.svg) [1] This is painful, as this code should be made simpler, not more complex, by using themes and attributes. But the only way to avoid this do a complete rewrite.
@ -692,7 +692,7 @@ public class CardBrowser extends NavigationDrawerActivity implements ActionBar.O
|
||||
entries[CONTEXT_MENU_DELETE] = res.getString(R.string.card_browser_delete_card);
|
||||
entries[CONTEXT_MENU_DETAILS] = res.getString(R.string.card_editor_preview_card);
|
||||
builder.setTitle("contextmenu");
|
||||
builder.setIcon(R.drawable.ic_menu_manage);
|
||||
// No icon
|
||||
builder.setItems(entries, mContextMenuListener);
|
||||
dialog = builder.create();
|
||||
break;
|
||||
|
@ -195,14 +195,30 @@ public class Reviewer extends AbstractFlashcardViewer {
|
||||
getMenuInflater().inflate(R.menu.reviewer, menu);
|
||||
Resources res = getResources();
|
||||
if (mCurrentCard != null && mCurrentCard.note().hasTag("marked")) {
|
||||
menu.findItem(R.id.action_mark_card).setTitle(R.string.menu_unmark_card).setIcon(R.drawable.ic_menu_marked);
|
||||
if (mNightMode) {
|
||||
menu.findItem(R.id.action_mark_card).setTitle(R.string.menu_unmark_card).setIcon(R.drawable.ic_menu_marked_dark);
|
||||
} else {
|
||||
menu.findItem(R.id.action_mark_card).setTitle(R.string.menu_unmark_card).setIcon(R.drawable.ic_menu_marked);
|
||||
}
|
||||
} else {
|
||||
menu.findItem(R.id.action_mark_card).setTitle(R.string.menu_mark_card).setIcon(R.drawable.ic_menu_mark);
|
||||
if (mNightMode) {
|
||||
menu.findItem(R.id.action_mark_card).setTitle(R.string.menu_mark_card).setIcon(R.drawable.ic_menu_mark_dark);
|
||||
}else {
|
||||
menu.findItem(R.id.action_mark_card).setTitle(R.string.menu_mark_card).setIcon(R.drawable.ic_menu_mark);
|
||||
}
|
||||
}
|
||||
if (colOpen() && getCol().undoAvailable()) {
|
||||
menu.findItem(R.id.action_undo).setEnabled(true).setIcon(R.drawable.ic_menu_revert);
|
||||
if (mNightMode) {
|
||||
menu.findItem(R.id.action_undo).setEnabled(true).setIcon(R.drawable.ic_menu_revert_dark);
|
||||
} else {
|
||||
menu.findItem(R.id.action_undo).setEnabled(true).setIcon(R.drawable.ic_menu_revert);
|
||||
}
|
||||
} else {
|
||||
menu.findItem(R.id.action_undo).setEnabled(false).setIcon(R.drawable.ic_menu_revert_disabled);
|
||||
if (mNightMode) {
|
||||
menu.findItem(R.id.action_undo).setEnabled(false).setIcon(R.drawable.ic_menu_revert_disabled_dark);
|
||||
} else {
|
||||
menu.findItem(R.id.action_undo).setEnabled(false).setIcon(R.drawable.ic_menu_revert_disabled);
|
||||
}
|
||||
}
|
||||
if (mPrefWhiteboard) {
|
||||
// Check if we can forceably squeeze in 3 items into the action bar, if not hide "show whiteboard"
|
||||
@ -223,12 +239,20 @@ public class Reviewer extends AbstractFlashcardViewer {
|
||||
menu.findItem(R.id.action_hide_whiteboard).setVisible(true);
|
||||
menu.findItem(R.id.action_clear_whiteboard).setVisible(true);
|
||||
if (mShowWhiteboard) {
|
||||
if (mNightMode) {
|
||||
menu.findItem(R.id.action_hide_whiteboard).setIcon(R.drawable.ic_action_whiteboard_enable_dark);
|
||||
} else {
|
||||
menu.findItem(R.id.action_hide_whiteboard).setIcon(R.drawable.ic_action_whiteboard_enable_light);
|
||||
}
|
||||
//menu.findItem(R.id.action_clear_whiteboard).setIcon(R.drawable.ic_whiteboard_clear_enabled);
|
||||
menu.findItem(R.id.action_hide_whiteboard).setIcon(R.drawable.ic_action_whiteboard_enable_light);
|
||||
menu.findItem(R.id.action_hide_whiteboard).setTitle(R.string.hide_whiteboard);
|
||||
} else {
|
||||
//menu.findItem(R.id.action_clear_whiteboard).setIcon(R.drawable.ic_whiteboard_clear_disabled);
|
||||
menu.findItem(R.id.action_hide_whiteboard).setIcon(R.drawable.ic_action_whiteboard_enable_light_disabled);
|
||||
if (mNightMode) {
|
||||
menu.findItem(R.id.action_hide_whiteboard).setIcon(R.drawable.ic_action_whiteboard_enable_dark_disabled);
|
||||
} else {
|
||||
menu.findItem(R.id.action_hide_whiteboard).setIcon(R.drawable.ic_action_whiteboard_enable_light_disabled);
|
||||
}
|
||||
//menu.findItem(R.id.action_clear_whiteboard).setIcon(R.drawable.ic_whiteboard_clear_disabled);
|
||||
menu.findItem(R.id.action_hide_whiteboard).setTitle(R.string.show_whiteboard);
|
||||
}
|
||||
} else {
|
||||
@ -241,9 +265,6 @@ public class Reviewer extends AbstractFlashcardViewer {
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Modify the options menu.
|
||||
* Pick the right icons for the whiteboard actions.
|
||||
|
@ -45,7 +45,7 @@ public class DeckPickerContextMenu extends DialogFragment {
|
||||
entries[CONTEXT_MENU_DELETE_DECK] = res.getString(R.string.contextmenu_deckpicker_delete_deck);
|
||||
entries[CONTEXT_MENU_EXPORT_DECK] = res.getString(R.string.export);
|
||||
builder.setTitle("Context Menu");
|
||||
builder.setIcon(R.drawable.ic_menu_manage);
|
||||
// No icon
|
||||
builder.setItems(entries, mContextMenuListener);
|
||||
builder.setTitle(getArguments().getString("dialogTitle"));
|
||||
StyledDialog dialog = builder.create();
|
||||
|
Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 554 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_accept_dark.png
Normal file
After Width: | Height: | Size: 471 B |
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 951 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_camera_dark.png
Normal file
After Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 1008 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 808 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_email_dark.png
Normal file
After Width: | Height: | Size: 644 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 1.2 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_help_dark.png
Normal file
After Width: | Height: | Size: 895 B |
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 457 B |
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 918 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_mic_dark.png
Normal file
After Width: | Height: | Size: 716 B |
Before Width: | Height: | Size: 802 B After Width: | Height: | Size: 1007 B |
Before Width: | Height: | Size: 705 B After Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 1020 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_search_dark.png
Normal file
After Width: | Height: | Size: 810 B |
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 1.2 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_settings_dark.png
Normal file
After Width: | Height: | Size: 891 B |
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 260 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_storage_dark.png
Normal file
After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 735 B After Width: | Height: | Size: 1.3 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_action_time_dark.png
Normal file
After Width: | Height: | Size: 1003 B |
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 954 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 727 B |
Before Width: | Height: | Size: 987 B After Width: | Height: | Size: 735 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 779 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_dialog_alert_dark.png
Normal file
After Width: | Height: | Size: 637 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 824 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_dialog_info_dark.png
Normal file
After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_add_dark.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_archive.png
Normal file
After Width: | Height: | Size: 466 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_archive_dark.png
Normal file
After Width: | Height: | Size: 411 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_close.png
Normal file
After Width: | Height: | Size: 501 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_close_dark.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_compose.png
Normal file
After Width: | Height: | Size: 573 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_compose_dark.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_delete.png
Normal file
After Width: | Height: | Size: 371 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_delete_dark.png
Normal file
After Width: | Height: | Size: 323 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_download.png
Normal file
After Width: | Height: | Size: 384 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_download_dark.png
Normal file
After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 573 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_edit_dark.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_help.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_help_dark.png
Normal file
After Width: | Height: | Size: 895 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_home.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_home_dark.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_info_details.png
Normal file
After Width: | Height: | Size: 824 B |
After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_mark_dark.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_marked_dark.png
Normal file
After Width: | Height: | Size: 794 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 902 B |
After Width: | Height: | Size: 708 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_night_dark.png
Normal file
After Width: | Height: | Size: 650 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_preferences.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 891 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_refresh_dark.png
Normal file
After Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 806 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_revert_dark.png
Normal file
After Width: | Height: | Size: 624 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 591 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_search.png
Normal file
After Width: | Height: | Size: 1020 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_search_dark.png
Normal file
After Width: | Height: | Size: 810 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 667 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_send_dark.png
Normal file
After Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 250 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_star_off.png
Normal file
After Width: | Height: | Size: 781 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_star_off_dark.png
Normal file
After Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 407 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_statistics_dark.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_upload.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
AnkiDroid/src/main/res/drawable-hdpi/ic_menu_upload_dark.png
Normal file
After Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 438 B |
BIN
AnkiDroid/src/main/res/drawable-mdpi/ic_action_accept_dark.png
Normal file
After Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 729 B |
BIN
AnkiDroid/src/main/res/drawable-mdpi/ic_action_camera_dark.png
Normal file
After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 780 B |
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 717 B |
BIN
AnkiDroid/src/main/res/drawable-mdpi/ic_action_email_dark.png
Normal file
After Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 883 B |
BIN
AnkiDroid/src/main/res/drawable-mdpi/ic_action_help_dark.png
Normal file
After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 463 B |
After Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 711 B |
BIN
AnkiDroid/src/main/res/drawable-mdpi/ic_action_mic_dark.png
Normal file
After Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 829 B |
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 624 B |