Improve download usability
This commit is contained in:
parent
0441b77952
commit
8ac1aea1b7
10 changed files with 59 additions and 17 deletions
|
@ -8,6 +8,8 @@ package net.osmand;
|
|||
public class ToDoConstants {
|
||||
|
||||
|
||||
// MAKE worldwide downloadable by default
|
||||
|
||||
// Index
|
||||
// Map QuadTree (skip small areas!!!)
|
||||
// Routing index !!
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="22dp"
|
||||
android:layout_marginRight="22dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_toLeftOf="@+id/title_image"
|
||||
android:layout_toRightOf="@+id/back_button"
|
||||
android:text="@string/favourites_activity" />
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="22dp"
|
||||
android:layout_marginRight="22dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_toLeftOf="@+id/title_image"
|
||||
android:layout_toRightOf="@+id/back_button"
|
||||
android:text="@string/favourites_activity" />
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
If you are making/correcting english translations make sure :
|
||||
1. All your modified/created strings are in the top of the file (to make easier find what's translated).
|
||||
-->
|
||||
<string name="select_index_file_to_download">Nothing was found. If you can\'t find your region manually, you can make it yourself (see osmand.net).</string>
|
||||
<string name="local_indexes_cat_tile">Online Map data</string>
|
||||
<string name="local_indexes_cat_map">Offline Map data</string>
|
||||
<string name="gpx_index_settings_descr"> (includes GPX analyzer)</string>
|
||||
<string name="index_settings_descr">Download, view details and manage offline maps</string>
|
||||
<string name="local_index_description">Download, (de-)activate, or delete offline data. \nTo see more details click on the item. \nCurrent data on device (%1$s free):</string>
|
||||
<string name="map_online_plugin_is_not_installed">Enable online maps plugin to select different map sources</string>
|
||||
<string name="map_online_data">Online maps</string>
|
||||
<string name="map_online_data_descr">Use online maps (download and save them on sdcard)</string>
|
||||
|
@ -31,7 +37,7 @@
|
|||
<string name="osmand_development_plugin_name">Osmand Development</string>
|
||||
<string name="plugins_screen">Plugin Manager</string>
|
||||
<string name="select_plugin_to_activate">Touch a Plugin to activate or deactivate it. (Restarting Osmand may be required.)</string>
|
||||
<string name="prefs_plugins_descr">Plugins provide extra functionality already contained in the application like tracking, tile maps, screen off mode, accessibility settings, and others.</string>
|
||||
<string name="prefs_plugins_descr">Plugins provide extra functionality bundled within the application like tracking, tile maps, screen off mode, accessibility settings, and others.</string>
|
||||
<string name="prefs_plugins">Plugin Manager</string>
|
||||
<string name="tip_recent_changes_0_8_0_t">Changes in 0.8.0 :
|
||||
\n\t- Plugin functionality
|
||||
|
@ -197,7 +203,7 @@
|
|||
<!-- this block re-worked for new Preferences structure -->
|
||||
<string name="profile_settings">Profile Specific Settings</string>
|
||||
<string name="settings_preset">User Profile</string>
|
||||
<string name="settings_preset_descr">Select a user profile. Each profile contains specific settings, which can be customized below.</string>
|
||||
<string name="settings_preset_descr">Select a user profile. Each profile contains the set of specific settings.</string>
|
||||
|
||||
<string name="monitor_preferences">- Tracking</string>
|
||||
<string name="monitor_preferences_descr">Specify tracking settings</string>
|
||||
|
@ -205,7 +211,6 @@
|
|||
<string name="routing_settings_descr">Specify navigation options</string>
|
||||
<string name="global_settings">Global Settings</string>
|
||||
<string name="index_settings">Offline Data (Download)</string>
|
||||
<string name="index_settings_descr">Download and manage offline maps and other data such as GPX tracks</string>
|
||||
<string name="general_settings">General Settings</string>
|
||||
<string name="general_settings_descr">Configure global settings</string>
|
||||
<string name="global_app_settings">Global app settings</string>
|
||||
|
@ -316,7 +321,6 @@
|
|||
<string name="show_gpx_route">Show on map</string>
|
||||
<string name="poi_filter_nominatim">Online Nominatim</string>
|
||||
<string name="search_select_point">Select</string>
|
||||
<string name="local_index_description">Download, (de-)activate, or delete offline data. \nCurrent data on device (%1$s free):</string>
|
||||
<string name="search_position_current_location_search">Searching position…</string>
|
||||
<string name="search_position_current_location_found">Position (Found)</string>
|
||||
<string name="search_position_address">Address…</string>
|
||||
|
@ -394,8 +398,6 @@
|
|||
<string name="local_indexes_cat_tts">Voice data (TTS)</string>
|
||||
<string name="local_indexes_cat_voice">Voice data (recorded)</string>
|
||||
<string name="local_indexes_cat_gpx">GPX data</string>
|
||||
<string name="local_indexes_cat_tile">Map data (tiles)</string>
|
||||
<string name="local_indexes_cat_map">Map data (vector)</string>
|
||||
<string name="local_indexes_cat_poi">POI data</string>
|
||||
|
||||
<string name="ttsvoice">TTS Voice</string>
|
||||
|
@ -786,7 +788,6 @@
|
|||
<string name="downloading">Downloading…</string>
|
||||
<string name="downloading_list_indexes">Downloading list of available regions…</string>
|
||||
<string name="list_index_files_was_not_loaded">The list of regions was not retrieved from osmand.net.</string>
|
||||
<string name="select_index_file_to_download">If you can\'t find your region, you can make it yourself. See osmand.net</string>
|
||||
<string name="show_poi_on_map">Show on map</string>
|
||||
<string name="fav_points_edited">Favorite point was edited</string>
|
||||
<string name="fav_points_not_exist">No favorite points exist</string>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="@string/profile_settings" android:key="profile_dep_cat">
|
||||
<Preference android:title="@string/index_settings" android:key="local_indexes" android:summary="@string/index_settings_descr"></Preference>
|
||||
<PreferenceCategory android:title="@string/profile_settings" android:key="profile_dep_cat">
|
||||
<ListPreference android:summary="@string/settings_preset_descr" android:title="@string/settings_preset" android:key="application_mode"></ListPreference>
|
||||
<PreferenceScreen android:key="appearance_settings" android:title="@string/map_settings" android:summary="@string/map_settings_descr">
|
||||
<ListPreference android:key="rotate_map" android:title="@string/rotate_map_to_bearing" android:summary="@string/rotate_map_to_bearing_descr"></ListPreference>
|
||||
|
@ -34,7 +35,6 @@
|
|||
|
||||
|
||||
<PreferenceCategory android:title="@string/global_settings" android:key="global_settings" >
|
||||
<Preference android:title="@string/index_settings" android:key="local_indexes" android:summary="@string/index_settings_descr"></Preference>
|
||||
<PreferenceScreen android:key="general_settings" android:title="@string/general_settings" android:summary="@string/general_settings_descr">
|
||||
<PreferenceCategory android:title="@string/global_app_settings">
|
||||
<ListPreference android:key="map_screen_orientation" android:title="@string/map_screen_orientation" android:summary="@string/map_screen_orientation_descr"></ListPreference>
|
||||
|
|
|
@ -703,7 +703,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
final Map<String, IndexItemCategory> cats = new TreeMap<String, DownloadIndexActivity.IndexItemCategory>();
|
||||
for(IndexItem i : indexItems){
|
||||
int nameId = R.string.index_name_other;
|
||||
int order = 12;
|
||||
int order = 0;
|
||||
String lc = i.getFileName().toLowerCase();
|
||||
if(lc.endsWith(".voice.zip")) {
|
||||
nameId = R.string.index_name_voice;
|
||||
|
@ -893,6 +893,12 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
item.setText(group.name);
|
||||
item.setLinkTextColor(Color.YELLOW);
|
||||
adjustIndicator(groupPosition, isExpanded, v);
|
||||
int cp = getChildrenCount(groupPosition);
|
||||
if(cp < 10 && !isExpanded) {
|
||||
getExpandableListView().expandGroup(groupPosition);
|
||||
} else if(cp > 50 && isExpanded){
|
||||
getExpandableListView().collapseGroup(groupPosition);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
|
|
|
@ -391,8 +391,8 @@ public class LocalIndexHelper {
|
|||
|
||||
|
||||
public enum LocalIndexType {
|
||||
TILES_DATA(R.string.local_indexes_cat_tile),
|
||||
MAP_DATA(R.string.local_indexes_cat_map),
|
||||
TILES_DATA(R.string.local_indexes_cat_tile),
|
||||
POI_DATA(R.string.local_indexes_cat_poi),
|
||||
VOICE_DATA(R.string.local_indexes_cat_voice),
|
||||
TTS_VOICE_DATA(R.string.local_indexes_cat_tts),
|
||||
|
|
|
@ -33,6 +33,9 @@ import android.os.AsyncTask;
|
|||
import android.os.AsyncTask.Status;
|
||||
import android.os.Bundle;
|
||||
import android.os.StatFs;
|
||||
import android.text.SpannableString;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -83,6 +86,8 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity {
|
|||
});
|
||||
setContentView(R.layout.local_index);
|
||||
titleBar.afterSetContentView();
|
||||
|
||||
|
||||
settings = getMyApplication().getSettings();
|
||||
descriptionLoader = new LoadLocalIndexDescriptionTask();
|
||||
listAdapter = new LocalIndexesAdapter();
|
||||
|
@ -671,8 +676,22 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity {
|
|||
StatFs fs = new StatFs(dir.getAbsolutePath());
|
||||
size = formatGb.format(new Object[]{(float) (fs.getAvailableBlocks()) * fs.getBlockSize() / (1 << 30) });
|
||||
}
|
||||
((TextView) findViewById(R.id.DescriptionText)).setText(
|
||||
getString(R.string.local_index_description, size));
|
||||
TextView ds = (TextView) findViewById(R.id.DescriptionText);
|
||||
String text = getString(R.string.local_index_description, size);
|
||||
int l = text.indexOf(',');
|
||||
if(l == -1) {
|
||||
l = text.length();
|
||||
}
|
||||
SpannableString content = new SpannableString(text);
|
||||
content.setSpan(new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
asyncLoader.setResult(null);
|
||||
startActivity(new Intent(LocalIndexesActivity.this, DownloadIndexActivity.class));
|
||||
}
|
||||
}, 0, l, 0);
|
||||
ds.setText(content);
|
||||
ds.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
private void closeSelectionMode(){
|
||||
|
|
|
@ -655,6 +655,10 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
|||
title = title.substring(1);
|
||||
}
|
||||
scr.getDialog().setTitle(" " + title + " [" + osmandSettings.APPLICATION_MODE.get().toHumanString(this) + "]");
|
||||
} else if(preference instanceof PreferenceScreen){
|
||||
PreferenceScreen scr = (PreferenceScreen)preference;
|
||||
String title = scr.getTitle().toString();
|
||||
scr.getDialog().setTitle(" " + title);
|
||||
}
|
||||
|
||||
if (preference == applicationDir) {
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package net.osmand.plus.monitoring;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import net.osmand.LogUtil;
|
||||
import net.osmand.plus.ContextMenuAdapter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
|
@ -22,6 +25,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
|||
private static final String ID = "osmand.monitoring";
|
||||
private OsmandSettings settings;
|
||||
private OsmandApplication app;
|
||||
private static final Log log = LogUtil.getLog(OsmandMonitoringPlugin.class);
|
||||
|
||||
public OsmandMonitoringPlugin(OsmandApplication app) {
|
||||
this.app = app;
|
||||
|
@ -69,6 +73,12 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
|||
|
||||
@Override
|
||||
public void settingsActivityCreate(final SettingsActivity activity, PreferenceScreen screen) {
|
||||
Preference offlineData = screen.findPreference("index_settings");
|
||||
if(offlineData == null) {
|
||||
log.error("OsmandMonitoringPlugin: Index settings preference not found !!!");
|
||||
} else {
|
||||
offlineData.setSummary(offlineData.getSummary() + " "+ app.getString(R.string.gpx_index_settings_descr));
|
||||
}
|
||||
PreferenceScreen grp = screen.getPreferenceManager().createPreferenceScreen(activity);
|
||||
grp.setTitle(R.string.monitor_preferences);
|
||||
grp.setSummary(R.string.monitor_preferences_descr);
|
||||
|
|
Loading…
Reference in a new issue