Changed save to share in my places for osm edits

This commit is contained in:
Denis 2015-03-18 14:01:22 +02:00
parent 05da7fb52b
commit c83cd825f6
6 changed files with 83 additions and 66 deletions

View file

@ -2052,7 +2052,10 @@ OsmAnd мае адкрыты зыходны код і актыўна разві
<string name="shared_string_more_actions">Больш дзеяньняў</string>
<string name="osmand_parking_overdue">Састарэлі</string>
<string name="osmand_parking_hour">г</string><string name="osmand_parking_minute">хв</string><string name="osmand_parking_time_left">Засталося</string> <string name="action_create">Стварыць дзеяньне</string>
<string name="osmand_parking_hour">г</string>
<string name="osmand_parking_minute">хв</string>
<string name="osmand_parking_time_left">Засталося</string>
<string name="action_create">Стварыць дзеяньне</string>
<string name="action_modify">Зьмяніць дзеяньне</string>
<string name="action_delete">Выдаліць дзеяньне</string>
<string name="osm_edits">праўкі OSM</string>

View file

@ -19,7 +19,7 @@
<string name="action_modify">Action modify</string>
<string name="action_delete">Action delete</string>
<string name="osm_edits">OSM edits</string>
<!-- means first letter of word *hour* -->
<string name="osmand_parking_hour">h</string><!-- means first letter of word *hour* -->
<string name="osmand_parking_minute">min</string><!-- means first letter of word *minute*-->
<!-- means first letter of word *minute* -->
<string name="parking_place_limited">Parking place time limited to</string>

View file

@ -4,45 +4,6 @@
package net.osmand.plus.activities.search;
import gnu.trove.set.hash.TLongHashSet;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.osmand.ResultMatcher;
import net.osmand.access.AccessibleToast;
import net.osmand.access.NavigationInfo;
import net.osmand.data.Amenity;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType;
import net.osmand.plus.OsmAndConstants;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandListActivity;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.poi.NameFinderPoiFilter;
import net.osmand.plus.poi.PoiLegacyFilter;
import net.osmand.plus.poi.SearchByNameFilter;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.views.DirectionDrawable;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import net.osmand.util.OpeningHoursParser;
import net.osmand.util.OpeningHoursParser.OpeningHours;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
@ -83,6 +44,46 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.ResultMatcher;
import net.osmand.access.AccessibleToast;
import net.osmand.access.NavigationInfo;
import net.osmand.data.Amenity;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType;
import net.osmand.plus.OsmAndConstants;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandListActivity;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.poi.NameFinderPoiFilter;
import net.osmand.plus.poi.PoiLegacyFilter;
import net.osmand.plus.poi.SearchByNameFilter;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.views.DirectionDrawable;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import net.osmand.util.OpeningHoursParser;
import net.osmand.util.OpeningHoursParser.OpeningHours;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import gnu.trove.set.hash.TLongHashSet;
/**
* Search poi activity
@ -147,7 +148,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
showFilterItem = menu.add(0, FILTER, 0, R.string.search_poi_filter);
MenuItemCompat.setShowAsAction(showFilterItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
showFilterItem = showFilterItem.setIcon(R.drawable.ic_action_filter_dark);
showFilterItem = showFilterItem.setIcon(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_filter_dark));
showFilterItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -3,28 +3,15 @@
*/
package net.osmand.plus.activities.search;
import java.util.ArrayList;
import java.util.List;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.ListFragment;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.*;
import net.osmand.access.AccessibleToast;
import net.osmand.data.LatLon;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
import net.osmand.plus.poi.NameFinderPoiFilter;
import net.osmand.plus.poi.PoiLegacyFilter;
import net.osmand.plus.poi.PoiFiltersHelper;
import net.osmand.plus.poi.SearchByNameFilter;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.resources.ResourceManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
@ -32,6 +19,23 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.access.AccessibleToast;
import net.osmand.data.LatLon;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
import net.osmand.plus.poi.NameFinderPoiFilter;
import net.osmand.plus.poi.PoiFiltersHelper;
import net.osmand.plus.poi.PoiLegacyFilter;
import net.osmand.plus.poi.SearchByNameFilter;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.resources.ResourceManager;
import java.util.ArrayList;
import java.util.List;
public class SearchPoiFilterFragment extends ListFragment implements SearchActivityChild {
@ -151,8 +155,9 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
OsmandApplication app = getMyApplication();
final PoiLegacyFilter model = getItem(position);
label.setText(model.getName());
IconsCache iconsCache = app.getIconsCache();
if(model.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID)) {
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_filter_dark));
icon.setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_action_filter_dark));
} else if (model.getFilterId().equals(PoiLegacyFilter.BY_NAME_FILTER_ID)) {
icon.setImageResource(android.R.drawable.ic_search_category_default);
} else {
@ -163,6 +168,7 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
}
}
ImageView editIcon = (ImageView) row.findViewById(R.id.folder_edit_icon);
editIcon.setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_action_filter_dark));
if (model.isStandardFilter()) {
editIcon.setVisibility(View.GONE);
} else {

View file

@ -90,7 +90,7 @@ public class DashOsmEditsFragment extends DashBaseFragment implements OsmEditsUp
OsmEditsFragment.getOsmEditView(view, point, getMyApplication());
ImageButton send =(ImageButton) view.findViewById(R.id.play);
send.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_gup_dark));
send.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_export));
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -3,6 +3,8 @@ package net.osmand.plus.osmedit;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
@ -108,7 +110,7 @@ public class OsmEditsFragment extends ListFragment implements OsmEditsUploadList
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
item = menu.add(R.string.local_osm_changes_backup).
setIcon(R.drawable.ic_action_gsave_dark);
setIcon(R.drawable.ic_action_gshare_dark);
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
@ -542,7 +544,12 @@ public class OsmEditsFragment extends ListFragment implements OsmEditsUploadList
if (result != null) {
AccessibleToast.makeText(getActivity(), getString(R.string.local_osm_changes_backup_failed) + " " + result, Toast.LENGTH_LONG).show();
} else {
AccessibleToast.makeText(getActivity(), getString(R.string.local_osm_changes_backup_successful, osmchange.getAbsolutePath()), Toast.LENGTH_LONG).show();
final Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_fav_subject));
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(osmchange));
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
}
}