Browse Source

Show back button by default on screen push

Guy Carmeli 8 years ago
parent
commit
c3deae58cc
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      src/deprecated/platformSpecificDeprecated.android.js

+ 10
- 0
src/deprecated/platformSpecificDeprecated.android.js View File

@@ -36,6 +36,7 @@ function startSingleScreenApp(params) {
36 36
 function navigatorPush(navigator, params) {
37 37
   addNavigatorParams(params, navigator);
38 38
   addNavigatorButtons(params);
39
+  addTitleBarBackButtonIfNeeded(params);
39 40
   addNavigationStyleParams(params);
40 41
 
41 42
   params.screenId = params.screen;
@@ -289,6 +290,15 @@ function addNavigatorButtons(screen) {
289 290
   }
290 291
 }
291 292
 
293
+function addTitleBarBackButtonIfNeeded(screen) {
294
+  const leftButton = getLeftButton(screen);
295
+  if (!leftButton) {
296
+    screen.leftButton = {
297
+      id: 'back'
298
+    }
299
+  }
300
+}
301
+
292 302
 function getLeftButton(screen) {
293 303
   if (screen.navigatorButtons && screen.navigatorButtons.leftButton) {
294 304
     return screen.navigatorButtons.leftButton;