question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with setting Dark theme programatically

See original GitHub issue

Hi @zawadz88,

I am trying to set dark theme programatically using below API in Java:

MaterialPopupMenuBuilder popupMenuBuilder = new MaterialPopupMenuBuilder(); popupMenuBuilder.setStyle(R.style.Widget_MPM_Menu_Dark);

It is working as expected for text color but not for background color:

screen shot 2018-02-28 at 1 06 03 pm

I am not sure if I am missing something, can you please guide on how to set the Dark theme programatically.

Thanks Pranav

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
zawadz88commented, Mar 13, 2018

Hi @prscX, This should be fixed in the newly released 1.4.0.

Thanks for reporting this!

1reaction
prscXcommented, Mar 18, 2018

Many Thanks @zawadz88 for release. I have tested and is working as expected.

Thanks Pranav

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to enable night mode programmatically? - Stack Overflow
enable dark theme: AppCompatDelegate. · forcefully disable dark theme: AppCompatDelegate. · set app theme based on mobile settings of dark mode, i.e. if...
Read more >
Moving to the Dark Side: Dark Theme Recap - ProAndroidDev
Check whether Dark Theme is applied programmatically​​ Sometimes you might want to customize your UI based on a theme at runtime. You can...
Read more >
Dark theme - Android Developers
There are three ways to enable Dark theme in Android 10 (API level 29) and higher: Use the system setting (Settings -> Display...
Read more >
Change theme programmatically in WinUI 3 preview ... - GitHub
I'm trying to change the theme of the app programmatically App.Current.RequestedTheme = themes.SelectedIndex == 0 ? ApplicationTheme.Dark ...
Read more >
Setting up Dark Theme for Your App - Wajahat Karim
To manage this, Android provides you a way to separate resources for light and dark themes. Normally, you put all your colors in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found