|
@@ -9,6 +9,7 @@ import com.reactnativenavigation.params.BaseScreenParams;
|
9
|
9
|
import com.reactnativenavigation.params.FabParams;
|
10
|
10
|
import com.reactnativenavigation.params.PageParams;
|
11
|
11
|
import com.reactnativenavigation.params.ScreenParams;
|
|
12
|
+import com.reactnativenavigation.params.TitleBarLeftButtonParams;
|
12
|
13
|
import com.reactnativenavigation.views.ContentView;
|
13
|
14
|
import com.reactnativenavigation.views.LeftButtonOnClickListener;
|
14
|
15
|
import com.reactnativenavigation.views.TopTabs;
|
|
@@ -30,7 +31,12 @@ public class ViewPagerScreen extends Screen {
|
30
|
31
|
|
31
|
32
|
@Override
|
32
|
33
|
public BaseScreenParams getScreenParams() {
|
33
|
|
- return screenParams.topTabParams.get(viewPager.getCurrentItem());
|
|
34
|
+ return screenParams.topTabParams.get(getCurrentItem());
|
|
35
|
+ }
|
|
36
|
+
|
|
37
|
+ @Override
|
|
38
|
+ public void setTitleBarLeftButton(String navigatorEventId, LeftButtonOnClickListener backButtonListener, TitleBarLeftButtonParams titleBarLeftButtonParams) {
|
|
39
|
+ super.setTitleBarLeftButton(getNavigatorEventId(), backButtonListener, titleBarLeftButtonParams);
|
34
|
40
|
}
|
35
|
41
|
|
36
|
42
|
@Override
|
|
@@ -41,7 +47,7 @@ public class ViewPagerScreen extends Screen {
|
41
|
47
|
|
42
|
48
|
@Override
|
43
|
49
|
public ContentView getContentView() {
|
44
|
|
- return contentViews.get(viewPager.getCurrentItem());
|
|
50
|
+ return contentViews.get(getCurrentItem());
|
45
|
51
|
}
|
46
|
52
|
|
47
|
53
|
@Override
|
|
@@ -120,12 +126,16 @@ public class ViewPagerScreen extends Screen {
|
120
|
126
|
|
121
|
127
|
@Override
|
122
|
128
|
public String getScreenInstanceId() {
|
123
|
|
- return screenParams.topTabParams.get(viewPager.getCurrentItem()).navigationParams.screenInstanceId;
|
|
129
|
+ return screenParams.topTabParams.get(getCurrentItem()).navigationParams.screenInstanceId;
|
124
|
130
|
}
|
125
|
131
|
|
126
|
132
|
@Override
|
127
|
133
|
public String getNavigatorEventId() {
|
128
|
|
- return screenParams.topTabParams.get(viewPager.getCurrentItem()).navigationParams.navigatorEventId;
|
|
134
|
+ return screenParams.topTabParams.get(getCurrentItem()).navigationParams.navigatorEventId;
|
|
135
|
+ }
|
|
136
|
+
|
|
137
|
+ private int getCurrentItem() {
|
|
138
|
+ return viewPager == null ? 0 : viewPager.getCurrentItem();
|
129
|
139
|
}
|
130
|
140
|
|
131
|
141
|
public void selectTopTabByTabIndex(int index) {
|