diff --git a/OsmAnd/res/layout/main.xml b/OsmAnd/res/layout/main.xml
index d66cce8b72..93c8d907aa 100644
--- a/OsmAnd/res/layout/main.xml
+++ b/OsmAnd/res/layout/main.xml
@@ -1,9 +1,23 @@
-
-
+
+
+
-
-
+
+
+
diff --git a/OsmAnd/res/values-ko/strings.xml b/OsmAnd/res/values-ko/strings.xml
index 2110c0e4a6..74a4321825 100644
--- a/OsmAnd/res/values-ko/strings.xml
+++ b/OsmAnd/res/values-ko/strings.xml
@@ -493,7 +493,7 @@ OsmAnd 는 Openstreetmap.org (OSM) 데이터 기반의 맵을 사용하며 -맵
인덱스 \'\'{0}\'\' 가 메모리에 적합하지 않습니다
인덱스 \'\'{0}\'\' 버전은 지원되지 않습니다
- OsmAnd 라우팅 >20km
+ OsmAnd 라우팅 서비스 >20km
20km 이상 긴 거리를 위해 CloudMade 대신에 OsmAnd 오프라인 라우팅을 사용합니다
OsmAnd 오프라인 라우팅은 실험적인 기능이며 20 km 이상의 거리에서는 동작하지 않습니다.\n\n라우팅 서비스는 일시적으로 온라인서비스인 CloudMade로 변경합니다.
지정한 폴더를 찾을 수 없습니다.
@@ -1174,7 +1174,7 @@ OsmAnd 는 Openstreetmap.org (OSM) 데이터 기반의 맵을 사용하며 -맵
라우팅을 중지하시겠습니까 ?
목적지를 취소하시겠습니까?
고장 없이 정확한 경로를 계산(라우팅) 할 수 있습니다 (여전히 거리 제한하고 느린 속도로).
- 정확한 길찾기:라우팅 (알파)
+ 정확한 라우팅 모드
표시
사진 %1$s of %2$s
사진 찍기
diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index 08eb8bbc77..eb736b610d 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -67,5 +67,7 @@
#33888888
#ff33b5e5
#b9b9b9
+
+ #303030
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index f9c34ddd02..a90f81a685 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -10,6 +10,13 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.opengl.GLSurfaceView;
+import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.support.v4.app.ActionBarDrawerToggle;
+import android.support.v4.widget.DrawerLayout;
+import com.actionbarsherlock.app.ActionBar;
import net.osmand.Location;
import net.osmand.StateChangedListener;
import net.osmand.access.AccessibilityPlugin;
@@ -102,6 +109,8 @@ public class MapActivity extends AccessibleActivity {
private FrameLayout lockView;
private GpxImportHelper gpxImportHelper;
private MapViewBaseController mapViewController;
+ private ActionBarDrawerToggle mDrawerToggle;
+ private DrawerLayout mDrawerLayout;
private Notification getNotification() {
@@ -128,7 +137,7 @@ public class MapActivity extends AccessibleActivity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Full screen is not used here
//getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
-
+ //getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
startProgressDialog = new ProgressDialog(this);
startProgressDialog.setCancelable(true);
app.checkApplicationIsBeingInitialized(this, startProgressDialog);
@@ -206,12 +215,40 @@ public class MapActivity extends AccessibleActivity {
}
gpxImportHelper = new GpxImportHelper(this, getMyApplication(), getMapView());
+
+// ActionBar actionBar = getSupportActionBar();
+// actionBar.setDisplayHomeAsUpEnabled(true);
+// actionBar.setHomeButtonEnabled(true);
+// actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#330000ff")));
+// actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#550000ff")));
+
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+ mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer_light,
+ R.string.default_buttons_other_actions, R.string.close);
}
public void addLockView(FrameLayout lockView) {
this.lockView = lockView;
}
+ public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) {
+ if (item.getItemId() == android.R.id.home && mDrawerToggle.isDrawerIndicatorEnabled()) {
+ if (mDrawerLayout.isDrawerOpen(findViewById(R.id.left_drawer))) {
+ mDrawerLayout.closeDrawer(findViewById(R.id.left_drawer));
+ } else {
+ mapActions.openOptionsMenuAsDrawer();
+ }
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ mDrawerToggle.syncState();
+ }
+
private void createProgressBarForRouting() {
FrameLayout parent = (FrameLayout) mapViewController.getParentView();
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
@@ -241,7 +278,13 @@ public class MapActivity extends AccessibleActivity {
});
}
-
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ mDrawerToggle.onConfigurationChanged(newConfig);
+ }
+
@SuppressWarnings("rawtypes")
public Object getLastNonConfigurationInstanceByKey(String key) {
Object k = super.getLastNonConfigurationInstance();
@@ -272,9 +315,10 @@ public class MapActivity extends AccessibleActivity {
mapViewController.resume();
cancelNotification();
//fixing bug with action bar appearing on android 2.3.3
- if (getSupportActionBar() != null){
- getSupportActionBar().hide();
- }
+// if (getSupportActionBar() != null){
+// getSupportActionBar().hide();
+// }
+
if (settings.MAP_SCREEN_ORIENTATION.get() != getRequestedOrientation()) {
setRequestedOrientation(settings.MAP_SCREEN_ORIENTATION.get());
// can't return from this method we are not sure if activity will be recreated or not
@@ -459,7 +503,7 @@ public class MapActivity extends AccessibleActivity {
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) {
- mapActions.openOptionsMenuAsList();
+ mapActions.openOptionsMenuAsDrawer();
return true;
} else if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
Intent newIntent = new Intent(MapActivity.this, getMyApplication().getAppCustomization().getSearchActivity());
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index 405ea5e422..c21b413b02 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -10,6 +10,9 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.widget.*;
import net.londatiga.android.ActionItem;
import net.londatiga.android.QuickAction;
import net.osmand.AndroidUtils;
@@ -67,17 +70,6 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.WindowManager;
-import android.widget.ArrayAdapter;
-import android.widget.AutoCompleteTextView;
-import android.widget.Button;
-import android.widget.CheckBox;
-import android.widget.EditText;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ListAdapter;
-import android.widget.TextView;
-import android.widget.Toast;
public class MapActivityActions implements DialogProvider {
@@ -731,7 +723,41 @@ public class MapActivityActions implements DialogProvider {
}
}
-
+ public void openOptionsMenuAsDrawer(){
+ final ContextMenuAdapter cm = createOptionsMenu();
+ final DrawerLayout mDrawerLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout);
+ final ListView mDrawerList = (ListView) mapActivity.findViewById(R.id.left_drawer);
+ mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
+ ListAdapter listAdapter ;
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){
+ listAdapter =
+ cm.createListAdapter(mapActivity, R.layout.list_menu_item, getMyApplication().getSettings().isLightContentMenu());
+ } else {
+ listAdapter =
+ cm.createListAdapter(mapActivity, R.layout.list_menu_item_native, getMyApplication().getSettings().isLightContentMenu());
+ }
+ mDrawerList.setAdapter(listAdapter);
+
+ if (getMyApplication().getSettings().isLightContentMenu()){
+ mDrawerList.setBackgroundColor(mapActivity.getResources().getColor(R.color.shadow_color));
+ } else {
+ mDrawerList.setBackgroundColor(mapActivity.getResources().getColor(R.color.dark_drawer_bg_color));
+ }
+ mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int which, long id) {
+ OnContextMenuClick click = cm.getClickAdapter(which);
+ if (click != null) {
+ click.onContextMenuClick(cm.getItemId(which), which, false, null);
+ }
+ mDrawerLayout.closeDrawer(mDrawerList);
+ }
+ });
+
+ mDrawerLayout.openDrawer(mDrawerList);
+ }
+
public AlertDialog openOptionsMenuAsList() {
final ContextMenuAdapter cm = createOptionsMenu();
final Builder bld = new AlertDialog.Builder(mapActivity);
@@ -753,7 +779,6 @@ public class MapActivityActions implements DialogProvider {
}
});
return bld.show();
-
}
private ContextMenuAdapter createOptionsMenu() {
diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
index cfa4ac1663..efddb224c5 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
@@ -3,6 +3,7 @@ package net.osmand.plus.helpers;
import java.util.ArrayList;
import java.util.List;
+import android.support.v4.widget.DrawerLayout;
import net.osmand.Location;
import net.osmand.data.LatLon;
import net.osmand.data.LocationPoint;
@@ -47,7 +48,7 @@ import android.widget.TextView;
public class WaypointDialogHelper implements OsmAndLocationListener {
private MapActivity mapActivity;
private OsmandApplication app;
- private FrameLayout mainLayout;
+ private DrawerLayout mainLayout;
private WaypointHelper waypointHelper;
public final static boolean OVERLAP_LAYOUT = true; // only true is supported
@@ -59,25 +60,26 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
this.app = mapActivity.getMyApplication();
waypointHelper = this.app.getWaypointHelper();
this.mapActivity = mapActivity;
- this.mainLayout = (FrameLayout) ((FrameLayout) mapActivity.getLayout()).getChildAt(0);
+ this.mainLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout);
+
}
-
+
public void init() {
app.getLocationProvider().addLocationListener(this);
}
-
+
@Override
public void updateLocation(Location location) {
- if(mapActivity != null) {
+ if (mapActivity != null) {
updateDialog();
}
}
-
+
public void removeListener() {
app.getLocationProvider().removeLocationListener(this);
mapActivity = null;
}
-
+
@SuppressWarnings("deprecation")
public void updateDialog() {
@@ -100,7 +102,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
all.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- showWaypointsDialog(mapActivity);
+ showWaypointsDialog(mapActivity);
}
});
@@ -120,7 +122,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
}
private static void updatePointInfoView(final OsmandApplication app, final Activity ctx,
- View localView, final LocationPointWrapper ps, final DialogFragment dialog) {
+ View localView, final LocationPointWrapper ps, final DialogFragment dialog) {
WaypointHelper wh = app.getWaypointHelper();
final LocationPoint point = ps.getPoint();
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
@@ -200,47 +202,47 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
wdf.setArguments(args);
fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit();
}
-
+
public static void showWaypointsDialog(FragmentActivity fragmentActivity) {
Bundle args = new Bundle();
WaypointDialogFragment wdf = new WaypointDialogFragment();
wdf.setArguments(args);
fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit();
}
-
+
public static class WaypointDialogFragment extends DialogFragment {
-
+
WaypointHelper waypointHelper;
private OsmandApplication app;
-
- public static final String FLAT_ARG = "FLAT_ARG";
-
+
+ public static final String FLAT_ARG = "FLAT_ARG";
+
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
app = (OsmandApplication) activity.getApplication();
waypointHelper = app.getWaypointHelper();
}
-
+
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
- if(getArguments() != null && getArguments().getBoolean(FLAT_ARG)) {
+ if (getArguments() != null && getArguments().getBoolean(FLAT_ARG)) {
return createWaypointsDialogFlat(waypointHelper.getAllPoints());
}
return createWaypointsDialog();
}
-
+
private void selectPoi(final int[] running, final ArrayAdapter