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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static ModernUI
Get Modern UI instance.Returns the Lifecycle of the provider.getResourceChannel
(String namespace, String path) getResourceStream
(String namespace, String path) static Locale
Get the default or preferred locale set by user.static Typeface
Get the default or preferred typeface set by user.Get the view manager of the application window (i.e.boolean
Whether to enable RTL support, it should always be true.protected Locale
Get the default or preferred locale set by user.protected Typeface
Get the default or preferred typeface set by user.void
Runs 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:LifecycleOwner
Returns the Lifecycle of the provider.- Specified by:
getLifecycle
in interfaceLifecycleOwner
- Returns:
- The lifecycle of the provider.
-
getResources
- Specified by:
getResources
in 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:
getWindowManager
in classActivity
- Returns:
- window view manager
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-