Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
0eb598d815 | ||
|
2ff8ff8230 | ||
|
e8a67845f1 |
9 changed files with 73 additions and 59 deletions
|
@ -43,13 +43,14 @@ public enum AmenityType {
|
||||||
this.defaultTag = defaultTag;
|
this.defaultTag = defaultTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AmenityType fromString(String s){
|
public static AmenityType fromString(String s) {
|
||||||
try {
|
for (AmenityType t : values()) {
|
||||||
return AmenityType.valueOf(s.toUpperCase());
|
if (t.name().equalsIgnoreCase(s)) {
|
||||||
} catch (IllegalArgumentException e) {
|
return t;
|
||||||
return AmenityType.OTHER;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return OTHER;
|
||||||
|
}
|
||||||
|
|
||||||
public String getDefaultTag() {
|
public String getDefaultTag() {
|
||||||
return defaultTag;
|
return defaultTag;
|
||||||
|
|
|
@ -248,7 +248,7 @@ public class MapRenderingTypes {
|
||||||
rtype.value = null;
|
rtype.value = null;
|
||||||
}
|
}
|
||||||
if (poiParentCategory != null) {
|
if (poiParentCategory != null) {
|
||||||
rtype.poiCategory = AmenityType.valueOf(poiParentCategory.toUpperCase());
|
rtype.poiCategory = AmenityType.fromString(poiParentCategory);
|
||||||
rtype.poiSpecified = true;
|
rtype.poiSpecified = true;
|
||||||
}
|
}
|
||||||
if (poiParentPrefix != null) {
|
if (poiParentPrefix != null) {
|
||||||
|
@ -305,7 +305,7 @@ public class MapRenderingTypes {
|
||||||
String tag = parser.getAttributeValue("","poi_tag");
|
String tag = parser.getAttributeValue("","poi_tag");
|
||||||
if (tag != null) {
|
if (tag != null) {
|
||||||
AmenityRuleType rtype = new AmenityRuleType();
|
AmenityRuleType rtype = new AmenityRuleType();
|
||||||
rtype.poiCategory = AmenityType.valueOf(poiParentCategory.toUpperCase());
|
rtype.poiCategory = AmenityType.fromString(poiParentCategory);
|
||||||
rtype.poiSpecified = true;
|
rtype.poiSpecified = true;
|
||||||
rtype.relation = Boolean.parseBoolean(parser.getAttributeValue("", "relation"));
|
rtype.relation = Boolean.parseBoolean(parser.getAttributeValue("", "relation"));
|
||||||
rtype.poiPrefix = poiParentPrefix;
|
rtype.poiPrefix = poiParentPrefix;
|
||||||
|
|
|
@ -96,6 +96,8 @@
|
||||||
</condition>
|
</condition>
|
||||||
<then>
|
<then>
|
||||||
<replaceregexp file="AndroidManifest.xml" match='android:versionCode="(.*)"' replace='android:versionCode="${build.version.code}"' byline="true" />
|
<replaceregexp file="AndroidManifest.xml" match='android:versionCode="(.*)"' replace='android:versionCode="${build.version.code}"' byline="true" />
|
||||||
|
<replaceregexp file="AndroidManifest.xml" match='android:debuggable="true"' replace='android:debuggable="false"' byline="true" />
|
||||||
|
|
||||||
</then>
|
</then>
|
||||||
</if>
|
</if>
|
||||||
<if>
|
<if>
|
||||||
|
|
|
@ -611,7 +611,7 @@
|
||||||
<string name="recording_is_recorded">صدا/تصویر در حال ضبط میباشد. برای متوقف کردن آن ویجت AV را بزنید.</string>
|
<string name="recording_is_recorded">صدا/تصویر در حال ضبط میباشد. برای متوقف کردن آن ویجت AV را بزنید.</string>
|
||||||
<string name="recording_playing">صدایی از ضبط مورد نظر درحال پخش میباشد.\n%1$s</string>
|
<string name="recording_playing">صدایی از ضبط مورد نظر درحال پخش میباشد.\n%1$s</string>
|
||||||
<string name="recording_delete_confirm">آیا میخواهید این مورد ضبط شده را پاک کنید؟</string>
|
<string name="recording_delete_confirm">آیا میخواهید این مورد ضبط شده را پاک کنید؟</string>
|
||||||
<string name="recording_description">ضبط %1$s%2$ s از %3$s</string>
|
<string name="recording_description">ضبط %1$s%2$s از %3$s</string>
|
||||||
<string name="osmand_srtm_short_description_80_chars">افزونه OsmAnd برای منحنی های همتراز آفلاین</string>
|
<string name="osmand_srtm_short_description_80_chars">افزونه OsmAnd برای منحنی های همتراز آفلاین</string>
|
||||||
<string name="use_magnetic_sensor_descr">استفاده از حسگر مغناطیسی به جای سنسور جهت یابی برای استفاده در قطب نما</string>
|
<string name="use_magnetic_sensor_descr">استفاده از حسگر مغناطیسی به جای سنسور جهت یابی برای استفاده در قطب نما</string>
|
||||||
<string name="show_poi_over_map">نشان دادن POI</string>
|
<string name="show_poi_over_map">نشان دادن POI</string>
|
||||||
|
|
|
@ -63,17 +63,21 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
||||||
public void onCreate(final Bundle icicle) {
|
public void onCreate(final Bundle icicle) {
|
||||||
Bundle bundle = this.getIntent().getExtras();
|
Bundle bundle = this.getIntent().getExtras();
|
||||||
String filterId = bundle.getString(AMENITY_FILTER);
|
String filterId = bundle.getString(AMENITY_FILTER);
|
||||||
helper = ((OsmandApplication)getApplication()).getPoiFilters();
|
helper = ((OsmandApplication) getApplication()).getPoiFilters();
|
||||||
filter = helper.getFilterById(filterId);
|
filter = helper.getFilterById(filterId);
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
|
|
||||||
|
|
||||||
setContentView(R.layout.editing_poi_filter);
|
setContentView(R.layout.editing_poi_filter);
|
||||||
getSupportActionBar().setTitle(R.string.filterpoi_activity);
|
getSupportActionBar().setTitle(R.string.filterpoi_activity);
|
||||||
getSupportActionBar().setIcon(R.drawable.tab_search_poi_icon);
|
getSupportActionBar().setIcon(R.drawable.tab_search_poi_icon);
|
||||||
|
|
||||||
|
if (filter != null) {
|
||||||
getSupportActionBar().setSubtitle(filter.getName());
|
getSupportActionBar().setSubtitle(filter.getName());
|
||||||
setListAdapter(new AmenityAdapter(AmenityType.getCategories()));
|
setListAdapter(new AmenityAdapter(AmenityType.getCategories()));
|
||||||
|
} else {
|
||||||
|
setListAdapter(new AmenityAdapter(new AmenityType[0]));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,6 +98,9 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
if(filter == null) {
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
createMenuItem(menu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item,
|
createMenuItem(menu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item,
|
||||||
R.drawable.ic_action_gsave_light, R.drawable.ic_action_gsave_dark ,
|
R.drawable.ic_action_gsave_light, R.drawable.ic_action_gsave_dark ,
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
|
|
@ -425,7 +425,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
title = R.string.search_poi_location;
|
title = R.string.search_poi_location;
|
||||||
enabled = false;
|
enabled = false;
|
||||||
} else if (!isNameFinderFilter() && !isSearchByNameFilter()) {
|
} else if (filter != null && !isNameFinderFilter() && !isSearchByNameFilter()) {
|
||||||
title = R.string.search_POI_level_btn;
|
title = R.string.search_POI_level_btn;
|
||||||
enabled = (taskAlreadyFinished || currentSearchTask.getStatus() != Status.RUNNING) && filter.isSearchFurtherAvailable();
|
enabled = (taskAlreadyFinished || currentSearchTask.getStatus() != Status.RUNNING) && filter.isSearchFurtherAvailable();
|
||||||
} else if (filter != null) {
|
} else if (filter != null) {
|
||||||
|
|
|
@ -47,13 +47,14 @@ public class SettingsAudioVideoActivity extends SettingsBaseActivity {
|
||||||
ListPreference defAct = createListPreference(p.AV_DEFAULT_ACTION, entries, intValues, R.string.av_widget_action,
|
ListPreference defAct = createListPreference(p.AV_DEFAULT_ACTION, entries, intValues, R.string.av_widget_action,
|
||||||
R.string.av_widget_action_descr);
|
R.string.av_widget_action_descr);
|
||||||
grp.addPreference(defAct);
|
grp.addPreference(defAct);
|
||||||
|
final Camera cam = openCamera();
|
||||||
|
if (cam != null) {
|
||||||
// camera type settings:
|
// camera type settings:
|
||||||
grp.addPreference(createCheckBoxPreference(p.AV_EXTERNAL_PHOTO_CAM, R.string.av_use_external_camera,
|
grp.addPreference(createCheckBoxPreference(p.AV_EXTERNAL_PHOTO_CAM, R.string.av_use_external_camera,
|
||||||
R.string.av_use_external_camera_descr));
|
R.string.av_use_external_camera_descr));
|
||||||
// focus mode settings:
|
// focus mode settings:
|
||||||
// show in menu only suppoted modes:
|
// show in menu only suppoted modes:
|
||||||
final Camera cam = openCamera();
|
|
||||||
Parameters parameters = cam.getParameters();
|
Parameters parameters = cam.getParameters();
|
||||||
List<String> sfm = parameters.getSupportedFocusModes();
|
List<String> sfm = parameters.getSupportedFocusModes();
|
||||||
List<String> items = new ArrayList<String>();
|
List<String> items = new ArrayList<String>();
|
||||||
|
@ -80,8 +81,8 @@ public class SettingsAudioVideoActivity extends SettingsBaseActivity {
|
||||||
itemsValues.add(AV_CAMERA_FOCUS_CONTINUOUS);
|
itemsValues.add(AV_CAMERA_FOCUS_CONTINUOUS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
entries = items.toArray(entries);
|
entries = items.toArray(new String[items.size()]);
|
||||||
intValues = itemsValues.toArray(intValues);
|
intValues = itemsValues.toArray(new Integer[itemsValues.size()]);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
ListPreference camFocus = createListPreference(p.AV_CAMERA_FOCUS_TYPE, entries, intValues, R.string.av_camera_focus,
|
ListPreference camFocus = createListPreference(p.AV_CAMERA_FOCUS_TYPE, entries, intValues, R.string.av_camera_focus,
|
||||||
R.string.av_camera_focus_descr);
|
R.string.av_camera_focus_descr);
|
||||||
|
@ -91,8 +92,7 @@ public class SettingsAudioVideoActivity extends SettingsBaseActivity {
|
||||||
grp.addPreference(createCheckBoxPreference(p.AV_PHOTO_PLAY_SOUND, R.string.av_photo_play_sound,
|
grp.addPreference(createCheckBoxPreference(p.AV_PHOTO_PLAY_SOUND, R.string.av_photo_play_sound,
|
||||||
R.string.av_photo_play_sound_descr));
|
R.string.av_photo_play_sound_descr));
|
||||||
cam.release();
|
cam.release();
|
||||||
|
}
|
||||||
|
|
||||||
// video settings:
|
// video settings:
|
||||||
grp.addPreference(createCheckBoxPreference(p.AV_EXTERNAL_RECORDER, R.string.av_use_external_recorder,
|
grp.addPreference(createCheckBoxPreference(p.AV_EXTERNAL_RECORDER, R.string.av_use_external_recorder,
|
||||||
R.string.av_use_external_recorder_descr));
|
R.string.av_use_external_recorder_descr));
|
||||||
|
|
|
@ -259,7 +259,9 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
|
||||||
}
|
}
|
||||||
app.showShortToastMessage(resId);
|
app.showShortToastMessage(resId);
|
||||||
updateSettings();
|
updateSettings();
|
||||||
|
if(mapView != null) {
|
||||||
mapView.refreshMap();
|
mapView.refreshMap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,6 +443,8 @@ public class ResourceManager {
|
||||||
context.getSettings().PREVIOUS_INSTALLED_VERSION.set(Version.getFullVersion(context));
|
context.getSettings().PREVIOUS_INSTALLED_VERSION.set(Version.getFullVersion(context));
|
||||||
|
|
||||||
context.getPoiFilters().updateFilters(false);
|
context.getPoiFilters().updateFilters(false);
|
||||||
|
} catch (SQLiteException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
|
|
Loading…
Reference in a new issue