Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
386d6f6646
6 changed files with 116 additions and 157 deletions
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -9,126 +9,89 @@
|
|||
android:layout_marginLeft="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TableLayout
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_name"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/Name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="">
|
||||
|
||||
android:stretchColumns="1">
|
||||
<requestFocus/>
|
||||
</EditText>
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:scrollHorizontally="true"
|
||||
android:text="@string/edit_tilesource_choose_existing"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_name" />
|
||||
<Spinner
|
||||
android:id="@+id/TileSourceSpinner"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/Name"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_url_to_load"/>
|
||||
|
||||
<requestFocus />
|
||||
</EditText>
|
||||
</TableRow>
|
||||
<EditText
|
||||
android:id="@+id/URLToLoad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="5"
|
||||
android:minLines="2"
|
||||
android:text=""/>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_minzoom"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_choose_existing"></TextView>
|
||||
<EditText
|
||||
android:id="@+id/MinZoom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/TileSourceSpinner"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"></Spinner>
|
||||
</TableRow>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_maxzoom"/>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<EditText
|
||||
android:id="@+id/MaxZoom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_url_to_load" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/edit_tilesource_expiration_time"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/URLToLoad"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="5"
|
||||
android:minLines="2"
|
||||
android:text=""></EditText>
|
||||
</TableRow>
|
||||
<EditText
|
||||
android:id="@+id/ExpirationTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""/>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_minzoom" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/MinZoom"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""></EditText>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit_tilesource_maxzoom" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/MaxZoom"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""></EditText>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/edit_tilesource_expiration_time" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ExpirationTime"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""></EditText>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/EllipticMercator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_span="2"
|
||||
android:text="@string/edit_tilesource_elliptic_tile" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
<CheckBox
|
||||
android:id="@+id/EllipticMercator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_span="2"
|
||||
android:text="@string/edit_tilesource_elliptic_tile"/>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<T> extends OsmandListActivity {
|
||||
|
||||
private static final String ENDING_TEXT = "ending_text";
|
||||
private EditText searchText;
|
||||
private AsyncTask<Object, ?, ?> initializeTask;
|
||||
|
||||
|
@ -76,7 +77,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
|
|||
protected ProgressBar progress;
|
||||
protected LatLon locationToSearch;
|
||||
protected OsmandSettings settings;
|
||||
protected List<T> initialListToFilter = new ArrayList<T>();
|
||||
protected List<T> initialListToFilter = new ArrayList<>();
|
||||
protected Handler uiHandler;
|
||||
protected Collator collator;
|
||||
protected NamesFilter namesFilter;
|
||||
|
@ -84,7 +85,7 @@ public abstract class SearchByNameAbstractActivity<T> 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<T> 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<T> 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<T> extends OsmandListActivity
|
|||
|
||||
|
||||
class UIUpdateHandler extends Handler {
|
||||
private Map<String, Integer> endingMap = new HashMap<String, Integer>();
|
||||
private Map<String, Integer> endingMap = new HashMap<>();
|
||||
private int minimalIndex = Integer.MAX_VALUE;
|
||||
private String minimalText = null;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue