Fix for issue 1661

This commit is contained in:
GaidamakUA 2015-09-07 12:56:03 +03:00
parent 27eb829848
commit 213807e415
10 changed files with 133 additions and 123 deletions

View file

@ -2257,4 +2257,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="number_of_rows_in_dash">Number of rows in dash %1$s</string> <string name="number_of_rows_in_dash">Number of rows in dash %1$s</string>
<string name="please_specify_poi_type">Please specify POI type.</string> <string name="please_specify_poi_type">Please specify POI type.</string>
<string name="working_days">Working days</string> <string name="working_days">Working days</string>
<string name="recent_places">Recent places</string>
<string name="favourites">Favourites</string>
</resources> </resources>

View file

@ -1,51 +1,5 @@
package net.osmand.plus.audionotes; package net.osmand.plus.audionotes;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.osmand.AndroidUtils;
import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.Location;
import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.access.AccessibleToast;
import net.osmand.data.DataTileManager;
import net.osmand.data.PointDescription;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.TabActivity.TabItem;
import net.osmand.plus.dashboard.tools.DashFragmentData;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.mapwidgets.TextInfoWidget;
import net.osmand.util.Algorithms;
import net.osmand.util.GeoPointParserUtil.GeoParsedPoint;
import net.osmand.util.MapUtils;
import org.apache.commons.logging.Log;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.ComponentName; import android.content.ComponentName;
@ -81,6 +35,52 @@ import android.widget.ArrayAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.Toast; import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.Location;
import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.access.AccessibleToast;
import net.osmand.data.DataTileManager;
import net.osmand.data.PointDescription;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.TabActivity.TabItem;
import net.osmand.plus.dashboard.tools.DashFragmentData;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.mapwidgets.TextInfoWidget;
import net.osmand.util.Algorithms;
import net.osmand.util.GeoPointParserUtil.GeoParsedPoint;
import net.osmand.util.MapUtils;
import org.apache.commons.logging.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class AudioVideoNotesPlugin extends OsmandPlugin { public class AudioVideoNotesPlugin extends OsmandPlugin {
@ -1303,6 +1303,6 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
@Override @Override
public DashFragmentData getCardFragment() { public DashFragmentData getCardFragment() {
return new DashFragmentData(DashAudioVideoNotesFragment.TAG, return new DashFragmentData(DashAudioVideoNotesFragment.TAG,
DashAudioVideoNotesFragment.class, getName(), 10); DashAudioVideoNotesFragment.class, R.string.audionotes_plugin_name, 10);
} }
} }

View file

@ -92,11 +92,11 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
new DashFragmentData(DashSearchFragment.TAG, DashSearchFragment.class, new DashFragmentData(DashSearchFragment.TAG, DashSearchFragment.class,
R.string.shared_string_search, 7), R.string.shared_string_search, 7),
new DashFragmentData(DashRecentsFragment.TAG, DashRecentsFragment.class, new DashFragmentData(DashRecentsFragment.TAG, DashRecentsFragment.class,
"Recent places", 8), R.string.recent_places, 8),
new DashFragmentData(DashFavoritesFragment.TAG, DashFavoritesFragment.class, new DashFragmentData(DashFavoritesFragment.TAG, DashFavoritesFragment.class,
"Favourites", defaultShouldShow, false, 9, DashFavoritesFragment.ROW_NUMBER_TAG), R.string.favourites, defaultShouldShow, false, 9, DashFavoritesFragment.ROW_NUMBER_TAG),
new DashFragmentData(DashPluginsFragment.TAG, DashPluginsFragment.class, new DashFragmentData(DashPluginsFragment.TAG, DashPluginsFragment.class,
"Plugins", 14) R.string.plugin_settings, 14)
}; };
private MapActivity mapActivity; private MapActivity mapActivity;

View file

@ -229,7 +229,7 @@ public class DashboardSettingsDialogFragment extends DialogFragment {
viewHolder.position = position; viewHolder.position = position;
viewHolder.compoundButton.setTag(viewHolder); viewHolder.compoundButton.setTag(viewHolder);
viewHolder.compoundButton.setChecked(checkedItems[position]); viewHolder.compoundButton.setChecked(checkedItems[position]);
viewHolder.textView.setText(dashFragmentData.title); viewHolder.textView.setText(dashFragmentData.titleStringId);
viewHolder.textView.setTextColor(checkedItems[position] ? textColorPrimary : viewHolder.textView.setTextColor(checkedItems[position] ? textColorPrimary :
textColorSecondary); textColorSecondary);
convertView.setTag(viewHolder); convertView.setTag(viewHolder);

View file

@ -130,7 +130,7 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
public DashFragmentData getCardFragment() { public DashFragmentData getCardFragment() {
return new DashFragmentData(DashSimulateFragment.TAG, return new DashFragmentData(DashSimulateFragment.TAG,
DashSimulateFragment.class, DashSimulateFragment.class,
getName(), R.string.debugging_and_development,
new DashboardOnMap.DefaultShouldShow(), 15); new DashboardOnMap.DefaultShouldShow(), 15);
} }
} }

View file

@ -1,11 +1,22 @@
package net.osmand.plus.development; package net.osmand.plus.development;
import java.io.File; import android.app.ActionBar;
import java.util.LinkedHashSet; import android.app.AlertDialog;
import java.util.Set; import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
import android.os.Build; import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast; import net.osmand.access.AccessibleToast;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
@ -15,22 +26,13 @@ import net.osmand.plus.voice.AbstractPrologCommandPlayer;
import net.osmand.plus.voice.CommandBuilder; import net.osmand.plus.voice.CommandBuilder;
import net.osmand.plus.voice.CommandPlayer; import net.osmand.plus.voice.CommandPlayer;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import java.io.File;
import java.util.LinkedHashSet;
import java.util.Set;
import alice.tuprolog.Struct; import alice.tuprolog.Struct;
import alice.tuprolog.Term; import alice.tuprolog.Term;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
/** /**
@ -170,7 +172,7 @@ public class TestVoiceActivity extends OsmandActionBarActivity {
addButton(ll, "Route recalculated (23150m & 350sec)", builder(p).routeRecalculated(23150, 350)); addButton(ll, "Route recalculated (23150m & 350sec)", builder(p).routeRecalculated(23150, 350));
addButton(ll, "In 1520m turn slightly left", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_LEFT_SL, 1520, street(p, ""))); addButton(ll, "In 1520m turn slightly left", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_LEFT_SL, 1520, street(p, "")));
addButton(ll, "After 850m turn sharply left onto 'Hauptstra"+"\u00df"+"e', then bear right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT_SH, 850, street(p, "Hauptstraße")).then().bearRight(street(p, ""))); addButton(ll, "After 850m turn sharply left onto 'Hauptstra"+"\u00df"+"e', then bear right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT_SH, 850, street(p, "Hauptstrasse")).then().bearRight(street(p, "")));
addButton(ll, "Turn left, then after 100m turn slightly right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT, street(p, "")).then().turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 100, street(p, ""))); addButton(ll, "Turn left, then after 100m turn slightly right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT, street(p, "")).then().turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 100, street(p, "")));
addButton(ll, "In 3100 turn right onto 'SR 80'", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_RIGHT, 3100, street(p, "SR 80"))); addButton(ll, "In 3100 turn right onto 'SR 80'", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_RIGHT, 3100, street(p, "SR 80")));
addButton(ll, "After 370m turn slightly right onto 'F23' 'Main Street', then bear left", builder(p).turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 370, street(p, "Main Street", "F23")).then().bearLeft(street(p, ""))); addButton(ll, "After 370m turn slightly right onto 'F23' 'Main Street', then bear left", builder(p).turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 370, street(p, "Main Street", "F23")).then().bearLeft(street(p, "")));

View file

@ -1,8 +1,23 @@
package net.osmand.plus.monitoring; package net.osmand.plus.monitoring;
import gnu.trove.list.array.TIntArrayList; import android.app.Activity;
import android.app.AlertDialog;
import java.util.List; import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import net.osmand.Location; import net.osmand.Location;
import net.osmand.ValueHolder; import net.osmand.ValueHolder;
@ -23,24 +38,10 @@ import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.mapwidgets.TextInfoWidget; import net.osmand.plus.views.mapwidgets.TextInfoWidget;
import android.app.Activity;
import android.app.AlertDialog; import java.util.List;
import android.app.AlertDialog.Builder;
import android.content.Context; import gnu.trove.list.array.TIntArrayList;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
public class OsmandMonitoringPlugin extends OsmandPlugin { public class OsmandMonitoringPlugin extends OsmandPlugin {
private static final String ID = "osmand.monitoring"; private static final String ID = "osmand.monitoring";
@ -465,6 +466,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
@Override @Override
public DashFragmentData getCardFragment() { public DashFragmentData getCardFragment() {
return new DashFragmentData(DashTrackFragment.TAG, DashTrackFragment.class, getName(), 11); return new DashFragmentData(DashTrackFragment.TAG, DashTrackFragment.class,
R.string.record_plugin_name, 11);
} }
} }

View file

@ -348,6 +348,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
@Override @Override
public DashFragmentData getCardFragment() { public DashFragmentData getCardFragment() {
return new DashFragmentData(DashOsmEditsFragment.TAG, DashOsmEditsFragment.class, getName(), 13); return new DashFragmentData(DashOsmEditsFragment.TAG, DashOsmEditsFragment.class,
R.string.osm_settings, 13);
} }
} }

View file

@ -1,12 +1,10 @@
package net.osmand.plus.osmo; package net.osmand.plus.osmo;
import java.io.File; import android.app.Activity;
import java.io.FileNotFoundException; import android.content.Intent;
import java.io.FileOutputStream; import android.os.AsyncTask;
import java.io.IOException; import android.view.View;
import java.io.InputStream; import android.widget.ArrayAdapter;
import java.net.URL;
import java.util.Arrays;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.Location; import net.osmand.Location;
@ -38,11 +36,13 @@ import org.apache.commons.logging.Log;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import android.app.Activity; import java.io.File;
import android.content.Intent; import java.io.FileNotFoundException;
import android.os.AsyncTask; import java.io.FileOutputStream;
import android.view.View; import java.io.IOException;
import android.widget.ArrayAdapter; import java.io.InputStream;
import java.net.URL;
import java.util.Arrays;
public class OsMoPlugin extends OsmandPlugin implements OsMoReactor { public class OsMoPlugin extends OsmandPlugin implements OsMoReactor {
@ -533,6 +533,7 @@ public class OsMoPlugin extends OsmandPlugin implements OsMoReactor {
@Override @Override
public DashFragmentData getCardFragment() { public DashFragmentData getCardFragment() {
return new DashFragmentData(DashOsMoFragment.TAG, DashOsMoFragment.class, getName(), 12); return new DashFragmentData(DashOsMoFragment.TAG, DashOsMoFragment.class,
R.string.osmo_plugin_name, 12);
} }
} }

View file

@ -1,7 +1,20 @@
package net.osmand.plus.parkingpoint; package net.osmand.plus.parkingpoint;
import java.util.Calendar; import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.text.format.DateFormat;
import android.text.format.Time;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.TimePicker;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
@ -20,20 +33,8 @@ import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.mapwidgets.TextInfoWidget; import net.osmand.plus.views.mapwidgets.TextInfoWidget;
import android.app.Activity;
import android.app.AlertDialog; import java.util.Calendar;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.text.format.DateFormat;
import android.text.format.Time;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.TimePicker;
/** /**
* *
@ -563,6 +564,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
@Override @Override
public DashFragmentData getCardFragment() { public DashFragmentData getCardFragment() {
return new DashFragmentData(DashParkingFragment.TAG, DashParkingFragment.class, getName(), 5); return new DashFragmentData(DashParkingFragment.TAG, DashParkingFragment.class,
R.string.osmand_parking_plugin_name, 5);
} }
} }