diff --git a/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml b/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml
index d118242aca..ff777bd94c 100644
--- a/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml
+++ b/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/OsmAnd/res/drawable/bg_plugin_logo_enabled_dark.xml b/OsmAnd/res/drawable/bg_plugin_logo_enabled_dark.xml
new file mode 100644
index 0000000000..b963cc4200
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_plugin_logo_enabled_dark.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/bg_plugin_logo_enabled.xml b/OsmAnd/res/drawable/bg_plugin_logo_enabled_light.xml
similarity index 79%
rename from OsmAnd/res/drawable/bg_plugin_logo_enabled.xml
rename to OsmAnd/res/drawable/bg_plugin_logo_enabled_light.xml
index 15c2ac747d..cbf06bc5fd 100644
--- a/OsmAnd/res/drawable/bg_plugin_logo_enabled.xml
+++ b/OsmAnd/res/drawable/bg_plugin_logo_enabled_light.xml
@@ -1,7 +1,7 @@
+ android:color="@color/osmand_orange" />
diff --git a/OsmAnd/res/drawable/divider_solid.xml b/OsmAnd/res/drawable/divider_solid.xml
new file mode 100644
index 0000000000..193090be72
--- /dev/null
+++ b/OsmAnd/res/drawable/divider_solid.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/keyboard_item_control_dark_bg.xml b/OsmAnd/res/drawable/keyboard_item_control_dark_bg.xml
index 77620dcc74..52ea60bb71 100644
--- a/OsmAnd/res/drawable/keyboard_item_control_dark_bg.xml
+++ b/OsmAnd/res/drawable/keyboard_item_control_dark_bg.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/OsmAnd/res/drawable/keyboard_item_dark_bg.xml b/OsmAnd/res/drawable/keyboard_item_dark_bg.xml
index 5181381256..46d5d0603b 100644
--- a/OsmAnd/res/drawable/keyboard_item_dark_bg.xml
+++ b/OsmAnd/res/drawable/keyboard_item_dark_bg.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/OsmAnd/res/layout/activity_livie_updates.xml b/OsmAnd/res/layout/activity_livie_updates.xml
index 8134cfc7d4..93c69a4be6 100644
--- a/OsmAnd/res/layout/activity_livie_updates.xml
+++ b/OsmAnd/res/layout/activity_livie_updates.xml
@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?attr/spinnerListBackground"
+ android:background="?attr/activity_background_color"
android:clickable="true"
android:orientation="vertical"
tools:context="net.osmand.plus.osmedit.EditPoiDialogFragment">
diff --git a/OsmAnd/res/layout/dash_plugin_item.xml b/OsmAnd/res/layout/dash_plugin_item.xml
index 69d03f6f71..f3eaaf6433 100644
--- a/OsmAnd/res/layout/dash_plugin_item.xml
+++ b/OsmAnd/res/layout/dash_plugin_item.xml
@@ -25,7 +25,7 @@
android:layout_height="32dp"
android:layout_margin="11dp"
android:layout_gravity="center_vertical"
- android:background="@drawable/bg_plugin_logo_enabled"
+ android:background="@drawable/bg_plugin_logo_enabled_light"
android:scaleType="center"
tools:src="@drawable/ic_extension_dark"/>
diff --git a/OsmAnd/res/layout/expandable_list.xml b/OsmAnd/res/layout/expandable_list.xml
index b5e7e756ab..04bbf398b3 100644
--- a/OsmAnd/res/layout/expandable_list.xml
+++ b/OsmAnd/res/layout/expandable_list.xml
@@ -17,7 +17,6 @@
@@ -218,7 +219,7 @@
+ android:background="?attr/divider_color"/>
+ android:background="?attr/divider_color"/>
+ android:background="?attr/divider_color"/>
@@ -421,7 +422,7 @@
android:layout_height="1dp"
android:layout_marginStart="64dp"
android:layout_marginLeft="64dp"
- android:background="@color/divider_color_light"/>
+ android:background="?attr/divider_color"/>
+ tools:background="?attr/divider_color"/>
diff --git a/OsmAnd/res/layout/point_editor_fragment.xml b/OsmAnd/res/layout/point_editor_fragment.xml
index 271444024d..5dee21225f 100644
--- a/OsmAnd/res/layout/point_editor_fragment.xml
+++ b/OsmAnd/res/layout/point_editor_fragment.xml
@@ -242,7 +242,7 @@
android:id="@+id/buttons_top_border"
android:layout_width="match_parent"
android:layout_height="1dp"
- android:background="@color/divider_color"/>
+ android:background="?attr/divider_color"/>
\ No newline at end of file
diff --git a/OsmAnd/res/layout/quick_action_create_edit_dialog.xml b/OsmAnd/res/layout/quick_action_create_edit_dialog.xml
index e9f15be4ef..8f51e0040a 100644
--- a/OsmAnd/res/layout/quick_action_create_edit_dialog.xml
+++ b/OsmAnd/res/layout/quick_action_create_edit_dialog.xml
@@ -41,20 +41,20 @@
android:focusableInTouchMode="true"
android:background="?attr/actionModeBackground">
-
+ android:layout_marginBottom="56dp"
+ android:background="?attr/activity_background_color">
@@ -126,7 +126,7 @@
android:gravity="center"
android:layout_gravity="bottom"
android:foreground="?attr/selectableItemBackground"
- android:background="@color/active_color_primary_light"/>
+ android:background="?attr/color_dialog_buttons"/>
diff --git a/OsmAnd/res/layout/quick_action_list.xml b/OsmAnd/res/layout/quick_action_list.xml
index 44e6fc11e3..e2219d633a 100644
--- a/OsmAnd/res/layout/quick_action_list.xml
+++ b/OsmAnd/res/layout/quick_action_list.xml
@@ -71,6 +71,6 @@
android:layout_margin="16dp"
android:src="@drawable/ic_action_plus"
android:contentDescription="@string/quick_action_new_action"
- app:backgroundTint="@color/active_color_primary_light"/>
+ app:backgroundTint="?attr/color_dialog_buttons"/>
\ No newline at end of file
diff --git a/OsmAnd/res/layout/wikivoyage_start_editing_card.xml b/OsmAnd/res/layout/wikivoyage_start_editing_card.xml
index 32f4a5eff3..973deb0dd8 100644
--- a/OsmAnd/res/layout/wikivoyage_start_editing_card.xml
+++ b/OsmAnd/res/layout/wikivoyage_start_editing_card.xml
@@ -48,6 +48,7 @@
+
diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml
index ca2c2d6f62..17140d91fa 100644
--- a/OsmAnd/res/values/styles.xml
+++ b/OsmAnd/res/values/styles.xml
@@ -9,10 +9,6 @@
- false
-
-
-
@@ -564,6 +571,10 @@
- @color/color_white
+
+
@@ -721,10 +732,10 @@
- @color/list_background_color_dark
-
diff --git a/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java b/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java
index e1bc125908..8e22c8704a 100644
--- a/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java
@@ -38,6 +38,7 @@ public abstract class ActionBarPreferenceActivity extends AppCompatPreferenceAct
}
setTheme(t);
super.onCreate(savedInstanceState);
+ boolean lightTheme = settings.isLightContent();
setContentView(R.layout.preference_activity);
tb = (Toolbar) findViewById(R.id.toolbar);
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
@@ -47,7 +48,8 @@ public abstract class ActionBarPreferenceActivity extends AppCompatPreferenceAct
shadowView = null;
}
tb.setClickable(true);
- tb.setNavigationIcon(((OsmandApplication) getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back));
+ int activeButtonsAndLinksTextColorResId = lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
+ tb.setNavigationIcon(((OsmandApplication) getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back, activeButtonsAndLinksTextColorResId));
tb.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
tb.setBackgroundColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTabBackground)));
tb.setTitleTextColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTextColor)));
diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java
index f768945257..68be42eb44 100644
--- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java
@@ -62,6 +62,8 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView
Drawable dividerDrawable = new ColorDrawable(ContextCompat.getColor(this, dividerColor));
listView.setDivider(dividerDrawable);
listView.setDividerHeight(AndroidUtils.dpToPx(this, 1f));
+ listView.setBackgroundColor(getResources().getColor(
+ lightContent ? R.color.list_background_color_light : R.color.list_background_color_dark));
setTitle(R.string.shared_string_help);
setupHomeButton();
diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java b/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java
index df3504912c..eac8723e84 100644
--- a/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java
@@ -1,5 +1,6 @@
package net.osmand.plus.activities;
+import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import android.app.ActionBar;
@@ -31,6 +32,9 @@ public abstract class OsmandListActivity extends
getResources().getColor(
getMyApplication().getSettings().isLightContent() ? R.color.list_background_color_light
: R.color.list_background_color_dark));
+ getListView().setDivider(getMyApplication().getUIUtilities().getIcon(R.drawable.divider_solid,
+ getMyApplication().getSettings().isLightContent() ? R.color.divider_color_light : R.color.divider_color_dark));
+ getListView().setDividerHeight(AndroidUtils.dpToPx(getMyApplication(), 1));
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
index 4c404be505..c2de28b04c 100644
--- a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
@@ -97,6 +97,7 @@ public class PluginsActivity extends OsmandListActivity {
boolean active = false;
int logoContDescId = R.string.shared_string_disable;
String name = "";
+ boolean isLightTheme = getMyApplication().getSettings().isLightContent();
ImageButton pluginLogo = (ImageButton) view.findViewById(R.id.plugin_logo);
ImageView pluginOptions = (ImageView) view.findViewById(R.id.plugin_options);
@@ -151,7 +152,7 @@ public class PluginsActivity extends OsmandListActivity {
pluginLogo.setContentDescription(getString(logoContDescId));
if (active) {
- pluginLogo.setBackgroundResource(R.drawable.bg_plugin_logo_enabled);
+ pluginLogo.setBackgroundResource(isLightTheme ? R.drawable.bg_plugin_logo_enabled_light : R.drawable.bg_plugin_logo_enabled_dark);
} else {
TypedArray attributes = getTheme().obtainStyledAttributes(new int[]{R.attr.bg_plugin_logo_disabled});
pluginLogo.setBackgroundDrawable(attributes.getDrawable(0));
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java
index 9dc1aa75a4..0bb0a03741 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java
@@ -129,7 +129,7 @@ public class DashPluginsFragment extends DashBaseFragment {
ImageButton logoView = (ImageButton) pluginView.findViewById(R.id.plugin_logo);
if (plugin.isActive()) {
- logoView.setBackgroundResource(R.drawable.bg_plugin_logo_enabled);
+ logoView.setBackgroundResource(R.drawable.bg_plugin_logo_enabled_light);
logoView.setContentDescription(getString(R.string.shared_string_disable));
} else {
TypedArray attributes = getActivity().getTheme().obtainStyledAttributes(
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java
index 29f43dc5dc..b46836ba0e 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java
@@ -478,12 +478,17 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (!openAsDialog()) {
+ OsmandApplication app = getMyApplication();
+ int colorResId = app.getSettings().isLightContent() ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
+
MenuItem itemReload = menu.add(0, RELOAD_ID, 0, R.string.shared_string_refresh);
- itemReload.setIcon(R.drawable.ic_action_refresh_dark);
+ Drawable icReload = app.getUIUtilities().getIcon(R.drawable.ic_action_refresh_dark, colorResId);
+ itemReload.setIcon(icReload);
MenuItemCompat.setShowAsAction(itemReload, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
MenuItem itemSearch = menu.add(0, SEARCH_ID, 1, R.string.shared_string_search);
- itemSearch.setIcon(R.drawable.ic_action_search_dark);
+ Drawable icSearch = app.getUIUtilities().getIcon(R.drawable.ic_action_search_dark, colorResId);
+ itemSearch.setIcon(icSearch);
MenuItemCompat.setShowAsAction(itemSearch, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java
index 5a76c47143..c4f8153e0e 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java
@@ -621,6 +621,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
//hide action bar from downloadindexfragment
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+ int iconColorResId = getMyApplication().getSettings().isLightContent() ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
optionsMenuAdapter = new ContextMenuAdapter();
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
@Override
@@ -634,11 +635,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
.setTitleId(R.string.shared_string_refresh, getContext())
.setIcon(R.drawable.ic_action_refresh_dark)
.setListener(listener)
+ .setColor(iconColorResId)
.createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_delete, getContext())
.setIcon(R.drawable.ic_action_delete_dark)
.setListener(listener)
+ .setColor(iconColorResId)
.createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.local_index_mi_backup, getContext())
@@ -669,7 +672,8 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
}
if (contextMenuItem.getIcon() != -1) {
- item.setIcon(contextMenuItem.getIcon());
+ Drawable icMenuItem = getMyApplication().getUIUtilities().getIcon(contextMenuItem.getIcon(), contextMenuItem.getColorRes());
+ item.setIcon(icMenuItem);
}
}
@@ -721,6 +725,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
private void openSelectionMode(final int actionResId, final int actionIconId,
final DialogInterface.OnClickListener listener) {
+ final int colorResId = getMyApplication().getSettings().isLightContent() ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
String value = getString(actionResId);
if (value.endsWith("...")) {
value = value.substring(0, value.length() - 3);
@@ -744,7 +749,8 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
selectionMode = true;
MenuItem it = menu.add(actionResId);
if (actionIconId != 0) {
- it.setIcon(actionIconId);
+ Drawable icon = getMyApplication().getUIUtilities().getIcon(actionIconId, colorResId);
+ it.setIcon(icon);
}
MenuItemCompat.setShowAsAction(it, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java
index 4a83fb3c98..034b2fa8f6 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java
@@ -2,6 +2,7 @@ package net.osmand.plus.download.ui;
import android.content.res.TypedArray;
import android.graphics.Color;
+import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
@@ -107,8 +108,12 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
showWiki = false;
}
+ boolean isLightContent = getMyApplication().getSettings().isLightContent();
+ int iconColorResId = isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
+
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
- toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
+ Drawable icBack = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back, iconColorResId);
+ toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@@ -144,12 +149,12 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
searchEditText = (EditText) view.findViewById(R.id.searchEditText);
searchEditText.setHint(R.string.search_map_hint);
- searchEditText.setTextColor(Color.WHITE);
- boolean isLight = getMyApplication().getSettings().isLightContent();
- searchEditText.setHintTextColor(ContextCompat.getColor(activity, isLight ? R.color.inactive_item_orange : R.color.searchbar_tab_inactive_dark));
+ searchEditText.setTextColor(ContextCompat.getColor(activity, isLightContent ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
+ searchEditText.setHintTextColor(ContextCompat.getColor(activity, isLightContent ? R.color.inactive_item_orange : R.color.searchbar_tab_inactive_dark));
progressBar = (ProgressBar) view.findViewById(R.id.searchProgressBar);
clearButton = (ImageButton) view.findViewById(R.id.clearButton);
+ clearButton.setColorFilter(iconColorResId);
clearButton.setVisibility(View.GONE);
searchEditText.addTextChangedListener(new TextWatcher() {
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java
index ae13ea412d..d53ab09d2e 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java
@@ -19,6 +19,7 @@ import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.util.Algorithms;
import android.app.Activity;
import android.content.Context;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
@@ -189,10 +190,13 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
ActionBar actionBar = getMyActivity().getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+ OsmandApplication app = getMyApplication();
- if (getMyApplication().getAppCustomization().showDownloadExtraActions()) {
+ if (app.getAppCustomization().showDownloadExtraActions()) {
+ int colorResId = app.getSettings().isLightContent() ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
MenuItem item = menu.add(0, RELOAD_ID, 0, R.string.shared_string_refresh);
- item.setIcon(R.drawable.ic_action_refresh_dark);
+ Drawable icRefresh = app.getUIUtilities().getIcon(R.drawable.ic_action_refresh_dark, colorResId);
+ item.setIcon(icRefresh);
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java
index 8ba5a99583..d64178fd71 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java
@@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu.editors;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
+import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
@@ -11,6 +12,7 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
+import android.support.v4.content.ContextCompat;
import android.support.v7.widget.Toolbar;
import android.util.TypedValue;
import android.view.LayoutInflater;
@@ -53,10 +55,12 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
editor.updateNightMode();
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
+ toolbar.setBackgroundColor(ContextCompat.getColor(getContext(), !editor.isLight() ? R.color.app_bar_color_dark : R.color.app_bar_color_light));
toolbar.setTitle(getToolbarTitle());
OsmandApplication app = requireMyApplication();
- toolbar.setNavigationIcon(app.getUIUtilities().getIcon(R.drawable.ic_arrow_back));
+ Drawable icBack = app.getUIUtilities().getIcon(R.drawable.ic_arrow_back, !editor.isLight() ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light);
+ toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setTitleTextColor(getResources().getColor(getResIdFromAttribute(getMapActivity(), R.attr.pstsTextColor)));
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@@ -65,9 +69,11 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
dismiss();
}
});
+
+ int activeColorResId = !editor.isLight() ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
Button saveButton = (Button) view.findViewById(R.id.save_button);
- saveButton.setTextColor(getResources().getColor(!editor.isLight() ? R.color.osmand_orange : R.color.map_widget_blue));
+ saveButton.setTextColor(getResources().getColor(activeColorResId));
saveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -76,7 +82,7 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
});
Button cancelButton = (Button) view.findViewById(R.id.cancel_button);
- cancelButton.setTextColor(getResources().getColor(!editor.isLight() ? R.color.osmand_orange : R.color.map_widget_blue));
+ cancelButton.setTextColor(getResources().getColor(activeColorResId));
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -86,7 +92,7 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
});
Button deleteButton = (Button) view.findViewById(R.id.delete_button);
- deleteButton.setTextColor(getResources().getColor(!editor.isLight() ? R.color.osmand_orange : R.color.map_widget_blue));
+ deleteButton.setTextColor(getResources().getColor(activeColorResId));
deleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java
index 55bbe91927..f8bbd70edf 100644
--- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java
@@ -74,7 +74,7 @@ public class MapillaryFiltersFragment extends BaseOsmAndFragment {
toggleIconColorId = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
} else {
toggleIconId = R.drawable.ic_action_hide;
- toggleIconColorId = nightMode ? 0 : R.color.icon_color_default_light;
+ toggleIconColorId = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
}
((AppCompatTextView) toggleRow.findViewById(R.id.toggle_row_title)).setText(toggleActionStringId);
final Drawable drawable = getIcon(toggleIconId, toggleIconColorId);
@@ -110,7 +110,7 @@ public class MapillaryFiltersFragment extends BaseOsmAndFragment {
});
- final int colorRes = nightMode ? R.color.color_white : R.color.icon_color_default_light;
+ final int colorRes = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
((AppCompatImageView) view.findViewById(R.id.mapillary_filters_user_icon)).setImageDrawable(getIcon(R.drawable.ic_action_user, colorRes));
((AppCompatImageView) view.findViewById(R.id.mapillary_filters_date_icon)).setImageDrawable(getIcon(R.drawable.ic_action_data, colorRes));
((AppCompatImageView) view.findViewById(R.id.mapillary_filters_tile_cache_icon)).setImageDrawable(getIcon(R.drawable.ic_layer_top_dark, colorRes));
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java
index 64722adb18..d46cc257fe 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java
@@ -277,21 +277,26 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
}
});
+ TextView optionsButton = mainView.findViewById(R.id.options_button);
+
if (orientationPortrait) {
- backBtn.setImageDrawable(getActiveIcon(R.drawable.ic_arrow_back));
+ backBtn.setImageDrawable(getColoredIcon(R.drawable.ic_arrow_back, lightTheme ? R.color.color_black : R.color.active_buttons_and_links_text_dark));
+ optionsButton.setTextColor(getResolvedColor(lightTheme ? R.color.active_color_primary_light : R.color.active_color_primary_dark));
TextView toolbar = (TextView) mainView.findViewById(R.id.toolbar_text);
- toolbar.setTextColor(getResolvedColor(lightTheme ? R.color.color_black : R.color.color_white));
+ toolbar.setTextColor(getResolvedColor(lightTheme ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
toolbar.setText(R.string.coord_input_add_point);
setBackgroundColor(R.id.app_bar, lightTheme ? R.color.route_info_bg_light : R.color.route_info_bg_dark);
setBackgroundColor(mainView, lightTheme ? R.color.activity_background_color_light : R.color.activity_background_color_dark);
} else {
+ backBtn.setImageDrawable(getColoredIcon(R.drawable.ic_arrow_back, lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark));
+ optionsButton.setTextColor(getResolvedColor(lightTheme ? R.color.color_white : R.color.active_color_primary_dark));
TextView toolbar = (TextView) mainView.findViewById(R.id.toolbar_text);
- toolbar.setTextColor(getResolvedColor(lightTheme ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
+ toolbar.setTextColor(getResolvedColor(lightTheme ? R.color.color_white : R.color.text_color_primary_dark));
toolbar.setText(R.string.coord_input_add_point);
setBackgroundColor(R.id.app_bar, lightTheme ? R.color.app_bar_color_light : R.color.route_info_bottom_view_bg_dark);
}
- mainView.findViewById(R.id.options_button).setOnClickListener(new View.OnClickListener() {
+ optionsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CoordinateInputBottomSheetDialogFragment fragment = new CoordinateInputBottomSheetDialogFragment();
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
index 02d8029de9..ff628d377e 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
@@ -2,6 +2,7 @@ package net.osmand.plus.mapmarkers;
import android.app.Dialog;
import android.content.Intent;
+import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
@@ -19,6 +20,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
+import android.widget.TextView;
import android.widget.Toast;
import net.osmand.AndroidUtils;
@@ -147,7 +149,9 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
View mainView = inflater.inflate(R.layout.fragment_map_markers_dialog, container);
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.map_markers_toolbar);
- toolbar.setNavigationIcon(getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back));
+ Drawable icArrowBack = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back,
+ lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
+ toolbar.setNavigationIcon(icArrowBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@@ -163,13 +167,13 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
viewPager.setAdapter(adapter);
progressBar = (ProgressBar) mainView.findViewById(R.id.progress_bar);
-
+
+ TextView toolbarTitle = mainView.findViewById(R.id.map_markers_toolbar_title);
bottomNav = mainView.findViewById(R.id.map_markers_bottom_navigation);
BottomNavigationViewHelper.disableShiftMode(bottomNav);
- if (!lightTheme) {
- bottomNav.setItemIconTintList(ContextCompat.getColorStateList(getContext(), R.color.bottom_navigation_color_selector_dark));
- bottomNav.setItemTextColor(ContextCompat.getColorStateList(getContext(), R.color.bottom_navigation_color_selector_dark));
- }
+ toolbarTitle.setTextColor(ContextCompat.getColor(getContext(), lightTheme ? R.color.active_buttons_and_links_text_light : R.color.text_color_primary_dark));
+ bottomNav.setItemIconTintList(ContextCompat.getColorStateList(getContext(), lightTheme ? R.color.bottom_navigation_color_selector_light : R.color.bottom_navigation_color_selector_dark));
+ bottomNav.setItemTextColor(ContextCompat.getColorStateList(getContext(), lightTheme ? R.color.bottom_navigation_color_selector_light : R.color.bottom_navigation_color_selector_dark));
if (groupIdToOpen != null) {
activeFragment.stopLocationUpdate();
groupsFragment.startLocationUpdate();
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/SaveAsTrackBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/SaveAsTrackBottomSheetDialogFragment.java
index 330eabb1cb..0c893db19b 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/SaveAsTrackBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/SaveAsTrackBottomSheetDialogFragment.java
@@ -61,11 +61,13 @@ public class SaveAsTrackBottomSheetDialogFragment extends BottomSheetDialogFragm
portrait = AndroidUiHelper.isOrientationPortrait(getActivity());
final boolean nightMode = !app.getSettings().isLightContent();
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
+ final int textPrimaryColor = nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light;
final View mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_marker_save_as_track_bottom_sheet_dialog, container);
LinearLayout contentLayout = (LinearLayout) mainView.findViewById(R.id.content_linear_layout);
TextView titleTv = (TextView) mainView.findViewById(R.id.save_as_track_title);
titleTv.setText(openFromCoordinateInput ? R.string.coord_input_save_as_track : R.string.marker_save_as_track);
+ titleTv.setTextColor(ContextCompat.getColor(getContext(), textPrimaryColor));
TextView descriptionTv = (TextView) mainView.findViewById(R.id.save_as_track_description);
descriptionTv.setText(openFromCoordinateInput ? getString(R.string.coord_input_save_as_track_descr, number) : getString(R.string.marker_save_as_track_descr));
int layoutRes;
@@ -102,6 +104,7 @@ public class SaveAsTrackBottomSheetDialogFragment extends BottomSheetDialogFragm
}
final EditText nameEditText = (EditText) mainView.findViewById(R.id.name_edit_text);
nameEditText.setText(displayedName);
+ nameEditText.setTextColor(ContextCompat.getColor(getContext(), textPrimaryColor));
if (textBox instanceof OsmandTextFieldBoxes) {
((OsmandTextFieldBoxes) textBox).activate(true);
}
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java
index 8032765b6b..0a7384b50b 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java
@@ -81,7 +81,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter collapsedCategories = new ArrayList<>();
private ArrayList showAllCategories = new ArrayList<>();
private Map poiAdditionalsTranslations = new HashMap<>();
+ private boolean isLightTheme;
public QuickSearchPoiFilterFragment() {
}
@@ -95,7 +98,7 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- boolean isLightTheme = getMyApplication().getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
+ isLightTheme = getMyApplication().getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
setStyle(STYLE_NO_FRAME, themeId);
}
@@ -146,7 +149,9 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
description.setText(filter.getName());
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
- toolbar.setNavigationIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_remove_dark));
+ Drawable icClose = app.getUIUtilities().getIcon(R.drawable.ic_action_remove_dark,
+ isLightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
+ toolbar.setNavigationIcon(icClose);
toolbar.setNavigationContentDescription(R.string.shared_string_close);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@@ -154,6 +159,8 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
dismiss();
}
});
+ toolbar.setBackgroundColor(ContextCompat.getColor(app, isLightTheme ? R.color.app_bar_color_light : R.color.app_bar_color_dark));
+ toolbar.setTitleTextColor(ContextCompat.getColor(app, isLightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark));
ImageButton moreButton = (ImageButton) view.findViewById(R.id.moreButton);
moreButton.setOnClickListener(new View.OnClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java b/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java
index a91f3ec865..1b2da62268 100644
--- a/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java
+++ b/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java
@@ -175,7 +175,7 @@ public class ContourLinesMenu {
R.color.active_color_primary_dark : R.color.active_color_primary_light;
} else {
toggleIconId = R.drawable.ic_action_hide;
- toggleIconColorId = nightMode ? 0 : R.color.icon_color_default_light;
+ toggleIconColorId = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
}
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(toggleActionStringId, mapActivity)
diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/HillshadeMenu.java b/OsmAnd/src/net/osmand/plus/srtmplugin/HillshadeMenu.java
index c5cb4819dc..b06a1d4e79 100644
--- a/OsmAnd/src/net/osmand/plus/srtmplugin/HillshadeMenu.java
+++ b/OsmAnd/src/net/osmand/plus/srtmplugin/HillshadeMenu.java
@@ -97,7 +97,7 @@ public class HillshadeMenu {
R.color.active_color_primary_dark : R.color.active_color_primary_light;
} else {
toggleIconId = R.drawable.ic_action_hide;
- toggleIconColorId = nightMode ? 0 : R.color.icon_color_default_light;
+ toggleIconColorId = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
}
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(toggleActionStringId, mapActivity)
diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java
index 44ae21063c..2b3d93d559 100644
--- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java
@@ -93,10 +93,11 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
setupToolbar((Toolbar) mainView.findViewById(R.id.toolbar));
articleToolbarText = (TextView) mainView.findViewById(R.id.article_toolbar_text);
+ articleToolbarText.setTextColor(ContextCompat.getColor(getContext(), R.color.text_color_primary_dark));
ColorStateList selectedLangColorStateList = AndroidUtils.createPressedColorStateList(
getContext(), nightMode,
R.color.icon_color_default_light, R.color.wikivoyage_active_light,
- R.color.icon_color_default_light, R.color.wikivoyage_active_dark
+ R.color.icon_color_default_dark, R.color.wikivoyage_active_dark
);
selectedLangTv = (TextView) mainView.findViewById(R.id.select_language_text_view);
diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java
index eab42c4e74..3fcab8b95e 100644
--- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java
+++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java
@@ -65,4 +65,9 @@ public abstract class BaseTravelCard {
}
return R.color.wikivoyage_secondary_text;
}
+
+ @ColorRes
+ protected int getPrimaryTextColorRes() {
+ return nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light;
+ }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/HeaderTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/HeaderTravelCard.java
index ec25a2904e..6a40252a3f 100644
--- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/HeaderTravelCard.java
+++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/HeaderTravelCard.java
@@ -25,8 +25,11 @@ public class HeaderTravelCard extends BaseTravelCard {
if (viewHolder instanceof HeaderTravelVH) {
final HeaderTravelVH holder = (HeaderTravelVH) viewHolder;
holder.title.setText(title);
+ int primaryTextColor = getResolvedColor(getPrimaryTextColorRes());
+ holder.title.setTextColor(primaryTextColor);
if (articleItemCount > 0) {
holder.description.setText(String.valueOf(articleItemCount));
+ holder.description.setTextColor(primaryTextColor);
holder.description.setVisibility(View.VISIBLE);
} else {
holder.description.setVisibility(View.INVISIBLE);