Skip to content

Commit 54b0c3a

Browse files
committed
Revert "Always merge options with parent controller (#5606)"
This reverts commit de2ea4e.
1 parent de2ea4e commit 54b0c3a

File tree

5 files changed

+3
-16
lines changed

5 files changed

+3
-16
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ChildController.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import android.app.Activity;
44
import android.support.annotation.CallSuper;
5-
import android.view.View;
65
import android.view.ViewGroup;
76

87
import com.reactnativenavigation.parse.Options;
98
import com.reactnativenavigation.presentation.Presenter;
109
import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
1110
import com.reactnativenavigation.views.Component;
1211

13-
1412
public abstract class ChildController<T extends ViewGroup> extends ViewController<T> {
1513
final Presenter presenter;
1614
private final ChildControllersRegistry childRegistry;
@@ -61,7 +59,6 @@ public void applyOptions(Options options) {
6159
public void mergeOptions(Options options) {
6260
if (options == Options.EMPTY) return;
6361
if (isViewShown()) presenter.mergeOptions(getView(), options);
64-
performOnParentController(parentController -> parentController.mergeChildOptions(options, this));
6562
super.mergeOptions(options);
6663
}
6764

lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import org.mockito.Mockito;
2121

22-
2322
public class SimpleViewController extends ChildController<SimpleViewController.SimpleView> {
2423

2524

lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
public class ChildControllerTest extends BaseTest {
2020

21-
private ParentController parent;
2221
private ChildController uut;
2322
private ChildControllersRegistry childRegistry;
2423
private Presenter presenter;
@@ -34,8 +33,6 @@ public Options resolveCurrentOptions() {
3433
return resolvedOptions;
3534
}
3635
};
37-
parent = Mockito.mock(ParentController.class);
38-
uut.setParentController(parent);
3936
}
4037

4138
@Test
@@ -82,13 +79,6 @@ public void mergeOptions_emptyOptionsAreIgnored() {
8279
verify(presenter, times(0)).mergeOptions(any(), any());
8380
}
8481

85-
@Test
86-
public void mergeOptions_mergeWithParentViewController() {
87-
Options options = new Options();
88-
uut.mergeOptions(options);
89-
verify(uut.getParentController()).mergeChildOptions(options, uut);
90-
}
91-
9282
@Test
9383
public void destroy() {
9484
uut.destroy();

playground/android/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ allprojects {
2929
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
3030
url "$rootDir/../../node_modules/react-native/android"
3131
}
32-
maven { url "$rootDir/../../node_modules/detox/Detox-android" }
32+
maven { url 'https://jitpack.io' }
3333
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
3434
maven { url "$rootDir/../../node_modules/jsc-android/dist" }
35+
maven { url "$rootDir/../../node_modules/detox/Detox-android" }
3536
}
3637
}

playground/src/screens/FirstBottomTabScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class FirstBottomTabScreen extends React.Component {
6060
}
6161
});
6262

63-
switchTabByComponentId = () => Navigation.mergeOptions('SecondTab', {
63+
switchTabByComponentId = () => Navigation.mergeOptions(this, {
6464
bottomTabs: {
6565
currentTabId: 'SecondTab'
6666
}

0 commit comments

Comments
 (0)