diff --git a/OsmAnd/res/drawable-xxhdpi/img_logo_38dp_contour_lines.png b/OsmAnd/res/drawable-xxhdpi/img_logo_38dp_contour_lines.png new file mode 100644 index 0000000000..9242783bb9 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/img_logo_38dp_contour_lines.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/img_logo_38dp_osmand.png b/OsmAnd/res/drawable-xxhdpi/img_logo_38dp_osmand.png new file mode 100644 index 0000000000..c5b12d9f31 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/img_logo_38dp_osmand.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/img_start_screen_travel_day.webp b/OsmAnd/res/drawable-xxhdpi/img_start_screen_travel_day.webp new file mode 100644 index 0000000000..0572dd4a38 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/img_start_screen_travel_day.webp differ diff --git a/OsmAnd/res/drawable-xxhdpi/img_start_screen_travel_night.webp b/OsmAnd/res/drawable-xxhdpi/img_start_screen_travel_night.webp new file mode 100644 index 0000000000..392457027b Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/img_start_screen_travel_night.webp differ diff --git a/OsmAnd/res/layout-land/point_editor_fragment.xml b/OsmAnd/res/layout-land/point_editor_fragment.xml index 7bc06605df..69f0d1a3d3 100644 --- a/OsmAnd/res/layout-land/point_editor_fragment.xml +++ b/OsmAnd/res/layout-land/point_editor_fragment.xml @@ -202,7 +202,7 @@ android:layout_height="wrap_content" android:layout_marginRight="16dp" android:layout_marginLeft="8dp" - android:maxLines="8" + android:maxLines="1000" android:layout_gravity="center_vertical" android:textColor="?android:textColorPrimary" android:textColorHint="?android:textColorSecondary" diff --git a/OsmAnd/res/layout/map_marker_item_header.xml b/OsmAnd/res/layout/map_marker_item_header.xml index b4bb2b9212..54e4da7a27 100644 --- a/OsmAnd/res/layout/map_marker_item_header.xml +++ b/OsmAnd/res/layout/map_marker_item_header.xml @@ -1,6 +1,7 @@ - - + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/map_marker_item_subheader.xml b/OsmAnd/res/layout/map_marker_item_subheader.xml index 4896a8a385..3955bd4381 100644 --- a/OsmAnd/res/layout/map_marker_item_subheader.xml +++ b/OsmAnd/res/layout/map_marker_item_subheader.xml @@ -7,11 +7,11 @@ android:descendantFocusability="blocksDescendants" android:orientation="vertical"> - @@ -24,45 +24,66 @@ + android:layout_height="@dimen/map_button_shadow_width"> - - - - - - - - - + android:textColor="?attr/wikivoyage_active_color" + android:textSize="@dimen/default_desc_text_size" + osmand:typeface="@string/font_roboto_medium" + tools:ignore="UnusedAttribute" + tools:text="Van Gogh Museum" /> + + + + @@ -70,6 +91,8 @@ android:id="@+id/divider" android:layout_width="wrap_content" android:layout_height="1dp" + android:layout_marginLeft="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" android:background="?attr/dashboard_divider" /> diff --git a/OsmAnd/res/layout/point_editor_fragment.xml b/OsmAnd/res/layout/point_editor_fragment.xml index b55876fb2b..2ae46b5ad2 100644 --- a/OsmAnd/res/layout/point_editor_fragment.xml +++ b/OsmAnd/res/layout/point_editor_fragment.xml @@ -214,7 +214,7 @@ android:layout_marginLeft="8dp" android:layout_marginRight="16dp" android:inputType="textMultiLine" - android:maxLines="8" + android:maxLines="1000" android:textColor="?android:textColorPrimary" android:textColorHint="?android:textColorSecondary"/> diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index 1046dd3eaf..6258455773 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -463,7 +463,6 @@ public class MapMarkersHelper { private void createHeadersInGroup(@NonNull MapMarkersGroup group) { GroupHeader header = new GroupHeader(); CategoriesSubHeader categoriesSubHeader = new CategoriesSubHeader(); - WikivoyageArticleSubHeader wikivoyageArticleSubHeader = new WikivoyageArticleSubHeader(); int type = group.getType(); if (type != -1) { header.iconRes = type == MapMarkersGroup.FAVORITES_TYPE @@ -472,10 +471,8 @@ public class MapMarkersHelper { } header.group = group; categoriesSubHeader.group = group; - wikivoyageArticleSubHeader.group = group; group.header = header; group.categoriesSubHeader = categoriesSubHeader; - group.wikivoyageArticleSubHeader = wikivoyageArticleSubHeader; } private void removeMarkerFromGroup(MapMarker marker) { @@ -1226,7 +1223,6 @@ public class MapMarkersHelper { // TODO should be removed from this class: private GroupHeader header; private CategoriesSubHeader categoriesSubHeader; - private WikivoyageArticleSubHeader wikivoyageArticleSubHeader; private ShowHideHistoryButton showHideHistoryButton; public MapMarkersGroup() { @@ -1307,10 +1303,6 @@ public class MapMarkersHelper { return categoriesSubHeader; } - public WikivoyageArticleSubHeader getWikivoyageArticleSubHeader() { - return wikivoyageArticleSubHeader; - } - public ShowHideHistoryButton getShowHideHistoryButton() { return showHideHistoryButton; } @@ -1375,19 +1367,6 @@ public class MapMarkersHelper { } } - public static class WikivoyageArticleSubHeader { - private int iconRes; - private MapMarkersGroup group; - - public int getIconRes() { - return iconRes; - } - - public MapMarkersGroup getGroup() { - return group; - } - } - public static class MapMarker implements LocationPoint { private static int[] colors; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java index c639a0e867..81715f73d0 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java @@ -33,6 +33,7 @@ public class SelectWptCategoriesBottomSheetDialogFragment extends MenuBottomShee public static final String TAG = "SelectWptCategoriesBottomSheetDialogFragment"; public static final String GPX_FILE_PATH_KEY = "gpx_file_path"; public static final String UPDATE_CATEGORIES_KEY = "update_categories"; + public static final String ACTIVE_CATEGORIES_KEY = "active_categories"; private GPXFile gpxFile; @@ -48,13 +49,15 @@ public class SelectWptCategoriesBottomSheetDialogFragment extends MenuBottomShee return; } isUpdateMode = getArguments().getBoolean(UPDATE_CATEGORIES_KEY); + List categories = getArguments().getStringArrayList(ACTIVE_CATEGORIES_KEY); + items.add(new TitleItem(getGpxName(gpxFile))); items.add(new DescriptionItem(getString(R.string.select_waypoints_category_description))); final BottomSheetItemWithCompoundButton[] selectAllItem = new BottomSheetItemWithCompoundButton[1]; selectAllItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() - .setChecked(true) + .setChecked(!isUpdateMode || categories!=null&&categories.size() == gpxFile.getPointsByCategories().size()) .setDescription(getString(R.string.shared_string_total) + ": " + gpxFile.getPoints().size()) .setIcon(getContentIcon(R.drawable.ic_action_group_select_all)) .setTitle(getString(R.string.shared_string_select_all)) @@ -79,7 +82,7 @@ public class SelectWptCategoriesBottomSheetDialogFragment extends MenuBottomShee for (String category : pointsByCategories.keySet()) { final BottomSheetItemWithCompoundButton[] categoryItem = new BottomSheetItemWithCompoundButton[1]; categoryItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() - .setChecked(true) + .setChecked(!isUpdateMode || (categories != null && categories.contains(category))) .setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -105,31 +108,18 @@ public class SelectWptCategoriesBottomSheetDialogFragment extends MenuBottomShee .create(); items.add(categoryItem[0]); categoryItems.add(categoryItem[0]); - selectedCategories.add(category); + if (!isUpdateMode || categories != null && categories.contains(category)) { + selectedCategories.add(category); + } } } @Override protected int getRightBottomButtonTextId() { - if (isUpdateMode) { - return super.getRightBottomButtonTextId(); - } else { - return R.string.shared_string_add; - } - } - - @Override - protected int getDismissButtonTextId() { if (isUpdateMode) { return R.string.shared_string_update; } else { - return super.getDismissButtonTextId(); - } - } - - protected void onDismissButtonClickAction() { - if (isUpdateMode) { - updateAddOrEnableGroupWptCategories(); + return R.string.shared_string_add; } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerCategoriesViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerCategoriesViewHolder.java index 15b9b9c928..0fd33e1c42 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerCategoriesViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerCategoriesViewHolder.java @@ -12,14 +12,14 @@ import net.osmand.plus.R; public class MapMarkerCategoriesViewHolder extends RecyclerView.ViewHolder { - final ImageView icon; final TextView title; + final TextView button; final View divider; public MapMarkerCategoriesViewHolder(View itemView) { super(itemView); - icon = (ImageView) itemView.findViewById(R.id.icon_right); title = (TextView) itemView.findViewById(R.id.title); + button = (TextView) itemView.findViewById(R.id.categories_button); divider = itemView.findViewById(R.id.divider); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java index dfd4f80baa..b0e77dafb4 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java @@ -14,9 +14,11 @@ public class MapMarkerHeaderViewHolder extends RecyclerView.ViewHolder { final ImageView icon; final View iconSpace; final TextView title; + final TextView content; + final TextView button; final SwitchCompat disableGroupSwitch; final View bottomShadow; - final View divider; + final View articleDescription; public MapMarkerHeaderViewHolder(View itemView) { super(itemView); @@ -25,6 +27,8 @@ public class MapMarkerHeaderViewHolder extends RecyclerView.ViewHolder { title = (TextView) itemView.findViewById(R.id.title); disableGroupSwitch = (SwitchCompat) itemView.findViewById(R.id.disable_group_switch); bottomShadow = itemView.findViewById(R.id.bottom_shadow); - divider = itemView.findViewById(R.id.divider); + content = itemView.findViewById(R.id.content); + button = itemView.findViewById(R.id.text_button); + articleDescription = itemView.findViewById(R.id.article_description); } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerOpenWikivoyageArticleViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerOpenWikivoyageArticleViewHolder.java deleted file mode 100644 index fb8ec18859..0000000000 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerOpenWikivoyageArticleViewHolder.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.osmand.plus.mapmarkers.adapters; - - -import android.support.v7.widget.RecyclerView; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; - -import net.osmand.plus.R; - -public class MapMarkerOpenWikivoyageArticleViewHolder extends RecyclerView.ViewHolder { - - final ImageView icon; - final TextView title; - final View divider; - - public MapMarkerOpenWikivoyageArticleViewHolder(View itemView) { - super(itemView); - icon = (ImageView) itemView.findViewById(R.id.icon_right); - title = (TextView) itemView.findViewById(R.id.title); - divider = itemView.findViewById(R.id.divider); - } -} diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index 5d5a30d94f..fe1ecd810f 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -38,8 +38,11 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.Set; public class MapMarkersGroupsAdapter extends RecyclerView.Adapter { @@ -47,7 +50,6 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter(group.getWptCategories())); SelectWptCategoriesBottomSheetDialogFragment fragment = new SelectWptCategoriesBottomSheetDialogFragment(); fragment.setArguments(args); fragment.setUsedOnMap(false); @@ -552,25 +571,15 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter categories = group.getWptCategories(); + if (categories != null && !categories.isEmpty()) { + Iterator it = categories.iterator(); + while (it.hasNext()) { + String category = it.next(); + if (category.equals("")) { + category = app.getResources().getString(R.string.waypoints); + } + sb.append(category); + if (it.hasNext()) { + sb.append(", "); + } + } + } + return sb.toString(); + } + @Override public int getItemViewType(int position) { Object item = items.get(position); @@ -594,10 +622,8 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter