UI Improvement for Place Description Display #10087

Open
DeshDeepakKant wants to merge 4 commits from DeshDeepakKant/ui/improve-description-display-9943 into master
DeshDeepakKant commented 2025-01-17 18:14:34 +00:00 (Migrated from github.com)

Overview

This pull request enhances the place description display in Organic Maps by implementing a more responsive, readable, and adaptive user interface.

Key Changes

  • Replaced basic WebView loading with a more sophisticated rendering approach
  • Added dynamic styling support for light and dark modes
  • Implemented responsive design with percentage-based sizing
  • Improved typography and readability

Detailed Improvements

1. WebView Configuration

  • Added WebViewClient for better web content handling
  • Enabled JavaScript and UTF-8 encoding
  • Set transparent background for seamless integration

2. Responsive Design

  • Implemented percentage-based sizing
  • Added dynamic font scaling using calc() CSS function
  • Ensured consistent layout across different screen sizes
  • Created media query for mobile optimization

3. Theme Support

  • Added dynamic color scheme for light and dark modes
  • Adjusted text, background, and heading colors based on current theme
  • Smooth transition between themes

4. Typography Enhancements

  • Used system-native font stack for better readability
  • Implemented justified text alignment
  • Added hyphenation support
  • Optimized heading and paragraph spacing

5. Accessibility Improvements

  • Ensured text is selectable
  • Maintained consistent line height
  • Implemented responsive font sizes

Before and After Screenshots

Light Mode (Before) Light Mode (After)
184ccdca-4bb1-459f-accd-e22844136d98 03e73901-26f5-4367-a02e-8c4c56f321e1
Dark Mode (Before) Dark Mode (After)
368bf9d9-edf9-407a-8ae2-b63099e0cbcd af9a7dfd-1827-466e-b934-1f3837a2f1e4
181c10c5-ca9c-44c9-bb7c-cd5aaf44b81e e2d21ad9-1090-469b-9c01-bba31a1494fb

If anyone has suggestions or improvements, please feel free to share them in the comments!

### Overview This pull request enhances the place description display in Organic Maps by implementing a more responsive, readable, and adaptive user interface. - Fixes **#9943**. ### Key Changes - Replaced basic WebView loading with a more sophisticated rendering approach - Added dynamic styling support for light and dark modes - Implemented responsive design with percentage-based sizing - Improved typography and readability ### Detailed Improvements #### 1. WebView Configuration - Added `WebViewClient` for better web content handling - Enabled JavaScript and UTF-8 encoding - Set transparent background for seamless integration #### 2. Responsive Design - Implemented percentage-based sizing - Added dynamic font scaling using `calc()` CSS function - Ensured consistent layout across different screen sizes - Created media query for mobile optimization #### 3. Theme Support - Added dynamic color scheme for light and dark modes - Adjusted text, background, and heading colors based on current theme - Smooth transition between themes #### 4. Typography Enhancements - Used system-native font stack for better readability - Implemented justified text alignment - Added hyphenation support - Optimized heading and paragraph spacing #### 5. Accessibility Improvements - Ensured text is selectable - Maintained consistent line height - Implemented responsive font sizes ### Before and After Screenshots | Light Mode (Before) | Light Mode (After) | |:---:|:---:| |![184ccdca-4bb1-459f-accd-e22844136d98](https://github.com/user-attachments/assets/17acce54-f632-4b2f-8e4a-2d786e2a87b9)| ![03e73901-26f5-4367-a02e-8c4c56f321e1](https://github.com/user-attachments/assets/a0d11ed4-d67b-4764-ab8f-2d1485ebfdfa) | | **Dark Mode (Before)** | **Dark Mode (After)** | | ![368bf9d9-edf9-407a-8ae2-b63099e0cbcd](https://github.com/user-attachments/assets/4b893f23-3a82-486c-8e7a-44dae2f4f5de) | ![af9a7dfd-1827-466e-b934-1f3837a2f1e4](https://github.com/user-attachments/assets/bf329ffc-422a-4661-afa4-a8bc74fac367) | | ![181c10c5-ca9c-44c9-bb7c-cd5aaf44b81e](https://github.com/user-attachments/assets/4e765560-6eec-4f13-852a-c8c25632cb3a) | ![e2d21ad9-1090-469b-9c01-bba31a1494fb](https://github.com/user-attachments/assets/08e4eeb1-2a19-42d9-a967-7a405b7acbf1) | If anyone has suggestions or improvements, please feel free to share them in the comments!
RedAuburn requested changes 2025-01-20 18:55:00 +00:00
RedAuburn left a comment
Member

Thanks for this! Looks good overall, just a few minor fixes and a few design considerations from me :)

@organicmaps/design any thoughts on centre-aligned vs start-aligned headers?

Thanks for this! Looks good overall, just a few minor fixes and a few design considerations from me :) @organicmaps/design any thoughts on centre-aligned vs start-aligned headers?
@ -11,3 +13,4 @@
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import app.organicmaps.R;
import app.organicmaps.base.BaseMwmFragment;

This doesn't seem to be needed, and Android studio warns that it may introduce XSS vulnerabilities, so probably best to remove it.

This doesn't seem to be needed, and Android studio warns that it may introduce XSS vulnerabilities, so probably best to remove it.

The android UI uses Roboto - best to prioritize that and just fallback to sans-serif

The android UI uses Roboto - best to prioritize that and just fallback to sans-serif

probably would be better to set these in values/colors.xml (in fact, they may already be defined there as generic colours)

probably would be better to set these in values/colors.xml (in fact, they may already be defined there as generic colours)

personally, i'd prefer left-aligned headers - this might need design discussion

personally, i'd prefer left-aligned headers - this might need design discussion

nit / general comment: it might be nicer to have something like Article from wikipedia.org. This would need a new string in ~data/strings/strings.txt and dealing with translations etc though, so doing it in this PR might be a bit much.

nit / general comment: it might be nicer to have something like `Article from wikipedia.org`. This would need a new string in `~data/strings/strings.txt` and dealing with translations etc though, so doing it in this PR might be a bit much.
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#10087
No description provided.