diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java index 4ea678880a..68268141dc 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java @@ -58,7 +58,7 @@ public class BugBottomSheetDialog extends MenuBottomSheetDialogFragment { View osmNoteView = View.inflate(UiUtilities.getThemedContext(app, nightMode), R.layout.open_osm_note_text, null); - osmNoteView.getViewTreeObserver().addOnScrollChangedListener(getOnGlobalLayoutListener()); + osmNoteView.getViewTreeObserver().addOnGlobalLayoutListener(getOnGlobalLayoutListener()); TextInputLayout textBox = osmNoteView.findViewById(R.id.name_text_box); textBox.setHint(AndroidUtils.addColon(app, R.string.osn_bug_name)); ColorStateList colorStateList = ColorStateList.valueOf(ContextCompat @@ -75,10 +75,9 @@ public class BugBottomSheetDialog extends MenuBottomSheetDialogFragment { items.add(new DividerSpaceItem(app, app.getResources().getDimensionPixelSize(R.dimen.content_padding_small))); } - private ViewTreeObserver.OnScrollChangedListener getOnGlobalLayoutListener() { - return new ViewTreeObserver.OnScrollChangedListener() { - @Override - public void onScrollChanged() { + private ViewTreeObserver.OnGlobalLayoutListener getOnGlobalLayoutListener() { + return new ViewTreeObserver.OnGlobalLayoutListener() { + @Override public void onGlobalLayout() { setShadowOnScrollableView(); } }; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index 3fdeaaae05..d956d00af4 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -66,7 +66,7 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode); View sendGpxView = themedInflater.inflate(R.layout.send_gpx_fragment, null); - sendGpxView.getViewTreeObserver().addOnScrollChangedListener(getOnGlobalLayoutListener()); + sendGpxView.getViewTreeObserver().addOnGlobalLayoutListener(getOnGlobalLayoutListener()); tagsField = sendGpxView.findViewById(R.id.tags_field); messageField = sendGpxView.findViewById(R.id.message_field); @@ -128,10 +128,10 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { items.add(titleItem); } - private ViewTreeObserver.OnScrollChangedListener getOnGlobalLayoutListener() { - return new ViewTreeObserver.OnScrollChangedListener() { + private ViewTreeObserver.OnGlobalLayoutListener getOnGlobalLayoutListener() { + return new ViewTreeObserver.OnGlobalLayoutListener() { @Override - public void onScrollChanged() { + public void onGlobalLayout() { scrollView = getView().findViewById(R.id.scroll_view); if (scrollView.canScrollVertically(1) || scrollView.canScrollVertically(-1)) { drawTopShadow(false); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index d1178dbca3..7230b7fd9e 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -78,7 +78,7 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen final View sendOsmNoteView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_osm_note_fragment, null); - sendOsmNoteView.getViewTreeObserver().addOnScrollChangedListener(getOnGlobalLayoutListener()); + sendOsmNoteView.getViewTreeObserver().addOnGlobalLayoutListener(getOnGlobalLayoutListener()); noteText = sendOsmNoteView.findViewById(R.id.note_text); noteText.setText(((OsmNotesPoint) poi[0]).getText()); @@ -150,10 +150,9 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen items.add(bottomSheetItem); } - private ViewTreeObserver.OnScrollChangedListener getOnGlobalLayoutListener() { - return new ViewTreeObserver.OnScrollChangedListener() { - @Override - public void onScrollChanged() { + private ViewTreeObserver.OnGlobalLayoutListener getOnGlobalLayoutListener() { + return new ViewTreeObserver.OnGlobalLayoutListener() { + @Override public void onGlobalLayout() { setShadowOnScrollableView(); } }; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index 28134215d7..0c4ca7e6b5 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -61,7 +61,7 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { final boolean isNightMode = app.getDaynightHelper().isNightModeForMapControls(); final View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_poi_fragment, null); - sendOsmPoiView.getViewTreeObserver().addOnScrollChangedListener(getOnGlobalLayoutListener()); + sendOsmPoiView.getViewTreeObserver().addOnGlobalLayoutListener(getOnGlobalLayoutListener()); closeChangeSet = sendOsmPoiView.findViewById(R.id.close_change_set_checkbox); messageEditText = sendOsmPoiView.findViewById(R.id.message_field); String defaultChangeSet = createDefaultChangeSet(app); @@ -106,10 +106,9 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { items.add(titleItem); } - private ViewTreeObserver.OnScrollChangedListener getOnGlobalLayoutListener() { - return new ViewTreeObserver.OnScrollChangedListener() { - @Override - public void onScrollChanged() { + private ViewTreeObserver.OnGlobalLayoutListener getOnGlobalLayoutListener() { + return new ViewTreeObserver.OnGlobalLayoutListener() { + @Override public void onGlobalLayout() { setShadowOnScrollableView(); } };