Renamed method in IconsCache

This commit is contained in:
GaidamakUA 2016-04-05 17:56:16 +03:00
parent af98243576
commit 59e571ef77
46 changed files with 136 additions and 138 deletions

View file

@ -50,7 +50,7 @@ public class IconsCache {
return d;
}
public Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color){
public Drawable getPaintedIcon(@DrawableRes int id, @ColorInt int color){
return getPaintedDrawable(id, color);
}
@ -67,7 +67,7 @@ public class IconsCache {
return new LayerDrawable(layers);
}
public Drawable getContentIcon(@DrawableRes int id) {
public Drawable getThemedIcon(@DrawableRes int id) {
return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color : 0);
}

View file

@ -212,7 +212,7 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
ImageButton options = (ImageButton) row.findViewById(R.id.options);
options.setFocusable(false);
options.setImageDrawable(((OsmandApplication) activity.getApplication())
.getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
.getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setVisibility(View.VISIBLE);
options.setOnClickListener(new View.OnClickListener() {
@Override
@ -223,7 +223,7 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
}
if (!favorite.getCategory().isEmpty()) {
giImage.setVisibility(View.VISIBLE);
giImage.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_group));
giImage.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_group));
} else {
giImage.setVisibility(View.GONE);
}

View file

@ -715,7 +715,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
}
final View ch = row.findViewById(R.id.options);
if (!selectionMode) {
((ImageView) ch).setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
((ImageView) ch).setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
ch.setVisibility(View.VISIBLE);
ch.setOnClickListener(new View.OnClickListener() {
@Override
@ -750,7 +750,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
if (showOptionsButton) {
ImageView options = (ImageView) row.findViewById(R.id.options);
options.setFocusable(false);
options.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(
options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(
R.drawable.ic_overflow_menu_white));
options.setVisibility(View.VISIBLE);
options.setOnClickListener(new View.OnClickListener() {

View file

@ -222,7 +222,7 @@ public class HelpActivity extends OsmandActionBarActivity {
convertView = LayoutInflater.from(parent.getContext()).inflate(
R.layout.help_to_improve_item, parent, false);
TextView feedbackButton = (TextView) convertView.findViewById(R.id.feedbackButton);
Drawable pollIcon = ctx.getIconsCache().getContentIcon(R.drawable.ic_action_message);
Drawable pollIcon = ctx.getIconsCache().getThemedIcon(R.drawable.ic_action_message);
feedbackButton.setCompoundDrawablesWithIntrinsicBounds(null, pollIcon, null, null);
feedbackButton.setOnClickListener(new View.OnClickListener() {
@Override
@ -233,7 +233,7 @@ public class HelpActivity extends OsmandActionBarActivity {
});
TextView contactUsButton = (TextView) convertView.findViewById(R.id.contactUsButton);
Drawable contactUsIcon =
ctx.getIconsCache().getContentIcon(R.drawable.ic_action_message);
ctx.getIconsCache().getThemedIcon(R.drawable.ic_action_message);
contactUsButton.setCompoundDrawablesWithIntrinsicBounds(null, contactUsIcon, null,
null);
final String email = ctx.getString(R.string.support_email);
@ -396,7 +396,7 @@ public class HelpActivity extends OsmandActionBarActivity {
if (menuItem.getIcon() != -1) {
leftImageView.setVisibility(View.VISIBLE);
leftImageView.setImageDrawable(context.getIconsCache()
.getContentIcon(menuItem.getIcon()));
.getThemedIcon(menuItem.getIcon()));
} else {
leftImageView.setVisibility(View.GONE);
}

View file

@ -253,7 +253,7 @@ public class IntermediatePointsDialog {
} else {
int icon = position == intermediates.size() - 1? R.drawable.ic_action_target:
R.drawable.ic_action_intermediate;
tv.setCompoundDrawablesWithIntrinsicBounds(app.getIconsCache().getContentIcon(icon), null, null, null);
tv.setCompoundDrawablesWithIntrinsicBounds(app.getIconsCache().getThemedIcon(icon), null, null, null);
tv.setCompoundDrawablePadding(padding);
final CheckBox ch = ((CheckBox) v.findViewById(R.id.toggle_item));
ch.setVisibility(View.VISIBLE);

View file

@ -122,7 +122,7 @@ public class OpeningHoursView {
}
TextView label = (TextView)row.findViewById(R.id.label);
ImageView icon = (ImageView)row.findViewById(R.id.remove);
icon.setBackgroundDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark));
icon.setBackgroundDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark));
if(selectedRule == position){
label.setTypeface(null, Typeface.BOLD);
label.setTextSize(22);

View file

@ -14,7 +14,6 @@ import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
@ -128,7 +127,7 @@ public class PluginActivity extends OsmandActionBarActivity {
Button getButton = (Button)findViewById(R.id.plugin_get);
Button settingsButton = (Button)findViewById(R.id.plugin_settings);
settingsButton.setCompoundDrawablesWithIntrinsicBounds(
getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_settings),
getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_settings),
null, null, null);
View installHeader = findViewById(R.id.plugin_install_header);
@ -138,7 +137,7 @@ public class PluginActivity extends OsmandActionBarActivity {
settingsButton.setVisibility(View.GONE);
installHeader.setVisibility(View.VISIBLE);
View worldGlobeIcon = installHeader.findViewById(R.id.ic_world_globe);
Drawable worldGlobeDrawable = getMyApplication().getIconsCache().getContentIcon(
Drawable worldGlobeDrawable = getMyApplication().getIconsCache().getThemedIcon(
R.drawable.ic_world_globe_dark);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
worldGlobeIcon.setBackground(worldGlobeDrawable);

View file

@ -1,8 +1,5 @@
package net.osmand.plus.activities;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import android.app.Activity;
import android.content.Intent;
import android.content.res.TypedArray;
@ -17,6 +14,10 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
public class PluginsActivity extends OsmandListActivity {
public static final int ACTIVE_PLUGINS_LIST_MODIFIED = 1;
@ -121,7 +122,7 @@ public class PluginsActivity extends OsmandListActivity {
ImageView pluginOptions = (ImageView) view.findViewById(R.id.plugin_options);
pluginOptions.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
pluginOptions.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
pluginOptions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -83,7 +83,7 @@ public class AppModeDialog {
iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), !nightMode));
AndroidUtils.setBackground(ctx, iv, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
} else {
iv.setImageDrawable(ctx.getIconsCache().getContentIcon(mode.getSmallIconDark()));
iv.setImageDrawable(ctx.getIconsCache().getThemedIcon(mode.getSmallIconDark()));
}
tb.findViewById(R.id.selection).setVisibility(View.INVISIBLE);
}

View file

@ -1,15 +1,5 @@
package net.osmand.plus.activities.search;
import net.osmand.access.AccessibleToast;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.resources.RegionAddressRepository;
import net.osmand.util.Algorithms;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
@ -28,6 +18,17 @@ import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.access.AccessibleToast;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.resources.RegionAddressRepository;
import net.osmand.util.Algorithms;
public class SearchAddressFragment extends Fragment {
public static final String SELECT_ADDRESS_POINT_INTENT_KEY = "SELECT_ADDRESS_POINT_INTENT_KEY";
@ -177,7 +178,7 @@ public class SearchAddressFragment extends Fragment {
}
});
OsmandApplication app = getApplication();
Drawable icon = getApplication().getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark);
Drawable icon = getApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark);
((ImageView)findViewById(R.id.ResetBuilding)).setBackgroundDrawable(icon);
findViewById(R.id.ResetBuilding).setOnClickListener(new View.OnClickListener(){
@Override

View file

@ -200,7 +200,7 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
MenuItem item = optionsMenu.getMenu().add(
R.string.shared_string_remove).setIcon(
getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_delete_dark));
getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -239,7 +239,7 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
DashLocationFragment.updateLocationView(!searchAroundLocation, location, heading, direction, distanceText,
historyEntry.getLat(), historyEntry.getLon(), screenOrientation, getMyApplication(), getActivity());
ImageButton options = (ImageButton) row.findViewById(R.id.options);
options.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setVisibility(View.VISIBLE);
options.setOnClickListener(new View.OnClickListener() {
@Override
@ -268,13 +268,13 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
PointDescription pd = historyEntry.getName();
nameText.setText(pd.getSimpleName(activity, false), BufferType.SPANNABLE);
ImageView icon = ((ImageView) row.findViewById(R.id.icon));
icon.setImageDrawable(ic.getContentIcon(getItemIcon(historyEntry.getName())));
icon.setImageDrawable(ic.getThemedIcon(getItemIcon(historyEntry.getName())));
String typeName = historyEntry.getName().getTypeName();
if (typeName != null && !typeName.isEmpty()) {
ImageView group = (ImageView) row.findViewById(R.id.type_name_icon);
group.setVisibility(View.VISIBLE);
group.setImageDrawable(ic.getContentIcon(R.drawable.ic_small_group));
group.setImageDrawable(ic.getThemedIcon(R.drawable.ic_small_group));
((TextView) row.findViewById(R.id.type_name)).setText(typeName);
} else {
row.findViewById(R.id.type_name_icon).setVisibility(View.GONE);

View file

@ -244,9 +244,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
});
((EditText)findViewById(R.id.searchEditText)).setHint(R.string.filter_poi_hint);
((ImageView)findViewById(R.id.search_icon)).setImageDrawable(
getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_filter_dark));
getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_filter_dark));
((ImageView) findViewById(R.id.options)).
setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
findViewById(R.id.options).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -336,7 +336,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
final PoiUIFilter f = this.filter;
MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_edit)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_edit_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -367,7 +367,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
private void addFilter(PopupMenu optionsMenu, final String value) {
IconsCache iconsCache = getMyApplication().getIconsCache();
MenuItem item = optionsMenu.getMenu().add(getString(R.string.search_poi_filter) + " " + value)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_filter_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_filter_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -69,7 +69,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
v.findViewById(R.id.SearchFilterLayout).setVisibility(View.VISIBLE);
((EditText)v.findViewById(R.id.searchEditText)).setHint(R.string.search_poi_category_hint);
((ImageView)v.findViewById(R.id.search_icon)).setImageDrawable(
getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_search_dark));
getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_search_dark));
setupSearchEditText((EditText) v.findViewById(R.id.searchEditText));
setupOptions((ImageView) v.findViewById(R.id.options));
@ -78,7 +78,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
}
private void setupOptions(ImageView options) {
options.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -332,7 +332,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
MenuItem item = optionsMenu.getMenu().add(R.string.poi_filter_custom_filter)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_filter_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_filter_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -2,7 +2,6 @@ package net.osmand.plus.audionotes;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
@ -132,7 +131,7 @@ public class AudioVideoNoteRecordingMenu {
ImageView leftButtonIcon = (ImageView) view.findViewById(R.id.leftButtonIcon);
View leftButtonView = view.findViewById(R.id.leftButtonView);
if (recording.getType() != AVActionType.REC_AUDIO) {
leftButtonIcon.setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_action_minimize));
leftButtonIcon.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_minimize));
TextView showHideText = (TextView) view.findViewById(R.id.leftButtonText);
showHideText.setText(showViewfinder ?
view.getResources().getString(R.string.shared_string_hide) : view.getResources().getString(R.string.shared_string_show));
@ -156,14 +155,14 @@ public class AudioVideoNoteRecordingMenu {
switch (recording.getType()) {
case REC_AUDIO:
case REC_VIDEO:
recIcon.setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_action_rec_stop));
recIcon.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_rec_stop));
recText.setText(view.getResources().getString(R.string.shared_string_control_stop));
recText.setVisibility(View.VISIBLE);
updateDuration();
timeView.setVisibility(View.VISIBLE);
break;
case REC_PHOTO:
recIcon.setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_action_photo_dark));
recIcon.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_photo_dark));
recText.setVisibility(View.GONE);
timeView.setVisibility(View.INVISIBLE);
break;

View file

@ -92,7 +92,7 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
getNoteView(recording, view, getMyApplication());
((ImageView) view.findViewById(R.id.play)).setImageDrawable(getMyApplication().getIconsCache()
.getContentIcon(R.drawable.ic_play_dark));
.getThemedIcon(R.drawable.ic_play_dark));
view.findViewById(R.id.play).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -374,7 +374,7 @@ public class NotesFragment extends OsmAndListFragment {
final CheckBox ch = (CheckBox) row.findViewById(R.id.check_local_index);
ImageButton options = (ImageButton) row.findViewById(R.id.options);
options.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
if(selectionMode) {
options.setVisibility(View.GONE);
ch.setVisibility(View.VISIBLE);
@ -437,9 +437,9 @@ public class NotesFragment extends OsmAndListFragment {
boolean isPhoto = recording.isPhoto();
Drawable playIcon;
if (isPhoto) {
playIcon = getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_view);
playIcon = getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_view);
} else {
playIcon = getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_play_dark);
playIcon = getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_play_dark);
}
item = optionsMenu.getMenu().add(isPhoto ? R.string.watch : R.string.recording_context_menu_play)
.setIcon(playIcon);
@ -452,7 +452,7 @@ public class NotesFragment extends OsmAndListFragment {
});
item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map).setIcon(
iconsCache.getContentIcon(R.drawable.ic_show_on_map));
iconsCache.getThemedIcon(R.drawable.ic_show_on_map));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -462,7 +462,7 @@ public class NotesFragment extends OsmAndListFragment {
});
item = optionsMenu.getMenu().add(R.string.shared_string_share)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_gshare_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_gshare_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -486,7 +486,7 @@ public class NotesFragment extends OsmAndListFragment {
});
item = optionsMenu.getMenu().add(R.string.shared_string_rename)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_edit_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -496,7 +496,7 @@ public class NotesFragment extends OsmAndListFragment {
});
item = optionsMenu.getMenu().add(R.string.recording_context_menu_delete)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_delete_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -48,7 +48,7 @@ public class BaseOsmAndDialogFragment extends DialogFragment {
}
protected Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color){
return getIconsCache().getPaintedContentIcon(id, color);
return getIconsCache().getPaintedIcon(id, color);
}
protected Drawable getIcon(@DrawableRes int id, @ColorRes int colorId){
@ -56,7 +56,7 @@ public class BaseOsmAndDialogFragment extends DialogFragment {
}
protected Drawable getContentIcon(@DrawableRes int id){
return getIconsCache().getContentIcon(id);
return getIconsCache().getThemedIcon(id);
}
protected void setThemedDrawable(View parent, @IdRes int viewId, @DrawableRes int iconId) {

View file

@ -33,7 +33,7 @@ public class BaseOsmAndFragment extends Fragment {
}
protected Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color){
return getIconsCache().getPaintedContentIcon(id, color);
return getIconsCache().getPaintedIcon(id, color);
}
protected Drawable getIcon(@DrawableRes int id, @ColorRes int colorId){
@ -41,7 +41,7 @@ public class BaseOsmAndFragment extends Fragment {
}
protected Drawable getContentIcon(@DrawableRes int id){
return getIconsCache().getContentIcon(id);
return getIconsCache().getThemedIcon(id);
}
protected void setThemedDrawable(View parent, @IdRes int viewId, @DrawableRes int iconId) {

View file

@ -60,7 +60,7 @@ public abstract class BottomSheetDialogFragment extends DialogFragment {
}
protected Drawable getContentIcon(@DrawableRes int drawableRes) {
return getMyApplication().getIconsCache().getContentIcon(drawableRes);
return getMyApplication().getIconsCache().getThemedIcon(drawableRes);
}
}

View file

@ -49,7 +49,7 @@ public class DashErrorFragment extends DashBaseFragment {
String msg = MessageFormat.format(getString(R.string.previous_run_crashed), OsmandApplication.EXCEPTION_PATH);
Typeface typeface = FontCache.getRobotoMedium(getActivity());
ImageView iv = ((ImageView) view.findViewById(R.id.error_icon));
iv.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_crashlog));
iv.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_crashlog));
TextView message = ((TextView) view.findViewById(R.id.error_header));
message.setTypeface(typeface);
message.setText(msg);

View file

@ -105,7 +105,7 @@ public class DashFavoritesFragment extends DashLocationFragment {
ImageView groupImage = (ImageView)view.findViewById(R.id.group_image);
if (point.getCategory().length() > 0) {
((TextView) view.findViewById(R.id.group_name)).setText(point.getCategory());
groupImage.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_small_group));
groupImage.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_small_group));
} else {
groupImage.setVisibility(View.GONE);
}
@ -120,7 +120,7 @@ public class DashFavoritesFragment extends DashLocationFragment {
name.setTypeface(Typeface.DEFAULT, point.isVisible() ? Typeface.NORMAL : Typeface.ITALIC);
view.findViewById(R.id.navigate_to).setVisibility(View.VISIBLE);
((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_gdirections_dark));
((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_gdirections_dark));
view.findViewById(R.id.navigate_to).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

View file

@ -76,7 +76,7 @@ public class DashNavigationFragment extends DashBaseFragment {
name.setText(routingHelper.getGeneralRouteInformation());
icon.setImageDrawable(getMyApplication().getIconsCache().getIcon(R.drawable.ic_action_start_navigation,
R.color.color_myloc_distance));
cancel.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark)
cancel.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark)
);
cancel.setOnClickListener(new OnClickListener() {
@ -109,8 +109,8 @@ public class DashNavigationFragment extends DashBaseFragment {
private void updatePlayButton(final RoutingHelper routingHelper, final MapActivity map, final ImageView play) {
boolean toContinueNavigation = routingHelper.isRoutePlanningMode();
play.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(
toContinueNavigation? R.drawable.ic_play_dark : R.drawable.ic_pause )
play.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(
toContinueNavigation ? R.drawable.ic_play_dark : R.drawable.ic_pause)
);
play.setContentDescription(getString(toContinueNavigation ? R.string.continue_navigation :
R.string.pause_navigation));

View file

@ -96,7 +96,7 @@ public class DashRecentsFragment extends DashLocationFragment {
SearchHistoryFragment.udpateHistoryItem(historyEntry, view, loc, getActivity(), getMyApplication());
view.findViewById(R.id.divider).setVisibility(View.VISIBLE);
view.findViewById(R.id.navigate_to).setVisibility(View.VISIBLE);
((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_gdirections_dark));
((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_gdirections_dark));
view.findViewById(R.id.navigate_to).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

View file

@ -161,7 +161,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
final boolean optionsVisible = (SHOW_ALL && getMyApplication().getTargetPointsHelper().getIntermediatePoints().size() > 0);
options.setImageDrawable(getMyApplication().getIconsCache().
getContentIcon(optionsVisible ? R.drawable.ic_overflow_menu_white :
getThemedIcon(optionsVisible ? R.drawable.ic_overflow_menu_white :
R.drawable.ic_action_remove_dark));
options.setOnClickListener(new View.OnClickListener() {
@Override
@ -176,7 +176,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
ImageButton navigate = ((ImageButton)view.findViewById(R.id.navigate_to));
navigate.setImageDrawable(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_gdirections_dark));
getThemedIcon(R.drawable.ic_action_gdirections_dark));
navigate.setVisibility(target? View.VISIBLE : View.GONE);
navigate.setOnClickListener(new View.OnClickListener() {
@Override
@ -241,7 +241,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
final int ind = target ? allTargets.size() - 1 : point.index;
item = optionsMenu.getMenu().add(R.string.waypoint_visit_before)
.setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_up_dark));
getThemedIcon(R.drawable.ic_action_up_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -256,7 +256,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
if (!target) {
item = optionsMenu.getMenu().add(R.string.waypoint_visit_after)
.setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_down_dark));
getThemedIcon(R.drawable.ic_action_down_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -271,7 +271,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
}
item = optionsMenu.getMenu().add(
R.string.shared_string_remove).setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_remove_dark));
getThemedIcon(R.drawable.ic_action_remove_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -40,8 +40,8 @@ public class DashSimulateFragment extends DashBaseFragment {
((TextView) getView().findViewById(R.id.name)).setText(routeAnimating ? R.string.animate_route_off
: R.string.animate_route);
((ImageButton) getView().findViewById(R.id.stop)).setImageDrawable(
!routeAnimating ? getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_play_dark)
: getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_rec_stop));
!routeAnimating ? getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_play_dark)
: getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_rec_stop));
}

View file

@ -36,7 +36,7 @@ public class ErrorBottomSheetDialog extends BottomSheetDialogFragment {
String msg = MessageFormat.format(getString(R.string.previous_run_crashed), OsmandApplication.EXCEPTION_PATH);
Typeface typeface = FontCache.getRobotoMedium(getActivity());
ImageView iv = ((ImageView) view.findViewById(R.id.error_icon));
iv.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_crashlog));
iv.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_crashlog));
TextView message = ((TextView) view.findViewById(R.id.error_header));
message.setTypeface(typeface);
message.setText(msg);

View file

@ -29,15 +29,15 @@ public class DownloadGroupViewHolder {
Drawable iconLeft;
if (group.getType() == DownloadResourceGroup.DownloadResourceGroupType.VOICE_REC
|| group.getType() == DownloadResourceGroup.DownloadResourceGroupType.VOICE_TTS) {
iconLeft = ctx.getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_volume_up);
iconLeft = ctx.getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_volume_up);
} else {
IconsCache cache = ctx.getMyApplication().getIconsCache();
if (isParentWorld(group) || isParentWorld(group.getParentGroup())) {
iconLeft = cache.getContentIcon(R.drawable.ic_world_globe_dark);
iconLeft = cache.getThemedIcon(R.drawable.ic_world_globe_dark);
} else {
DownloadResourceGroup ggr = group
.getSubGroupById(DownloadResourceGroup.DownloadResourceGroupType.REGION_MAPS.getDefaultId());
iconLeft = cache.getContentIcon(R.drawable.ic_map);
iconLeft = cache.getThemedIcon(R.drawable.ic_map);
if (ggr != null && ggr.getIndividualResources() != null) {
IndexItem item = null;
for (IndexItem ii : ggr.getIndividualResources()) {

View file

@ -269,15 +269,15 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
Drawable iconLeft;
if (group.getType() == DownloadResourceGroupType.VOICE_REC
|| group.getType() == DownloadResourceGroupType.VOICE_TTS) {
iconLeft = ctx.getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_volume_up);
iconLeft = ctx.getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_volume_up);
} else {
IconsCache cache = ctx.getMyApplication().getIconsCache();
if (isParentWorld(group) || isParentWorld(group.getParentGroup())) {
iconLeft = cache.getContentIcon(R.drawable.ic_world_globe_dark);
iconLeft = cache.getThemedIcon(R.drawable.ic_world_globe_dark);
} else {
DownloadResourceGroup ggr = group
.getSubGroupById(DownloadResourceGroupType.REGION_MAPS.getDefaultId());
iconLeft = cache.getContentIcon(R.drawable.ic_map);
iconLeft = cache.getThemedIcon(R.drawable.ic_map);
if (ggr != null && ggr.getIndividualResources() != null) {
IndexItem item = null;
for (IndexItem ii : ggr.getIndividualResources()) {

View file

@ -350,7 +350,7 @@ public class ItemViewHolder {
final File fl = indexItem.getTargetFile(context.getMyApplication());
if (fl.exists()) {
item = optionsMenu.getMenu().add(R.string.shared_string_remove).setIcon(
context.getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark));
context.getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -386,7 +386,7 @@ public class ItemViewHolder {
});
}
item = optionsMenu.getMenu().add(R.string.shared_string_download)
.setIcon(context.getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_import));
.setIcon(context.getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_import));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -399,10 +399,10 @@ public class ItemViewHolder {
}
private Drawable getContentIcon(DownloadActivity context, int resourceId) {
return context.getMyApplication().getIconsCache().getContentIcon(resourceId);
return context.getMyApplication().getIconsCache().getThemedIcon(resourceId);
}
private Drawable getContentIcon(DownloadActivity context, int resourceId, int color) {
return context.getMyApplication().getIconsCache().getPaintedContentIcon(resourceId, color);
return context.getMyApplication().getIconsCache().getPaintedIcon(resourceId, color);
}
}

View file

@ -1062,7 +1062,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
public void bindLocalIndexInfo(final LocalIndexInfo child) {
options.setImageDrawable(ctx.getMyApplication().getIconsCache()
.getContentIcon(R.drawable.ic_overflow_menu_white));
.getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1138,7 +1138,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
}
private Drawable getContentIcon(DownloadActivity context, int resourceId) {
return context.getMyApplication().getIconsCache().getContentIcon(resourceId);
return context.getMyApplication().getIconsCache().getThemedIcon(resourceId);
}
private Drawable getContentIcon(DownloadActivity context, int resourceId, int colorId) {
@ -1156,7 +1156,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
MenuItem item;
if ((info.getType() == LocalIndexType.MAP_DATA) || (info.getType() == LocalIndexType.DEACTIVATED)) {
item = optionsMenu.getMenu().add(restore ? R.string.local_index_mi_restore : R.string.local_index_mi_backup)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_type_archive));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_type_archive));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -1167,7 +1167,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
}
item = optionsMenu.getMenu().add(R.string.shared_string_rename)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_edit_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -1178,7 +1178,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
final IndexItem update = filesToUpdate.get(info.getFileName());
if (update != null) {
item = optionsMenu.getMenu().add(R.string.shared_string_download)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_import));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_import));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -1189,7 +1189,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
}
item = optionsMenu.getMenu().add(R.string.shared_string_delete)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_delete_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -66,7 +66,7 @@ public class AvoidSpecificRoads {
final RouteDataObject obj = getItem(position);
v.findViewById(R.id.all_points).setVisibility(View.GONE);
((ImageView) v.findViewById(R.id.waypoint_icon)).setImageDrawable(
app.getIconsCache().getContentIcon(R.drawable.ic_action_road_works_dark));
app.getIconsCache().getThemedIcon(R.drawable.ic_action_road_works_dark));
double dist = MapUtils.getDistance(mapLocation, MapUtils.get31LatitudeY(obj.getPoint31YTile(0)),
MapUtils.get31LongitudeX(obj.getPoint31XTile(0)));
((TextView) v.findViewById(R.id.waypoint_dist)).setText(OsmAndFormatter.getFormattedDistance((float) dist, app));
@ -74,7 +74,7 @@ public class AvoidSpecificRoads {
((TextView) v.findViewById(R.id.waypoint_text)).setText(getText(obj));
ImageButton remove = (ImageButton) v.findViewById(R.id.info_close);
remove.setVisibility(View.VISIBLE);
remove.setImageDrawable(app.getIconsCache().getContentIcon(
remove.setImageDrawable(app.getIconsCache().getThemedIcon(
R.drawable.ic_action_remove_dark));
remove.setOnClickListener(new View.OnClickListener() {

View file

@ -345,7 +345,7 @@ public class MapMarkerDialogHelper {
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
MenuItem item;
item = optionsMenu.getMenu().add(R.string.shared_string_clear)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_delete_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -373,7 +373,7 @@ public class MapMarkerDialogHelper {
if (!sorted) {
item = optionsMenu.getMenu().add(R.string.shared_string_reverse_order).setIcon(
iconsCache.getContentIcon(R.drawable.ic_action_undo_dark));
iconsCache.getThemedIcon(R.drawable.ic_action_undo_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -389,7 +389,7 @@ public class MapMarkerDialogHelper {
}
item = optionsMenu.getMenu().add(R.string.shared_string_save_as_gpx).setIcon(
iconsCache.getContentIcon(R.drawable.ic_action_save));
iconsCache.getThemedIcon(R.drawable.ic_action_save));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -433,7 +433,7 @@ public class MapMarkerDialogHelper {
MenuItem item;
item = optionsMenu.getMenu().add(
R.string.shared_string_remove).setIcon(app.getIconsCache().
getContentIcon(R.drawable.ic_action_remove_dark));
getThemedIcon(R.drawable.ic_action_remove_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -434,7 +434,7 @@ public class WaypointDialogHelper {
if (hasActivePoints) {
item = optionsMenu.getMenu().add(
R.string.intermediate_items_sort_by_distance).setIcon(app.getIconsCache().
getContentIcon(R.drawable.ic_sort_waypoint_dark));
getThemedIcon(R.drawable.ic_sort_waypoint_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -445,7 +445,7 @@ public class WaypointDialogHelper {
});
item = optionsMenu.getMenu().add(
R.string.switch_start_finish).setIcon(app.getIconsCache().
getContentIcon(R.drawable.ic_action_undo_dark));
getThemedIcon(R.drawable.ic_action_undo_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -502,7 +502,7 @@ public class WaypointDialogHelper {
MenuItem item;
if (index > 0 && count > 1) {
item = optionsMenu.getMenu().add(R.string.shared_string_move_up)
.setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_arrow_drop_up));
.setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_action_arrow_drop_up));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -515,7 +515,7 @@ public class WaypointDialogHelper {
}
if (index < count - 1 && count > 1) {
item = optionsMenu.getMenu().add(R.string.shared_string_move_down)
.setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_arrow_drop_down));
.setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_action_arrow_drop_down));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -528,7 +528,7 @@ public class WaypointDialogHelper {
}
item = optionsMenu.getMenu().add(R.string.shared_string_remove)
.setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark));
.setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -161,7 +161,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList
TextView statusTextView = (TextView) subscriptionHeader.findViewById(R.id.statusTextView);
TextView regionNameTextView = (TextView) subscriptionHeader.findViewById(R.id.regionTextView);
statusTextView.setText(getString(R.string.osm_live_active));
statusIcon.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_done));
statusIcon.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_done));
String countryName = getSettings().BILLING_USER_COUNTRY.get();
if (Algorithms.isEmpty(countryName)) {
@ -561,7 +561,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList
private Drawable getSecondaryColorPaintedIcon(@DrawableRes int drawable) {
return fragment.getMyActivity().getMyApplication().getIconsCache()
.getPaintedContentIcon(drawable, secondaryColor);
.getPaintedIcon(drawable, secondaryColor);
}
}

View file

@ -88,7 +88,7 @@ public abstract class BaseMenuController {
protected Drawable getPaintedIcon(int iconId, int color) {
IconsCache iconsCache = getMapActivity().getMyApplication().getIconsCache();
return iconsCache.getPaintedContentIcon(iconId, color);
return iconsCache.getPaintedIcon(iconId, color);
}
protected Drawable getIcon(int iconId, int colorLightId, int colorDarkId) {

View file

@ -65,7 +65,7 @@ public class GpxItemMenuBuilder extends MenuBuilder {
llIconParams.setMargins(0, 0, gpxSmallIconMargin, 0);
llIconParams.gravity = Gravity.CENTER_VERTICAL;
icon.setLayoutParams(llIconParams);
icon.setImageDrawable(app.getIconsCache().getContentIcon(iconId));
icon.setImageDrawable(app.getIconsCache().getThemedIcon(iconId));
ll.addView(icon);
}

View file

@ -406,6 +406,6 @@ public abstract class PointEditorFragment extends Fragment {
protected Drawable getPaintedIcon(int iconId, int color) {
IconsCache iconsCache = getMapActivity().getMyApplication().getIconsCache();
return iconsCache.getPaintedContentIcon(iconId, color);
return iconsCache.getPaintedIcon(iconId, color);
}
}

View file

@ -937,7 +937,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
if (row.icon != null) {
icon = row.icon;
} else if (row.iconId > 0) {
icon = mapActivity.getMyApplication().getIconsCache().getContentIcon(row.iconId);
icon = mapActivity.getMyApplication().getIconsCache().getThemedIcon(row.iconId);
}
label.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
label.setCompoundDrawablePadding(AndroidUtils.dpToPx(mapActivity, 16f));

View file

@ -193,7 +193,7 @@ public class DashTrackFragment extends DashBaseFragment {
}
});
} else {
showOnMap.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_show_on_map));
showOnMap.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_show_on_map));
showOnMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -189,9 +189,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
final boolean isRecording = app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get();
ImageButton stop = ((ImageButton) v.findViewById(R.id.stop));
if (isRecording) {
stop.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_rec_stop));
stop.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_rec_stop));
} else {
stop.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_rec_start));
stop.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_rec_start));
}
stop.setOnClickListener(new View.OnClickListener() {
@Override
@ -217,7 +217,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
} else {
save.setVisibility(View.GONE);
}
save.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_gsave_dark));
save.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_gsave_dark));
((TextView) v.findViewById(R.id.points_count)).setText(String.valueOf(sth.getPoints()));
((TextView) v.findViewById(R.id.distance))
@ -225,10 +225,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
v.findViewById(R.id.points_icon).setVisibility(View.VISIBLE);
ImageView distance = (ImageView) v.findViewById(R.id.distance_icon);
distance.setVisibility(View.VISIBLE);
distance.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_distance));
distance.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_distance));
ImageView pointsCount = (ImageView) v.findViewById(R.id.points_icon);
pointsCount.setVisibility(View.VISIBLE);
pointsCount.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_point));
pointsCount.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_point));
}
@ -772,7 +772,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
ImageView icon = (ImageView) v.findViewById(R.id.icon);
ImageButton options = (ImageButton) v.findViewById(R.id.options);
options.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_overflow_menu_white));
options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -952,7 +952,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map).setIcon(iconsCache.getContentIcon(R.drawable.ic_show_on_map));
MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map).setIcon(iconsCache.getThemedIcon(R.drawable.ic_show_on_map));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -962,7 +962,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
});
item = optionsMenu.getMenu().add(R.string.shared_string_rename)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_edit_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -978,7 +978,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
});
item = optionsMenu.getMenu().add(R.string.shared_string_share)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_gshare_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_gshare_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -993,7 +993,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
final OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class);
if (osmEditingPlugin != null && osmEditingPlugin.isActive()) {
item = optionsMenu.getMenu().add(R.string.shared_string_export).setIcon(iconsCache.getContentIcon(R.drawable.ic_action_export));
item = optionsMenu.getMenu().add(R.string.shared_string_export).setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_export));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -1005,7 +1005,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
item = optionsMenu.getMenu().add(R.string.shared_string_delete)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_delete_dark));
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -1287,7 +1287,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
// ImageView icon = (ImageView) v.findViewById(!isDashItem? R.id.icon : R.id.show_on_map);
ImageView icon = (ImageView) v.findViewById(R.id.icon);
icon.setVisibility(View.VISIBLE);
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_gpx_track));
icon.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_gpx_track));
if (child.isCorrupted()) {
viewName.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
} else {
@ -1327,13 +1327,13 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
v.findViewById(R.id.unknown_section).setVisibility(View.GONE);
ImageView distanceI = (ImageView) v.findViewById(R.id.distance_icon);
distanceI.setVisibility(View.VISIBLE);
distanceI.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_distance));
distanceI.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_distance));
ImageView pointsI = (ImageView) v.findViewById(R.id.points_icon);
pointsI.setVisibility(View.VISIBLE);
pointsI.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_point));
pointsI.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_point));
ImageView timeI = (ImageView) v.findViewById(R.id.time_icon);
timeI.setVisibility(View.VISIBLE);
timeI.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_time));
timeI.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_time));
TextView time = (TextView) v.findViewById(R.id.time);
TextView distance = (TextView) v.findViewById(R.id.distance);
TextView pointsCount = (TextView) v.findViewById(R.id.points_count);

View file

@ -463,9 +463,9 @@ public class SelectedGPXFragment extends OsmAndListFragment {
icon.setVisibility(View.VISIBLE);
additional.setVisibility(View.INVISIBLE);
if (child.group.getType() == GpxDisplayItemType.TRACK_SEGMENT) {
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_polygom_dark));
icon.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_polygom_dark));
} else if (child.group.getType() == GpxDisplayItemType.TRACK_ROUTE_POINTS) {
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_markers_dark));
icon.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_markers_dark));
} else {
int groupColor = child.group.getColor();
if (child.locationStart != null) {

View file

@ -106,7 +106,7 @@ public class DashOsmEditsFragment extends DashBaseFragment
OsmEditsFragment.getOsmEditView(view, point, getMyApplication());
ImageButton send = (ImageButton) view.findViewById(R.id.play);
send.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_export));
send.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_export));
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -416,7 +416,7 @@ public class OsmEditsFragment extends OsmAndListFragment
}
((ImageView) options).setImageDrawable(getMyApplication().getIconsCache()
.getContentIcon(R.drawable.ic_overflow_menu_white));
.getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -454,7 +454,7 @@ public class OsmEditsFragment extends OsmAndListFragment
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map).
setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_show_on_map));
setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_show_on_map));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -466,7 +466,7 @@ public class OsmEditsFragment extends OsmAndListFragment
});
if (info instanceof OpenstreetmapPoint && info.getAction() != Action.DELETE) {
item = optionsMenu.getMenu().add(R.string.poi_context_menu_modify_osm_change)
.setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_edit_dark));
.setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_action_edit_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@ -482,7 +482,7 @@ public class OsmEditsFragment extends OsmAndListFragment
});
}
item = optionsMenu.getMenu().add(R.string.shared_string_delete).
setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_delete_dark));
setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -494,7 +494,7 @@ public class OsmEditsFragment extends OsmAndListFragment
}
});
item = optionsMenu.getMenu().add(R.string.local_openstreetmap_upload).
setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_export));
setIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_action_export));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -274,8 +274,8 @@ public class OsmEditsUploadListenerHelper implements OsmEditsUploadListener {
holder.pointNameTextView.setText(pointWrapper.point);
IconsCache cache = ((OsmandApplication) context.getApplication()).getIconsCache();
holder.checkedUncheckedImageView.setImageDrawable(pointWrapper.hasError ?
cache.getContentIcon(R.drawable.ic_action_remove_dark) :
cache.getContentIcon(R.drawable.ic_action_done));
cache.getThemedIcon(R.drawable.ic_action_remove_dark) :
cache.getThemedIcon(R.drawable.ic_action_done));
return row;
}

View file

@ -152,7 +152,7 @@ public class DashOsMoFragment extends DashLocationFragment implements OsMoGroups
ImageButton share = (ImageButton) header.findViewById(R.id.share);
IconsCache cache = getMyApplication().getIconsCache();
share.setImageDrawable(cache.getContentIcon(R.drawable.ic_action_gshare_dark));
share.setImageDrawable(cache.getThemedIcon(R.drawable.ic_action_gshare_dark));
share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -291,10 +291,10 @@ public class DashOsMoFragment extends DashLocationFragment implements OsMoGroups
ImageView icon = (ImageView) v.findViewById(R.id.icon);
if (device.isEnabled()) {
icon.setImageDrawable(getMyApplication().getIconsCache().
getPaintedContentIcon(R.drawable.ic_person, device.getColor()));
getPaintedIcon(R.drawable.ic_person, device.getColor()));
} else {
icon.setImageDrawable(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_person));
getThemedIcon(R.drawable.ic_person));
}
((TextView) v.findViewById(R.id.name)).setText(name);

View file

@ -341,8 +341,6 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
final Drawable srcSignalBig = getResources().getDrawable(R.drawable.mon_osmo_conn_signal_big);
// final Drawable srcinactive = getResources().getDrawable(R.drawable.mon_osmo_inactive);
final Drawable srcSignalinactive = getResources().getDrawable(R.drawable.mon_osmo_signal_inactive);
// final Drawable srcSignalinactive = app.getIconsCache().getPaintedContentIcon(R.drawable.mon_osmo_signal_inactive,
// Color.LTGRAY);
OsMoService service = osMoPlugin.getService();
OsMoTracker tracker = osMoPlugin.getTracker();
@ -864,7 +862,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
}
};
ImageButton info = (ImageButton) v.findViewById(R.id.info);
info.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_gabout_dark));
info.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_gabout_dark));
info.setOnClickListener(click);
warnCreateDesc.setOnClickListener(click);