Kaynağa Gözat

Added subtitle option to screenParams (#567)

b_d 8 yıl önce
ebeveyn
işleme
a71acf5fb1

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/params/BaseScreenParams.java Dosyayı Görüntüle

@@ -7,6 +7,7 @@ import java.util.List;
7 7
 public class BaseScreenParams {
8 8
     public String screenId;
9 9
     public String title;
10
+    public String subtitle;
10 11
     public NavigationParams navigationParams;
11 12
     public List<TitleBarButtonParams> rightButtons;
12 13
     public TitleBarLeftButtonParams leftButton;

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/params/parsers/ScreenParamsParser.java Dosyayı Görüntüle

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

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/screens/Screen.java Dosyayı Görüntüle

@@ -87,6 +87,7 @@ public abstract class Screen extends RelativeLayout implements Subscriber {
87 87
     private void createTitleBar() {
88 88
         addTitleBarButtons();
89 89
         topBar.setTitle(screenParams.title);
90
+        topBar.setSubtitle(screenParams.subtitle);
90 91
     }
91 92
 
92 93
     private void addTitleBarButtons() {