-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathTopBarBackgroundViewController.java
More file actions
60 lines (47 loc) · 2.08 KB
/
TopBarBackgroundViewController.java
File metadata and controls
60 lines (47 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.reactnativenavigation.viewcontrollers.stack.topbar;
import android.app.Activity;
import com.reactnativenavigation.options.ComponentOptions;
import com.reactnativenavigation.options.Options;
import com.reactnativenavigation.react.events.ComponentType;
import com.reactnativenavigation.utils.CompatUtils;
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
import com.reactnativenavigation.viewcontrollers.viewcontroller.YellowBoxDelegate;
import com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.ViewControllerOverlay;
import com.reactnativenavigation.views.stack.topbar.TopBarBackgroundView;
import com.reactnativenavigation.views.stack.topbar.TopBarBackgroundViewCreator;
public class TopBarBackgroundViewController extends ViewController<TopBarBackgroundView> {
private TopBarBackgroundViewCreator viewCreator;
private ComponentOptions component;
public TopBarBackgroundViewController(Activity activity, TopBarBackgroundViewCreator viewCreator) {
super(activity, CompatUtils.generateViewId() + "", new YellowBoxDelegate(activity), new Options(), new ViewControllerOverlay(activity));
this.viewCreator = viewCreator;
}
@Override
public TopBarBackgroundView createView() {
return viewCreator.create(getActivity(), component.componentId.get(), component.name.get());
}
@Override
public void onViewWillAppear() {
getView().sendComponentWillStart(ComponentType.Background);
super.onViewWillAppear();
getView().sendComponentStart(ComponentType.Background);
}
@Override
public void onViewDisappear() {
getView().sendComponentStop(ComponentType.Background);
super.onViewDisappear();
}
@Override
public void sendOnNavigationButtonPressed(String buttonId) {
}
@Override
public String getCurrentComponentName() {
return component.name.get();
}
public void setComponent(ComponentOptions component) {
this.component = component;
}
public ComponentOptions getComponent() {
return component;
}
}