Package icyllis.modernui
Class ModernUI
java.lang.Object
icyllis.modernui.core.Context
icyllis.modernui.app.Activity
icyllis.modernui.ModernUI
- All Implemented Interfaces:
LifecycleOwner,AutoCloseable
The core class of Modern UI.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ModernUIGet Modern UI instance.Returns the Lifecycle of the provider.getResourceChannel(String namespace, String path) getResourceStream(String namespace, String path) static LocaleGet the default or preferred locale set by user.static TypefaceGet the default or preferred typeface set by user.Get the view manager of the application window (i.e.booleanWhether to enable RTL support, it should always be true.protected LocaleGet the default or preferred locale set by user.protected TypefaceGet the default or preferred typeface set by user.voidRuns the Modern UI with the default application setups.Methods inherited from class icyllis.modernui.app.Activity
getToastManager
-
Field Details
-
ID
- See Also:
-
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
-
-
Constructor Details
-
ModernUI
public ModernUI()
-
-
Method Details
-
getInstance
Get Modern UI instance.- Returns:
- the Modern UI
-
run
Runs the Modern UI with the default application setups. This method is only called by themain()on the main thread. -
getLifecycle
Description copied from interface:LifecycleOwnerReturns the Lifecycle of the provider.- Specified by:
getLifecyclein interfaceLifecycleOwner- Returns:
- The lifecycle of the provider.
-
getResources
- Specified by:
getResourcesin classContext
-
onGetSelectedLocale
Get the default or preferred locale set by user.- Returns:
- the selected locale
-
getSelectedLocale
Get the default or preferred locale set by user.- Returns:
- the selected locale
-
onGetSelectedTypeface
Get the default or preferred typeface set by user.- Returns:
- the selected 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
Get the view manager of the application window (i.e. main window).- Overrides:
getWindowManagerin classActivity- Returns:
- window view manager
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-