Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.

Support new event in fragment #57

Merged

Conversation

georgeci
Copy link
Contributor

Fragment.OnViewCreated() is important event of fragment's lifecycle.

@@ -245,6 +251,7 @@ public Type type() {
ACTIVITY_CREATED,
VIEW_STATE_RESTORED,
DESTROY_VIEW,
DETACH
DETACH,
VIEW_CREATED
Copy link
Contributor

Choose a reason for hiding this comment

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

This should go below CREATE_VIEW

@dlew
Copy link
Contributor

dlew commented Jun 15, 2016

VIEW_CREATED needs to go into HandleEvents.FRAGMENT_EVENTS.

@@ -119,4 +119,10 @@
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
base.onRequestPermissionsResult(requestCode, permissions, grantResults);
}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be ordered below onCreateView().

@dlew
Copy link
Contributor

dlew commented Jun 15, 2016

Needs to be added to NaviDialogFragment.

@@ -295,4 +295,9 @@ public void restoreInstanceStatePersistableListener() {
exception.expect(IllegalArgumentException.class);
emitter.addListener(Event.DETACHED_FROM_WINDOW, mock(Listener.class));
}

@Test public void onViewCreatedListener() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test should be verifying that you can use this event, not that it throws an exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, there should be this test in NaviActivityTest to verify that it doesn't have an onViewCreated() method.

import android.support.annotation.Nullable;
import android.view.View;

public class ViewCreated {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Kotlin:
data class ViewCreated(val view: View, val bundle: Bundle)

Copy link
Contributor

Choose a reason for hiding this comment

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

There should be some newlines between stuff, to match formatting of the other models.

public Bundle getBundle() {
return bundle;
}
public View getView() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should just be bundle() and view(), to match the other models.

Also should be ordered consistently throughout - always view then bundle.

@dlew
Copy link
Contributor

dlew commented Jun 15, 2016

This is still missing support for the support NaviDialogFragment.

@dlew dlew merged commit 2d74202 into trello-archive:master Jun 16, 2016
@dlew
Copy link
Contributor

dlew commented Jun 16, 2016

Thanks for all the work!

@rogerhu
Copy link

rogerhu commented Jun 22, 2016

can we bump the version for this? :)

@dlew
Copy link
Contributor

dlew commented Jun 30, 2016

I'll work on getting a release out soon. I've been on vacation for the past week, sorry.

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

Successfully merging this pull request may close these issues.

3 participants