use of androidx.coordinatorlayout.widget.CoordinatorLayout in project react-native-navigation by wix.
the class ModalPresenterTest method beforeEach.
@Override
public void beforeEach() {
super.beforeEach();
Activity activity = newActivity();
ChildControllersRegistry childRegistry = new ChildControllersRegistry();
root = spy(new SimpleViewController(activity, childRegistry, "root", new Options()));
FrameLayout contentLayout = new FrameLayout(activity);
FrameLayout rootLayout = new FrameLayout(activity);
rootLayout.addView(root.getView());
modalsLayout = new CoordinatorLayout(activity);
contentLayout.addView(rootLayout);
contentLayout.addView(modalsLayout);
activity.setContentView(contentLayout);
animator = spy(new ModalAnimator(activity));
uut = new ModalPresenter(animator);
uut.setModalsLayout(modalsLayout);
uut.setRootLayout(rootLayout);
modal1 = spy(new SimpleViewController(activity, childRegistry, MODAL_ID_1, new Options()));
modal2 = spy(new SimpleViewController(activity, childRegistry, MODAL_ID_2, new Options()));
}
use of androidx.coordinatorlayout.widget.CoordinatorLayout in project react-native-navigation by wix.
the class ModalStackTest method beforeEach.
@Override
public void beforeEach() {
super.beforeEach();
activity = newActivity();
childRegistry = new ChildControllersRegistry();
root = new SimpleViewController(activity, childRegistry, "root", new Options());
FrameLayout rootLayout = new FrameLayout(activity);
CoordinatorLayout modalsLayout = new CoordinatorLayout(activity);
FrameLayout contentLayout = new FrameLayout(activity);
contentLayout.addView(rootLayout);
contentLayout.addView(modalsLayout);
activity.setContentView(contentLayout);
animator = spy(new ModalAnimatorMock(activity));
presenter = spy(new ModalPresenter(animator));
uut = new ModalStack(activity, presenter);
uut.setModalsLayout(modalsLayout);
uut.setRootLayout(rootLayout);
emitter = Mockito.mock(EventEmitter.class);
uut.setEventEmitter(emitter);
modal1 = spy(new SimpleViewController(activity, childRegistry, MODAL_ID_1, new Options()));
modal2 = spy(new SimpleViewController(activity, childRegistry, MODAL_ID_2, new Options()));
modal3 = spy(new SimpleViewController(activity, childRegistry, MODAL_ID_3, new Options()));
modal4 = spy(new SimpleViewController(activity, childRegistry, MODAL_ID_4, new Options()));
stack = TestUtils.newStackController(activity).setChildren(modal4).build();
}
use of androidx.coordinatorlayout.widget.CoordinatorLayout in project AndroidUtilCode by Blankj.
the class SnackbarUtils method findSuitableParentCopyFromSnackbar.
private static ViewGroup findSuitableParentCopyFromSnackbar(View view) {
ViewGroup fallback = null;
do {
if (view instanceof CoordinatorLayout) {
return (ViewGroup) view;
}
if (view instanceof FrameLayout) {
if (view.getId() == android.R.id.content) {
return (ViewGroup) view;
}
fallback = (ViewGroup) view;
}
if (view != null) {
ViewParent parent = view.getParent();
view = parent instanceof View ? (View) parent : null;
}
} while (view != null);
return fallback;
}
use of androidx.coordinatorlayout.widget.CoordinatorLayout in project RxBinding by JakeWharton.
the class RxSwipeDismissBehaviorTestActivity method onCreate.
@SuppressWarnings("ResourceType")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
parent = new CoordinatorLayout(this);
view = new View(this);
view.setId(1);
view.setLayoutParams(new CoordinatorLayout.LayoutParams(100, 100));
view.setBackgroundColor(0xFFFF0000);
parent.addView(view);
setContentView(parent);
}
use of androidx.coordinatorlayout.widget.CoordinatorLayout in project react-native-navigation by wix.
the class AttachModeTest method beforeEach.
@Override
public void beforeEach() {
activity = newActivity();
childRegistry = new ChildControllersRegistry();
parent = new CoordinatorLayout(activity);
tabs = createTabs();
options = new Options();
options.bottomTabsOptions.currentTabIndex = new Number(INITIAL_TAB);
presenter = Mockito.mock(BottomTabsPresenter.class);
}
Aggregations