Fix bottomSheet height with expandableListView
This commit is contained in:
parent
c840cedc0f
commit
8193ed11d2
3 changed files with 11 additions and 2 deletions
|
@ -179,7 +179,11 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
public void onGlobalLayout() {
|
||||
final View contentView = useScrollableItemsContainer() ? mainView.findViewById(R.id.scroll_view) : itemsContainer;
|
||||
if (contentView.getHeight() > contentHeight) {
|
||||
contentView.getLayoutParams().height = contentHeight;
|
||||
if (useScrollableItemsContainer()) {
|
||||
contentView.getLayoutParams().height = contentHeight;
|
||||
} else {
|
||||
contentView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
}
|
||||
contentView.requestLayout();
|
||||
}
|
||||
|
||||
|
@ -187,6 +191,9 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
boolean showTopShadow = screenHeight - statusBarHeight - mainView.getHeight() >= AndroidUtils.dpToPx(activity, 8);
|
||||
if (AndroidUiHelper.isOrientationPortrait(activity)) {
|
||||
mainView.setBackgroundResource(showTopShadow ? getPortraitBgResId() : getBgColorId());
|
||||
if (!useScrollableItemsContainer() && !showTopShadow) {
|
||||
mainView.setPadding(0, 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
mainView.setBackgroundResource(showTopShadow ? getLandscapeTopsidesBgResId() : getLandscapeSidesBgResId());
|
||||
}
|
||||
|
|
|
@ -188,7 +188,6 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
|
|||
|
||||
counter++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void populateImpassableRoadsTypes() {
|
||||
|
|
|
@ -182,6 +182,7 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment
|
|||
if (adapter != null) {
|
||||
adapter.contentItem = getAdapterContentItems();
|
||||
adapter.notifyDataSetChanged();
|
||||
setupHeightAndBackground(getView());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,6 +310,7 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment
|
|||
}
|
||||
if (isChecked) {
|
||||
expListView.expandGroup(groupPosition);
|
||||
setupHeightAndBackground(getView());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -322,6 +324,7 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment
|
|||
} else {
|
||||
expListView.expandGroup(groupPosition);
|
||||
}
|
||||
setupHeightAndBackground(getView());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue