Merge pull request #7335 from osmandapp/ColorsRefactoring

colors refactoring
This commit is contained in:
max-klaus 2019-07-28 12:32:59 +03:00 committed by GitHub
commit ea2111952d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 218 additions and 92 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/active_color_primary_dark" android:state_checked="true"/>
<item android:color="@color/text_color_primary_dark" android:state_checked="false"/>
<item android:color="@color/icon_color_default_dark" android:state_checked="false"/>
</selector>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="@color/active_color_primary_dark" />
<corners
android:radius="3dp" />
</shape>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#ff8f00" />
android:color="@color/osmand_orange" />
<corners
android:radius="3dp" />
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_white"/>
</shape>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/keyboard_item_pressed_bg" android:state_pressed="true"/>
<item android:drawable="@color/active_buttons_and_links_bg_pressed_dark" android:state_pressed="true"/>
<item android:drawable="@color/keyboard_item_control_dark_bg"/>
</selector>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/keyboard_item_pressed_bg" android:state_pressed="true"/>
<item android:drawable="@color/active_buttons_and_links_bg_pressed_dark" android:state_pressed="true"/>
<item android:drawable="@color/keyboard_item_dark_bg"/>
</selector>

View file

@ -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">

View file

@ -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"/>

View file

@ -17,7 +17,6 @@
<ExpandableListView
android:id="@android:id/list"
style="@style/OsmandListView"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_marginLeft="0dp"

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ListView
android:id="@android:id/list"
style="@style/OsmandListView"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -35,6 +35,7 @@
android:layout_height="wrap_content">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/map_markers_toolbar_title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"

View file

@ -64,6 +64,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?android:textColorPrimary"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/profile_type_base_string"/>
@ -218,7 +219,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider_color_light"/>
android:background="?attr/divider_color"/>
<LinearLayout
@ -261,7 +262,7 @@
android:layout_width="1dp"
android:layout_height="36dp"
android:layout_gravity="center_vertical"
android:background="@color/divider_color_light"/>
android:background="?attr/divider_color"/>
<LinearLayout
android:id="@+id/select_icon_color_button"
@ -298,7 +299,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider_color_light"/>
android:background="?attr/divider_color"/>
</LinearLayout>
@ -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"/>
<LinearLayout
android:id="@+id/screen_config_btn"
@ -470,7 +471,7 @@
android:layout_height="1dp"
android:layout_marginStart="64dp"
android:layout_marginLeft="64dp"
android:background="@color/divider_color_light"
android:background="?attr/divider_color"
/>
<LinearLayout

View file

@ -185,7 +185,7 @@
android:layout_height="1dp"
android:layout_marginLeft="@dimen/map_button_shadow_width"
android:layout_marginStart="@dimen/map_button_shadow_width"
tools:background="?attr/dashboard_divider"/>
tools:background="?attr/divider_color"/>
</LinearLayout>
<include

View file

@ -30,7 +30,6 @@
<ExpandableListView
android:id="@android:id/list"
style="@style/OsmandListView"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_marginLeft="0dp"

View file

@ -15,7 +15,7 @@
android:layout_gravity="center"
android:layout_margin="8dp"
android:adjustViewBounds="true"
android:background="@drawable/bg_plugin_logo_enabled"
android:background="@drawable/bg_plugin_logo_enabled_light"
android:padding="12dp"
android:scaleType="fitCenter"
tools:src="@drawable/ic_extension_dark" />

View file

@ -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"/>
<LinearLayout
android:id="@+id/buttons_layout"

View file

@ -8,6 +8,7 @@
android:paddingTop="24dp">
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dialog_add_action_title"
@ -36,6 +37,6 @@
android:text="@string/shared_string_dismiss"
android:layout_gravity="right"
android:background="?attr/selectableItemBackground"
android:textColor="@color/active_color_primary_light"
android:textColor="?attr/color_dialog_buttons"
android:textAllCaps="true"/>
</LinearLayout>

View file

@ -41,20 +41,20 @@
android:focusableInTouchMode="true"
android:background="?attr/actionModeBackground">
<ImageView
<android.support.v7.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:scaleType="centerInside"
android:tint="@color/color_white"
app:tint="?attr/app_bar_primary_item_color"
android:layout_marginTop="24dp"
android:src="@drawable/ic_action_flag_dark" />
<android.support.v7.widget.AppCompatEditText
android:id="@+id/name"
android:theme="@style/WhiteControls"
android:theme="@style/AppBarControls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
@ -91,12 +91,12 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/spinnerListBackground"
android:layout_marginBottom="56dp">
android:layout_marginBottom="56dp"
android:background="?attr/activity_background_color">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:id="@+id/container"/>
</ScrollView>
@ -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"/>
</FrameLayout>

View file

@ -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"/>
</RelativeLayout>

View file

@ -48,6 +48,7 @@
<TextView
android:id="@+id/description"
android:textColor="?android:textColorPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="@dimen/text_button_line_spacing_multiplier"

View file

@ -57,6 +57,7 @@
<attr name="search_tabbar_layout_theme" format="reference"/>
<attr name="toolbar_theme" format="reference"/>
<attr name="new_app_theme" format="reference"/>
<attr name="app_bar_primary_item_color" format="color"/>
<attr name="divider_color" format="reference" />
<attr name="contextMenuButtonColor" format="reference" />

View file

@ -9,10 +9,6 @@
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="OsmandListView" parent="@android:style/Widget.ListView">
</style>
<!-- Dashboard styles -->
<style name="DashboardSubHeader">
<item name="android:layout_width">0dp</item>
@ -184,12 +180,13 @@
<item name="actionOverflowButtonStyle">@style/OverflowMenuButton</item>
<item name="circle_dialog_bg">@drawable/circle_dialog_bg_light</item>
<item name="textColorAlertDialogListItem">@color/text_color_primary_light</item>
<item name="secondary_icon_color">@color/icon_color_secondary_light</item>
<item name="default_icon_color">@color/icon_color_default_light</item>
<item name="primary_icon_color">@color/icon_color_primary_light</item>
<item name="text_color_tab_active">@color/text_color_tab_active_light</item>
<item name="text_color_tab_active_white">@color/text_color_secondary_light</item>
<item name="app_bar_primary_item_color">@color/active_buttons_and_links_text_light</item>
<item name="appbar_layout_theme">@style/OsmandLightTheme.DarkActionbar</item>
<item name="search_tabbar_layout_theme">@style/OsmandLightTheme.SearchTabbar</item>
@ -288,6 +285,8 @@
<style name="OsmandLightTheme.NoActionbar.Preferences">
<item name="android:textColorSecondary">@color/text_color_secondary_light</item>
<item name="android:listDivider">@color/divider_color_light</item>
<item name="android:dividerHeight">1dp</item>
</style>
<style name="OsmandLightTheme.DarkActionbar">
@ -356,10 +355,13 @@
<style name="OsmandDarkTheme.NoActionbar.Preferences">
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
<item name="android:listDivider">@color/divider_color_dark</item>
<item name="android:dividerHeight">1dp</item>
</style>
<style name="OsmandDarkTheme.NoAnimation">
<item name="alertDialogTheme">@style/Theme.AppCompat.Dialog.Alert.NoAnimation</item>
<item name="dialog_title_color">@color/marker_red</item>
</style>
<style name="OsmandLightTheme.NoAnimation">
@ -441,6 +443,7 @@
<item name="primary_icon_color">@color/icon_color_primary_dark</item>
<item name="text_color_tab_active">@color/text_color_tab_active_dark</item>
<item name="text_color_tab_active_white">@color/text_color_tab_active_dark</item>
<item name="app_bar_primary_item_color">@color/active_buttons_and_links_text_dark</item>
<item name="appbar_layout_theme">@style/OsmandDarkTheme.DarkActionbar</item>
<item name="search_tabbar_layout_theme">@style/OsmandDarkTheme.SearchTabbar</item>
@ -461,6 +464,7 @@
<item name="subscription_active_div_color">@color/subscription_active_div_color_dark</item>
<item name="circle_dialog_bg">@drawable/circle_dialog_bg_night</item>
<item name="textColorAlertDialogListItem">@color/text_color_primary_dark</item>
<item name="dialog_bg_color">@color/activity_background_color_dark</item>
<item name="dialog_transparent_bg_color">@color/activity_background_transparent_color_dark</item>
<item name="dialog_title_color">@color/text_color_primary_dark</item>
@ -543,7 +547,10 @@
<!-- Standard action bar override -->
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@color/app_bar_color_dark</item>
<item name="titleTextStyle">@style/Widget.Styled.DarkActionBarTitle</item>
<item name="android:background">@color/app_bar_color_dark</item>
<item name="android:titleTextStyle">@style/Widget.Styled.DarkActionBarTitle</item>
<item name="elevation">0dp</item>
</style>
@ -564,6 +571,10 @@
<item name="android:textColor">@color/color_white</item>
</style>
<style name="Widget.Styled.DarkActionBarTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/text_color_primary_dark</item>
</style>
<style name="Widget.Styled.LightActionBarSubtitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
<item name="android:textColor">@color/white_80_transparent</item>
</style>
@ -721,10 +732,10 @@
<item name="bg_color">@color/list_background_color_dark</item>
</style>
<style name="WhiteControls" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorControlNormal">@color/color_white</item>
<item name="colorControlActivated">@color/color_white</item>
<item name="colorControlHighlight">@color/color_white</item>
<style name="AppBarControls" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorControlNormal">?attr/app_bar_primary_item_color</item>
<item name="colorControlActivated">?attr/app_bar_primary_item_color</item>
<item name="colorControlHighlight">?attr/app_bar_primary_item_color</item>
</style>
</resources>

View file

@ -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)));

View file

@ -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();

View file

@ -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));
}

View file

@ -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));

View file

@ -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(

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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() {

View file

@ -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);
}
}

View file

@ -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) {

View file

@ -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));

View file

@ -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();

View file

@ -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();

View file

@ -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);
}

View file

@ -81,7 +81,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
holder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_arrow_marker_diretion, markerColor));
holder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.list_divider_dark : R.color.markers_top_bar_background));
holder.title.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_white));
holder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.text_color_primary_dark : R.color.color_white));
holder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.map_markers_on_map_divider_color));
holder.optionsBtn.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.marker_circle_background_on_map_with_inset));
holder.optionsBtn.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_marker_passed, R.color.color_white));
@ -95,10 +95,10 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
holder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, markerColor));
holder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.list_background_color_dark : R.color.list_background_color_light));
holder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.color_white : R.color.color_black));
holder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.text_color_primary_dark : R.color.text_color_primary_light));
holder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.app_bar_color_dark : R.color.divider_color_light));
holder.optionsBtn.setBackgroundDrawable(mapActivity.getResources().getDrawable(night ? R.drawable.marker_circle_background_dark_with_inset : R.drawable.marker_circle_background_light_with_inset));
holder.optionsBtn.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_marker_passed));
holder.optionsBtn.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_marker_passed, night ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light));
holder.iconReorder.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_reorder));
holder.description.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.icon_color_default_dark : R.color.icon_color_default_light));

View file

@ -278,7 +278,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
itemViewHolder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_arrow_marker_diretion, color));
itemViewHolder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.list_divider_dark : R.color.markers_top_bar_background));
itemViewHolder.title.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_white));
itemViewHolder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.text_color_primary_dark : R.color.text_color_primary_light));
itemViewHolder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.map_markers_on_map_divider_color));
itemViewHolder.optionsBtn.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.marker_circle_background_on_map_with_inset));
itemViewHolder.optionsBtn.setImageDrawable(iconsCache.getIcon(markerInHistory ? R.drawable.ic_action_reset_to_default_dark : R.drawable.ic_action_marker_passed, R.color.color_white));
@ -291,10 +291,11 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
itemViewHolder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, color));
itemViewHolder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.list_background_color_dark : R.color.list_background_color_light));
itemViewHolder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.color_white : R.color.color_black));
itemViewHolder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.text_color_primary_dark : R.color.text_color_primary_light));
itemViewHolder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.app_bar_color_dark : R.color.divider_color_light));
itemViewHolder.optionsBtn.setBackgroundDrawable(mapActivity.getResources().getDrawable(night ? R.drawable.marker_circle_background_dark_with_inset : R.drawable.marker_circle_background_light_with_inset));
itemViewHolder.optionsBtn.setImageDrawable(iconsCache.getThemedIcon(markerInHistory ? R.drawable.ic_action_reset_to_default_dark : R.drawable.ic_action_marker_passed));
itemViewHolder.optionsBtn.setImageDrawable(iconsCache.getIcon(markerInHistory ? R.drawable.ic_action_reset_to_default_dark : R.drawable.ic_action_marker_passed,
night ? R.color.icon_color_primary_dark : R.color.active_buttons_and_links_text_light));
itemViewHolder.description.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.icon_color_default_dark : R.color.icon_color_default_light));
drawableResToUpdate = R.drawable.ic_direction_arrow;

View file

@ -88,7 +88,7 @@ public class OsmNotesMenu {
if (showOsmBugs) {
toggleIconColorId = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
} else {
toggleIconColorId = nightMode ? 0 : R.color.icon_color_default_light;
toggleIconColorId = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
}
adapter.addItem(new ContextMenuItem.ItemBuilder()

View file

@ -1,5 +1,6 @@
package net.osmand.plus.profiles;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -32,8 +33,11 @@ public class EditProfileActivity extends OsmandActionBarActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
int activeButtonsAndLinksTextResId = getMyApplication().getSettings().isLightContent() ?
R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
Drawable icDelete = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_action_delete_dark, activeButtonsAndLinksTextResId);
MenuItem m = menu.add(0, DELETE_ID, 0, R.string.action_delete)
.setIcon(R.drawable.ic_action_delete_dark);
.setIcon(icDelete);
MenuItemCompat.setShowAsAction(m, MenuItem.SHOW_AS_ACTION_ALWAYS);
super.onCreateOptionsMenu(menu);
return true;

View file

@ -5,6 +5,7 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.view.ContextThemeWrapper;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
@ -28,15 +29,17 @@ import java.util.List;
public class AddQuickActionDialog extends DialogFragment {
public static final String TAG = AddQuickActionDialog.class.getSimpleName();
private boolean isLightContent;
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
OsmandApplication application = (OsmandApplication) getActivity().getApplication();
boolean light = application.getSettings().isLightContent() && !application.getDaynightHelper().isNightMode();
isLightContent = application.getSettings().isLightContent() && !application.getDaynightHelper().isNightMode();
return new Dialog(new ContextThemeWrapper(getActivity(), light
return new Dialog(new ContextThemeWrapper(getActivity(), isLightContent
? R.style.Dialog90Light
: R.style.Dialog90Dark), getTheme());
}
@ -55,9 +58,13 @@ public class AddQuickActionDialog extends DialogFragment {
View root = inflater.inflate(R.layout.quick_action_add_dialog, container, false);
Adapter adapter = new Adapter(QuickActionFactory.produceTypeActionsListWithHeaders(active));
TextView tvTitle = root.findViewById(R.id.tvTitle);
RecyclerView recyclerView = (RecyclerView) root.findViewById(R.id.recycler_view);
Button btnDismiss = (Button) root.findViewById(R.id.btnDismiss);
tvTitle.setTextColor(ContextCompat.getColor(getContext(),
isLightContent ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
btnDismiss.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -147,6 +154,8 @@ public class AddQuickActionDialog extends DialogFragment {
ItemViewHolder itemHolder = (ItemViewHolder) holder;
itemHolder.title.setText(action.getNameRes());
itemHolder.title.setTextColor(ContextCompat.getColor(getContext(),
isLightContent ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
itemHolder.icon.setImageResource(action.getIconRes());
itemHolder.itemView.setOnClickListener(new View.OnClickListener() {

View file

@ -7,6 +7,7 @@ import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ContextThemeWrapper;
import android.support.v7.widget.Toolbar;
@ -63,14 +64,15 @@ public class CreateEditActionDialog extends DialogFragment {
private QuickAction action;
private boolean isNew;
private boolean isLightContent;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
OsmandApplication application = (OsmandApplication) getActivity().getApplication();
boolean light = application.getSettings().isLightContent() && !application.getDaynightHelper().isNightMode();
isLightContent = application.getSettings().isLightContent() && !application.getDaynightHelper().isNightMode();
Dialog dialog = new Dialog(new ContextThemeWrapper(getActivity(), light
Dialog dialog = new Dialog(new ContextThemeWrapper(getActivity(), isLightContent
? R.style.Dialog90Light
: R.style.Dialog90Dark), getTheme());
@ -149,11 +151,10 @@ public class CreateEditActionDialog extends DialogFragment {
? R.string.quick_action_new_action
: R.string.quick_action_edit_action);
toolbar.setTitleTextColor(Color.WHITE);
int buttonsAndLinksTextColorResId = isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
toolbar.setTitleTextColor(ContextCompat.getColor(getContext(), buttonsAndLinksTextColorResId));
toolbar.setNavigationIcon(getIconsCache().getIcon(
R.drawable.ic_arrow_back,
R.color.color_white));
toolbar.setNavigationIcon(getIconsCache().getIcon(R.drawable.ic_arrow_back, buttonsAndLinksTextColorResId));
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
@ -169,6 +170,8 @@ public class CreateEditActionDialog extends DialogFragment {
ImageView image = (ImageView) root.findViewById(R.id.image);
EditText name = (EditText) root.findViewById(R.id.name);
int buttonsAndLinksTextColorResId = isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
name.setTextColor(ContextCompat.getColor(getContext(), buttonsAndLinksTextColorResId));
name.addTextChangedListener(new TextWatcher() {
@Override

View file

@ -50,13 +50,17 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
QuickActionAdapter adapter;
ItemTouchHelper touchHelper;
QuickActionRegistry quickActionRegistry;
private boolean isLightContent;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.quick_action_list, container, false);
isLightContent = getMyApplication().getSettings().isLightContent();
quickActionRV = (RecyclerView) view.findViewById(R.id.recycler_view);
fab = (FloatingActionButton) view.findViewById(R.id.fabButton);
@ -109,7 +113,8 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
private void setUpToolbar(View view) {
Toolbar toolbar = (Toolbar) view.findViewById(R.id.custom_toolbar);
Drawable back = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back, R.color.color_white);
Drawable back = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back,
isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
toolbar.setNavigationIcon(back);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@ -119,7 +124,8 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
}
});
toolbar.setTitle(R.string.configure_screen_quick_action);
toolbar.setTitleTextColor(ContextCompat.getColor(getContext(), R.color.color_white));
toolbar.setTitleTextColor(ContextCompat.getColor(getContext(),
isLightContent ? R.color.color_white : R.color.text_color_primary_dark));
}
@Override

View file

@ -3,10 +3,12 @@ package net.osmand.plus.search;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
@ -97,6 +99,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os
private boolean paused;
private LatLon currentLatLon;
private UpdateLocationViewCache updateLocationViewCache;
private boolean isLightTheme;
private ProcessIndexItemsTask parseOlcCodeTask = null;
@ -114,7 +117,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os
@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);
}
@ -127,7 +130,9 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os
view = inflater.inflate(R.layout.search_advanced_coords, container, false);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(app.getUIUtilities().getIcon(R.drawable.ic_arrow_back));
Drawable icBack = app.getUIUtilities().getIcon(R.drawable.ic_arrow_back,
isLightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@ -135,6 +140,9 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os
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.color_white : R.color.text_color_primary_dark));
updateLocationViewCache = app.getUIUtilities().getUpdateLocationViewCache();
myLocation = app.getLocationProvider().getLastKnownLocation();
currentFormat = app.getSettings().COORDINATES_FORMAT.get();

View file

@ -2,10 +2,12 @@ package net.osmand.plus.search;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatTextView;
@ -57,6 +59,7 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
private TextView barTitle;
private TextView barButton;
private boolean editMode;
private boolean isLightTheme;
public QuickSearchCustomPoiFragment() {
@ -69,7 +72,7 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean isLightTheme =
isLightTheme =
getMyApplication().getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
setStyle(STYLE_NO_FRAME, themeId);
@ -97,7 +100,9 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
view = inflater.inflate(R.layout.search_custom_poi, container, false);
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
@ -105,6 +110,8 @@ public class QuickSearchCustomPoiFragment 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));
TextView title = (TextView) view.findViewById(R.id.title);
if (editMode) {

View file

@ -2,9 +2,11 @@ package net.osmand.plus.search;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.SwitchCompat;
@ -84,6 +86,7 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
private ArrayList<String> collapsedCategories = new ArrayList<>();
private ArrayList<String> showAllCategories = new ArrayList<>();
private Map<PoiType, String> 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() {

View file

@ -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)

View file

@ -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)

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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);