Show separator for all types of context menu

This commit is contained in:
Alex Sytnyk 2018-08-01 16:40:18 +03:00
parent cd688b4e06
commit 5fe78faf05
4 changed files with 4 additions and 18 deletions

View file

@ -1279,13 +1279,6 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
return 0;
}
public boolean isShowInfoCompassSeparator() {
if (menuController != null) {
return menuController.isShowInfoCompassSeparator();
}
return false;
}
public boolean isMapDownloaded() {
return menuController != null && menuController.isMapDownloaded();
}

View file

@ -1479,7 +1479,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
TextView additionalInfoTextView = (TextView) view.findViewById(R.id.additional_info_text_view);
CharSequence additionalInfoStr = menu.getAdditionalInfo();
boolean showAdditionalImage = false;
if (!TextUtils.isEmpty(additionalInfoStr)) {
boolean showAdditionalInfo = !TextUtils.isEmpty(additionalInfoStr);
if (showAdditionalInfo) {
int colorId = menu.getAdditionalInfoColor();
int additionalInfoIconRes = menu.getAdditionalInfoIconRes();
if (colorId != 0) {
@ -1497,8 +1498,9 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}
additionalInfoImageView.setVisibility(showAdditionalImage ? View.VISIBLE : View.GONE);
boolean showSeparator = showAdditionalInfo && menu.displayDistanceDirection();
view.findViewById(R.id.info_compass_separator)
.setVisibility(menu.isShowInfoCompassSeparator() ? View.VISIBLE : View.GONE);
.setVisibility(showSeparator ? View.VISIBLE : View.GONE);
}
updateCompassVisibility();
updateAdditionalInfoVisibility();

View file

@ -528,10 +528,6 @@ public abstract class MenuController extends BaseMenuController implements Colla
return 0;
}
public boolean isShowInfoCompassSeparator() {
return false;
}
private boolean shouldShowMapSize() {
return indexItem != null && !downloaded;
}

View file

@ -133,11 +133,6 @@ public class AMapPointMenuController extends MenuController {
return super.getAdditionalInfoIconRes();
}
@Override
public boolean isShowInfoCompassSeparator() {
return getPointSpeed() != NO_SPEED;
}
@Override
public boolean needStreetName() {
return false;