This commit is contained in:
GaidamakUA 2015-10-23 16:46:39 +03:00
commit d8c0e5f539
7 changed files with 42 additions and 16 deletions

View file

@ -14,7 +14,7 @@
android:insetRight="@dimen/map_button_inset_shadow" android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" > android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" > <shape android:shape="oval" >
<solid android:color="@color/fab_color" /> <solid android:color="@color/map_widget_blue" />
</shape> </shape>
</inset> </inset>
</item> </item>

View file

@ -14,7 +14,7 @@
android:insetRight="@dimen/map_button_inset_shadow" android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" > android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" > <shape android:shape="oval" >
<solid android:color="@color/fab_color_pressed" /> <solid android:color="@color/map_widget_blue_pressed" />
</shape> </shape>
</inset> </inset>
</item> </item>

View file

@ -24,7 +24,7 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/share_menu_title" android:text="@string/share_menu_location"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_list_text_size"/> android:textSize="@dimen/default_list_text_size"/>

View file

@ -2266,4 +2266,25 @@
<string name="poi_tomb_crypt">Type: krypt</string> <string name="poi_tomb_crypt">Type: krypt</string>
<string name="poi_tomb_pyramid">Type: pyramide</string> <string name="poi_tomb_pyramid">Type: pyramide</string>
<string name="poi_historic_civilization_ancient_roman">Civilisation: antik romersk</string>
<string name="poi_historic_civilization_nuragic">Civilisation: nuragherkulturen</string>
<string name="poi_historic_civilization_etruscan">Civilisation: etruskisk</string>
<string name="poi_historic_civilization_prehistoric">Civilisation: forhistorisk</string>
<string name="poi_historic_civilization_ancient_greek">Civilisation: oldgræsk</string>
<string name="poi_historic_civilization_roman">Civilisation: romersk</string>
<string name="poi_historic_civilization_byzantine">Civilisation: byzantinsk</string>
<string name="poi_historic_civilization_imperial_chinese">Civilisation: kinesiske dynastier</string>
<string name="poi_historic_civilization_ancient_egyptian">Civilisation: gammelegyptisk</string>
<string name="poi_historic_civilization_celtic">Civilisation: celtic</string>
<string name="poi_historic_civilization_western_roman">Civilisation: vestlig romersk</string>
<string name="poi_historic_civilization_mycenaean">Civilisation: mykensk</string>
<string name="poi_historic_civilization_dacian">Civilisation: daker</string>
<string name="poi_historic_civilization_hernici">Civilisation: herniker</string>
<string name="poi_historic_civilization_greek_egyptian">Civilisation: græsk egyptisk</string>
<string name="poi_historic_civilization_roman_and_byzantine_egyptian">Civilisation: romersk og byzantinsk egyptisk</string>
<string name="poi_historic_civilization_helladic">Civilisation: helladisk</string>
<string name="poi_historic_civilization_cycladic">Civilisation: kykladisk</string>
<string name="poi_historic_civilization_minoan">Civilisation: minoisk</string>
<string name="poi_historic_civilization_tiahuanacota">Civilisation: tiahuanacota</string>
</resources> </resources>

View file

@ -2194,4 +2194,5 @@
<string name="share_menu_location">Del placering</string> <string name="share_menu_location">Del placering</string>
<string name="shared_string_send">Send</string> <string name="shared_string_send">Send</string>
<string name="hello_blank_fragment">Hej tomme fragment</string> <string name="hello_blank_fragment">Hej tomme fragment</string>
<string name="application_dir_description">Vælg hvor kortfilerne skal gemmes.</string>
</resources> </resources>

View file

@ -193,7 +193,7 @@ public class MapContextMenuFragment extends Fragment {
showOnMap(menu.getLatLon(), true, false); showOnMap(menu.getLatLon(), true, false);
if (hasMoved) { if (hasMoved) {
applyPosY(getViewY(), false); applyPosY(getViewY(), false, false);
} }
return true; return true;
} }
@ -217,7 +217,7 @@ public class MapContextMenuFragment extends Fragment {
hasMoved = true; hasMoved = true;
float y = event.getY(); float y = event.getY();
float newY = getViewY() + (y - dy); float newY = getViewY() + (y - dy);
setViewY((int) newY, false); setViewY((int) newY, false, false);
menuFullHeight = view.getHeight() - (int) newY + 10; menuFullHeight = view.getHeight() - (int) newY + 10;
if (!oldAndroid()) { if (!oldAndroid()) {
@ -246,13 +246,16 @@ public class MapContextMenuFragment extends Fragment {
boolean needCloseMenu = false; boolean needCloseMenu = false;
int oldMenuState = menu.getCurrentMenuState();
if (menuBottomViewHeight > 0 && slidingUp) { if (menuBottomViewHeight > 0 && slidingUp) {
menu.slideUp(); menu.slideUp();
} else if (slidingDown) { } else if (slidingDown) {
needCloseMenu = !menu.slideDown(); needCloseMenu = !menu.slideDown();
} }
int newMenuState = menu.getCurrentMenuState();
boolean needMapAdjust = oldMenuState != newMenuState && newMenuState != MenuController.MenuState.FULL_SCREEN;
applyPosY(currentY, needCloseMenu); applyPosY(currentY, needCloseMenu, needMapAdjust);
break; break;
@ -260,7 +263,7 @@ public class MapContextMenuFragment extends Fragment {
return true; return true;
} }
private void applyPosY(final int currentY, final boolean needCloseMenu) { private void applyPosY(final int currentY, final boolean needCloseMenu, boolean needMapAdjust) {
final int posY = getPosY(needCloseMenu); final int posY = getPosY(needCloseMenu);
if (currentY != posY) { if (currentY != posY) {
if (posY < currentY) { if (posY < currentY) {
@ -297,9 +300,11 @@ public class MapContextMenuFragment extends Fragment {
.setInterpolator(new DecelerateInterpolator()) .setInterpolator(new DecelerateInterpolator())
.start(); .start();
if (needMapAdjust) {
adjustMapPosition(posY, true); adjustMapPosition(posY, true);
}
} else { } else {
setViewY(posY, false); setViewY(posY, false, needMapAdjust);
updateMainViewLayout(posY); updateMainViewLayout(posY);
} }
} }
@ -576,7 +581,7 @@ public class MapContextMenuFragment extends Fragment {
} }
} }
private void setViewY(int y, boolean animated) { private void setViewY(int y, boolean animated, boolean adjustMapPos) {
if (!oldAndroid()) { if (!oldAndroid()) {
mainView.setY(y); mainView.setY(y);
fabView.setY(getFabY(y)); fabView.setY(getFabY(y));
@ -585,7 +590,9 @@ public class MapContextMenuFragment extends Fragment {
fabView.setPadding(0, getFabY(y), 0, 0); fabView.setPadding(0, getFabY(y), 0, 0);
} }
if (!customMapCenter) { if (!customMapCenter) {
if (adjustMapPos) {
adjustMapPosition(y, animated); adjustMapPosition(y, animated);
}
} else { } else {
customMapCenter = false; customMapCenter = false;
} }
@ -645,7 +652,7 @@ public class MapContextMenuFragment extends Fragment {
private void doLayoutMenu() { private void doLayoutMenu() {
final int posY = getPosY(); final int posY = getPosY();
setViewY(posY, true); setViewY(posY, true, true);
updateMainViewLayout(posY); updateMainViewLayout(posY);
} }

View file

@ -2,16 +2,13 @@ package net.osmand.plus.mapcontextmenu.details;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.widget.ArrayAdapter;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.search.SearchHistoryFragment;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.parkingpoint.ParkingPositionPlugin; import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
@ -76,7 +73,7 @@ public class ParkingPositionController extends MenuController {
@Override @Override
public String getTitleButtonCaption() { public String getTitleButtonCaption() {
return getMapActivity().getText(R.string.osmand_parking_delete).toString(); return getMapActivity().getString(R.string.osmand_parking_delete);
} }
@Override @Override