|
@@ -20,6 +20,8 @@ import com.reactnativenavigation.views.Component;
|
20
|
20
|
|
21
|
21
|
public abstract class ViewController<T extends ViewGroup> implements ViewTreeObserver.OnGlobalLayoutListener {
|
22
|
22
|
|
|
23
|
+ private Runnable onAppearedListener;
|
|
24
|
+
|
23
|
25
|
public interface ViewVisibilityListener {
|
24
|
26
|
/**
|
25
|
27
|
* @return true if the event is consumed, false otherwise
|
|
@@ -52,6 +54,10 @@ public abstract class ViewController<T extends ViewGroup> implements ViewTreeObs
|
52
|
54
|
options = initialOptions.copy();
|
53
|
55
|
}
|
54
|
56
|
|
|
57
|
+ public void setOnAppearedListener(Runnable onAppearedListener) {
|
|
58
|
+ this.onAppearedListener = onAppearedListener;
|
|
59
|
+ }
|
|
60
|
+
|
55
|
61
|
protected abstract T createView();
|
56
|
62
|
|
57
|
63
|
public void setViewVisibilityListener(ViewVisibilityListener viewVisibilityListener) {
|
|
@@ -162,6 +168,10 @@ public abstract class ViewController<T extends ViewGroup> implements ViewTreeObs
|
162
|
168
|
parentController.clearOptions();
|
163
|
169
|
if (getView() instanceof Component) parentController.applyChildOptions(options, (Component) getView());
|
164
|
170
|
});
|
|
171
|
+ if (onAppearedListener != null) {
|
|
172
|
+ onAppearedListener.run();
|
|
173
|
+ onAppearedListener = null;
|
|
174
|
+ }
|
165
|
175
|
}
|
166
|
176
|
|
167
|
177
|
public void onViewWillDisappear() {
|