Search in sources :

Example 6 with CoordinatorLayout

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()));
}
Also used : CoordinatorLayout(androidx.coordinatorlayout.widget.CoordinatorLayout) Options(com.reactnativenavigation.options.Options) FrameLayout(android.widget.FrameLayout) Activity(android.app.Activity) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController)

Example 7 with CoordinatorLayout

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();
}
Also used : CoordinatorLayout(androidx.coordinatorlayout.widget.CoordinatorLayout) TransitionAnimationOptions(com.reactnativenavigation.options.TransitionAnimationOptions) Options(com.reactnativenavigation.options.Options) EventEmitter(com.reactnativenavigation.react.events.EventEmitter) FrameLayout(android.widget.FrameLayout) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController)

Example 8 with CoordinatorLayout

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;
}
Also used : CoordinatorLayout(androidx.coordinatorlayout.widget.CoordinatorLayout) ViewGroup(android.view.ViewGroup) ViewParent(android.view.ViewParent) FrameLayout(android.widget.FrameLayout) View(android.view.View)

Example 9 with CoordinatorLayout

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);
}
Also used : CoordinatorLayout(androidx.coordinatorlayout.widget.CoordinatorLayout) View(android.view.View)

Example 10 with CoordinatorLayout

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);
}
Also used : CoordinatorLayout(androidx.coordinatorlayout.widget.CoordinatorLayout) Options(com.reactnativenavigation.options.Options) Number(com.reactnativenavigation.options.params.Number) BottomTabsPresenter(com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsPresenter) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)

Aggregations

CoordinatorLayout (androidx.coordinatorlayout.widget.CoordinatorLayout)11 View (android.view.View)4 FrameLayout (android.widget.FrameLayout)4 Options (com.reactnativenavigation.options.Options)3 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)3 ViewGroup (android.view.ViewGroup)2 ViewParent (android.view.ViewParent)2 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)2 SuppressLint (android.annotation.SuppressLint)1 Activity (android.app.Activity)1 Dialog (android.app.Dialog)1 SharedPreferences (android.content.SharedPreferences)1 SpannableString (android.text.SpannableString)1 ForegroundColorSpan (android.text.style.ForegroundColorSpan)1 LayoutInflater (android.view.LayoutInflater)1 EditText (android.widget.EditText)1 TextView (android.widget.TextView)1 NonNull (androidx.annotation.NonNull)1 AlertDialog (androidx.appcompat.app.AlertDialog)1 AppBarLayout (com.google.android.material.appbar.AppBarLayout)1