diff --git a/OsmAnd/assets/style.css b/OsmAnd/assets/style.css
new file mode 100644
index 0000000000..6b930f6502
--- /dev/null
+++ b/OsmAnd/assets/style.css
@@ -0,0 +1,8 @@
+ h3 { text-align: center}
+ h4 { text-align: center}
+ div {border-width: 1px; padding: 10px;
+ border: groove; margin-left:auto;margin-right:auto; }
+ li { text-align:justify;"}
+ img { max-width: 75%; width: auto; height: auto; }
+ p.img {text-align: center}
+
diff --git a/OsmAnd/build.xml b/OsmAnd/build.xml
index c7365a4ab1..6a4e204870 100644
--- a/OsmAnd/build.xml
+++ b/OsmAnd/build.xml
@@ -40,6 +40,11 @@
+
+
+
+
+
@@ -58,7 +63,8 @@
-
+
+
@@ -135,6 +141,14 @@
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/libs/android-support-v4.jar b/OsmAnd/libs/android-support-v4.jar
new file mode 100644
index 0000000000..187bdf48b1
Binary files /dev/null and b/OsmAnd/libs/android-support-v4.jar differ
diff --git a/OsmAnd/project.properties b/OsmAnd/project.properties
index 155a517787..da75a72a89 100644
--- a/OsmAnd/project.properties
+++ b/OsmAnd/project.properties
@@ -12,3 +12,4 @@ split.density=false
# Project target.
target=android-19
android.library.reference.1=../SherlockBar
+dex.force.jumbo=true
diff --git a/OsmAnd/res/drawable-hdpi/drawer_shadow.9.png b/OsmAnd/res/drawable-hdpi/drawer_shadow.9.png
new file mode 100644
index 0000000000..224cc4ff43
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/drawer_shadow.9.png differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_drawer_am.png b/OsmAnd/res/drawable-hdpi/ic_drawer_am.png
new file mode 100644
index 0000000000..ff7b1def9a
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_drawer_am.png differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_navigation_drawer_dark.png b/OsmAnd/res/drawable-hdpi/ic_navigation_drawer_dark.png
new file mode 100644
index 0000000000..5c9db3584a
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_navigation_drawer_dark.png differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_navigation_drawer_light.png b/OsmAnd/res/drawable-hdpi/ic_navigation_drawer_light.png
new file mode 100644
index 0000000000..68b53bbf39
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_navigation_drawer_light.png differ
diff --git a/OsmAnd/res/drawable-hdpi/icon_sherpafy.png b/OsmAnd/res/drawable-hdpi/icon_sherpafy.png
index 702303d671..5549aa0539 100644
Binary files a/OsmAnd/res/drawable-hdpi/icon_sherpafy.png and b/OsmAnd/res/drawable-hdpi/icon_sherpafy.png differ
diff --git a/OsmAnd/res/drawable-mdpi/drawer_shadow.9.png b/OsmAnd/res/drawable-mdpi/drawer_shadow.9.png
new file mode 100644
index 0000000000..3797f99c0e
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/drawer_shadow.9.png differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_drawer_am.png b/OsmAnd/res/drawable-mdpi/ic_drawer_am.png
new file mode 100644
index 0000000000..fb681ba263
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_drawer_am.png differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_navigation_drawer_dark.png b/OsmAnd/res/drawable-mdpi/ic_navigation_drawer_dark.png
new file mode 100644
index 0000000000..b7d28b5c71
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_navigation_drawer_dark.png differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_navigation_drawer_light.png b/OsmAnd/res/drawable-mdpi/ic_navigation_drawer_light.png
new file mode 100644
index 0000000000..836dde34b2
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_navigation_drawer_light.png differ
diff --git a/OsmAnd/res/drawable-mdpi/icon_sherpafy.png b/OsmAnd/res/drawable-mdpi/icon_sherpafy.png
index ac21e6a7b3..e68e47d8a5 100644
Binary files a/OsmAnd/res/drawable-mdpi/icon_sherpafy.png and b/OsmAnd/res/drawable-mdpi/icon_sherpafy.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/drawer_shadow.9.png b/OsmAnd/res/drawable-xhdpi/drawer_shadow.9.png
new file mode 100644
index 0000000000..fa3d853e90
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/drawer_shadow.9.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_drawer_am.png b/OsmAnd/res/drawable-xhdpi/ic_drawer_am.png
new file mode 100644
index 0000000000..b9bc3d70f1
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_drawer_am.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_navigation_drawer_dark.png b/OsmAnd/res/drawable-xhdpi/ic_navigation_drawer_dark.png
new file mode 100644
index 0000000000..0c6062e1fd
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_navigation_drawer_dark.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_navigation_drawer_light.png b/OsmAnd/res/drawable-xhdpi/ic_navigation_drawer_light.png
new file mode 100644
index 0000000000..204946d428
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_navigation_drawer_light.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/icon_sherpafy.png b/OsmAnd/res/drawable-xhdpi/icon_sherpafy.png
index 1c4beb81f1..a7bb49b573 100644
Binary files a/OsmAnd/res/drawable-xhdpi/icon_sherpafy.png and b/OsmAnd/res/drawable-xhdpi/icon_sherpafy.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_navigation_drawer_dark.png b/OsmAnd/res/drawable-xxhdpi/ic_navigation_drawer_dark.png
new file mode 100644
index 0000000000..42e0f81ed7
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_navigation_drawer_dark.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_navigation_drawer_light.png b/OsmAnd/res/drawable-xxhdpi/ic_navigation_drawer_light.png
new file mode 100644
index 0000000000..3d0df3b821
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_navigation_drawer_light.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/icon_sherpafy.png b/OsmAnd/res/drawable-xxhdpi/icon_sherpafy.png
index d339f1d842..5645d91a2c 100644
Binary files a/OsmAnd/res/drawable-xxhdpi/icon_sherpafy.png and b/OsmAnd/res/drawable-xxhdpi/icon_sherpafy.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/icon_sherpafy.png b/OsmAnd/res/drawable-xxxhdpi/icon_sherpafy.png
index 6a48bbf5bf..79b71f4382 100644
Binary files a/OsmAnd/res/drawable-xxxhdpi/icon_sherpafy.png and b/OsmAnd/res/drawable-xxxhdpi/icon_sherpafy.png differ
diff --git a/OsmAnd/res/layout/sherpafy_browse_tour.xml b/OsmAnd/res/layout/sherpafy_browse_tour.xml
new file mode 100644
index 0000000000..3105af7b84
--- /dev/null
+++ b/OsmAnd/res/layout/sherpafy_browse_tour.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/sherpafy_list_tour_item.xml b/OsmAnd/res/layout/sherpafy_list_tour_item.xml
new file mode 100644
index 0000000000..455227c3ec
--- /dev/null
+++ b/OsmAnd/res/layout/sherpafy_list_tour_item.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml
index 7041ee1556..65c90e1e02 100644
--- a/OsmAnd/res/values-be/strings.xml
+++ b/OsmAnd/res/values-be/strings.xml
@@ -1,4 +1,4 @@
-
+
Без аўтаматычнага масштабіраваньня
Зачыніць
Для сярэдняга масштаба
diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml
index 91e026bca4..2a42577e6c 100644
--- a/OsmAnd/res/values-ca/strings.xml
+++ b/OsmAnd/res/values-ca/strings.xml
@@ -1,4 +1,4 @@
-
+
Mostra els missatges d\'avís…
Rutes amb fluorescència
Mostra el regle
diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml
index ddde6950b0..1c6bfd0886 100644
--- a/OsmAnd/res/values-da/strings.xml
+++ b/OsmAnd/res/values-da/strings.xml
@@ -1,4 +1,4 @@
-
+
Overvej at købe Højdekurve udvidelsen (\'Contour lines\') på Google Play for at støtte den videre udvikling.
Optag video
Optag audio
diff --git a/OsmAnd/res/values-el/strings.xml b/OsmAnd/res/values-el/strings.xml
index 98631a5d50..8a297f0401 100644
--- a/OsmAnd/res/values-el/strings.xml
+++ b/OsmAnd/res/values-el/strings.xml
@@ -1,4 +1,4 @@
-
+
Προσθήκη Ετικέτας
Λειτουργία για προχωρημένους…
Στάθμευση
diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml
index d8db68a4cf..47af0973db 100644
--- a/OsmAnd/res/values-es/strings.xml
+++ b/OsmAnd/res/values-es/strings.xml
@@ -1,4 +1,4 @@
-
+
Configura pantalla
diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml
index af58394e98..062c1d86c0 100644
--- a/OsmAnd/res/values-fa/strings.xml
+++ b/OsmAnd/res/values-fa/strings.xml
@@ -1,4 +1,4 @@
-
+
پشتیبانگیری از تغییرات OsmAnd ناموفق بود
زمان
دقت
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index b7152b25b2..ff3466a898 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -1,4 +1,4 @@
-
+
Modifications hors-ligne
Toujours utiliser l\'édition hors-ligne
"Changements en 0.7.1 :
diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml
index aa251e8eb4..5eb8186c0f 100644
--- a/OsmAnd/res/values-hu/strings.xml
+++ b/OsmAnd/res/values-hu/strings.xml
@@ -1,4 +1,4 @@
-
+
"A 0.7.2 kiadás változásai:
\n\t- Natív renderelő minden eszközre
\n\t- Offline POI szerkesztés
diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml
index 1248f01a28..8ef1e988e7 100644
--- a/OsmAnd/res/values-it/strings.xml
+++ b/OsmAnd/res/values-it/strings.xml
@@ -1,4 +1,4 @@
-
+
Sovrapposizioni fluorescenti
Usa colori fluorescenti per visualizzare tracce e percorsi
Modifiche offline
diff --git a/OsmAnd/res/values-ko/strings.xml b/OsmAnd/res/values-ko/strings.xml
index af53695042..18d172fb9c 100644
--- a/OsmAnd/res/values-ko/strings.xml
+++ b/OsmAnd/res/values-ko/strings.xml
@@ -1,4 +1,4 @@
-
+
벡터 맵이 더욱 빠르게 표시됩니다. 하지만, 어떤 기기에서는 잘 작동하지 않을 수 있습니다.
현재 선택된 음성 명령을 재생합니다
diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml
index 04d32ce288..56c396573c 100644
--- a/OsmAnd/res/values-lt/strings.xml
+++ b/OsmAnd/res/values-lt/strings.xml
@@ -1,4 +1,4 @@
-
+
Pradžios taškas yra per toli nuo artimiausio kelio.
Bendrinta vieta
Dėmesio
diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml
index 9ceec947a6..22278fc03b 100644
--- a/OsmAnd/res/values-nl/strings.xml
+++ b/OsmAnd/res/values-nl/strings.xml
@@ -1,4 +1,4 @@
-
+
Configureer scherm
diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml
index 82c5d93f69..56ffc7915b 100644
--- a/OsmAnd/res/values-ru/strings.xml
+++ b/OsmAnd/res/values-ru/strings.xml
@@ -1,4 +1,4 @@
-
+
Этот плагин позволяет загружать линии высот (Загрузка данных -> Меню -> "Другие карты") для использования оффлайн.
Рассмотрите пожалуйста покупку плагина \"Линии высот\" на Market, чтобы поддержать последующую разработку.
Линии высот
diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml
index b91937a807..f67dc9c585 100644
--- a/OsmAnd/res/values-sk/strings.xml
+++ b/OsmAnd/res/values-sk/strings.xml
@@ -1,4 +1,4 @@
-
+
Zobraziť
Fotografia %1$s zachytená dňa %2$s
Zachytiť fotografiu
diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml
index 79236835d7..88470199f1 100644
--- a/OsmAnd/res/values-sl/strings.xml
+++ b/OsmAnd/res/values-sl/strings.xml
@@ -1,4 +1,4 @@
-
+
Iskanje
Iskanje
Nastavitve
diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml
index d5e0694445..ee665b99a1 100644
--- a/OsmAnd/res/values-zh-rTW/strings.xml
+++ b/OsmAnd/res/values-zh-rTW/strings.xml
@@ -1,4 +1,4 @@
-
+
選擇道路的色彩調配:
道路的色彩調配
顯示目的地方向
diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index 1a7ce30d08..ba606d9c8a 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -64,4 +64,5 @@
#C8FFFF00
#dd6CB336
+ #33aaaaaa
\ No newline at end of file
diff --git a/OsmAnd/res/values/no_translate.xml b/OsmAnd/res/values/no_translate.xml
index 25e804ab19..e1a50148a2 100644
--- a/OsmAnd/res/values/no_translate.xml
+++ b/OsmAnd/res/values/no_translate.xml
@@ -1,6 +1,6 @@
- OsmAnd~
+ Sherpafy
1.8 alpha
UA-28342846-2
diff --git a/OsmAnd/res/values/sherpafy.xml b/OsmAnd/res/values/sherpafy.xml
index 9553a0dcb9..339c8268f8 100644
--- a/OsmAnd/res/values/sherpafy.xml
+++ b/OsmAnd/res/values/sherpafy.xml
@@ -1,5 +1,6 @@
+ Sherpafy Tours
Access code is not valid
Enter access code
Overview
diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java
new file mode 100644
index 0000000000..e8f1255fcf
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java
@@ -0,0 +1,36 @@
+package net.osmand.plus.sherpafy;
+
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.R;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.actionbarsherlock.app.SherlockFragment;
+
+public class SherpafyLoadingFragment extends SherlockFragment {
+ OsmandApplication app;
+ private View view;
+
+ public SherpafyLoadingFragment(OsmandApplication app) {
+ this.app = app;
+ }
+
+ public View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container,
+ Bundle savedInstanceState) {
+ view = inflater.inflate(R.layout.sherpafy_loading, container, false);
+
+ app.checkApplicationIsBeingInitialized(getActivity(), (TextView) view.findViewById(R.id.ProgressMessage),
+ (ProgressBar) view.findViewById(R.id.ProgressBar), new Runnable() {
+ @Override
+ public void run() {
+ ((TextView) view.findViewById(R.id.ProgressMessage)).setVisibility(View.GONE);
+ view.findViewById(R.id.ProgressBar).setVisibility(View.GONE);
+ ((TourViewActivity)getSherlockActivity()).loadingFinished();
+ }
+ });
+ return view;
+ }
+
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java
new file mode 100644
index 0000000000..4d002d0360
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java
@@ -0,0 +1,173 @@
+package net.osmand.plus.sherpafy;
+
+import java.util.List;
+
+import net.osmand.IProgress;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.R;
+import net.osmand.plus.activities.DownloadIndexActivity;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.AlertDialog.Builder;
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.AsyncTask;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.LinearLayout.LayoutParams;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.actionbarsherlock.app.SherlockListFragment;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuInflater;
+import com.actionbarsherlock.view.MenuItem;
+import com.actionbarsherlock.view.MenuItem.OnMenuItemClickListener;
+
+public class SherpafyToursFragment extends SherlockListFragment {
+ private static final int ACTION_DOWNLOAD = 5;
+ OsmandApplication app;
+ private View view;
+ private SherpafyCustomization custom;
+
+ public SherpafyToursFragment(OsmandApplication app) {
+ this.app = app;
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ OsmandApplication app = (OsmandApplication) getSherlockActivity().getApplication();
+ custom = (SherpafyCustomization) app.getAppCustomization();
+ TourAdapter tourAdapter = new TourAdapter(custom.getTourInformations());
+ setListAdapter(tourAdapter);
+ }
+
+ @Override
+ public void onListItemClick(ListView l, View v, int position, long id) {
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ OsmandApplication app = (OsmandApplication) getActivity().getApplication();
+ boolean light = true; //app.getSettings().isLightActionBar();
+ com.actionbarsherlock.view.MenuItem menuItem = menu.add(0, ACTION_DOWNLOAD, 0, R.string.download_tours).setShowAsActionFlags(
+ MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ //menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gdirections_light : R.drawable.ic_action_gdirections_dark);
+ menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(com.actionbarsherlock.view.MenuItem item) {
+ if (custom.getAccessCode().length() == 0) {
+ openAccessCode(true);
+ } else {
+ startDownloadActivity();
+ }
+ return true;
+ }
+ });
+
+ }
+
+ protected void openAccessCode(final boolean startDownload) {
+ Builder builder = new AlertDialog.Builder(getActivity());
+ builder.setTitle(R.string.enter_access_code);
+ final EditText editText = new EditText(getActivity());
+ editText.setInputType(EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS);
+ LinearLayout ll = new LinearLayout(getActivity());
+ ll.setPadding(5, 3, 5, 0);
+ ll.addView(editText, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
+ builder.setView(ll);
+ builder.setNegativeButton(R.string.default_buttons_cancel, null);
+ builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ String acCode = editText.getText().toString();
+ if (!custom.setAccessCode(acCode)) {
+ Toast.makeText(getActivity(), R.string.access_code_is_not_valid, Toast.LENGTH_LONG).show();
+ return;
+ }
+ if (startDownload) {
+ startDownloadActivity();
+ }
+ }
+ });
+ builder.create().show();
+ }
+
+ private void startDownloadActivity() {
+ final Intent download = new Intent(getActivity(), DownloadIndexActivity.class);
+ download.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ startActivity(download);
+ }
+
+ private void selectTourAsync(final TourInformation tour) {
+ new AsyncTask() {
+ private ProgressDialog dlg;
+
+ protected void onPreExecute() {
+ dlg = new ProgressDialog(getActivity());
+ dlg.setTitle(R.string.selecting_tour_progress);
+ dlg.setMessage(getString(R.string.indexing_tour, tour == null ? "" : tour.getName()));
+ dlg.show();
+ };
+
+ @Override
+ protected Void doInBackground(TourInformation... params) {
+ // if tour is already selected - do nothing
+ if (custom.getSelectedTour() != null) {
+ if (custom.getSelectedTour().equals(params[0])) {
+ return null;
+ }
+ }
+ custom.selectTour(params[0], IProgress.EMPTY_PROGRESS);
+ return null;
+ }
+
+ protected void onPostExecute(Void result) {
+ // to avoid illegal argument exception when rotating phone during loading
+ try {
+ dlg.dismiss();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ //startTourView();
+ };
+ }.execute(tour);
+ }
+
+ class TourAdapter extends ArrayAdapter {
+
+ public TourAdapter(List list) {
+ super(getActivity(), R.layout.search_history_list_item, list);
+ }
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ View row = convertView;
+ if (row == null) {
+ LayoutInflater inflater = getActivity().getLayoutInflater();
+ row = inflater.inflate(R.layout.sherpafy_list_tour_item, parent, false);
+ }
+ TourInformation ti = getItem(position);
+ TextView description = (TextView) row.findViewById(R.id.TourDescription);
+ TextView name = (TextView) row.findViewById(R.id.TourName);
+ description.setText(ti.getShortDescription());
+ name.setText(ti.getName());
+ ImageView iv = (ImageView) row.findViewById(R.id.TourImage);
+ if(ti.getImageBitmap() != null) {
+ iv.setBackground(new BitmapDrawable(getResources(), ti.getImageBitmap()));
+ }
+ return row;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/TourInformation.java b/OsmAnd/src/net/osmand/plus/sherpafy/TourInformation.java
index e5016385b5..b88d4f829c 100644
--- a/OsmAnd/src/net/osmand/plus/sherpafy/TourInformation.java
+++ b/OsmAnd/src/net/osmand/plus/sherpafy/TourInformation.java
@@ -204,6 +204,11 @@ public class TourInformation {
return img;
}
+ @Override
+ public String toString() {
+ return name;
+ }
+
}
//Returns full string from which contains XML tags from XMLParser
@@ -236,5 +241,10 @@ public class TourInformation {
String content = sb.toString();
return content;
}
+
+ @Override
+ public String toString() {
+ return name;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java
index f5482e49c5..916ed5e503 100644
--- a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java
+++ b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java
@@ -21,24 +21,37 @@ import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
+import android.support.v4.app.ActionBarDrawerToggle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v4.widget.DrawerLayout.DrawerListener;
import android.text.Html;
import android.text.Html.ImageGetter;
import android.util.TypedValue;
import android.view.Gravity;
+import android.view.LayoutInflater;
import android.view.View;
+import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
+import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
@@ -47,6 +60,7 @@ import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
+import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
@@ -56,73 +70,160 @@ import com.actionbarsherlock.view.MenuItem.OnMenuItemClickListener;
*/
public class TourViewActivity extends SherlockFragmentActivity {
- private static final int GO_TO_MAP = 1;
- private static final int SETTINGS_ID = 2;
- private static final int TOUR_ID = 3;
- private static final int STATE_TOUR_VIEW = 1;
- private static final int STATE_LOADING = 0;
- private static final int STATE_SELECT_TOUR = -1;
+ private static final int ACTION_GO_TO_MAP = 1;
+ private static final int ACTION_TOUR_ID = 3;
+ private static final int ACTION_SHARE = 4;
+
+ private static final int STATE_LOADING = -1;
+ private static final int STATE_TOUR_VIEW = 1;
+ private static final int STATE_SELECT_TOUR = 2;
private static int state = STATE_LOADING;
+
+
public static final int APP_EXIT_CODE = 4;
public static final String APP_EXIT_KEY = "APP_EXIT_KEY";
+
- private SherpafyCustomization customization;
ImageView img;
TextView description;
LinearLayout fullDescriptionView;
RadioGroup stages;
private ToggleButton collapser;
- Point size;
- private Set currentTourInformations = new HashSet();
+ private Set currentTourInformations = new HashSet();
+
+ private SherpafyCustomization customization;
+ private Point displaySize;
+ private ActionBarDrawerToggle mDrawerToggle;
+ private DrawerLayout mDrawerLayout;
+ private ListView mDrawerList;
+ private ArrayAdapter