From aebd125b9a200fb96f98bbe29328ae24b1ea160a Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 31 Jul 2014 17:55:23 +0300 Subject: [PATCH 1/6] Fixed some expetions for android 2.3.3 --- .../osmand/plus/monitoring/SettingsMonitoringActivity.java | 1 + OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java b/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java index e019245a45..a7eeb5b5b2 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java @@ -39,6 +39,7 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity { @Override public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); + requestWindowFeature(Window.FEATURE_PROGRESS); super.onCreate(savedInstanceState); setSupportProgressBarIndeterminateVisibility(false); getSupportActionBar().setTitle(R.string.monitoring_settings); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index 9025983ed0..cf16504849 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -109,7 +109,10 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider @Override protected List calculateResult(RotatedTileBox tileBox) { QuadRect bounds = tileBox.getLatLonBounds(); - return loadingBugs(bounds.top, bounds.left, bounds.bottom, bounds.right); + if (bounds != null){ + return loadingBugs(bounds.top, bounds.left, bounds.bottom, bounds.right); + } + return new ArrayList(); } }; } From 67bad9a1bd9e4189b38d10d5d7b08d6264b4288d Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 5 Aug 2014 14:41:28 +0300 Subject: [PATCH 2/6] Tour view is now clickable. Fixed compatibility bug for android 2.3.3 --- .../osmand/plus/sherpafy/SherpafySelectToursFragment.java | 7 +++++++ OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafySelectToursFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafySelectToursFragment.java index 4aa8b893a3..70b6b93c31 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafySelectToursFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafySelectToursFragment.java @@ -124,11 +124,18 @@ public class SherpafySelectToursFragment extends SherlockListFragment { LayoutInflater inflater = getActivity().getLayoutInflater(); row = inflater.inflate(R.layout.sherpafy_list_tour_item, parent, false); } + final TourInformation ti = getItem(position); TextView description = (TextView) row.findViewById(R.id.TourDescription); TextView name = (TextView) row.findViewById(R.id.TourName); TextView moreInformation = (TextView) row.findViewById(R.id.MoreInformation); SpannableString content = new SpannableString(getString(R.string.sherpafy_more_information)); + row.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + ((TourViewActivity) getActivity()).selectMenu( ti); + } + }); content.setSpan(new ClickableSpan() { @Override public void onClick(View widget) { diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java index 004fd8c916..47d1959ec7 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java @@ -108,8 +108,7 @@ public class TourViewActivity extends SherlockFragmentActivity { } }); - displaySize = new Point(); - getWindowManager().getDefaultDisplay().getSize(displaySize); + displaySize = new Point(getWindowManager().getDefaultDisplay().getWidth(), getWindowManager().getDefaultDisplay().getHeight()); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer_light, R.string.default_buttons_other_actions, R.string.close); if (getMyApplication().isApplicationInitializing()) { From cb34049144484db1220ba56630e1996d2a9c4603 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 5 Aug 2014 15:35:00 +0300 Subject: [PATCH 3/6] Added back handling for shertpafytoursactivity --- .../net/osmand/plus/sherpafy/TourViewActivity.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java index 47d1959ec7..796742c581 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java @@ -118,7 +118,17 @@ public class TourViewActivity extends SherlockFragmentActivity { showSelectedItem(); } } - + + @Override + public void onBackPressed() { + if (state == STATE_SELECT_TOUR){ + super.onBackPressed(); + } else if (state == STATE_TOUR_VIEW){ + selectMenu(R.string.sherpafy_tours); + } else if (state == STATE_STAGE_OVERVIEW){ + selectMenu(customization.getSelectedTour()); + } + } private ArrayAdapter setupAdapter() { return new ArrayAdapter(this, R.layout.sherpafy_drawer_list_item){ From a2b46e097bbe730fe3cdbbd7ac6ecfba5fef9696 Mon Sep 17 00:00:00 2001 From: Bars107 Date: Tue, 5 Aug 2014 20:36:52 +0300 Subject: [PATCH 4/6] Update SettingsMonitoringActivity.java --- .../net/osmand/plus/monitoring/SettingsMonitoringActivity.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java b/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java index a7eeb5b5b2..e019245a45 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java @@ -39,7 +39,6 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity { @Override public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - requestWindowFeature(Window.FEATURE_PROGRESS); super.onCreate(savedInstanceState); setSupportProgressBarIndeterminateVisibility(false); getSupportActionBar().setTitle(R.string.monitoring_settings); From 30a830601f23db50df79c6038506287fddb72340 Mon Sep 17 00:00:00 2001 From: Bars107 Date: Tue, 5 Aug 2014 20:37:16 +0300 Subject: [PATCH 5/6] Update OsmBugsLayer.java --- OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index cf16504849..985b72c0c9 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -109,10 +109,8 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider @Override protected List calculateResult(RotatedTileBox tileBox) { QuadRect bounds = tileBox.getLatLonBounds(); - if (bounds != null){ - return loadingBugs(bounds.top, bounds.left, bounds.bottom, bounds.right); - } - return new ArrayList(); + return loadingBugs(bounds.top, bounds.left, bounds.bottom, bounds.right); + } }; } From 8cb2f753ab71816d846d4135be7997a184855e56 Mon Sep 17 00:00:00 2001 From: Bars107 Date: Tue, 5 Aug 2014 20:37:26 +0300 Subject: [PATCH 6/6] Update OsmBugsLayer.java --- OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index 985b72c0c9..9025983ed0 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -110,7 +110,6 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider protected List calculateResult(RotatedTileBox tileBox) { QuadRect bounds = tileBox.getLatLonBounds(); return loadingBugs(bounds.top, bounds.left, bounds.bottom, bounds.right); - } }; }