Guy Carmeli 6 anni fa
parent
commit
2668c8b3eb

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/parse/TopBarOptions.java Vedi File

@@ -59,6 +59,9 @@ public class TopBarOptions implements DEFAULT_VALUES {
59 59
     public ArrayList<Button> rightButtons;
60 60
 
61 61
     void mergeWith(final TopBarOptions other) {
62
+        if (other.testId.hasValue()) {
63
+            testId = other.testId;
64
+        }
62 65
         if (other.title.hasValue())
63 66
             title = other.title;
64 67
         if (other.backgroundColor.hasValue())
@@ -110,5 +113,8 @@ public class TopBarOptions implements DEFAULT_VALUES {
110 113
             leftButtons = defaultOptions.leftButtons;
111 114
         if (rightButtons == null)
112 115
             rightButtons = defaultOptions.rightButtons;
116
+        if (!testId.hasValue()) {
117
+            testId = defaultOptions.testId;
118
+        }
113 119
     }
114 120
 }

+ 3
- 1
lib/android/app/src/main/java/com/reactnativenavigation/views/TopBar.java Vedi File

@@ -17,11 +17,11 @@ import android.widget.TextView;
17 17
 import com.reactnativenavigation.anim.TopBarAnimator;
18 18
 import com.reactnativenavigation.anim.TopBarCollapseBehavior;
19 19
 import com.reactnativenavigation.interfaces.ScrollEventListener;
20
+import com.reactnativenavigation.parse.params.Bool;
20 21
 import com.reactnativenavigation.parse.params.Button;
21 22
 import com.reactnativenavigation.parse.params.Color;
22 23
 import com.reactnativenavigation.parse.params.Fraction;
23 24
 import com.reactnativenavigation.parse.params.Number;
24
-import com.reactnativenavigation.parse.params.Bool;
25 25
 
26 26
 import java.util.ArrayList;
27 27
 
@@ -47,6 +47,8 @@ public class TopBar extends AppBarLayout implements ScrollEventListener.ScrollAw
47 47
         this.animator = new TopBarAnimator(this);
48 48
         this.parentView = parentView;
49 49
         addView(titleBar);
50
+        titleBar.setContentDescription("titleBar");
51
+        setContentDescription("TopBar");
50 52
     }
51 53
 
52 54
     public void setTitle(String title) {