-
Notifications
You must be signed in to change notification settings - Fork 1
[21479] Dark Mode Support #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…o DayNight - TripKitAndroidUI: Updated 3 dialog/component themes to DayNight - FullScreenDialog: Theme.AppCompat.Light.Dialog → DayNight.Dialog - Widget.CalendarView.Custom: Theme.MaterialComponents.Light → DayNight - FlatDialog: Fixed @android:color/white → @color/white - tripkituisample: Theme.MaterialComponents.Light.NoActionBar → DayNight.NoActionBar - Updated tripkit-android submodule reference (clean commit with .gitignore fix) Part of Phase 1: Core Theme Migration for dark mode support
- Updated tripkit-android submodule reference
- Add night-res map style JSON for dark mode map styling - Remove custom backgrounds from all info window layouts to use Google's default styling - Update info window text colors to use @android:color/black (no night variant) for visibility - Remove custom icon tinting from info windows to use default colors - Updated layouts: - map_pin_info_window.xml - free_floating_vehicle_info_window.xml - bike_share_info_window.xml - view_simple_callout.xml - city_callout.xml
…k mode fixes - Add ThemeAwareApplyTintStrategy for theme-aware icon tinting when service colors disabled - Update GetTransportIconTintStrategy to use ThemeAwareApplyTintStrategy when service colors disabled - Remove tint from trip_result_segment_item.xml to allow branding icons (Beam) to display correctly - Remove tint from trip_result_list_transport_item.xml, handle theme via background colors - Update trip_result_transport_mode_selector_background.xml with theme-aware colors - Add transport_mode_selector_checked and transport_mode_selector_unchecked color resources - Fix TimeDatePickerFragment dark mode: shadows, divider lines, and date column text - Add top_shadow and bottom_shadow drawables with night variants - Update SuggestionViewModel with programmatic icon tinting for search results - Update various layouts with app:tint for dark mode icon visibility
This comment was marked as outdated.
This comment was marked as outdated.
|
✅ Unit tests passed successfully! Test results are available under the "Artifacts" section of this run in GitHub Actions. Please ensure the code is reviewed before proceeding with the merge. |
|
This pull request is stale because it has been open 5 days with no activity. |
| setWheelViewShadows(mDaysView) | ||
| setWheelViewShadows(mHoursView) | ||
| setWheelViewShadows(mMinutesView) | ||
| setWheelViewShadows(mAmPmView) | ||
|
|
||
| // Set center drawable and divider lines for dark mode support | ||
| setWheelViewCenterDrawable(mDaysView) | ||
| setWheelViewCenterDrawable(mHoursView) | ||
| setWheelViewCenterDrawable(mMinutesView) | ||
| setWheelViewCenterDrawable(mAmPmView) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sg-jsonjuliane , just wanted to clarify, is this intended for dark mode only? If so, do we need a checker to detect whether the device is in dark mode? If not, then all good. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This applies to both. There are already separate day and night variants for the drawables being used, so they will adjust automatically.
| private fun isDarkMode(): Boolean { | ||
| val nightModeFlags = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK | ||
| return nightModeFlags == Configuration.UI_MODE_NIGHT_YES | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sg-jsonjuliane, I noticed this is also being called in another part of the code. Maybe we can add an extension using Resources (e.g., fun Resources.isDarkMode()) and call it from there instead. Thanks 🙇
| <?xml version="1.0" encoding="utf-8"?> | ||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <gradient | ||
| android:startColor="#FFFFFF" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sg-jsonjuliane, in other parts we replaced hardcoded colors with values from resources. Maybe we should do the same here as well. Thanks 🙇
MichaelReyes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sg-jsonjuliane, I have a few minor comments, but aside from those, everything looks good 👍
|
✅ Unit tests passed successfully! Test results are available under the "Artifacts" section of this run in GitHub Actions. Please ensure the code is reviewed before proceeding with the merge. |
PR Context
Changes
Describe your changes in detail, highlighting the problem it solves or the feature it adds.
DayNightfor automatic dark mode supportvalues-night/colors.xmlwith dark mode color variants for all UI components (includingicon_tint_defaultandtransport_mode_selectorcolors)@android:color/white→@color/white(40+ instances)@android:color/black→@color/blackon neutral backgrounds (20+ instances)app:tintfor 51+ icons (transport icons, checkmarks, UI elements)ThemeAwareApplyTintStrategyfor theme-aware transport icon tinting:WheelViewcomponents (TimeDatePickerFragment):app:tintattributes that interfered with branding iconstripkit-androidsubmodule reference to include booking UI dark mode supportChecklist for Reviewers
Documentation and Code Quality
Testing and Reliability
Error Handling and Logging
Testing Procedure
If applicable, provide steps or commands for testing your changes. This can help reviewers and testers.
Work-in-Progress (WIP)
List any remaining work or areas that need additional focus. This section can be updated as the work progresses.
Remember to keep this template updated based on the feedback and evolving project standards.