Fenix: Search widget is not dark in dark mode

Created on 20 Aug 2019  ·  34Comments  ·  Source: mozilla-mobile/fenix

How to reproduce:

  • Set Fenix to dark mode.
  • Add the Fenix search widget to the home screen

Actual result: a search bar with a white background is added to the home screen

Expected result: a search bar with a dark background should be added (to be consistent with the dark home screen)

Themes Hacktoberfest engverified ready feature request 🌟 SearchWidget help wanted

Most helpful comment

Thank you @abodea
I agree with your proposal, seems like this issue is resolved and verified, thanks @shahsurajk !

And I think indeed the issue from Andrei depends on LineageOS.
We could open a ticket to track the issue but this should probably be resolved by LOS devs.
One way to try to debug would be to add a similar widget - that supports day/night theme and see if that is also affected.

All 34 comments

@NotWoods I could try this, here's my plan:

  1. The widget provider seems to have a number of layouts for different sizes, I'll replace the color resource values with the themed versions (ones also present in the colors/night file, these will be the same as in the fragment_home xml )
  2. On theme change action, trigger redraw of widgets (a test case for this as well)

Do let me know your thoughts on this. Also sorry to keep tagging you, I don't know any other point of contact here.

@shahsurajk You can also just leave a comment without the need to tag anyone 😃

@jyeontaek what are your thoughts? I believe you worked on the widget.

I think we should consult the UI team on this.

@Verdi What do you think?

Just one thought back on the initial 'expected' result: the desired color of the search widget is maybe more related to the theme of the home screen than to the theme of Fenix, as a user may have a dark home screen where a dark widget would fit better, but still use Fenix in white mode.
Actually the widget theme could be independant from the Fenix one, and the selection could even be done manually by the user (2 widgets?). Or?

assigning to verdi and @AmyYLee (who worked on dark theme). thanks!

@klint I have a question. If the user has Dark theme for Fenix and puts a Dark theme search widget on the homescreen and then switches to Light theme on Fenix, does the search widget oh homescreen also change to Light theme or does it stay dark? I agree that the colouring of the search widget should be based the device's homescreen theme than on Fenix

@AmyYLee: in my opinion, the search widget should stay dark to match the theme where it is displayed -ie the homescreen's one.

@AmyYLee: in my opinion, the search widget should stay dark to match the theme where it is displayed -ie the homescreen's one.

I agree. The colour of the widget should be based on the Android system theme and not Fenix. @Verdi thoughts?

I've attached specs for a dark theme version of the widget:
Screen Shot 2019-08-30 at 4 30 37 PM

I agree. The colour of the widget should be based on the Android system theme and not Fenix. @Verdi thoughts?

Yes, this makes sense to me. Let's do it.

If the widget can not follow the app theme setting, can we have it follow the OS theme setting?

Found this on a help page for the Google Calendar app:

For Android 10 and up, widgets and the Calendar appear in Dark mode if Battery saver or Dark theme are turned on from your system settings.

For Android 9 and lower, widgets are always in light mode.

Hey @AmyYLee! Can I be assigned this issue?
Also, how should i proceed with it and which files should i look up?

Hey @AmyYLee! Can I be assigned this issue?
Also, how should i proceed with it and which files should i look up?

@NotWoods @liuche Can you assign and assist with this question? Thanks

@NotWoods I can't seem to find the file where search widget is defined with its properties(such as colors and behavior) . Can you please guide me on the same?

org.mozilla.gecko.search.SearchWidgetProvider should be a good starting point.

Any news on this?

Any news on this?

In progress, should be ready soon 😃

@brampitoyo We need some UX feedback regarding when the widget layout will actually be updated fi the app is in background.

With my proposed solution here - https://github.com/mozilla-mobile/fenix/pull/10209#issuecomment-673572383 we would be able to instantly update the widget if the app is in foreground / background, for app theme changes or system wide theme changes.
But if the app is not running - not in memory we will probably not be able to update the widget "automatically" but rather have to wait for the update cycle (currently at 60 minutes) to complete.
Following https://github.com/mozilla-mobile/fenix/issues/11051#issuecomment-671731789 I want to ask if this is also a compromise we're willing to take. With all the background limitation of >=Oreo there is no easy solution otherwise.

@Mugurell I agree with your assessment on https://github.com/mozilla-mobile/fenix/pull/10209#issuecomment-673572383

  • If Firefox is running, then let’s instantly update the widget theme.
  • If Firefox is not running, then I’m okay with waiting for the update cycle.

Our main concern is this: what happens if people think that something isn’t working correctly? “I’ve changed the system theme, but the Firefox widget theme doesn’t follow. What’s wrong?

People’s first response is probably to check Firefox. To do that, they will most likely tap on the app itself, or on the widget.

Doing this will activate Firefox. And the moment we become active, we can instantly update the widget theme. Unfortunately, people won’t see this unless they’ve minimised or quit the app. Either way, the problem is now fixed – although I recognise the fact that the “fix” is totally invisible.

Should be ready to test in the next nightly.

Was this reverted? It's white again. @Mugurell

Hi all!
This is not fixed yet on the latest Nightly build from 8/31. I could see the search widget in dark mode only on Samsung Galaxy Tab S6 (Android 9), but on Sony Xperia Z5 Premium (Android 7.1.1), and on Google Pixel (Android 10) the search widget was still white.
I'll remove the qa:needed label.

@shahsurajk Do you want to give it another try?

@softvision-miralobontiu just to know more, since this feature depends on the systems dark theme values, i'm not sure if Sony Xperia Z5 Premium with Android 7.1.1 would have support for this, could you check this once?

@Mugurell how do you propose we fix this for older versions of android, though still not sure what's wrong with Pixel and why it's not working on it.

It works fine on my Pixel 2 XL with stock Android 10.

I tested (initially and now) on a Pixel3 with Android 10 and for me it works as expected.
Wanted to also test on a Sony Z5 with Android 7.1.1 but I don't think it has a night mode setting.

So I'm also curious, @softvision-miralobontiu , @andreicristianpetcu - have you tested this by changing the system theme or the Fenix theme?

Yes, sorry Mugurel, I didn't change the system's theme to dark, only the Fenix theme.
The dark widget is displayed correctly on Samsung Galaxy Tab S6 (Android 9), OnePlus 5T (Android 9), and Google Pixel (Android 10).

However, on HTC 10 (Android 8), Sony Xperia Z5 Premium (Android 7.1.1), Xiaomi Mi4i (Android 5.0.2) it doesn't work. But, I have to mention that on these devices the dark theme/mode isn't available in their Settings'.

@Verdi, @AmyYLee is this expected? That the devices that don't have the dark theme/mode options should display the light widget?

Thanks!

@Mugurell I have both system theme and fenix theme to dark. I initially got a couple of builds with dark widget, then a few with white widget and now isback to dark.

If I'll have new problems, I will report them. Now it's fine.

It's light again.
Screenshot_20200903-072409_Lawnchair

@andreicristianpetcu I also see the microphone icon is missing.
Is this because you don't have installed an app for speech recognition or another issue you're encountering?
I see this happened in the morning? Are there any deep sleep / battery optimizations running overnight? Or in general? And if so can you please turn them off for Fenix and report back?
Has the "right widget" appeared after >1 hour?

Just trying to find more details that would help in pinpointing the issue.
I tried various scenarios for reproducing this but I couldn't.

@ QA is this something you've also observed?

I don't have any google services. No gapps. Vanilla LineageOS. I don't need voice search.

It's alsohappening late at night. It happens with and without the android battery save toggle.

The white widget has been enabled all day so 1h makes no difference.

How can I debug this?

I re-checked this issue on the latest Nightly 9/8 with Google Pixel 4 XL (11).
Note that the search widget color is displayed correctly in light and dark mode.
I do believe what you mentioned above is only to LineageOS.
@Mugurell should we close this one and open a new issue that is more specific only for LineageOS?
Removing the eng:qa:needed until further notice.

20200908-115250-1

Thank you @abodea
I agree with your proposal, seems like this issue is resolved and verified, thanks @shahsurajk !

And I think indeed the issue from Andrei depends on LineageOS.
We could open a ticket to track the issue but this should probably be resolved by LOS devs.
One way to try to debug would be to add a similar widget - that supports day/night theme and see if that is also affected.

Thanks, @Mugurell, then I will close this issue accordingly.

This is not a general LineageOs issue either, I have used it on LineageOS with a OnePlust 6T since when it was available and it have worked as expected from day 1. Just did a test to be sure, where I switched the them to light and back and the widget followed as expected.

Was this page helpful?
0 / 5 - 0 ratings