street str refactoring
This commit is contained in:
parent
58bf6d35f6
commit
e19935563a
3 changed files with 10 additions and 13 deletions
|
@ -1804,12 +1804,12 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
||||||
private void setAddressLocation() {
|
private void setAddressLocation() {
|
||||||
if (view != null) {
|
if (view != null) {
|
||||||
// Text line 1
|
// Text line 1
|
||||||
TextView line1 = (TextView) view.findViewById(R.id.context_menu_line1);
|
TextView line1 = view.findViewById(R.id.context_menu_line1);
|
||||||
line1.setText(menu.getTitleStr());
|
line1.setText(menu.getTitleStr());
|
||||||
toolbarTextView.setText(menu.getTitleStr());
|
toolbarTextView.setText(menu.getTitleStr());
|
||||||
// Text line 2
|
// Text line 2
|
||||||
LinearLayout line2layout = (LinearLayout) view.findViewById(R.id.context_menu_line2_layout);
|
LinearLayout line2layout = view.findViewById(R.id.context_menu_line2_layout);
|
||||||
TextView line2 = (TextView) view.findViewById(R.id.context_menu_line2);
|
TextView line2 = view.findViewById(R.id.context_menu_line2);
|
||||||
if (menu.hasCustomAddressLine()) {
|
if (menu.hasCustomAddressLine()) {
|
||||||
line2layout.removeAllViews();
|
line2layout.removeAllViews();
|
||||||
menu.buildCustomAddressLine(line2layout);
|
menu.buildCustomAddressLine(line2layout);
|
||||||
|
@ -1819,7 +1819,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
||||||
StringBuilder line2Str = new StringBuilder();
|
StringBuilder line2Str = new StringBuilder();
|
||||||
if (!Algorithms.isEmpty(typeStr)) {
|
if (!Algorithms.isEmpty(typeStr)) {
|
||||||
line2Str.append(typeStr);
|
line2Str.append(typeStr);
|
||||||
|
|
||||||
Drawable icon = menu.getTypeIcon();
|
Drawable icon = menu.getTypeIcon();
|
||||||
if (icon != null){
|
if (icon != null){
|
||||||
GravityDrawable gravityIcon = new GravityDrawable(icon);
|
GravityDrawable gravityIcon = new GravityDrawable(icon);
|
||||||
|
@ -1840,10 +1839,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
||||||
}
|
}
|
||||||
line2.setCompoundDrawablePadding(dpToPx(5f));
|
line2.setCompoundDrawablePadding(dpToPx(5f));
|
||||||
}
|
}
|
||||||
if (menu.getPointDescription().isFavorite() &&
|
|
||||||
menu.getObject() instanceof FavouritePoint){
|
|
||||||
streetStr = ((FavouritePoint)menu.getObject()).getAddress();
|
|
||||||
}
|
|
||||||
if (!Algorithms.isEmpty(streetStr) && !menu.displayStreetNameInTitle()) {
|
if (!Algorithms.isEmpty(streetStr) && !menu.displayStreetNameInTitle()) {
|
||||||
if (line2Str.length() > 0) {
|
if (line2Str.length() > 0) {
|
||||||
line2Str.append(", ");
|
line2Str.append(", ");
|
||||||
|
|
|
@ -150,6 +150,12 @@ public class FavouritePointMenuController extends MenuController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String getSubtypeStr() {
|
||||||
|
return fav.getAddress();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Drawable getSecondLineTypeIcon() {
|
public Drawable getSecondLineTypeIcon() {
|
||||||
return getIcon(R.drawable.ic_action_group_name_16, isLight() ? R.color.icon_color_default_light : R.color.ctx_menu_bottom_view_icon_dark);
|
return getIcon(R.drawable.ic_action_group_name_16, isLight() ? R.color.icon_color_default_light : R.color.ctx_menu_bottom_view_icon_dark);
|
||||||
|
|
|
@ -89,11 +89,7 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter<MapMultiSelectionMe
|
||||||
TextView line2 = (TextView) convertView.findViewById(R.id.context_menu_line2);
|
TextView line2 = (TextView) convertView.findViewById(R.id.context_menu_line2);
|
||||||
((TextView) line2).setTextColor(ContextCompat.getColor(getContext(), R.color.ctx_menu_subtitle_color));
|
((TextView) line2).setTextColor(ContextCompat.getColor(getContext(), R.color.ctx_menu_subtitle_color));
|
||||||
StringBuilder line2Str = new StringBuilder(item.getTypeStr());
|
StringBuilder line2Str = new StringBuilder(item.getTypeStr());
|
||||||
String streetStr = "";
|
String streetStr = item.getStreetStr();
|
||||||
if (item.getPointDescription().isFavorite() &&
|
|
||||||
item.getObject() instanceof FavouritePoint){
|
|
||||||
streetStr = ((FavouritePoint)item.getObject()).getAddress();
|
|
||||||
}
|
|
||||||
if (!Algorithms.isEmpty(streetStr) && !item.displayStreetNameInTitle()) {
|
if (!Algorithms.isEmpty(streetStr) && !item.displayStreetNameInTitle()) {
|
||||||
if (line2Str.length() > 0) {
|
if (line2Str.length() > 0) {
|
||||||
line2Str.append(", ");
|
line2Str.append(", ");
|
||||||
|
|
Loading…
Reference in a new issue