Package 

Class Screen

  • All Implemented Interfaces:
    io.github.kakaocup.kakao.screen.ScreenActions

    
    public class Screen<T extends Screen<T>>
     implements ScreenActions
                        

    Container class for UI elements.

    This class groups UI elements and grants access to basic actions, such as tapBack() and closeSoftKeyboard()

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Screen.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      Screen()
    • Method Summary

      Modifier and Type Method Description
      ViewInteractionDelegate getView()
      KBaseView<?> getRootView() The visibility of rootView will be checked when entering the screen
      Unit setRootView(KBaseView<?> rootView) The visibility of rootView will be checked when entering the screen
      final Unit intercept(Function1<Interceptor.Configurator, Unit> configurator) Sets the interceptors for the screen.
      final Unit reset() Removes the interceptors from the screen.
      final Unit invoke(Function1<T, Unit> function) Operator that allows usage of DSL style
      • Methods inherited from class io.github.kakaocup.kakao.screen.Screen

        closeSoftKeyboard, pressBack, pressKey, pressKey, pressMenuKey
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Screen

        Screen()
    • Method Detail

      • getRootView

         KBaseView<?> getRootView()

        The visibility of rootView will be checked when entering the screen

      • setRootView

         Unit setRootView(KBaseView<?> rootView)

        The visibility of rootView will be checked when entering the screen

      • intercept

         final Unit intercept(Function1<Interceptor.Configurator, Unit> configurator)

        Sets the interceptors for the screen. Interceptors will be invoked on all interactions while the screen is active.

        The screen is considered active when it is invoked in one of the following ways:

        val screen = SomeScreen()
        
        screen { // Active
            view { click() }
            ...
        } // Inactive
        
        // OR
        
        onScreen<SomeScreen>() { // Active
            view { click() }
            ...
        } // Inactive

        If you use nesting screens, all interceptors of the screens that became active will be invoked in LIFO order (using Deque).

        Parameters:
        configurator - Configuration of the interceptors
      • reset

         final Unit reset()

        Removes the interceptors from the screen.

      • invoke

         final Unit invoke(Function1<T, Unit> function)

        Operator that allows usage of DSL style

        Parameters:
        function - Tail lambda with receiver which is your screen