Context menu small refactor, make left icon look nicer

This commit is contained in:
Alexey Kulish 2015-11-09 11:52:43 +03:00
parent 212f9cbe75
commit 52d1376815
17 changed files with 10 additions and 74 deletions

View file

@ -43,12 +43,11 @@
<ImageView <ImageView
android:id="@+id/context_menu_icon_view" android:id="@+id/context_menu_icon_view"
android:layout_width="match_parent" android:layout_width="@dimen/standard_icon_size"
android:layout_height="wrap_content" android:layout_height="@dimen/standard_icon_size"
android:layout_marginLeft="12dp" android:layout_marginLeft="16dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginTop="18dp" android:layout_marginTop="18dp"
android:scaleType="center"
android:src="@drawable/ic_action_building_number"/> android:src="@drawable/ic_action_building_number"/>
</LinearLayout> </LinearLayout>

View file

@ -15,12 +15,11 @@
<ImageView <ImageView
android:id="@+id/context_menu_icon_view" android:id="@+id/context_menu_icon_view"
android:layout_width="match_parent" android:layout_width="@dimen/standard_icon_size"
android:layout_height="wrap_content" android:layout_height="@dimen/standard_icon_size"
android:layout_marginLeft="12dp" android:layout_marginLeft="16dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginTop="18dp" android:layout_marginTop="18dp"
android:scaleType="center"
android:src="@drawable/ic_action_building_number"/> android:src="@drawable/ic_action_building_number"/>
</LinearLayout> </LinearLayout>

View file

@ -531,7 +531,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
iconLayout.setVisibility(View.VISIBLE); iconLayout.setVisibility(View.VISIBLE);
} else if (iconId != 0) { } else if (iconId != 0) {
iconView.setImageDrawable(iconsCache.getIcon(iconId, iconView.setImageDrawable(iconsCache.getIcon(iconId,
light ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); light ? R.color.osmand_orange : R.color.osmand_orange_dark));
iconLayout.setVisibility(View.VISIBLE); iconLayout.setVisibility(View.VISIBLE);
} else { } else {
iconLayout.setVisibility(View.GONE); iconLayout.setVisibility(View.GONE);

View file

@ -75,9 +75,4 @@ public class AmenityMenuController extends MenuController {
} }
addMyLocationToPlainItems(pointDescription, amenity.getLocation()); addMyLocationToPlainItems(pointDescription, amenity.getLocation());
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
} }

View file

@ -85,11 +85,6 @@ public class AudioVideoNoteMenuController extends MenuController {
} }
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
return recording.getType(getMapActivity()); return recording.getType(getMapActivity());

View file

@ -134,11 +134,6 @@ public class EditPOIMenuController extends MenuController {
return getIcon(R.drawable.ic_action_gabout_dark, R.color.osmand_orange_dark, R.color.osmand_orange); return getIcon(R.drawable.ic_action_gabout_dark, R.color.osmand_orange_dark, R.color.osmand_orange);
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
return pointTypeStr; return pointTypeStr;

View file

@ -55,7 +55,7 @@ public class FavouritePointMenuController extends MenuController {
@Override @Override
public Drawable getLeftIcon() { public Drawable getLeftIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), true); return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false);
} }
@Override @Override
@ -73,9 +73,4 @@ public class FavouritePointMenuController extends MenuController {
return fav.getCategory().length() == 0 ? return fav.getCategory().length() == 0 ?
getMapActivity().getString(R.string.shared_string_favorites) : fav.getCategory(); getMapActivity().getString(R.string.shared_string_favorites) : fav.getCategory();
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
} }

View file

@ -50,11 +50,6 @@ public class HistoryMenuController extends MenuController {
} }
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
if (needTypeStr()) { if (needTypeStr()) {

View file

@ -35,7 +35,6 @@ public class MapDataMenuController extends MenuController {
private WorldRegion region; private WorldRegion region;
private IndexItem indexItem; private IndexItem indexItem;
private List<IndexItem> otherIndexItems; private List<IndexItem> otherIndexItems;
private String name;
private DownloadValidationManager downloadValidationManager; private DownloadValidationManager downloadValidationManager;
private DownloadIndexesThread downloadThread; private DownloadIndexesThread downloadThread;
@ -45,7 +44,6 @@ public class MapDataMenuController extends MenuController {
OsmandRegions osmandRegions = app.getRegions(); OsmandRegions osmandRegions = app.getRegions();
String fullName = osmandRegions.getFullName(dataObject); String fullName = osmandRegions.getFullName(dataObject);
this.region = osmandRegions.getRegionData(fullName); this.region = osmandRegions.getRegionData(fullName);
name = getPointDescription().getName();
downloadValidationManager = new DownloadValidationManager(app); downloadValidationManager = new DownloadValidationManager(app);
downloadThread = app.getDownloadThread(); downloadThread = app.getDownloadThread();
@ -120,11 +118,6 @@ public class MapDataMenuController extends MenuController {
return getIcon(R.drawable.ic_map, R.color.osmand_orange_dark, R.color.osmand_orange); return getIcon(R.drawable.ic_map, R.color.osmand_orange_dark, R.color.osmand_orange);
} }
@Override
public String getNameStr() {
return name;
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
String res; String res;

View file

@ -25,9 +25,4 @@ public class MyLocationMenuController extends MenuController {
ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode(); ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode();
return getMapActivity().getResources().getDrawable(appMode.getResourceLocation()); return getMapActivity().getResources().getDrawable(appMode.getResourceLocation());
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
} }

View file

@ -40,11 +40,6 @@ public class OsMoMenuController extends MenuController {
} }
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
OsmandApplication app = getMapActivity().getMyApplication(); OsmandApplication app = getMapActivity().getMyApplication();

View file

@ -61,11 +61,6 @@ public class ParkingPositionMenuController extends MenuController {
return getIcon(R.drawable.ic_action_parking_dark, R.color.map_widget_blue, R.color.osmand_orange); return getIcon(R.drawable.ic_action_parking_dark, R.color.map_widget_blue, R.color.osmand_orange);
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
return parkingDescription; return parkingDescription;

View file

@ -52,11 +52,6 @@ public class PointDescriptionMenuController extends MenuController {
} }
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
if (needTypeStr()) { if (needTypeStr()) {

View file

@ -68,11 +68,6 @@ public class TargetPointMenuController extends MenuController {
} }
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
@Override @Override
public String getTypeStr() { public String getTypeStr() {
return targetPoint.getPointDescription(getMapActivity()).getTypeName(); return targetPoint.getPointDescription(getMapActivity()).getTypeName();

View file

@ -70,9 +70,4 @@ public class WptPtMenuController extends MenuController {
public String getTypeStr() { public String getTypeStr() {
return wpt.category != null ? wpt.category : getMapActivity().getString(R.string.shared_string_none); return wpt.category != null ? wpt.category : getMapActivity().getString(R.string.shared_string_none);
} }
@Override
public String getNameStr() {
return getPointDescription().getName();
}
} }

View file

@ -210,7 +210,7 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
if (group != null) { if (group != null) {
color = group.color; color = group.color;
} }
return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, true); return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, false);
} }
@Override @Override

View file

@ -142,7 +142,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi
iconLayout.setVisibility(View.VISIBLE); iconLayout.setVisibility(View.VISIBLE);
} else if (iconId != 0) { } else if (iconId != 0) {
iconView.setImageDrawable(iconsCache.getIcon(iconId, iconView.setImageDrawable(iconsCache.getIcon(iconId,
menu.isLight() ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); menu.isLight() ? R.color.osmand_orange : R.color.osmand_orange_dark));
iconLayout.setVisibility(View.VISIBLE); iconLayout.setVisibility(View.VISIBLE);
} else { } else {
iconLayout.setVisibility(View.GONE); iconLayout.setVisibility(View.GONE);