diff --git a/OsmAnd/res/layout/dash_favorites_fragment.xml b/OsmAnd/res/layout/dash_common_fragment.xml
similarity index 95%
rename from OsmAnd/res/layout/dash_favorites_fragment.xml
rename to OsmAnd/res/layout/dash_common_fragment.xml
index 60ff6bf115..060814f565 100644
--- a/OsmAnd/res/layout/dash_favorites_fragment.xml
+++ b/OsmAnd/res/layout/dash_common_fragment.xml
@@ -16,7 +16,7 @@
android:text="@string/show_all"
style="@style/DashboardGeneralButton"/>
-
diff --git a/OsmAnd/res/layout/dash_gpx_track_item.xml b/OsmAnd/res/layout/dash_gpx_track_item.xml
new file mode 100644
index 0000000000..c9973f7fb8
--- /dev/null
+++ b/OsmAnd/res/layout/dash_gpx_track_item.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout/dash_osmo_fragment.xml b/OsmAnd/res/layout/dash_osmo_fragment.xml
new file mode 100644
index 0000000000..c7ccac2de1
--- /dev/null
+++ b/OsmAnd/res/layout/dash_osmo_fragment.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/dash_osmo_item.xml b/OsmAnd/res/layout/dash_osmo_item.xml
new file mode 100644
index 0000000000..f36715ffb7
--- /dev/null
+++ b/OsmAnd/res/layout/dash_osmo_item.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/dashboard.xml b/OsmAnd/res/layout/dashboard.xml
index 6d4a44369c..964f6c6ec7 100644
--- a/OsmAnd/res/layout/dashboard.xml
+++ b/OsmAnd/res/layout/dashboard.xml
@@ -56,6 +56,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
+
+
@@ -63,6 +71,7 @@
+
+ Points
+ Tracks
+ My location
+ Manage
RECENTS
Start navigation over track?
You can change route by selecting roads to avoid
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java
index c45c876e89..bea912a60b 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java
@@ -55,7 +55,7 @@ public class DashFavoritesFragment extends DashBaseFragment implements Favourite
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- View view = getActivity().getLayoutInflater().inflate(R.layout.dash_favorites_fragment, container, false);
+ View view = getActivity().getLayoutInflater().inflate(R.layout.dash_common_fragment, container, false);
Typeface typeface = FontCache.getRobotoMedium(getActivity());
((TextView) view.findViewById(R.id.fav_text)).setTypeface(typeface);
((Button) view.findViewById(R.id.show_all)).setTypeface(typeface);
@@ -132,7 +132,7 @@ public class DashFavoritesFragment extends DashBaseFragment implements Favourite
return (dist - dist2);
}
});
- LinearLayout favorites = (LinearLayout) mainView.findViewById(R.id.favorites);
+ LinearLayout favorites = (LinearLayout) mainView.findViewById(R.id.items);
favorites.removeAllViews();
if (points.size() > 3){
while (points.size() != 3){
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashOsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashOsmEditsFragment.java
new file mode 100644
index 0000000000..43e9088f18
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashOsmEditsFragment.java
@@ -0,0 +1,58 @@
+package net.osmand.plus.dashboard;
+
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.R;
+import net.osmand.plus.helpers.FontCache;
+import net.osmand.plus.osmedit.OsmEditingPlugin;
+
+/**
+ * Created by Denis
+ * on 20.01.2015.
+ */
+public class DashOsmEditsFragment extends DashBaseFragment {
+ OsmEditingPlugin plugin;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ plugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class);
+
+ View view = getActivity().getLayoutInflater().inflate(R.layout.dash_audio_video_notes_plugin, container, false);
+ Typeface typeface = FontCache.getRobotoMedium(getActivity());
+ TextView header = ((TextView) view.findViewById(R.id.notes_text));
+ header.setTypeface(typeface);
+ header.setText(R.string.osm_settings);
+ Button manage = ((Button) view.findViewById(R.id.show_all));
+ manage.setTypeface(typeface);
+ manage.setText(R.string.osm_editing_manage);
+
+ return view;
+ }
+
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ if (plugin == null) {
+ plugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class);
+ }
+
+ setupEditings();
+ }
+
+ private void setupEditings() {
+ View mainView = getView();
+ if (plugin == null){
+ mainView.setVisibility(View.GONE);
+ return;
+ }
+
+
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashOsmoFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashOsmoFragment.java
new file mode 100644
index 0000000000..c757ba18a6
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashOsmoFragment.java
@@ -0,0 +1,34 @@
+package net.osmand.plus.dashboard;
+
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.R;
+import net.osmand.plus.helpers.FontCache;
+import net.osmand.plus.osmo.OsMoPlugin;
+
+/**
+ * Created by Denis
+ * on 20.01.2015.
+ */
+public class DashOsmoFragment extends DashBaseFragment {
+ OsMoPlugin plugin;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ plugin = OsmandPlugin.getEnabledPlugin(OsMoPlugin.class);
+
+ View view = getActivity().getLayoutInflater().inflate(R.layout.dash_osmo_fragment, container, false);
+ Typeface typeface = FontCache.getRobotoMedium(getActivity());
+ ((TextView) view.findViewById(R.id.osmo_text)).setTypeface(typeface);
+ Button manage = (Button) view.findViewById(R.id.manage);
+
+
+ return view;
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashTrackFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashTrackFragment.java
new file mode 100644
index 0000000000..cd90f8ea13
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashTrackFragment.java
@@ -0,0 +1,97 @@
+package net.osmand.plus.dashboard;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import net.osmand.IndexConstants;
+import net.osmand.plus.GPXUtilities;
+import net.osmand.plus.OsmAndAppCustomization;
+import net.osmand.plus.R;
+import net.osmand.plus.helpers.FontCache;
+import net.osmand.plus.helpers.GpxUiHelper;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Created by Denis
+ * on 21.01.2015.
+ */
+public class DashTrackFragment extends DashBaseFragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = getActivity().getLayoutInflater().inflate(R.layout.dash_common_fragment, container, false);
+ Typeface typeface = FontCache.getRobotoMedium(getActivity());
+ TextView header = (TextView) view.findViewById(R.id.fav_text);
+ header.setTypeface(typeface);
+ header.setText(R.string.tracks);
+ ((Button) view.findViewById(R.id.show_all)).setTypeface(typeface);
+
+ (view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Activity activity = getActivity();
+ OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
+ final Intent favorites = new Intent(activity, appCustomization.getFavoritesActivity());
+ favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ activity.startActivity(favorites);
+ }
+ });
+ return view;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ setupGpxFiles();
+ }
+
+ private void setupGpxFiles() {
+ View mainView = getView();
+ final File dir = getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR);
+ final List list = GpxUiHelper.getSortedGPXFilenames(dir);
+
+
+ if (list.size() == 0){
+ (mainView.findViewById(R.id.main_fav)).setVisibility(View.GONE);
+ return;
+ } else {
+ (mainView.findViewById(R.id.main_fav)).setVisibility(View.VISIBLE);
+ }
+
+ LinearLayout tracks = (LinearLayout) mainView.findViewById(R.id.items);
+ tracks.removeAllViews();
+ if (list.size() > 3){
+ while (list.size() != 3){
+ list.remove(3);
+ }
+ }
+
+ for (String filename : list){
+ final File f = new File(dir, filename);
+ GPXUtilities.GPXFile res = GPXUtilities.loadGPXFile(getMyApplication(), f);
+ LayoutInflater inflater = getActivity().getLayoutInflater();
+ View view = inflater.inflate(R.layout.dash_gpx_track_item, null, false);
+ ((TextView)view.findViewById(R.id.name)).setText(filename);
+ ((TextView)view.findViewById(R.id.points_count)).
+ setText(res.points.size() + " " + getActivity().getString(R.string.points));
+ String description = GpxUiHelper.getDescription(getMyApplication(), res, f, true);
+ int startindex = description.indexOf(">");
+ int endindex = description.indexOf("");
+ String distnace = description.substring(startindex + 1, endindex);
+ ((TextView)view.findViewById(R.id.distance)).
+ setText(distnace);
+ view.findViewById(R.id.time_icon).setVisibility(View.GONE);
+ //view.findViewById(R.id.distance_icon).setVisibility(View.GONE);
+ tracks.addView(view);
+ }
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java
index 309412d2a1..e4840c4e1f 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java
@@ -389,7 +389,7 @@ public class GpxUiHelper {
}
}
}
- private static List getSortedGPXFilenames(File dir) {
+ public static List getSortedGPXFilenames(File dir) {
return getSortedGPXFilenames(dir, null);
}