Skip to content
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

An option to set text shadow of a specific color #88

Closed
yvolk opened this issue Jan 15, 2022 · 11 comments
Closed

An option to set text shadow of a specific color #88

yvolk opened this issue Jan 15, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@yvolk
Copy link
Member

yvolk commented Jan 15, 2022

Initial User's request was:

..can I set a text shadow or a text surrounding in a specific color?
This would help to increase readability on various backgrounds at 100% transparency.
Image reading white movie subtitles on light background, its difficult to read. So a black shadow will solve the problem.

  1. We need to figure out the best way to implement a shadow in a widget (RemoveViews).
  2. Maybe we will have one shadow option for all text items. To ease configuring...

Related topic: setting Text color (implemented): #47

@yvolk yvolk added the enhancement New feature or request label Jan 15, 2022
@Akselmo
Copy link

Akselmo commented Jan 4, 2024

Hi, any update on this? Having the shadows would help a lot!

@yvolk
Copy link
Member Author

yvolk commented Jan 5, 2024

Hi @Akselmo! Thank you for asking :-)
As I understand, in order to implement text shadows in our widget, we need to find solutions for the below things. Could you help? Maybe finding any Open Source implementations ready for reuse?!

  1. There are docs on making text shadows in "normal" Android app ( e.g. here https://stackoverflow.com/questions/3297437/shadow-effect-for-a-text-in-android ), but I didn't find anything for RemoteViews i.e. for home screen widgets,
    But I found quite an old request to Google to implement this in Android. It's not implemented: https://issuetracker.google.com/issues/36919784

  2. Suppose we know how to create a text shadow in a Home screen widget,
    I see that in order to be really useful we need to create sort of "Text with shadow" single (settings) "Preference", where a User can adjust colors of a text and of its shadow, and also shift and direction of the shadow.
    So we could have such setting for different elements of a widget.
    Could anybody create or find such a preference?

@Akselmo
Copy link

Akselmo commented Jan 5, 2024

I know that Breezy Weather has text shadows in their widgets: https://github.com/breezy-weather/breezy-weather

Maybe they have something you could look into? I don't know anything really about Android dev myself.

@yvolk
Copy link
Member Author

yvolk commented Jan 8, 2024

@Akselmo Thank you for the link: I do see that the Breezy-Weather widget uses text shadow actively. But all that shadows are configured statically, in XML (theme) files. As I read earlier.

Our widget app consists of about 13 layout files. No shadows defined in them.
In order to have, say, "black shadow", we need to create a copy of all of them with that shadow color (not even saying about other shadow parameters...)
The same for any other color.

But maybe it's worth to have at least black and white shadows only?!

@Akselmo
Copy link

Akselmo commented Jan 8, 2024

I see, again I don't know much about Android dev so this is just a thought:

Could the shadow be just same text, but slightly offset and always behind the real text? Then expose the color setting for this text too.

It would mean duplicated text, so it's not possibly ideal, but it would work as a shadow.

@yvolk
Copy link
Member Author

yvolk commented Jan 8, 2024

I think this will cause unexpected effects due to differences in text wrapping to the next line...
BTW Breezy-Weather widget has only one color for all shadows, and looks like you like it?! :-)

@Akselmo
Copy link

Akselmo commented Jan 8, 2024

Yeah I would be fine with either black or white shadow, depending on the text color. I guess it could be calculated with something like this: https://www.accessibility-developer-guide.com/knowledge/colours-and-contrast/how-to-calculate/#the-formula

So compare text color to black shadow color, and if ratio is too low, set the shadow color to white.

edit: Personally I use only white text so black shadow would be fine for my usecase.

@yvolk
Copy link
Member Author

yvolk commented Jan 8, 2024

I added "Text shadow" option to Colors section with these values: "No shadow" (default, nothing changes for existing widgets), "Dark shadow" and "Light shadow". For simplicity the same shadow applies to all parts of the widget.

Dark shadow:
Screenshot-darkt-shadow-2024-01-08

Light shadow:
Screenshot-light-shadow-2024-01-08 180142

@Akselmo
Copy link

Akselmo commented Jan 8, 2024

Yeah that works perfectly for me! Thank you!

yvolk added a commit that referenced this issue Jan 8, 2024
…No shadow" (default, nothing changes for existing widgets), "Dark shadow" and "Light shadow". For simplicity the same shadow applies to all parts of the widget.
@yvolk
Copy link
Member Author

yvolk commented Jan 8, 2024

@Akselmo Please check, I published v.4.9.0 https://github.com/andstatus/todoagenda/releases/tag/4.9.0-release

@Akselmo
Copy link

Akselmo commented Jan 8, 2024

Yep this works great, thanks!

@yvolk yvolk closed this as completed Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants