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

Change API design to support Drawables/Colors/... instead of just resource IDs #193

Open
MFlisar opened this issue Mar 16, 2017 · 5 comments

Comments

@MFlisar
Copy link
Contributor

MFlisar commented Mar 16, 2017

Currently you use a builder to setup the simple slide. As they are used for creating a fragment, you're limited in what you can define (like you can only define image resources, but can't define a drawable instead).

For surpassing this limitation, it would be nice to add an interface that the parent activity can implement and that can provide additional data (like for example a Drawable for the icon) and much more of course.

What do you think about that?

This means, we can use the SimpeSlide for many more usecases and make it much more flexible, drawback is, me must add an id for each SimpleSlide to identify the slide in the interfaces functions...

PS: check out my repo clone, I have uploaded a very basic change already just to DEMONSTRATE what I mean. Changes are minimal currently...

@janheinrichmerker
Copy link
Owner

This may be a thing to have in a major release as I would have to change the API to make the interaction as intuitive as possible.

@janheinrichmerker janheinrichmerker changed the title Parent activity interface to personalise the simple slides Change API design to support Drawables/Colors/... instead of just resource IDs Mar 21, 2017
@MFlisar
Copy link
Contributor Author

MFlisar commented Mar 21, 2017

My clone currently does fully support this (inclusive fast and easy extension of views, for example adding a progress bar or a checkbox to the inner LinearLayout container). I can make a pull request and you just comment on it, if you want some changes...

It's fine if you do it yourself as well when you have time, my clone is working perfectly fine for me now as well...

@janheinrichmerker
Copy link
Owner

Yeah, a PR would be great!

@janheinrichmerker janheinrichmerker self-assigned this Mar 30, 2017
@chimbori
Copy link
Collaborator

@MFlisar If you’re able to submit a PR, we’d love that!

@chimbori chimbori reopened this Sep 14, 2019
@MFlisar
Copy link
Contributor Author

MFlisar commented Sep 16, 2019

Here's the according PR - #195 - it's already merged... And here's the renamed interface for the simple slide of the current master: https://github.com/heinrichreimer/material-intro/blob/master/library/src/main/java/com/heinrichreimersoftware/materialintro/slide/SimpleSlideActivity.java

Inside the callbacks you can update your views to your liking as much as you want

@janheinrichmerker janheinrichmerker removed their assignment May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants