Package io.nevernull.mobileui
Class MobileUI
- java.lang.Object
-
- io.nevernull.mobileui.MobileUI
-
public class MobileUI extends Object
Main Interface to the basic functions of MobileUI for your app.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
firePropertyChanged(Object bindingContext, String... property)
Fire that a property of the given bindingContext has changed.static ApplicationContext
getApplicationContext()
PURPLE Returns the MicronautApplicationContext
, if you have mobileui-inject added to your app.static void
inject(Object object)
PURPLE Injects dependencies into the given object.static void
runOnUiThread(Runnable runnable)
Run on the system's UI-Thread, if we're not already there.static void
runOnUiThread(Runnable runnable, long delay)
Run on the system's UI-Thread after a given delay in ms
-
-
-
Method Detail
-
firePropertyChanged
public static void firePropertyChanged(@Nonnull Object bindingContext, @Nonnull String... property)
Fire that a property of the given bindingContext has changed. This will either add this information to the currently running EventContext (if this happends due to pending user input) or take the required action to fire the property on the UI thread. This method can securely be called from every location and thread.- Parameters:
bindingContext
- the object with the currently changed propertyproperty
- list of properties by name that have been changed
-
runOnUiThread
public static void runOnUiThread(@Nonnull Runnable runnable)
Run on the system's UI-Thread, if we're not already there.- Parameters:
runnable
- the action to execute on the UI thread
-
runOnUiThread
public static void runOnUiThread(@Nonnull Runnable runnable, long delay)
Run on the system's UI-Thread after a given delay in ms- Parameters:
runnable
- action to executedelay
- delay in ms
-
getApplicationContext
@Nonnull public static ApplicationContext getApplicationContext()
PURPLE Returns the MicronautApplicationContext
, if you have mobileui-inject added to your app. If mobileui-inject is not available, this throws anIllegalStateException
.- Returns:
- the application context the Micronaut
ApplicationContext
- Throws:
IllegalStateException
- if mobileui-inject is not available- Since:
- 0.4.0
-
-