Rename left icon to right icon

This commit is contained in:
PavelRatushny 2017-12-27 17:07:38 +02:00
parent 16c733d726
commit e01319cd82
26 changed files with 41 additions and 42 deletions

View file

@ -86,7 +86,7 @@ public class AudioVideoNoteMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
if (mRecording.isPhoto()) {
return getIcon(R.drawable.ic_action_photo_dark, R.color.audio_video_icon_color);
} else if (mRecording.isAudio()) {

View file

@ -851,8 +851,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
OsmandApplication app = getMyApplication();
if (app != null && view != null) {
final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);
Drawable icon = menu.getLeftIcon();
int iconId = menu.getLeftIconId();
Drawable icon = menu.getRightIcon();
int iconId = menu.getRightIconId();
if (icon != null) {
iconView.setImageDrawable(icon);
iconView.setVisibility(View.VISIBLE);

View file

@ -386,11 +386,11 @@ public abstract class MenuController extends BaseMenuController {
return false;
}
public int getLeftIconId() {
public int getRightIconId() {
return 0;
}
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return null;
}

View file

@ -11,8 +11,8 @@ import net.osmand.util.Algorithms;
public abstract class MenuTitleController {
protected int leftIconId;
protected Drawable leftIcon;
protected int rightIconId;
protected Drawable rightIcon;
protected String nameStr = "";
protected String typeStr = "";
protected String commonTypeStr = "";
@ -65,12 +65,12 @@ public abstract class MenuTitleController {
return !addressNotFoundStr.equals(title) && !searchAddressStr.equals(title);
}
public int getLeftIconId() {
return leftIconId;
public int getRightIconId() {
return rightIconId;
}
public Drawable getLeftIcon() {
return leftIcon;
public Drawable getRightIcon() {
return rightIcon;
}
public Drawable getTypeIcon() {
@ -125,13 +125,13 @@ public abstract class MenuTitleController {
protected void acquireIcons() {
MenuController menuController = getMenuController();
leftIconId = 0;
leftIcon = null;
rightIconId = 0;
rightIcon = null;
secondLineTypeIcon = null;
if (menuController != null) {
leftIconId = menuController.getLeftIconId();
leftIcon = menuController.getLeftIcon();
rightIconId = menuController.getRightIconId();
rightIcon = menuController.getRightIcon();
secondLineTypeIcon = menuController.getSecondLineTypeIcon();
}
}

View file

@ -49,7 +49,7 @@ public class AMapPointMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_get_my_location);
}

View file

@ -21,7 +21,6 @@ import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.resources.TransportIndexRepository;
import net.osmand.plus.transport.TransportStopType;
import net.osmand.plus.views.POIMapLayer;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import net.osmand.util.OpeningHoursParser;
@ -109,11 +108,11 @@ public class AmenityMenuController extends MenuController {
}
@Override
public int getLeftIconId() {
return getLeftIconId(amenity);
public int getRightIconId() {
return getRightIconId(amenity);
}
private static int getLeftIconId(Amenity amenity) {
private static int getRightIconId(Amenity amenity) {
String id = null;
PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
if (st != null) {
@ -221,7 +220,7 @@ public class AmenityMenuController extends MenuController {
public static void addPlainMenuItems(Amenity amenity, String typeStr, MenuBuilder builder) {
if (!Algorithms.isEmpty(typeStr)) {
int resId = getLeftIconId(amenity);
int resId = getRightIconId(amenity);
if (resId == 0) {
PoiCategory pc = amenity.getType();
resId = RenderingIcons.getBigIconResourceId(pc.getIconKeyName());

View file

@ -102,7 +102,7 @@ public class FavouritePointMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false);
}

View file

@ -45,7 +45,7 @@ public class GpxItemMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_polygom_dark, R.color.osmand_orange);
}
}

View file

@ -52,7 +52,7 @@ public class HistoryMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return getIcon(SearchHistoryFragment.getItemIcon(entry.getName()));
}

View file

@ -53,7 +53,7 @@ public class ImpassibleRoadsMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return ContextCompat.getDrawable(getMapActivity(), R.drawable.map_pin_avoid_road);
}
}

View file

@ -231,7 +231,7 @@ public class MapDataMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
int iconResId;
if (getDownloadActivityType() != null) {
iconResId = getDownloadActivityType().getIconResource();

View file

@ -89,7 +89,7 @@ public class MapMarkerMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return MapMarkerDialogHelper.getMapMarkerIcon(getMapActivity().getMyApplication(), mapMarker.colorIndex);
}

View file

@ -42,7 +42,7 @@ public class MyLocationMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode();
return getMapActivity().getResources().getDrawable(appMode.getResourceLocationDay());
}

View file

@ -46,7 +46,7 @@ public class PointDescriptionMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return getIcon(SearchHistoryFragment.getItemIcon(getPointDescription()));
}

View file

@ -49,7 +49,7 @@ public class RenderedObjectMenuController extends MenuController {
}
@Override
public int getLeftIconId() {
public int getRightIconId() {
if (renderedObject.getIconRes() != null && RenderingIcons.containsBigIcon(renderedObject.getIconRes())) {
return RenderingIcons.getBigIconResourceId(renderedObject.getIconRes());
} else {

View file

@ -79,7 +79,7 @@ public class TargetPointMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
if (targetPoint.start) {
return getIconOrig(R.drawable.list_startpoint);
} else if (!targetPoint.intermediate) {

View file

@ -61,7 +61,7 @@ public class TransportRouteController extends MenuController {
}
@Override
public int getLeftIconId() {
public int getRightIconId() {
return this.transportRoute.type == null ?
R.drawable.mx_public_transport :
this.transportRoute.type.getTopResourceId();

View file

@ -58,7 +58,7 @@ public class TransportStopController extends MenuController {
}
@Override
public int getLeftIconId() {
public int getRightIconId() {
if (topType == null) {
return R.drawable.mx_public_transport;
} else {

View file

@ -76,7 +76,7 @@ public class WptPtMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(),
wpt.getColor(ContextCompat.getColor(getMapActivity(), R.color.gpx_color_point)), false);
}

View file

@ -49,8 +49,8 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter<MapMultiSelectionMe
IconsCache iconsCache = menu.getMapActivity().getMyApplication().getIconsCache();
final View iconLayout = convertView.findViewById(R.id.context_menu_icon_layout);
final ImageView iconView = (ImageView) convertView.findViewById(R.id.context_menu_icon_view);
Drawable icon = item.getLeftIcon();
int iconId = item.getLeftIconId();
Drawable icon = item.getRightIcon();
int iconId = item.getRightIconId();
if (icon != null) {
iconView.setImageDrawable(icon);
iconLayout.setVisibility(View.VISIBLE);

View file

@ -56,7 +56,7 @@ public class MapillaryMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_mapillary, R.color.mapillary_color);
}

View file

@ -148,7 +148,7 @@ public class EditPOIMenuController extends MenuController {
}
@Override
public int getLeftIconId() {
public int getRightIconId() {
if (osmPoint.getGroup() == OsmPoint.Group.POI) {
OpenstreetmapPoint osmP = (OpenstreetmapPoint) osmPoint;
int iconResId = 0;

View file

@ -73,7 +73,7 @@ public class OsmBugMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
if (bug.isOpened()) {
return getIcon(R.drawable.ic_action_gabout_dark, R.color.osm_bug_unresolved_icon_color);
} else {

View file

@ -96,7 +96,7 @@ public class OsMoMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
if (isLight()) {
return getIconOrig(R.drawable.widget_osmo_connected_location_day);
} else {

View file

@ -89,7 +89,7 @@ public class ParkingPositionMenuController extends MenuController {
}
@Override
public Drawable getLeftIcon() {
public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_parking_dark, R.color.map_widget_blue);
}

View file

@ -504,7 +504,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
view.setLatLon(lat, lon);
mInChangeMarkerPositionMode = true;
mMoveMarkerBottomSheetHelper.show(menu.getLeftIcon());
mMoveMarkerBottomSheetHelper.show(menu.getRightIcon());
mark(View.INVISIBLE, R.id.map_ruler_layout,
R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);