diff --git a/OsmAnd/res/layout/fragment_gpx_approximation_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_gpx_approximation_bottom_sheet_dialog.xml
index 086fb5a66f..0d85fb98e5 100644
--- a/OsmAnd/res/layout/fragment_gpx_approximation_bottom_sheet_dialog.xml
+++ b/OsmAnd/res/layout/fragment_gpx_approximation_bottom_sheet_dialog.xml
@@ -13,6 +13,14 @@
+
+
+
+
-
-
diff --git a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java
index 664c2a8afe..57928eac50 100644
--- a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java
@@ -66,6 +66,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
private View view;
private OnLayoutChangeListener containerLayoutListener;
private View topShadow;
+ private ViewGroup topView;
private View bottomScrollView;
private LinearLayout cardsContainer;
private FrameLayout bottomContainer;
@@ -167,6 +168,11 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
return mainView;
}
+ @Nullable
+ public ViewGroup getTopView() {
+ return topView;
+ }
+
public boolean isNightMode() {
return nightMode;
}
@@ -290,7 +296,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
final int touchSlop = vc.getScaledTouchSlop();
if (getTopViewId() != 0) {
- View topView = view.findViewById(getTopViewId());
+ topView = view.findViewById(getTopViewId());
AndroidUtils.setBackground(app, topView, nightMode, R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
}
if (!portrait) {
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/GpxApproximationFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/GpxApproximationFragment.java
index 7c19d0db33..4217faf1c9 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/GpxApproximationFragment.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/GpxApproximationFragment.java
@@ -61,6 +61,11 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
return R.layout.fragment_gpx_approximation_bottom_sheet_dialog;
}
+ @Override
+ public int getTopViewId() {
+ return R.id.gpx_approximation_top_shadow_all;
+ }
+
@Override
public int getHeaderViewHeight() {
return menuTitleHeight;
@@ -259,9 +264,11 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
ViewGroup cardsContainer = getCardsContainer();
cardsContainer.removeAllViews();
- SliderCard sliderCard = new SliderCard(mapActivity, distanceThreshold);
- sliderCard.setListener(this);
- cardsContainer.addView(sliderCard.build(mapActivity));
+ if (getTopView() != null) {
+ SliderCard sliderCard = new SliderCard(mapActivity, distanceThreshold);
+ sliderCard.setListener(this);
+ getTopView().addView(sliderCard.build(mapActivity));
+ }
ProfileCard profileCard = new ProfileCard(mapActivity, snapToRoadAppMode);
profileCard.setListener(this);
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java
index 0f7f812f48..65f1bab915 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java
@@ -477,8 +477,8 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
AndroidUtils.setBackground(ctx, getCardsContainer(), isNightMode(),
R.color.activity_background_light, R.color.activity_background_dark);
- if (getTopViewId() != 0) {
- View topView = view.findViewById(getTopViewId());
+ if (getTopView() != null) {
+ View topView = getTopView();
AndroidUtils.setBackground(ctx, topView, isNightMode(), R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
}