Browse Source

Merge pull request #83 from the-mx-group/android_style_fixes

Android style fixes
Guy Carmeli 8 years ago
parent
commit
7133b914eb

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java View File

@@ -157,6 +157,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
157 157
 
158 158
     public Screen resetTo(Screen screen) {
159 159
         super.resetTo(screen);
160
+        StyleHelper.updateStyles(mToolbar, screen);
160 161
         return mScreenStacks.get(mCurrentStackPosition).resetTo(screen);
161 162
     }
162 163
 

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/activities/SingleScreenActivity.java View File

@@ -76,6 +76,7 @@ public class SingleScreenActivity extends BaseReactActivity {
76 76
     public Screen resetTo(Screen screen) {
77 77
         super.resetTo(screen);
78 78
         Screen popped = mScreenStack.resetTo(screen);
79
+        StyleHelper.updateStyles(mToolbar, screen);
79 80
         return popped;
80 81
     }
81 82
 

+ 2
- 1
android/app/src/main/java/com/reactnativenavigation/activities/TabActivity.java View File

@@ -7,6 +7,7 @@ import com.reactnativenavigation.R;
7 7
 import com.reactnativenavigation.adapters.ViewPagerAdapter;
8 8
 import com.reactnativenavigation.core.RctManager;
9 9
 import com.reactnativenavigation.core.objects.Screen;
10
+import com.reactnativenavigation.utils.StyleHelper;
10 11
 import com.reactnativenavigation.views.RnnTabLayout;
11 12
 import com.reactnativenavigation.views.RnnToolBar;
12 13
 
@@ -68,7 +69,7 @@ public class TabActivity extends BaseReactActivity {
68 69
     @Override
69 70
     public void push(Screen screen) {
70 71
         super.push(screen);
71
-        setNavigationStyle(screen);
72
+        StyleHelper.updateStyles(mToolbar, screen);
72 73
         mAdapter.push(screen);
73 74
     }
74 75
 

+ 2
- 2
src/platformSpecific.android.js View File

@@ -73,7 +73,7 @@ function navigatorPop(navigator, params) {
73 73
 function navigatorPopToRoot(navigator, params) {
74 74
   RctActivity.navigatorPopToRoot({
75 75
     navigatorID: navigator.navigatorID,
76
-    animated: !(params.animated !== false)
76
+    animated: !(params.animated === false)
77 77
   });
78 78
 }
79 79
 
@@ -157,7 +157,7 @@ function addNavigatorButtons(screen) {
157 157
 
158 158
 function addNavigationStyleParams(screen) {
159 159
   const Screen = Navigation.getRegisteredScreen(screen.screen);
160
-  screen.navigatorStyle = Screen.navigatorStyle;
160
+  screen.navigatorStyle = Object.assign({}, screen.navigatorStyle, Screen.navigatorStyle);
161 161
 }
162 162
 
163 163
 export default {