Merge pull request #5438 from osmandapp/ContextmenuFixes

Fix empty space in context menu
This commit is contained in:
Alexey 2018-05-19 00:51:24 +03:00 committed by GitHub
commit d9aaabf651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

View file

@ -26,7 +26,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingBottom="@dimen/context_menu_padding_margin_tiny"
android:paddingLeft="@dimen/context_menu_padding_margin_default" android:paddingLeft="@dimen/context_menu_padding_margin_default"
android:paddingRight="@dimen/context_menu_padding_margin_default"> android:paddingRight="@dimen/context_menu_padding_margin_default">

View file

@ -1501,15 +1501,23 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
} }
private void updateAdditionalInfoVisibility() { private void updateAdditionalInfoVisibility() {
View line3 = (TextView) view.findViewById(R.id.context_menu_line3); View line3 = view.findViewById(R.id.context_menu_line3);
View additionalInfoImageView = (ImageView) view.findViewById(R.id.additional_info_image_view); View additionalInfoImageView = view.findViewById(R.id.additional_info_image_view);
View additionalInfoTextView = (TextView) view.findViewById(R.id.additional_info_text_view); View additionalInfoTextView = view.findViewById(R.id.additional_info_text_view);
View compassView = view.findViewById(R.id.compass_layout); View compassView = view.findViewById(R.id.compass_layout);
View titleButtonContainer = view.findViewById(R.id.title_button_container);
View downloadButtonsContainer = view.findViewById(R.id.download_buttons_container);
View titleBottomButtonContainer = view.findViewById(R.id.title_bottom_button_container);
View titleProgressContainer = view.findViewById(R.id.title_progress_container);
if (line3.getVisibility() == View.GONE if (line3.getVisibility() == View.GONE
&& additionalInfoImageView.getVisibility() == View.GONE && additionalInfoImageView.getVisibility() == View.GONE
&& additionalInfoTextView.getVisibility() == View.GONE && additionalInfoTextView.getVisibility() == View.GONE
&& compassView.getVisibility() == View.INVISIBLE) { && compassView.getVisibility() == View.INVISIBLE
&& titleButtonContainer.getVisibility() == View.GONE
&& downloadButtonsContainer.getVisibility() == View.GONE
&& titleBottomButtonContainer.getVisibility() == View.GONE
&& titleProgressContainer.getVisibility() == View.VISIBLE) {
view.findViewById(R.id.additional_info_row).setVisibility(View.GONE); view.findViewById(R.id.additional_info_row).setVisibility(View.GONE);
} else { } else {
view.findViewById(R.id.additional_info_row).setVisibility(View.VISIBLE); view.findViewById(R.id.additional_info_row).setVisibility(View.VISIBLE);
@ -1896,6 +1904,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private void doAfterMenuStateChange(int previousState, int newState) { private void doAfterMenuStateChange(int previousState, int newState) {
updateCompassVisibility(); updateCompassVisibility();
updateAdditionalInfoVisibility();
} }
} }

View file

@ -265,9 +265,6 @@ public class MapDataMenuController extends MenuController {
if (downloadActivityType != null) { if (downloadActivityType != null) {
res += ", " + downloadActivityType.getString(getMapActivity()); res += ", " + downloadActivityType.getString(getMapActivity());
} }
if (getMenuType() == MenuType.STANDARD) {
res += "\n";
}
return res; return res;
} }