From dafddbf041d904c18bf441462cde1d350fa20b5f Mon Sep 17 00:00:00 2001 From: Bars107 Date: Tue, 24 Mar 2015 17:57:59 +0200 Subject: [PATCH] Fixed icons color in action bar on light theme --- .../plus/download/LocalIndexesFragment.java | 4 ++-- .../osmand/plus/osmedit/OsmEditingPlugin.java | 2 +- .../osmand/plus/osmo/OsMoGroupsActivity.java | 23 ++++++++++++++----- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 95d2f43704..ae89d972c1 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -509,10 +509,10 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { } }; optionsMenuAdapter.item(R.string.local_index_mi_reload) - .iconColor(R.drawable.ic_action_refresh_dark) + .icon(R.drawable.ic_action_refresh_dark) .listen(listener).position(1).reg(); optionsMenuAdapter.item(R.string.shared_string_delete) - .iconColor(R.drawable.ic_action_delete_dark) + .icon(R.drawable.ic_action_delete_dark) .listen(listener).position(2).reg(); optionsMenuAdapter.item(R.string.local_index_mi_backup) .listen(listener).position(3).reg(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index ce4aa7e047..2d76566b0d 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -203,7 +203,7 @@ public class OsmEditingPlugin extends OsmandPlugin { if (fragment instanceof AvailableGPXFragment) { final AvailableGPXFragment f = ((AvailableGPXFragment) fragment); optionsMenuAdapter.item(R.string.local_index_mi_upload_gpx) - .iconColor(R.drawable.ic_action_export) + .icon(R.drawable.ic_action_export) .listen(new OnContextMenuClick() { @Override diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java index f912087c64..aa1c10037b 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java @@ -433,10 +433,18 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements actionMode = startSupportActionMode(new ActionMode.Callback() { private OsMoDevice device; private OsMoGroup group; + private Menu menu; @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { selectedObject = o; + boolean portrait = ScreenOrientationHelper.isOrientationPortrait(OsMoGroupsActivity.this); + if (portrait) { + menu = getClearToolbar(true).getMenu(); + } else { + getClearToolbar(false); + } + this.menu = menu; device = (OsMoDevice) (o instanceof OsMoDevice ? o : null); group = (OsMoGroup) (o instanceof OsMoGroup ? o : null); MenuItem mi = null; @@ -446,31 +454,31 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements } if (device != null && device.getLastLocation() != null) { createMenuItem(menu, SHOW_ON_MAP_ID, R.string.shared_string_show_on_map, R.drawable.ic_action_marker_dark, - MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); + MenuItemCompat.SHOW_AS_ACTION_ALWAYS); } createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark, // there is a bug in Android 4.2 layout - device != null && device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); + device != null && device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_ALWAYS); /// if (device != null) { createMenuItem(menu, SETTINGS_DEV_ID, R.string.shared_string_settings, R.drawable.ic_action_settings_enabled_dark, // there is a bug in Android 4.2 layout - device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); + device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_ALWAYS); } if (device != null && device.getLastLocation() != null) { MenuItem menuItem = createMenuItem(menu, TRACK_DEV_ID, R.string.osmo_set_moving_target, R.drawable.ic_action_flage_dark, // there is a bug in Android 4.2 layout - device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); + device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_ALWAYS); menuItem.setTitleCondensed(getString(R.string.osmo_follow)); } if (group != null) { createMenuItem(menu, GROUP_INFO, R.string.osmo_group_info, R.drawable.ic_action_info_dark, - MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); + MenuItemCompat.SHOW_AS_ACTION_ALWAYS); } if ((group != null && !group.isMainGroup()) || (device != null && device.getGroup().isMainGroup())) { createMenuItem(menu, DELETE_ACTION_ID, R.string.shared_string_delete, R.drawable.ic_action_delete_dark, - MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); + MenuItemCompat.SHOW_AS_ACTION_ALWAYS); } @@ -500,6 +508,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements public void onDestroyActionMode(ActionMode mode) { selectedObject = null; refreshList(); + if (ScreenOrientationHelper.isOrientationPortrait(OsMoGroupsActivity.this)){ + onCreateOptionsMenu(menu); + } } @Override