Fix context menu margin

This commit is contained in:
Alexey Kulish 2017-10-11 14:59:21 +03:00
parent 7c7083d4e0
commit 654ce8fa45

View file

@ -889,26 +889,31 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
int dp16 = dpToPx(16f);
boolean has16margin = false;
int titleButtonHeight = 0;
View titleButtonContainer = view.findViewById(R.id.title_button_container);
if (titleButtonContainer.getVisibility() == View.VISIBLE) {
titleButtonHeight = titleButtonContainer.getMeasuredHeight() - dp16;
if (titleButtonHeight < 0) {
titleButtonHeight = 0;
} else {
has16margin = true;
}
}
int downloadButtonsHeight = 0;
View downloadButtonsContainer = view.findViewById(R.id.download_buttons_container);
if (downloadButtonsContainer.getVisibility() == View.VISIBLE) {
downloadButtonsHeight = downloadButtonsContainer.getMeasuredHeight() - dp16;
downloadButtonsHeight = downloadButtonsContainer.getMeasuredHeight() - (has16margin ? 0 : dp16);
if (downloadButtonsHeight < 0) {
downloadButtonsHeight = 0;
} else {
has16margin = true;
}
}
int titleProgressHeight = 0;
View titleProgressContainer = view.findViewById(R.id.title_progress_container);
if (titleProgressContainer.getVisibility() == View.VISIBLE) {
titleProgressHeight = titleProgressContainer.getMeasuredHeight() - dp16;
titleProgressHeight = titleProgressContainer.getMeasuredHeight() - (has16margin ? 0 : dp16);
if (titleProgressHeight < 0) {
titleProgressHeight = 0;
}