diff --git a/OsmAnd/res/layout/editing_tile_source.xml b/OsmAnd/res/layout/editing_tile_source.xml index 669b5439dc..c526a87911 100644 --- a/OsmAnd/res/layout/editing_tile_source.xml +++ b/OsmAnd/res/layout/editing_tile_source.xml @@ -1,7 +1,7 @@ + android:layout_width="fill_parent" + android:layout_height="fill_parent"> - + + - android:stretchColumns="1"> + + - + - + - + - - - + - + - + - - + - + - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 2a986ef28b..dd6cfe1a54 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -66,7 +66,7 @@ Пошук вуліцы ў суседніх гарадах Прамежкавыя пункты шляху адсартаваныя аптымальным чынам ад бягучага становішча да месца прызначэньня. - Упарадкаваць па адлегласьці + Упарадкаваць ад дзьвярэй да дзьвярэй Файл зьмен OSM пасьпяхова створаны ў %1$s Збой рэзервовага капіяваньня файлу зьмен OSM Рэзервовае капіяваньне файлу зьмен OSM @@ -2038,4 +2038,13 @@ Колер сьледу GPX Пераадкрыць Выкарыстоўваць мэню + Кнопка Мэню паказвае панэль кіраваньня, а не мэню + Доступ з мапы + Выдаліць шляхавую кропку GPX? + Правіць кропку шляху GPX + Пазьбягаць лесьвіц + Пазьбягаць лесьвіц + Пазьбягаць перасячэньня мяжы + Выкарыстоўваць панэль кіраваньня + Панэль кіраваньня ці мэню diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index b50e0c22a1..d716c6ae5c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -398,9 +398,9 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { dashboardOnMap.setDashboardVisibility(true, DashboardOnMap.staticVisibleType); } else { if (ErrorBottomSheetDialog.shouldShow(settings, this)) { - new ErrorBottomSheetDialog().show(getFragmentManager(), "dialog"); + new ErrorBottomSheetDialog().show(getSupportFragmentManager(), "dialog"); } else if (RateUsBottomSheetDialog.shouldShow(settings)) { - new RateUsBottomSheetDialog().show(getFragmentManager(), "dialog"); + new RateUsBottomSheetDialog().show(getSupportFragmentManager(), "dialog"); } } } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java index bf01f11644..9dd92f8041 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java @@ -1,34 +1,6 @@ package net.osmand.plus.activities.search; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.osmand.Collator; -import net.osmand.CollatorStringMatcher; -import net.osmand.CollatorStringMatcher.StringMatcherMode; -import net.osmand.OsmAndCollator; -import net.osmand.PlatformUtil; -import net.osmand.data.LatLon; -import net.osmand.data.MapObject; -import net.osmand.data.PointDescription; -import net.osmand.plus.OsmAndConstants; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.OsmandSettings; -import net.osmand.plus.R; -import net.osmand.plus.activities.MapActivity; -import net.osmand.plus.activities.OsmandListActivity; -import net.osmand.plus.activities.search.SearchAddressFragment.AddressInformation; -import net.osmand.plus.dialogs.DirectionsDialogs; -import net.osmand.plus.dialogs.FavoriteDialogs; - -import org.apache.commons.logging.Log; - import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; @@ -62,10 +34,39 @@ import android.widget.TextView; import android.widget.TextView.BufferType; import android.widget.TextView.OnEditorActionListener; +import net.osmand.Collator; +import net.osmand.CollatorStringMatcher; +import net.osmand.CollatorStringMatcher.StringMatcherMode; +import net.osmand.OsmAndCollator; +import net.osmand.PlatformUtil; +import net.osmand.data.LatLon; +import net.osmand.data.MapObject; +import net.osmand.data.PointDescription; +import net.osmand.plus.OsmAndConstants; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.OsmandSettings; +import net.osmand.plus.R; +import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.activities.OsmandListActivity; +import net.osmand.plus.activities.search.SearchAddressFragment.AddressInformation; +import net.osmand.plus.dialogs.DirectionsDialogs; +import net.osmand.plus.dialogs.FavoriteDialogs; + +import org.apache.commons.logging.Log; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + @SuppressLint("NewApi") public abstract class SearchByNameAbstractActivity extends OsmandListActivity { + private static final String ENDING_TEXT = "ending_text"; private EditText searchText; private AsyncTask initializeTask; @@ -76,7 +77,7 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity protected ProgressBar progress; protected LatLon locationToSearch; protected OsmandSettings settings; - protected List initialListToFilter = new ArrayList(); + protected List initialListToFilter = new ArrayList<>(); protected Handler uiHandler; protected Collator collator; protected NamesFilter namesFilter; @@ -84,7 +85,7 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity private boolean initFilter = false; private String endingText = ""; private T endingObject; - private StyleSpan previousSpan; + private StyleSpan previousSpan = new StyleSpan(Typeface.BOLD_ITALIC); private static final Log log = PlatformUtil.getLog(SearchByNameAbstractActivity.class); private static final int NAVIGATE_TO = 3; @@ -233,17 +234,15 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - outState.putString("ENDING_TEXT", endingText); - outState.putParcelable("PREVIOUS_SPAN", this.previousSpan); + outState.putString(ENDING_TEXT, endingText); } @Override protected void onRestoreInstanceState(Bundle prevState) { - endingText = prevState.getString("ENDING_TEXT"); + endingText = prevState.getString(ENDING_TEXT); if(endingText == null) { endingText = ""; } - previousSpan = prevState.getParcelable("PREVIOUS_SPAN"); super.onRestoreInstanceState(prevState); } @@ -268,12 +267,9 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity if(updateText) { searchText.getText().replace(currentFilter.length(), currentFilter.length() + prevEndtext.length(), locEndingText); } - if (previousSpan != null) { - searchText.getText().removeSpan(previousSpan); - previousSpan = null; - } + + searchText.getText().removeSpan(previousSpan); if (locEndingText.length() > 0) { - previousSpan = new StyleSpan(Typeface.BOLD_ITALIC); searchText.getText().setSpan(previousSpan, currentFilter.length(), currentFilter.length() + locEndingText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); if (searchText.getSelectionEnd() > currentFilter.length()) { @@ -384,7 +380,7 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity class UIUpdateHandler extends Handler { - private Map endingMap = new HashMap(); + private Map endingMap = new HashMap<>(); private int minimalIndex = Integer.MAX_VALUE; private String minimalText = null; diff --git a/OsmAnd/src/net/osmand/plus/base/BottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/base/BottomSheetDialogFragment.java index 671ccf1c41..36229aac60 100644 --- a/OsmAnd/src/net/osmand/plus/base/BottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/BottomSheetDialogFragment.java @@ -1,12 +1,12 @@ package net.osmand.plus.base; import android.app.Dialog; -import android.app.DialogFragment; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.ColorRes; import android.support.annotation.DrawableRes; import android.support.annotation.Nullable; +import android.support.v4.app.DialogFragment; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashDashboardOrDrawerFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashDashboardOrDrawerFragment.java index e50e23e98a..faf607415f 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashDashboardOrDrawerFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashDashboardOrDrawerFragment.java @@ -42,7 +42,6 @@ public class DashDashboardOrDrawerFragment extends DashBaseFragment { settings.SHOW_DASHBOARD_ON_START.set(false); settings.SHOW_DASHBOARD_ON_MAP_SCREEN.set(false); settings.SHOW_CARD_TO_CHOOSE_DRAWER.set(false); - dashboard.hideFragmentByTag(TAG); dashboard.hideDashboard(); } }); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 383d39ac44..ab5ed943d1 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -13,6 +13,7 @@ import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; +import android.support.v4.widget.Space; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.MenuItem; @@ -23,7 +24,6 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; -import android.support.v4.widget.Space; import android.widget.TextView; import android.widget.Toast; @@ -577,7 +577,7 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl GoToMapFragment fragment = new GoToMapFragment(); fragment.regionCenter = region.getRegionCenter(); fragment.regionName = region.getLocaleName(); - fragment.show(getFragmentManager(), GoToMapFragment.TAG); + fragment.show(getSupportFragmentManager(), GoToMapFragment.TAG); } private void showDownloadWorldMapIfNeeded() { @@ -590,7 +590,7 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl SUGGESTED_TO_DOWNLOAD_BASEMAP = true; AskMapDownloadFragment fragment = new AskMapDownloadFragment(); fragment.indexItem = worldMap; - fragment.show(getFragmentManager(), AskMapDownloadFragment.TAG); + fragment.show(getSupportFragmentManager(), AskMapDownloadFragment.TAG); } } @@ -599,7 +599,7 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl final boolean externalExists = getMyApplication().getSettings().getSecondaryStorage() != null; if (firstTime && externalExists && DataStoragePlaceDialogFragment.isInterestedInFirstTime) { - new DataStoragePlaceDialogFragment().show(getFragmentManager(), null); + new DataStoragePlaceDialogFragment().show(getSupportFragmentManager(), null); } } @@ -762,7 +762,8 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (savedInstanceState != null) { - regionName = savedInstanceState.getString(KEY_GOTO_MAP_REGION_NAME, ""); + regionName = savedInstanceState.getString(KEY_GOTO_MAP_REGION_NAME); + regionName = regionName == null ? "" : regionName; Object rCenterObj = savedInstanceState.getSerializable(KEY_GOTO_MAP_REGION_CENTER); if (rCenterObj != null) { regionCenter = (LatLon) rCenterObj;