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

Segue service #8

Open
pardom-zz opened this issue Aug 31, 2015 · 4 comments
Open

Segue service #8

pardom-zz opened this issue Aug 31, 2015 · 4 comments

Comments

@pardom-zz
Copy link

The library additions depend on SimplePathContainer for view inflation, however, there is no way to provide custom animations. Ideally, SimplePathContainer could fetch a segue animation using something like SegueService.getSegueAnimator(context) and default to the basic animation if no service is found.

@almozavr
Copy link
Contributor

Good catch, but also one could copy/modify-and-provide CustomPathContainer to make own-style animation, or even make a AnimFactory which will create animation depending on Path properties.

@pardom-zz
Copy link
Author

Yes, I considered those alternatives. Out of all those, I would probably lean towards the AnimFactory type solution. If that were the preferred route, I would also like to see ScreenScoper support factory composition. For example: https://speakerdeck.com/loganj/android-forestry-droidcon-nyc-2015?slide=95

@almozavr
Copy link
Contributor

I consider ScreenScoper way a little bit obtrusive as for library as it's not clear for client how to scale it for custom needs – by now I'm using something like this to control title and drawer:

public class StyledPath extends Path {

    public PathAttrs getAttrs() {
        return EMPTY;
    }

    @Value.Immutable
    public static abstract class PathAttrs {

        public abstract @StringRes int title();
        @Value.Default public boolean drawerEnabled() {
            return true;
        }

        public static ImmutablePathAttrs of(@StringRes int title) {
            return ImmutablePathAttrs.builder().title(title).build();
        }

        public static ImmutablePathAttrs withDrawer(boolean enabled) {
            return ImmutablePathAttrs.builder().title(R.string.app_name).drawerEnabled(enabled).build();
        }

    }

    public static PathAttrs EMPTY = PathAttrs.of(R.string.app_name);
}

Would like to think about ScreenScoper way a bit more.

@almozavr
Copy link
Contributor

Anyway, mortar-flow is the square-way for android. So, it's quite strong opinion to move that direction :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants