Skip to content

Added widget with just a sync icon #1340

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

Merged
merged 10 commits into from
May 14, 2025
Merged

Added widget with just a sync icon #1340

merged 10 commits into from
May 14, 2025

Conversation

ArnyminerZ
Copy link
Member

@ArnyminerZ ArnyminerZ commented Mar 10, 2025

Purpose

Some people is requesting a simple square widget to run synchronization for DAVx⁵ manually, this adds a new widget to extend the existing one.

Short description

Added a new widget with just an icon, that runs synchronization when clicked:

Screenshot

Screenshot_20250310_194301

This doesn't exclude the already existing one with a label, but gives a new simpler option to the users.

TODO:

  • For some reason both widgets have the same label, it would be cool to be able to differentiate them.

    Fixed

    Screenshot_20250310_195350

  • It would be cool to show a proper preview to know how the widget will look like.

    Fixed

    Screenshot_20250310_200515

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@ArnyminerZ ArnyminerZ added the enhancement New feature or request label Mar 10, 2025
@ArnyminerZ ArnyminerZ self-assigned this Mar 10, 2025
@ArnyminerZ ArnyminerZ linked an issue Mar 10, 2025 that may be closed by this pull request
@ArnyminerZ
Copy link
Member Author

Not really a thing that needs to be done quickly, but at least it's something, and since those files are pretty much never modified, we can just leave this ready until we want to merge it.

@ArnyminerZ ArnyminerZ marked this pull request as ready for review March 10, 2025 19:06
@ArnyminerZ ArnyminerZ requested a review from sunkup March 26, 2025 17:47
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, but wow that is a lot of new code. I can't help but think it would be less if we had only one widget.

Is it hard to make it one widget only, which resizes and then simply hides and shows the text depending on the widget size? Without the text they are exactly the same, no?

Also, does it need to be a circle? When adding the widget I can see the widget as a square, with/without rounded borders (depending on the widget settings) for a very short time before it goes back to circle again. I could think of users who want it to behave like the other widgets do. That is to have a full background color for the widget which is cropped by the widget setting and not enforce the rounded corners (circle shape) ourselves.

I took the screenshot at the right moment, but it turns back into a circle right after:

Show screenshot

image

@ArnyminerZ
Copy link
Member Author

Is it hard to make it one widget only, which resizes and then simply hides and shows the text depending on the widget size?

No, it should be easy, but I think @devvv4ever told me to have two different widgets, in case anyone wants a small widget with text

@ArnyminerZ
Copy link
Member Author

Also, does it need to be a circle?

Not technically, but I guess we can choose

@sunkup
Copy link
Member

sunkup commented Apr 7, 2025

No, it should be easy, but I think @devvv4ever told me to have two different widgets, in case anyone wants a small widget with text

You can add the same widget twice and resize one of the instances to be smaller. They will look differently, but have the same action. So in the end it'll have the same effect as creating two different ones. I think a second widget only makes sense if we want to add other functionality or show data, etc.

@devvv4ever
Copy link
Member

If you can manage to make the widget "responsive" in the sense of adapting text to to the user set size of the widget one widget would be good too. Speaking of: if the user sets it to 1x1 only display a sync button, and if it is large enough display an additional label. But it is of course more work to make the "one" widget more sophisticated ;-)

for example:
1x1 - only sync button
1x2 sync button with text "sync"
1x3...x with text "Synchronize".

I also think that users like to see these widget options as seen in your previews in the first posting here (which I definitely like!) - so they "see what they get" when choosing between the two options. But you decide :)

@sunkup
Copy link
Member

sunkup commented Apr 7, 2025

I also think that users like to see these widget options as seen in your previews in the first posting here (which I definitely like!) - so they "see what they get" when choosing between the two options. But you decide :)

I don't think we should do it, if it means maintaining three different widget code bases. If we're able to reuse the same code it could be an option.

@devvv4ever
Copy link
Member

I also think that users like to see these widget options as seen in your previews in the first posting here (which I definitely like!) - so they "see what they get" when choosing between the two options. But you decide :)

I don't think we should do it, if it means maintining three different widget code bases. If we're able to reuse the same code it could be an option.

It would not mean 3 widgets. Only two: one 1x1 fixed sync button widget without text and a second "resizeable" one with a label on it with min-size 1x2 and that can be enlargend as the user wishes.

Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks ok. I can't resize the bigger 1x2 widget though.

The description of how the buttons look in the widget description is superfluous. The existing widgets on the emulator always have their user action as description, so I would do it the same way. I.E. for google drive it's: "Quickly access suggested files and search" and for google calendar: "View your tasks and upcoming events".

So instead of:
"A circular button for running synchronization manually." and "A simple button for running synchronization manually with an icon and a label."

I would probably write this for both: "Tap to synchronize."

@devvv4ever Maybe you also want to spin this up on the emulator too and see if it's what you imagined it to be like.

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@devvv4ever
Copy link
Member

Code looks ok. I can't resize the bigger 1x2 widget though.

The description of how the buttons look in the widget description is superfluous. The existing widgets on the emulator always have their user action as description, so I would do it the same way. I.E. for google drive it's: "Quickly access suggested files and search" and for google calendar: "View your tasks and upcoming events".

So instead of: "A circular button for running synchronization manually." and "A simple button for running synchronization manually with an icon and a label."

I would probably write this for both: "Tap to synchronize."

Also possible. I'd be fine with it, but how do people understand the difference for both widgets then?

@devvv4ever Maybe you also want to spin this up on the emulator too and see if it's what you imagined it to be like.

I can't since I have no Android studio to try it out myself

@sunkup
Copy link
Member

sunkup commented Apr 28, 2025

Also possible. I'd be fine with it, but how do people understand the difference for both widgets then?

They can see it :D Also it still says 1x1 or 2x1 for the size.

I might be wrong, but I don't think we need to think in terms of accessibility here - as in describing what the buttons look like, for visually impaired.

@rfc2822
Copy link
Member

rfc2822 commented May 7, 2025

What is the status of the PR?

@ArnyminerZ
Copy link
Member Author

What is the status of the PR?

Well, it's a matter of deciding how we want to implement this. Either in the same widget with resizing options, or with two different widgets

@sunkup
Copy link
Member

sunkup commented May 12, 2025

What is the status of the PR?

Well, it's a matter of deciding how we want to implement this. Either in the same widget with resizing options, or with two different widgets

I think it's all good to have two widgets like @devvv4ever says, so the user can see that different sizes with/without text/label are available. We just need the 1x2 widget to be resizable to a bigger size and to change the text to what the widget does, rather than what the widget looks like.

@rfc2822
Copy link
Member

rfc2822 commented May 12, 2025

Just an idea: Could we have one widget that

  • is called " (resizable)"
  • automatically shows the reconfiguration when added:

Then it should be quite clear that there are two configurations?


But the end it shouldn't matter much

@ArnyminerZ
Copy link
Member Author

automatically shows the reconfiguration when added

Then we have to add the config screen and all of that. Is it really worth it? (I don't mind working on it)

@sunkup
Copy link
Member

sunkup commented May 13, 2025

automatically shows the reconfiguration when added

Then we have to add the config screen and all of that. Is it really worth it? (I don't mind working on it)

maybe not for a first implementation ^^

@ArnyminerZ
Copy link
Member Author

Okay so just to be clear. Maybe we can have two widgets now (after fixing the resize issue), and then in a future, if we want, use a single widget with a config screen

@sunkup
Copy link
Member

sunkup commented May 13, 2025

Okay so just to be clear. Maybe we can have two widgets now (after fixing the resize issue), and then in a future, if we want, use a single widget with a config screen

And the text

@rfc2822
Copy link
Member

rfc2822 commented May 13, 2025

I'm fine with everything 😄 Soo this can be merged?

@rfc2822 rfc2822 requested a review from sunkup May 13, 2025 13:10
@sunkup sunkup removed their request for review May 13, 2025 13:18
@sunkup
Copy link
Member

sunkup commented May 13, 2025

I'm fine with everything 😄 Soo this can be merged?

No, changes are still missing. Just for focus I will repeat them here:

  • Make 1x2 resizable horizontally (bigger)
  • Change the widget description texts to describe what they can do, instead of how they look.
    Something similar to: "Tap to synchronize"

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ
Copy link
Member Author

Updated description:

image

And allowed horizontal resize.

@ArnyminerZ ArnyminerZ requested a review from sunkup May 13, 2025 13:51
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perf 👍

@sunkup sunkup requested a review from rfc2822 May 13, 2025 13:58
@rfc2822 rfc2822 removed their request for review May 14, 2025 06:50
@rfc2822 rfc2822 merged commit ededcb9 into main-ose May 14, 2025
8 checks passed
@rfc2822 rfc2822 deleted the sync-icon-widget branch May 14, 2025 06:50
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

Successfully merging this pull request may close these issues.

[Widget] Add a 1x1 square sized widget
4 participants