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

Fixed callback if DialogFragment called from an other Fragment #39

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yurezcv
Copy link

@yurezcv yurezcv commented Sep 23, 2014

Good day to you.

I have been trying to use your library in my own project.
And I found out that if I start DialogFragment from an Fragment then I don't receive the interface callback there, but I receive it on Activity which has started this Fragment.
So I decided to add small changes to your library.

Please, check it, if everything is allright I will be very happy to help you :)

@yurezcv yurezcv changed the title Fixed callback if DiaglogDragment called from an other Fragment Fixed callback if DialogFragment called from an other Fragment Sep 23, 2014
@passy
Copy link
Owner

passy commented Sep 26, 2014

Thanks for the patch. I think that's a good idea. Do you think you could also add some tests for around the new behavior?

@@ -250,7 +251,14 @@ private void adjustResourceLightness() {
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mListener = Option.some((OnFragmentInteractionListener) activity);
if (activity instanceof OnFragmentInteractionListener) {
Copy link
Owner

Choose a reason for hiding this comment

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

Since we now have proper checks in place, we no longer need to catch the ClassCastException

Copy link
Owner

Choose a reason for hiding this comment

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

^

@passy
Copy link
Owner

passy commented Nov 5, 2014

@yurezcv Hey, are you still interested in getting this in?

@yurezcv
Copy link
Author

yurezcv commented Nov 5, 2014

@passy Hi, sorry. I have a lot of stuff to do. But I'm interested.
Could you tell me what changes I should apply to get this pull request accepted?
Thank you in advance.

@passy
Copy link
Owner

passy commented Nov 5, 2014

@yurezcv No worries, I'm in the same boat. :)

Just the two things mentioned above, ie. the class cast and removing the unnecessary changes to the XML files.

@passy
Copy link
Owner

passy commented Jan 15, 2015

ping

@yurezcv
Copy link
Author

yurezcv commented Jan 19, 2015

I'm here :)
I didn't get what you mean in "removing unnecessary changes to the XML files.
There are only necessary changes. And I have already removed the class cast, but didn't push it yet.

@passy
Copy link
Owner

passy commented Jan 19, 2015

@yurezcv Cool, the rest is okay the way it is. So it's only left to the class cast. :)

@b3nson
Copy link

b3nson commented Nov 19, 2015

hey,
why got this pull-request never merged???
are you planning to do so?
would urgently need the "DialogFragment called from an other Fragment"-functionality (getTargetFragment())
:)
thanks.

@passy
Copy link
Owner

passy commented Nov 19, 2015

@b3nson I don't have time to pick this up at the moment. Do you want to address the comments? Would be happy to review it.

@b3nson
Copy link

b3nson commented Nov 20, 2015

@passy check pull request here: #72
Only changes to the library-project, removed ClassCastException, no XML-changes.
Is that what you meant?

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

Successfully merging this pull request may close these issues.

3 participants