From e069d66b66e521a4974f4ff9e514fc257a0996bf Mon Sep 17 00:00:00 2001 From: PaulStets Date: Fri, 26 Jan 2018 16:49:52 +0200 Subject: [PATCH 1/3] Fixed #4873 --- .../MeasurementToolFragment.java | 3 +-- .../adapter/MeasurementToolAdapter.java | 18 +++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 0245c0ce75..5e3dd47ac4 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -705,9 +705,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { } @Override - public void onItemClick(View view) { + public void onItemClick(int position) { if (mapActivity != null && measurementLayer != null) { - int position = pointsRv.indexOfChild(view); if (pointsListOpened) { hidePointsList(); } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java index effb5e6442..caa20b9106 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java @@ -8,8 +8,10 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; +import android.widget.RelativeLayout; import android.widget.TextView; import net.osmand.plus.GPXUtilities.WptPt; @@ -52,12 +54,6 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter Date: Fri, 26 Jan 2018 16:51:56 +0200 Subject: [PATCH 2/3] Removed unused import --- .../plus/measurementtool/adapter/MeasurementToolAdapter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java index caa20b9106..293fd57816 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java @@ -11,7 +11,6 @@ import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; -import android.widget.RelativeLayout; import android.widget.TextView; import net.osmand.plus.GPXUtilities.WptPt; From bffea36c300c3813ba28c6d110556e11e33f2a96 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Fri, 26 Jan 2018 17:03:02 +0200 Subject: [PATCH 3/3] Use itemView --- .../plus/measurementtool/adapter/MeasurementToolAdapter.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java index 293fd57816..c123cf5c15 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/MeasurementToolAdapter.java @@ -8,7 +8,6 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @@ -124,7 +123,7 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter