Browse Source

Added subtitle option to screenParams (#567)

b_d 8 years ago
parent
commit
a71acf5fb1

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/params/BaseScreenParams.java View File

7
 public class BaseScreenParams {
7
 public class BaseScreenParams {
8
     public String screenId;
8
     public String screenId;
9
     public String title;
9
     public String title;
10
+    public String subtitle;
10
     public NavigationParams navigationParams;
11
     public NavigationParams navigationParams;
11
     public List<TitleBarButtonParams> rightButtons;
12
     public List<TitleBarButtonParams> rightButtons;
12
     public TitleBarLeftButtonParams leftButton;
13
     public TitleBarLeftButtonParams leftButton;

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/params/parsers/ScreenParamsParser.java View File

12
 
12
 
13
 public class ScreenParamsParser extends Parser {
13
 public class ScreenParamsParser extends Parser {
14
     private static final String KEY_TITLE = "title";
14
     private static final String KEY_TITLE = "title";
15
+    private static final String KEY_SUBTITLE = "subtitle";
15
     private static final String KEY_SCREEN_ID = "screenId";
16
     private static final String KEY_SCREEN_ID = "screenId";
16
     private static final String KEY_NAVIGATION_PARAMS = "navigationParams";
17
     private static final String KEY_NAVIGATION_PARAMS = "navigationParams";
17
     private static final String STYLE_PARAMS = "styleParams";
18
     private static final String STYLE_PARAMS = "styleParams";
30
         result.styleParams = new StyleParamsParser(params.getBundle(STYLE_PARAMS)).parse();
31
         result.styleParams = new StyleParamsParser(params.getBundle(STYLE_PARAMS)).parse();
31
 
32
 
32
         result.title = params.getString(KEY_TITLE);
33
         result.title = params.getString(KEY_TITLE);
34
+        result.subtitle = params.getString(KEY_SUBTITLE);
33
         result.rightButtons = ButtonParser.parseRightButton(params);
35
         result.rightButtons = ButtonParser.parseRightButton(params);
34
         result.overrideBackPressInJs = params.getBoolean(OVERRIDE_BACK_PRESS, false);
36
         result.overrideBackPressInJs = params.getBoolean(OVERRIDE_BACK_PRESS, false);
35
         result.leftButton = ButtonParser.parseLeftButton(params);
37
         result.leftButton = ButtonParser.parseLeftButton(params);

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/screens/Screen.java View File

87
     private void createTitleBar() {
87
     private void createTitleBar() {
88
         addTitleBarButtons();
88
         addTitleBarButtons();
89
         topBar.setTitle(screenParams.title);
89
         topBar.setTitle(screenParams.title);
90
+        topBar.setSubtitle(screenParams.subtitle);
90
     }
91
     }
91
 
92
 
92
     private void addTitleBarButtons() {
93
     private void addTitleBarButtons() {