-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add Custom themes via XML for light / dark mode #507
Conversation
86bc98b
to
d999369
Compare
String nightThemeUrl = context.getString(R.string.navigation_guidance_night_v2); | ||
String dayThemeUrl = context.getString(R.string.navigation_guidance_day_v2); | ||
map.setStyleUrl(darkThemeEnabled ? nightThemeUrl : dayThemeUrl, listener); | ||
TypedValue mapStyleAttr = new TypedValue(); |
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.
Could we extract this block of code into a shared method in order to avoid duplication?
👀 methods retrieveNavigationViewPrimaryColor
, retrieveNavigationViewSecondaryColor
, retrieveNavigationViewBannerBackgroundColor
, retrieveNavigationViewBannerManeuverPrimaryColor
, retrieveNavigationViewBannerManeuverSecondaryColor
, retrieveNavigationViewProgressColor
and retrieveNavigationViewProgressBackgroundColor
*/ | ||
static void setTheme(Context context) { | ||
static void setTheme(Context context, AttributeSet attrs) { |
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.
setTheme
method is getting long.
2d3fa8c
to
3481d67
Compare
@Guardiola31337 Addressed your comments, ready for another round 👀 |
12e085e
to
b637a5f
Compare
b637a5f
to
5e37e0f
Compare
Will allows developers to add a light and dark theme via the
NavigationView
XML:This also adds the map style URLs to the themes.
cc @ericrwolfe