Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2e35a4d62b
6 changed files with 91 additions and 4 deletions
|
@ -134,6 +134,54 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_toolbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/ctx_menu_info_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttonToolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp"
|
||||
android:clickable="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/buttonToolbarImage"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_action_marker_dark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/buttonToolbarTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:lines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@string/show_on_map"
|
||||
android:textColor="?attr/color_dialog_buttons"
|
||||
android:textSize="@dimen/default_desc_text_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textColor="?attr/color_dialog_buttons"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
tools:text="Amsterdam"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -9,7 +9,8 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="share_history_subject">History shared via OsmAnd</string>
|
||||
<string name="show_on_map">Show on the map</string>
|
||||
<string name="share_history_subject"> shared via OsmAnd</string>
|
||||
<string name="search_categories">Categories</string>
|
||||
<string name="postcode">Postcode</string>
|
||||
<string name="shared_string_from">from</string>
|
||||
|
|
|
@ -252,7 +252,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
|
|||
for(GpxDisplayItem i : modifiableList) {
|
||||
if (i.locationStart != null) {
|
||||
FavouritePoint fp = new FavouritePoint(i.locationStart.lat, i.locationStart.lon, i.name, category);
|
||||
if (i.description != null)) {
|
||||
if (!Algorithms.isEmpty(i.description)) {
|
||||
fp.setDescription(i.description);
|
||||
}
|
||||
fdb.addFavourite(fp, false);
|
||||
|
|
|
@ -603,7 +603,9 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
|
|||
@Override
|
||||
public int compareTo(@NonNull PoiUIFilter another) {
|
||||
if (another.filterId.equals(this.filterId)) {
|
||||
return 0;
|
||||
String thisFilterByName = this.filterByName == null ? "" : this.filterByName;
|
||||
String anotherFilterByName = another.filterByName == null ? "" : another.filterByName;
|
||||
return thisFilterByName.compareToIgnoreCase(anotherFilterByName);
|
||||
} else {
|
||||
return this.name.compareTo(another.name);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import android.widget.AdapterView;
|
|||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
@ -35,6 +36,7 @@ import net.osmand.ResultMatcher;
|
|||
import net.osmand.binary.BinaryMapIndexReader;
|
||||
import net.osmand.data.FavouritePoint;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.osm.AbstractPoiType;
|
||||
import net.osmand.plus.GPXUtilities;
|
||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||
import net.osmand.plus.GPXUtilities.WptPt;
|
||||
|
@ -48,6 +50,7 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.helpers.SearchHistoryHelper;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
|
||||
import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo;
|
||||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.resources.RegionAddressRepository;
|
||||
import net.osmand.search.SearchUICore;
|
||||
import net.osmand.search.SearchUICore.SearchResultCollection;
|
||||
|
@ -81,6 +84,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
private View tabToolbarView;
|
||||
private View tabsView;
|
||||
private View searchView;
|
||||
private View buttonToolbarView;
|
||||
private ImageView buttonToolbarImage;
|
||||
private TextView buttonToolbarText;
|
||||
private QuickSearchMainListFragment mainSearchFragment;
|
||||
private QuickSearchHistoryListFragment historySearchFragment;
|
||||
private QuickSearchCategoriesListFragment categoriesSearchFragment;
|
||||
|
@ -136,6 +142,33 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
tabsView = view.findViewById(R.id.tabs_view);
|
||||
searchView = view.findViewById(R.id.search_view);
|
||||
|
||||
buttonToolbarView = view.findViewById(R.id.button_toolbar_layout);
|
||||
buttonToolbarImage = (ImageView) view.findViewById(R.id.buttonToolbarImage);
|
||||
buttonToolbarImage.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_marker_dark));
|
||||
buttonToolbarText = (TextView) view.findViewById(R.id.buttonToolbarTitle);
|
||||
buttonToolbarText.setText(app.getString(R.string.show_on_map).toUpperCase());
|
||||
view.findViewById(R.id.buttonToolbar).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SearchPhrase searchPhrase = searchUICore.getPhrase();
|
||||
if (searchPhrase.isLastWord(ObjectType.POI_TYPE)) {
|
||||
OsmandSettings settings = app.getSettings();
|
||||
AbstractPoiType abstractPoiType = (AbstractPoiType) searchPhrase.getLastSelectedWord().getResult().object;
|
||||
PoiUIFilter filter = new PoiUIFilter(abstractPoiType, app, "");
|
||||
if (!Algorithms.isEmpty(searchPhrase.getLastWord())) {
|
||||
filter.setFilterByName(searchPhrase.getLastWord());
|
||||
}
|
||||
app.getPoiFilters().clearSelectedPoiFilters();
|
||||
app.getPoiFilters().addSelectedPoiFilter(filter);
|
||||
if (location != null) {
|
||||
settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(), 15);
|
||||
}
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
||||
toolbar.setNavigationIcon(app.getIconsCache().getThemedIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
|
||||
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
|
||||
|
@ -399,10 +432,12 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
private void updateTabbarVisibility(boolean show) {
|
||||
if (show && tabsView.getVisibility() == View.GONE) {
|
||||
tabToolbarView.setVisibility(View.VISIBLE);
|
||||
buttonToolbarView.setVisibility(View.GONE);
|
||||
tabsView.setVisibility(View.VISIBLE);
|
||||
searchView.setVisibility(View.GONE);
|
||||
} else if (!show && tabsView.getVisibility() == View.VISIBLE) {
|
||||
tabToolbarView.setVisibility(View.GONE);
|
||||
buttonToolbarView.setVisibility(View.VISIBLE);
|
||||
tabsView.setVisibility(View.GONE);
|
||||
searchView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
@ -762,6 +797,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
public void enableSelectionMode(boolean selectionMode,int position) {
|
||||
historySearchFragment.setSelectionMode(selectionMode, position);
|
||||
tabToolbarView.setVisibility(selectionMode ? View.GONE : View.VISIBLE);
|
||||
buttonToolbarView.setVisibility(View.GONE);
|
||||
toolbar.setVisibility(selectionMode ? View.GONE : View.VISIBLE);
|
||||
toolbarEdit.setVisibility(selectionMode ? View.VISIBLE : View.GONE);
|
||||
viewPager.setSwipeLocked(selectionMode);
|
||||
|
|
Loading…
Reference in a new issue