Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ public final Controller getTargetController() {
return null;
}

/**
* Called when this Controller's View has been created.
*
* @param view The View for this Controller (passed for convenience)
*/
protected void onViewCreated(@NonNull View view) { }

/**
* Called when this Controller's View is being destroyed. This should overridden to unbind the View
* from any local variables.
Expand Down Expand Up @@ -1013,6 +1020,7 @@ final View inflate(@NonNull ViewGroup parent) {
if (view == parent) {
throw new IllegalStateException("Controller's onCreateView method returned the parent ViewGroup. Perhaps you forgot to pass false for LayoutInflater.inflate's attachToRoot parameter?");
}
onViewCreated(view);

listeners = new ArrayList<>(lifecycleListeners);
for (LifecycleListener lifecycleListener : listeners) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class CallState implements Parcelable {
public int changeStartCalls;
public int changeEndCalls;
public int createViewCalls;
public int onViewCreatedCalls;
public int attachCalls;
public int destroyViewCalls;
public int detachCalls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ protected View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup
return view;
}

@Override
protected void onViewCreated(@NonNull View view) {
super.onViewCreated(view);
currentCallState.onViewCreatedCalls++;
}

@Override
protected void onChangeStarted(@NonNull ControllerChangeHandler changeHandler, @NonNull ControllerChangeType changeType) {
super.onChangeStarted(changeHandler, changeType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ protected View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup
return view;
}

@Override
protected void onViewCreated(@NonNull View view) {
super.onViewCreated(view);
Log.i(TAG, "Conductor: onViewCreated() called");
}

@Override
protected void onAttach(@NonNull View view) {
Log.i(TAG, "Conductor: onAttach() called");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public void accept(Long num) {
return view;
}

@Override
protected void onViewCreated(@NonNull View view) {
super.onViewCreated(view);
Log.i(TAG, "Conductor: onViewCreated() called");
}

@Override
protected void onAttach(@NonNull View view) {
super.onAttach(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void accept(Long num) {
return view;
}

@Override
protected void onViewCreated(@NonNull View view) {
super.onViewCreated(view);
Log.i(TAG, "Conductor: onViewCreated() called");
}

@Override
protected void onAttach(@NonNull View view) {
super.onAttach(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void call(Long num) {
return view;
}

@Override
protected void onViewCreated(@NonNull View view) {
super.onViewCreated(view);
Log.i(TAG, "Conductor: onViewCreated() called");
}

@Override
protected void onAttach(@NonNull View view) {
super.onAttach(view);
Expand Down