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

Better separation of concerns between UI & core logic #29

Open
vanniktech opened this issue Nov 28, 2024 · 1 comment
Open

Better separation of concerns between UI & core logic #29

vanniktech opened this issue Nov 28, 2024 · 1 comment

Comments

@vanniktech
Copy link

I really like the idea of having a core module and an ui module where you can split things. Right now the barrier to roll your own ui is too high in my opinion. CropperPreview should be part of the core module. It also has no reference to material which is nice for #26. Like you said there could even be a krop-material & krop-material3 module where you have two different implemenations.

If CropperPreview is in the core module one could also just embed the core bit (without the controls):

Screenshot 2024-11-28 at 16 29 14

as part of my own UI. Personally, I don't like that currently it is shown as a Dialog. It feels clunky, especially with a toolbar. It would be much nicer if this was a proper screen that also takes proper insets and I would be able to do so if I could use CropperPreview on my own.

Another thing that probably needs to be refactored is the state.setInitialState(style) function. Maybe it is as easy as passing the style as a constructor parameter.

@tamimattafi
Copy link
Owner

@vanniktech For now, you can pass 0.dp for insets when passing your dialog style. This will make it look more like a full screen.

As for the separation of concerns, I agree. I already have this planned for upcoming major versions. In this version, I did my best not to introduce many changes, so people from the android Fork can migrate more easily.

For a new version, some breaking changes are inevitable. More suggestions on how the api should look like will be appreciated.

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