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

Feature/simple spinning #1728

Merged
merged 15 commits into from
Jul 26, 2021
Merged

Feature/simple spinning #1728

merged 15 commits into from
Jul 26, 2021

Conversation

infeo
Copy link
Member

@infeo infeo commented Jul 19, 2021

This is a follow up PR of #1704 .

The spinning logic is simplyfied by just rotating the IconView on certain conditions. The rotation is sequence of discrete rotations by 45° angle each. The subscription for the rotation needs to be stored because its binding is only weak and would be otherwise gc'ed.

Any appearance of class ProgressSpinner is replaced by a rotating IconView except in the health package due to outstanding PR #1712 .

@infeo infeo added the type:enhancement Improvements on an existing feature label Jul 19, 2021
@infeo infeo added this to the 1.6.0 milestone Jul 19, 2021
Copy link
Member

@overheadhunter overheadhunter left a comment

Choose a reason for hiding this comment

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

Factories and Builder are pretty nice, however due to the number of duplications, I'd suggest to add a new class to org.cryptomator.ui.controls and use it from within the fxml files:

public class Spinner extends FontAwesome5IconView {
    public Spinner(@NamedArg("spinning") ObservableValue<Boolean> spinning) {
        setGlyph(FontAwesome5Icon.SPINNER);
        var animation = Animations.createDiscrete360Rotation(this);
        this.animator = AutoAnimator.animate(animation)) //
 				.onCondition(spinning) //
 				.afterStop(() -> setRotate(0)) //
 				.build();
    }
}

src/main/java/org/cryptomator/ui/common/AutoAnimator.java Outdated Show resolved Hide resolved
src/main/java/org/cryptomator/ui/common/AutoAnimator.java Outdated Show resolved Hide resolved
This reverts commit a1303ef.
* extends FontAwesome5IconView
* by default animates if visisble
* replace all iconViews only showing a spinner glyph by new class
@infeo infeo removed the request for review from tobihagemann July 26, 2021 15:18
@infeo infeo merged commit c81ef1c into develop Jul 26, 2021
@infeo infeo deleted the feature/simple-spinning branch July 26, 2021 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Improvements on an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants