From 54069a1106487900f6590be0d54447115248ff24 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Fri, 16 Apr 2021 22:36:29 +0300 Subject: [PATCH] Fix: icon not shown for first element in list --- OsmAnd/src/net/osmand/plus/base/SelectionBottomSheet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/SelectionBottomSheet.java b/OsmAnd/src/net/osmand/plus/base/SelectionBottomSheet.java index 66778f134c..f4bea22e62 100644 --- a/OsmAnd/src/net/osmand/plus/base/SelectionBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/base/SelectionBottomSheet.java @@ -62,6 +62,7 @@ public abstract class SelectionBottomSheet extends MenuBottomSheetDialogFragment @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { View mainView = super.onCreateView(inflater, parent, savedInstanceState); + createSelectionListIfPossible(); notifyUiInitialized(); return mainView; } @@ -109,7 +110,6 @@ public abstract class SelectionBottomSheet extends MenuBottomSheetDialogFragment ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); listContainer.setOrientation(LinearLayout.VERTICAL); - fillInSelectionList(); return new SimpleBottomSheetItem.Builder().setCustomView(listContainer).create(); } @@ -148,7 +148,7 @@ public abstract class SelectionBottomSheet extends MenuBottomSheetDialogFragment if (!Algorithms.isEmpty(allItems)) { this.allItems.clear(); this.allItems.addAll(allItems); - fillInSelectionList(); + createSelectionListIfPossible(); } } @@ -160,7 +160,7 @@ public abstract class SelectionBottomSheet extends MenuBottomSheetDialogFragment this.applySelectionListener = onApplySelectionListener; } - private void fillInSelectionList() { + private void createSelectionListIfPossible() { if (listContainer != null && allItems != null) { recreateList(); }