From 9090faf285d8e3d85e6c5a979bd10ea3fa0692a3 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 12 Mar 2018 10:30:54 +0200 Subject: [PATCH] Fix bug with displaying asynchronously loaded gpx tracks --- .../net/osmand/plus/base/MenuBottomSheetDialogFragment.java | 6 +++--- .../mapmarkers/AddTracksGroupBottomSheetDialogFragment.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java index f1b2034b3c..2f8abc1391 100644 --- a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java @@ -81,7 +81,7 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra }); ((TextView) mainView.findViewById(R.id.close_row_text)).setText(getCloseRowTextId()); - setupHeightAndBackground(mainView, R.id.scroll_view); + setupHeightAndBackground(mainView); return mainView; } @@ -123,7 +123,7 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra return getIcon(id, nightMode ? R.color.osmand_orange : R.color.color_myloc_distance); } - protected void setupHeightAndBackground(final View mainView, final int scrollViewId) { + protected void setupHeightAndBackground(final View mainView) { final Activity activity = getActivity(); final int screenHeight = AndroidUtils.getScreenHeight(activity); final int statusBarHeight = AndroidUtils.getStatusBarHeight(activity); @@ -132,7 +132,7 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { - final View scrollView = mainView.findViewById(scrollViewId); + final View scrollView = mainView.findViewById(R.id.scroll_view); int scrollViewHeight = scrollView.getHeight(); int dividerHeight = AndroidUtils.dpToPx(getContext(), 1); int cancelButtonHeight = getContext().getResources().getDimensionPixelSize(R.dimen.bottom_sheet_cancel_button_height); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java index dbb762b02d..d8feb5906e 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java @@ -152,6 +152,7 @@ public class AddTracksGroupBottomSheetDialogFragment extends AddGroupBottomSheet progressBar.setVisibility(View.GONE); lookingForTracksText.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); + setupHeightAndBackground(getView()); } } }