Class ModernUI

All Implemented Interfaces:
LifecycleOwner, AutoCloseable

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

    • ID

      public static final String ID
      See Also:
    • NAME_CPT

      public static final String NAME_CPT
      See Also:
    • 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