E51E Add capacity to parking search results by dvdmrtnz · Pull Request #11689 · organicmaps/organicmaps · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@dvdmrtnz
Copy link
Contributor
@dvdmrtnz dvdmrtnz commented Nov 9, 2025

Add bicycle and car icons with capacity to parking search results.

@biodranik
Copy link
Member

Can emoji be used instead? Maybe a specialized monochrome font with a few icons that we can also embed/reuse on Android (which often lacks standard emoji fonts)?

@dvdmrtnz
Copy link
Contributor Author

Can emoji be used instead? Maybe a specialized monochrome font with a few icons that we can also embed/reuse on Android (which often lacks standard emoji fonts)?

Like in #11579?

Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
@dvdmrtnz
Copy link
Contributor Author

Now using custom OrganicMapsEmojiFont

Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
@dvdmrtnz dvdmrtnz marked this pull request as ready for review November 23, 2025 13:31
@dvdmrtnz dvdmrtnz requested review from a team as code owners November 23, 2025 13:31
Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
Copy link
Member
@biodranik biodranik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few nits, @kirylkaveryn WDYT about reusing the font size?

@Rawdyrathaur would you mind implementing the same for Android, based on commits in this PR?

[self.locationLabel sizeToFit];

// Define emoji font with fallback
UIFont * emojiFont = [UIFont fontWithName:@"OrganicMapsEmojiFont" size:13];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the size be taken from the font used in the cell instead of hard-coding it?

UIFontDescriptor * baseDescriptor = (emojiFont ?: fallbackFont).fontDescriptor;
UIFontDescriptor * cascadeDescriptor = [baseDescriptor
fontDescriptorByAddingAttributes:@{UIFontDescriptorCascadeListAttribute: @[fallbackFont.fontDescriptor]}];
UIFont * emojiFontWithFallback = [UIFont fontWithDescriptor:cascadeDescriptor size:13];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, at least use a shared constant?


// Define emoji font with fallback
UIFont * emojiFont = [UIFont fontWithName:@"OrganicMapsEmojiFont" size:13];
UIFont * fallbackFont = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

return {};
}

string FormatCapacity(string_view capacity, TypesHolder const & types)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string FormatCapacity(string_view capacity, TypesHolder const & types)
string FormatCapacity(std::string_view capacity, TypesHolder const & types)

Comment on lines +516 to +517
else
return {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed.

Suggested change
else
return {};

@Rawdyrathaur
Copy link
Contributor

I've implemented the Android version. Added emoji font support to search result descriptions in android/app/src/main/res/layout/item_search_result.xml.
Parking capacity now displays properly with emojis on Android.

Screenshot 2025-11-23 at 10 45 05 PM

Should I create a separate PR or can this be added to this PR?

6880

@biodranik
Copy link
Member

@Rawdyrathaur cool, thanks! Please make a separate PR/branch with the commits from this PR/branch, so we can:

  1. Review and merge them independently.
  2. If @dvdmrtnz fixes/changes his commits, you can safely rebase your commits on top of his latest changes on your branch.

Rawdyrathaur added a commit to Rawdyrathaur/organicmaps that referenced this pull request Nov 23, 2025
Support displaying parking capacity with emoji (🚘/🚲) in search results
by applying the custom emoji font to the description TextView.

Related to PR organicmaps#11689

Signed-off-by: Rawdyrathaur <mrathaur704@gmail.com>
Rawdyrathaur added a commit to Rawdyrathaur/organicmaps that referenced this pull request Nov 23, 2025
Support displaying parking capacity with emoji (🚘/🚲) in search results
by applying the custom emoji font to the description TextView.

Related to PR organicmaps#11689

Signed-off-by: Rawdyrathaur <mrathaur704@gmail.com>
@vng
Copy link
Member
vng commented Nov 23, 2025

Not a big deal, but on iOS Debug I see a red car first, and the nice grey car (from font) then, after some time and scrolling.

@biodranik
Copy link
Member

@kirylkaveryn @dvdmrtnz is there a way to replace fonts without blinking? Should it be done in xib/storyboard?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0