diff --git a/OsmAnd/src/net/osmand/plus/profiles/AppProfileArrayAdapter.java b/OsmAnd/src/net/osmand/plus/profiles/AppProfileArrayAdapter.java index cde5553a57..0128d4da54 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/AppProfileArrayAdapter.java +++ b/OsmAnd/src/net/osmand/plus/profiles/AppProfileArrayAdapter.java @@ -21,13 +21,14 @@ public class AppProfileArrayAdapter extends ArrayAdapter { private Activity context; private List modes; private int layout; - private int colorRes; + private OsmandApplication app; public AppProfileArrayAdapter(@NonNull Activity context, int resource, @NonNull List objects) { super(context, resource, objects); this.context = context; this.modes = objects; this.layout = resource; + app = (OsmandApplication) context.getApplication(); } public long getItemId(int position) { @@ -61,17 +62,10 @@ public class AppProfileArrayAdapter extends ArrayAdapter { ProfileDataObject mode = modes.get(position); Drawable iconDrawable; - if (getMyApp(context) != null) { - if (mode.isSelected()) { - iconDrawable = getMyApp(context).getUIUtilities().getIcon(mode.getIconRes(), - mode.getIconColor(!getMyApp(context).getSettings().isLightContent()) - ); - } else { - iconDrawable = getMyApp(context).getUIUtilities() - .getIcon(mode.getIconRes(), R.color.profile_icon_color_inactive); - } + if (mode.isSelected()) { + iconDrawable = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColor(!app.getSettings().isLightContent())); } else { - iconDrawable = context.getDrawable(mode.getIconRes()); + iconDrawable = app.getUIUtilities().getIcon(mode.getIconRes(), R.color.profile_icon_color_inactive); } viewHolder.title.setText(mode.getName()); @@ -81,13 +75,4 @@ public class AppProfileArrayAdapter extends ArrayAdapter { return rowView; } - - private OsmandApplication getMyApp(Activity context) { - Application app = context.getApplication(); - if (app instanceof OsmandApplication) { - return (OsmandApplication) app; - } else { - return null; - } - } } diff --git a/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java b/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java index 9acfc8930e..f03038c6ec 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java @@ -246,13 +246,6 @@ public class EditProfileFragment extends BaseOsmAndFragment { } int iconColor = profile.iconColor.getColor(nightMode); -// if (isNew) { -// iconColor = profile.iconColor.getColor(nightMode); -// } else if (isUserProfile) { -// iconColor = profile.iconColor.getColor(nightMode); -// } else { -// iconColor = R.color.icon_color; -// } profileIcon.setImageDrawable(app.getUIUtilities().getIcon(startIconId, iconColor)); colorSample.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_circle, iconColor));