From 82a641bda475fac27f9f7d3c196a44feddef8514 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Mon, 30 Oct 2017 19:07:18 +0200 Subject: [PATCH] Fix keyboard --- .../fragment_coordinate_input_dialog.xml | 19 ++++++------------- .../CoordinateInputDialogFragment.java | 16 +++++++++------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml b/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml index 03c2881bd3..bb53612811 100644 --- a/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml +++ b/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml @@ -152,20 +152,13 @@ - - - - - + android:layout_height="match_parent"/> diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index 633fd04c51..649eae6ba1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -222,13 +222,15 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm RecyclerView recyclerView = (RecyclerView) mainView.findViewById(R.id.markers_recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); adapter = new CoordinateInputAdapter(mapActivity, mapMarkers); - adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() { - @Override - public void onChanged() { - super.onChanged(); - mapMarkersLayout.setVisibility(adapter.isEmpty() ? View.GONE : View.VISIBLE); - } - }); + if (mapMarkersLayout != null) { + adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() { + @Override + public void onChanged() { + super.onChanged(); + mapMarkersLayout.setVisibility(adapter.isEmpty() ? View.GONE : View.VISIBLE); + } + }); + } recyclerView.setAdapter(adapter); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override