diff --git a/OsmAnd/res/layout/favorites_list_item.xml b/OsmAnd/res/layout/favorites_list_item.xml index 7ce1d0f3f2..e28350326c 100644 --- a/OsmAnd/res/layout/favorites_list_item.xml +++ b/OsmAnd/res/layout/favorites_list_item.xml @@ -29,6 +29,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:orientation="horizontal" + android:paddingRight="@dimen/list_header_padding" + android:paddingEnd="@dimen/list_header_padding" android:paddingLeft="@dimen/list_header_padding" android:paddingStart="@dimen/list_header_padding"> @@ -41,10 +43,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginRight="@dimen/list_content_padding" android:focusable="false" android:visibility="gone" tools:visibility="visible" + android:layout_marginLeft="@dimen/list_header_padding" + android:layout_marginStart="@dimen/list_header_padding" + android:layout_marginRight="@dimen/list_content_padding" android:layout_marginEnd="@dimen/list_content_padding" /> + android:layout_marginRight="@dimen/list_header_text_left_margin" + android:layout_marginEnd="@dimen/list_header_text_left_margin" + android:contentDescription="@string/favorite" /> + android:paddingTop="@dimen/context_menu_padding_margin_tiny" + android:paddingBottom="@dimen/context_menu_padding_margin_tiny"> + android:layout_marginTop="@dimen/subHeaderPadding" + android:src="@drawable/ic_direction_arrow" + android:contentDescription="@string/show_view_angle" /> + android:layout_marginStart="@dimen/subHeaderPadding" /> + android:layout_marginStart="@dimen/list_item_button_padding" + android:contentDescription="@string/favorite_category_name" /> + android:layout_marginStart="@dimen/subHeaderPadding" /> diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index af8672eef8..2792986f73 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -139,7 +139,7 @@ android:paddingStart="12dp" android:paddingLeft="12dp" android:paddingRight="12dp" - android:scrollHorizontally="false" + android:scrollbars="vertical" android:textSize="16sp" tools:text="@string/lorem_ipsum" /> diff --git a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java index 68181d3797..084e58ae08 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java @@ -31,6 +31,7 @@ import net.osmand.IProgress; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.data.FavouritePoint; +import net.osmand.data.FavouritePoint.BackgroundType; import net.osmand.plus.AppInitializer; import net.osmand.plus.AppInitializer.AppInitializeListener; import net.osmand.plus.AppInitializer.InitEvents; @@ -1181,6 +1182,7 @@ public class ImportHelper { } fp.setColor(p.getColor(0)); fp.setIconIdFromName(app, p.getIconName()); + fp.setBackgroundType(BackgroundType.getByTypeName(p.getBackgroundType(), BackgroundType.CIRCLE)); favourites.add(fp); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index e096f6282b..76d340844f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -1,5 +1,6 @@ package net.osmand.plus.mapcontextmenu.editors; +import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.DialogInterface; @@ -10,6 +11,7 @@ import android.os.Bundle; import android.os.IBinder; import android.view.LayoutInflater; +import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; @@ -65,7 +67,7 @@ import static net.osmand.util.Algorithms.capitalizeFirstLetter; public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { - public static final String TAG = "PointEditorFragmentNew"; + public static final String TAG = PointEditorFragmentNew.class.getSimpleName(); private View view; private EditText nameEdit; @@ -87,6 +89,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { private View descriptionCaption; private EditText descriptionEdit; + @SuppressLint("ClickableViewAccessibility") @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -95,6 +98,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { nightMode = app.getDaynightHelper().isNightModeForMapControls(); view = UiUtilities.getMaterialInflater(getContext(), nightMode) .inflate(R.layout.point_editor_fragment_new, container, false); + AndroidUtils.addStatusBarPadding21v(getActivity(), view); final PointEditor editor = getEditor(); if (editor == null) { @@ -131,6 +135,8 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { if (scrollViewY != scrollView.getScrollY()) { scrollViewY = scrollView.getScrollY(); hideKeyboard(); + descriptionEdit.clearFocus(); + nameEdit.clearFocus(); } } }); @@ -259,6 +265,23 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { createShapeSelector(); updateColorSelector(selectedColor, view); updateShapeSelector(selectedShape, view); + scrollView.setOnTouchListener(new View.OnTouchListener() { + + @Override + public boolean onTouch(View v, MotionEvent event) { + descriptionEdit.getParent().requestDisallowInterceptTouchEvent(false); + return false; + } + }); + + descriptionEdit.setOnTouchListener(new View.OnTouchListener() { + + @Override + public boolean onTouch(View v, MotionEvent event) { + descriptionEdit.getParent().requestDisallowInterceptTouchEvent(true); + return false; + } + }); return view; } @@ -442,10 +465,11 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { } IconCategoriesAdapter iconCategoriesAdapter = new IconCategoriesAdapter(); iconCategoriesAdapter.setItems(new ArrayList<>(iconCategories.keySet())); - RecyclerView groupNameRecyclerView = view.findViewById(R.id.group_name_recycler_view); - groupNameRecyclerView.setAdapter(iconCategoriesAdapter); - groupNameRecyclerView.setLayoutManager(new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false)); + RecyclerView iconCategoriesRecyclerView = view.findViewById(R.id.group_name_recycler_view); + iconCategoriesRecyclerView.setAdapter(iconCategoriesAdapter); + iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false)); iconCategoriesAdapter.notifyDataSetChanged(); + iconCategoriesRecyclerView.scrollToPosition(iconCategoriesAdapter.getItemPosition(selectedIconCategory)); for (String name : iconNameList) { selectIcon.addView(createIconItemView(name, selectIcon), new FlowLayout.LayoutParams(0, 0)); } @@ -562,7 +586,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { @Override protected boolean isFullScreenAllowed() { - return false; + return true; } private void hideKeyboard() { @@ -920,6 +944,10 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { public int getItemCount() { return items.size(); } + + int getItemPosition(String name) { + return items.indexOf(name); + } } static class NameViewHolder extends RecyclerView.ViewHolder {