Package icyllis.modernui

# Class ModernUI

java.lang.Object
icyllis.modernui.core.Context
icyllis.modernui.app.Activity
icyllis.modernui.ModernUI

All Implemented Interfaces:
  `LifecycleOwner`, `AutoCloseable`

public class ModernUI extends Activity implements AutoCloseable, LifecycleOwner
The core class of Modern UI.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ID`
  `static final org.apache.logging.log4j.Logger`
  `LOGGER`
  `static final org.apache.logging.log4j.Marker`
  `MARKER`
  `static final String`
  `NAME_CPT`
  `static final Properties`
  `props`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ModernUI()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `static ModernUI`
  `getInstance()`
  Get Modern UI instance.
  `Lifecycle`
  `getLifecycle()`
  Returns the Lifecycle of the provider.
  `ReadableByteChannel`
  `getResourceChannel(String namespace, String path)`
  `Resources`
  `getResources()`
  `InputStream`
  `getResourceStream(String namespace, String path)`
  `static Locale`
  `getSelectedLocale()`
  Get the default or preferred locale set by user.
  `static Typeface`
  `getSelectedTypeface()`
  Get the default or preferred typeface set by user.
  `WindowManager`
  `getWindowManager()`
  Get the view manager of the application window (i.e.
  `boolean`
  `hasRtlSupport()`
  Whether to enable RTL support, it should always be true.
  `protected Locale`
  `onGetSelectedLocale()`
  Get the default or preferred locale set by user.
  `protected Typeface`
  `onGetSelectedTypeface()`
  Get the default or preferred typeface set by user.
  `void`
  `run(Fragment fragment)`
  Runs the Modern UI with the default application setups.

  ### Methods inherited from class icyllis.modernui.app.Activity

  `getToastManager`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### ID

    public static final String ID
    See Also:
      - Constant Field Values

  - ### NAME_CPT

    public static final String NAME_CPT
    See Also:
      - Constant Field Values

  - ### LOGGER

    public static final org.apache.logging.log4j.Logger LOGGER

  - ### MARKER

    public static final org.apache.logging.log4j.Marker MARKER

  - ### props

    public static final Properties props

- ## Constructor Details

  - ### ModernUI

    public ModernUI()

- ## Method Details

  - ### getInstance

    public static ModernUI getInstance()
    Get Modern UI instance.
    Returns:
      the Modern UI

  - ### run

    @MainThread public void run(@NonNull Fragment fragment)
    Runs the Modern UI with the default application setups. This method is only called by the `main()` on the main thread.

  - ### getLifecycle

    @NonNull public Lifecycle getLifecycle()
    Description copied from interface: `LifecycleOwner`
    Returns the Lifecycle of the provider.
    Specified by:
      `getLifecycle` in interface `LifecycleOwner`
    Returns:
      The lifecycle of the provider.

  - ### getResources

    public Resources getResources()
    Specified by:
      `getResources` in class `Context`

  - ### onGetSelectedLocale

    protected Locale onGetSelectedLocale()
    Get the default or preferred locale set by user.
    Returns:
      the selected locale

  - ### getSelectedLocale

    @NonNull public static Locale getSelectedLocale()
    Get the default or preferred locale set by user.
    Returns:
      the selected locale

  - ### onGetSelectedTypeface

    @NonNull protected Typeface onGetSelectedTypeface()
    Get the default or preferred typeface set by user.
    Returns:
      the selected typeface

  - ### getSelectedTypeface

    @NonNull public static Typeface getSelectedTypeface()
    Get the default or preferred typeface set by user.
    Returns:
      the selected typeface

  - ### hasRtlSupport

    @Experimental public boolean hasRtlSupport()
    Whether to enable RTL support, it should always be true.
    Returns:
      whether RTL is supported

  - ### getResourceStream

    @Experimental @NonNull public InputStream getResourceStream(@NonNull String namespace, @NonNull String path) throws IOException
    Throws:
      `IOException`

  - ### getResourceChannel

    @Experimental @NonNull public ReadableByteChannel getResourceChannel(@NonNull String namespace, @NonNull String path) throws IOException
    Throws:
      `IOException`

  - ### getWindowManager

    @Internal public WindowManager getWindowManager()
    Get the view manager of the application window (i.e. main window).
    Overrides:
      `getWindowManager` in class `Activity`
    Returns:
      window view manager

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`