From 0069da55380df425f4e5d8bf9885717a730df8c4 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 7 Jul 2017 11:32:35 +0300 Subject: [PATCH 1/4] Fix #3897 --- OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java index 73256ca461..004dad0f1e 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java @@ -168,7 +168,8 @@ public class MapPoiTypes { public Map getAllTranslatedNames(boolean skipNonEditable) { Map translation = new HashMap(); - for (PoiCategory pc : categories) { + for (int i = 0; i < categories.size(); i++) { + PoiCategory pc = categories.get(i); if (skipNonEditable && pc.isNotEditableOsm()) { continue; } From 6bc13f374a8c379e64f840c91fcc57892a8c969f Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 7 Jul 2017 13:20:34 +0300 Subject: [PATCH 2/4] Fix #4035 --- OsmAnd/res/layout/map_hud_quick_actions.xml | 1 - .../osmand/plus/views/MapQuickActionLayer.java | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/layout/map_hud_quick_actions.xml b/OsmAnd/res/layout/map_hud_quick_actions.xml index 27ca1ada1c..d6536d8d4c 100644 --- a/OsmAnd/res/layout/map_hud_quick_actions.xml +++ b/OsmAnd/res/layout/map_hud_quick_actions.xml @@ -15,7 +15,6 @@ android:id="@+id/map_quick_actions_button" android:layout_width="@dimen/map_button_size" android:layout_height="@dimen/map_button_size" - android:background="@drawable/btn_circle_blue" android:contentDescription="@string/configure_screen_quick_action" android:layout_gravity="bottom|right" android:visibility="gone" diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java index d7db3f3771..351ea7dd4d 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java @@ -3,6 +3,7 @@ package net.osmand.plus.views; import android.content.Context; import android.graphics.Canvas; import android.graphics.PointF; +import android.graphics.drawable.Drawable; import android.os.Vibrator; import android.support.annotation.DimenRes; import android.support.v4.content.ContextCompat; @@ -73,7 +74,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe quickActionButton = (ImageButton) mapActivity.findViewById(R.id.map_quick_actions_button); setQuickActionButtonMargin(); isLayerOn = quickActionRegistry.isQuickActionOn(); - quickActionButton.setImageResource(R.drawable.map_quick_action); + setUpQuickActionBtnResources(app.getDaynightHelper().isNightModeForMapControls()); quickActionButton.setContentDescription(mapActivity.getString(R.string.configure_screen_quick_action)); quickActionButton.setOnClickListener(new View.OnClickListener() { @Override @@ -293,6 +294,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe contextMarker.draw(canvas); } setUpQuickActionBtnVisibility(); + setUpQuickActionBtnResources(settings.isNightMode()); } private void setUpQuickActionBtnVisibility() { @@ -306,6 +308,20 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe quickActionButton.setVisibility(hideQuickButton ? View.GONE : View.VISIBLE); } + private void setUpQuickActionBtnResources(boolean nightMode) { + Drawable icon; + int backgroundId; + if (nightMode) { + backgroundId = R.drawable.btn_circle_night; + icon = app.getIconsCache().getIcon(R.drawable.map_quick_action, 0); + } else { + backgroundId = R.drawable.btn_circle_trans; + icon = app.getIconsCache().getIcon(R.drawable.map_quick_action, R.color.icon_color); + } + quickActionButton.setBackgroundResource(backgroundId); + quickActionButton.setImageDrawable(icon); + } + @Override public void destroyLayer() { From c80eed2840c7fdc10582cf41b271f4e124cb1c28 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 7 Jul 2017 15:33:27 +0300 Subject: [PATCH 3/4] Fix #3909 --- .../AudioVideoNoteRecordingMenuFullScreenFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenuFullScreenFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenuFullScreenFragment.java index ddcbdd7591..8b824feb8f 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenuFullScreenFragment.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenuFullScreenFragment.java @@ -38,7 +38,7 @@ public class AudioVideoNoteRecordingMenuFullScreenFragment extends Fragment { @Override public void onDestroyView() { super.onDestroyView(); - if (!dismissing) { + if (!dismissing && menu != null) { menu.finishRecording(); } } From bcbd94ed56de166b534630f3fda8229a62c48ed7 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 7 Jul 2017 17:04:27 +0300 Subject: [PATCH 4/4] Fix #3874 --- .../plus/myplaces/AvailableGPXFragment.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 5b682404cf..7e979ff35c 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -27,6 +27,8 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.view.inputmethod.InputMethodManager; +import android.widget.AbsListView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; @@ -327,6 +329,22 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { listView.setAdapter(this.adapter); } + listView.setOnScrollListener(new AbsListView.OnScrollListener() { + @Override + public void onScrollStateChanged(AbsListView absListView, int i) { + View currentFocus = getActivity().getCurrentFocus(); + if (currentFocus != null) { + InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0); + } + } + + @Override + public void onScroll(AbsListView absListView, int i, int i1, int i2) { + + } + }); + return v; }