Package io.nevernull.mobileui.ios
Class MobileUILayout
- java.lang.Object
-
- org.robovm.rt.bro.NativeObject
-
- org.robovm.objc.ObjCObject
-
- org.robovm.apple.foundation.NSObject
-
- org.robovm.apple.uikit.UIResponder
-
- org.robovm.apple.uikit.UIView
-
- io.nevernull.mobileui.ios.AbstractViewAdapter
-
- io.nevernull.mobileui.ios.MobileUILayout
-
- All Implemented Interfaces:
io.nevernull.mobileui.core.PropertyFireListener
,io.nevernull.mobileui.core.ResourceUpdateListener
,io.nevernull.mobileui.core.TemplateVariableChangeListener
,CALayerDelegate
,NSCoding
,NSObjectProtocol
,UIAccessibility
,UIAccessibilityIdentification
,UIAppearanceContainer
,UICoordinateSpace
,UIDynamicItem
,UIFocusEnvironment
,UIFocusItem
,UIFocusItemContainer
,UILargeContentViewerItem
,UITraitEnvironment
,ObjCProtocol
public class MobileUILayout extends AbstractViewAdapter implements io.nevernull.mobileui.core.ResourceUpdateListener, io.nevernull.mobileui.core.PropertyFireListener, io.nevernull.mobileui.core.TemplateVariableChangeListener
MobileUI Layout for iOS that can be used as part of the UIView-tree or as view for aUIViewController
.To use a MobileUI layout in your
UIViewController
, create it within theloadView()
method like this:@Override public void loadView() { setView(new MobileUILayout("Main.layout.xml", this)); }
The second parameter is the binding context for the UI data bindings.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.nevernull.mobileui.ios.AbstractViewAdapter
AbstractViewAdapter.SafeAreaMode
-
Nested classes/interfaces inherited from class org.robovm.apple.uikit.UIView
UIView.UIViewPtr
-
Nested classes/interfaces inherited from class org.robovm.apple.uikit.UIResponder
UIResponder.UIResponderPtr
-
Nested classes/interfaces inherited from class org.robovm.apple.foundation.NSObject
NSObject.Marshaler, NSObject.NoRetainMarshaler, NSObject.NSKeyValueObserver, NSObject.NSObjectPtr
-
Nested classes/interfaces inherited from class org.robovm.objc.ObjCObject
ObjCObject.ObjCObjectPtr, ObjCObject.Super
-
Nested classes/interfaces inherited from interface org.robovm.apple.uikit.UIAccessibility
UIAccessibility.Notifications
-
-
Field Summary
-
Fields inherited from class org.robovm.apple.foundation.NSObject
FLAG_NO_RETAIN
-
-
Constructor Summary
Constructors Constructor Description MobileUILayout(@Nonnull UIViewController viewController, @Nonnull io.nevernull.mobileui.LayoutConfig layoutConfig)
Constructs a MobileUI layout with a LayoutConfig that determines the layout resource and binding context.MobileUILayout(@Nonnull UIViewController viewController, @Nonnull String layoutResource)
Creates a layout from the given XML-resource without binding context.MobileUILayout(@Nonnull UIViewController viewController, @Nonnull String layoutResource, boolean bindToTestObject)
Creates a layout for a given XML-resource and optionally binds to thetestObject
that is embedded within the layout XML file.MobileUILayout(@Nonnull UIViewController viewController, @Nonnull String layoutResource, @Nonnull Object bindingContext)
Creates a layout from the given XML-resource binding to the givenbindingContext
using the givenas source for lifecycle events
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
didMoveToWindow()
Internal APIvoid
firePropertyChanged(@Nonnull String... properties)
Fire a property change for this layout and bindingContext.android.view.View<UIView>
getContentView()
Internal API<T extends UIView>
@Nullable TgetNativeView(String id)
Returns theUIView
that is the delegate of theView
carrying the given ID.void
onResourceUpdate(String absoluteResourceName)
Internal APIvoid
onTemplateVariableChanged()
void
removeFromController()
void
triggerReload()
-
Methods inherited from class io.nevernull.mobileui.ios.AbstractViewAdapter
execute, getContentFrameLayout, getIntrinsicContentSize, getLayoutParams, layoutSubviews, setInstantLayout, setListMode, setSafeAreaMode
-
Methods inherited from class org.robovm.apple.uikit.UIView
addConstraint, addConstraints, addGestureRecognizer, addInteraction, addKeyframe, addLayoutGuide, addMotionEffect, addSubview, animate, animate, animate, animate, animateKeyframes, areAnimationsEnabled, autoresizesSubviews, beginAnimations, bringSubviewToFront, canBecomeFocused, clearsContextBeforeDrawing, clipsToBounds, commitAnimations, convertPointFromCoordinateSpace, convertPointFromView, convertPointToCoordinateSpace, convertPointToView, convertRectFromCoordinateSpace, convertRectFromView, convertRectToCoordinateSpace, convertRectToView, decodeRestorableState, didAddSubview, didHintFocusMovement, didMoveToSuperview, didUpdateFocus, displayLayer, draw, draw, drawLayer, drawViewHierarchy, encode, encodeRestorableState, endEditing, exchangeSubview, exerciseAmbiguityInLayout, focusItemsInRect, gestureRecognizerShouldBegin, getAccessibilityIdentifier, getAction, getAlignmentRectForFrame, getAlignmentRectInsets, getAlpha, getAutoresizingMask, getBackgroundColor, getBottomAnchor, getBounds, getCenter, getCenterXAnchor, getCenterYAnchor, getCollisionBoundingPath, getCollisionBoundsType, getConstraints, getConstraintsAffectingLayout, getContentCompressionResistancePriority, getContentHuggingPriority, getContentMode, getContentScaleFactor, getCoordinateSpace, getDirectionalLayoutMargins, getEffectiveUserInterfaceLayoutDirection, getFirstBaselineAnchor, getFocusItemContainer, getFrame, getFrameForAlignmentRect, getGestureRecognizers, getHeightAnchor, getInheritedAnimationDuration, getInteractions, getLargeContentImage, getLargeContentImageInsets, getLargeContentTitle, getLastBaselineAnchor, getLayer, getLayerClass, getLayoutGuides, getLayoutMargins, getLayoutMarginsGuide, getLeadingAnchor, getLeftAnchor, getMaskView, getMotionEffects, getOverrideUserInterfaceStyle, getParentFocusEnvironment, getPreferredFocusedView, getPreferredFocusEnvironments, getReadableContentGuide, getResizableSnapshot, getRestorationIdentifier, getRightAnchor, getSafeAreaInsets, getSafeAreaLayoutGuide, getSemanticContentAttribute, getSizeThatFits, getSnapshot, getSubviews, getSuperview, getSystemLayoutSizeFittingSize, getSystemLayoutSizeFittingSize, getTag, getTintAdjustmentMode, getTintColor, getTopAnchor, getTrailingAnchor, getTraitCollection, getTransform, getTransform3D, getUserInterfaceLayoutDirection, getUserInterfaceLayoutDirection, getViewForBaselineLayout, getViewForFirstBaselineLayout, getViewForLastBaselineLayout, getViewPrintFormatter, getViewWithTag, getWidthAnchor, getWindow, hasAmbiguousLayout, hitTest, insertSubview, insertSubviewAbove, insertSubviewBelow, invalidateIntrinsicContentSize, isAccessibilityIgnoresInvertColors, isDescendantOf, isExclusiveTouch, isFocused, isHidden, isInsetsLayoutMarginsFromSafeArea, isMultipleTouchEnabled, isOpaque, isPointInside, isScalesLargeContentImage, isUserInteractionEnabled, layoutIfNeeded, layoutMarginsDidChange, layoutSublayers, modifyAnimations, needsUpdateConstraints, NoIntrinsicMetric, performSystemAnimation, performWithoutAnimation, preservesSuperviewLayoutMargins, removeConstraint, removeConstraints, removeFromSuperview, removeGestureRecognizer, removeInteraction, removeLayoutGuide, removeMotionEffect, requiresConstraintBasedLayout, safeAreaInsetsDidChange, sendSubviewToBack, setAccessibilityIdentifier, setAccessibilityIgnoresInvertColors, setAlpha, setAnimationBeginsFromCurrentState, setAnimationCurve, setAnimationDelay, setAnimationDelegate, setAnimationDidStopSelector, setAnimationDurationInSeconds, setAnimationRepeatAutoreverses, setAnimationRepeatCount, setAnimationsEnabled, setAnimationStartDate, setAnimationTransition, setAnimationWillStartSelector, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setCenter, setClearsContextBeforeDrawing, setClipsToBounds, setContentCompressionResistancePriority, setContentHuggingPriority, setContentMode, setContentScaleFactor, setDirectionalLayoutMargins, setExclusiveTouch, setFrame, setGestureRecognizers, setHidden, setInsetsLayoutMarginsFromSafeArea, setInteractions, setLargeContentImage, setLargeContentImageInsets, setLargeContentTitle, setLayoutMargins, setMaskView, setMotionEffects, setMultipleTouchEnabled, setNeedsDisplay, setNeedsDisplay, setNeedsFocusUpdate, setNeedsLayout, setNeedsUpdateConstraints, setOpaque, setOverrideUserInterfaceStyle, setPreservesSuperviewLayoutMargins, setRestorationIdentifier, setScalesLargeContentImage, setSemanticContentAttribute, setShowsLargeContentViewer, setTag, setTintAdjustmentMode, setTintColor, setTransform, setTransform3D, setTranslatesAutoresizingMaskIntoConstraints, setUserInteractionEnabled, shouldUpdateFocus, showsLargeContentViewer, sizeToFit, tintColorDidChange, traitCollectionDidChange, transition, transition, translatesAutoresizingMaskIntoConstraints, updateConstraints, updateConstraintsIfNeeded, updateFocusIfNeeded, willDrawLayer, willMoveToSuperview, willMoveToWindow, willRemoveSubview
-
Methods inherited from class org.robovm.apple.uikit.UIResponder
areAccessibilityElementsHidden, becomeFirstResponder, buildMenu, canBecomeFirstResponder, canPerformAction, canResignFirstResponder, clearTextInputContextIdentifier, getAccessibilityActivationPoint, getAccessibilityAttributedHint, getAccessibilityAttributedLabel, getAccessibilityAttributedUserInputLabels, getAccessibilityAttributedValue, getAccessibilityFrame, getAccessibilityHint, getAccessibilityLabel, getAccessibilityLanguage, getAccessibilityNavigationStyle, getAccessibilityPath, getAccessibilityTextualContext, getAccessibilityTraits, getAccessibilityUserInputLabels, getAccessibilityValue, getActionTarget, getActivityItemsConfiguration, getEditingInteractionConfiguration, getInputAccessoryView, getInputAccessoryViewController, getInputAssistantItem, getInputView, getInputViewController, getKeyCommands, getNextResponder, getTextInputContextIdentifier, getTextInputMode, getUndoManager, getUserActivity, isAccessibilityElement, isAccessibilityRespondsToUserInteraction, isAccessibilityViewModal, isFirstResponder, motionBegan, motionCancelled, motionEnded, pressesBegan, pressesCancelled, pressesChanged, pressesEnded, reloadInputViews, remoteControlReceived, resignFirstResponder, restoreUserActivityState, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityElement, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewModal, setActivityItemsConfiguration, setShouldGroupAccessibilityChildren, setUserActivity, shouldGroupAccessibilityChildren, touchesBegan, touchesCancelled, touchesEnded, touchesEstimatedPropertiesUpdated, touchesMoved, updateUserActivityState, validateCommand
-
Methods inherited from class org.robovm.apple.foundation.NSObject
addKeyValueObserver, addKeyValueObserver, autorelease, awakeFromNib, conformsToProtocol, copy, description, didChangeValue, didChangeValue, didChangeValues, equals, getAutoContentAccessingProxy, getClassForCoder, getClassForKeyedArchiver, getKeyValueCoder, getObservationInfo, hash, hashCode, isEqual, isKindOfClass, isMemberOfClass, mutableCopy, performSelector, performSelector, performSelector, performSelector, performSelector, performSelector, performSelector, performSelectorInBackground, performSelectorOnMainThread, performSelectorOnMainThread, performSelectorV, performSelectorV, performSelectorV, release, removeKeyValueObserver, removeKeyValueObservers, respondsToSelector, retain, retainCount, setObservationInfo, toString, willChangeValue, willChangeValue, willChangeValues
-
Methods inherited from class org.robovm.objc.ObjCObject
addStrongRef, dispose, getAssociatedObject, getObjCClass, logRetainRelease, removeStrongRef, setAssociatedObject, toObjCObject, toObjCObject, updateStrongRef
-
-
-
-
Constructor Detail
-
MobileUILayout
public MobileUILayout(@Nonnull UIViewController viewController, @Nonnull io.nevernull.mobileui.LayoutConfig layoutConfig)
Constructs a MobileUI layout with a LayoutConfig that determines the layout resource and binding context.- Parameters:
viewController
- the view controllerlayoutConfig
- the layout config- Since:
- 0.4.0
-
MobileUILayout
public MobileUILayout(@Nonnull UIViewController viewController, @Nonnull String layoutResource)
Creates a layout from the given XML-resource without binding context. This can be used for completely static layouts.- Parameters:
viewController
- theUIViewController
giving the lifecycle events for a possibleLifecycleAware
bindingContextlayoutResource
- path of the MobileUI layout within the assets folder
-
MobileUILayout
public MobileUILayout(@Nonnull UIViewController viewController, @Nonnull String layoutResource, boolean bindToTestObject)
Creates a layout for a given XML-resource and optionally binds to thetestObject
that is embedded within the layout XML file.- Parameters:
viewController
- theUIViewController
giving the lifecycle events for a possibleLifecycleAware
bindingContextlayoutResource
- path of the MobileUI layout within the assets folderbindToTestObject
- flag to enabletestObject
-binding
-
MobileUILayout
public MobileUILayout(@Nonnull UIViewController viewController, @Nonnull String layoutResource, @Nonnull Object bindingContext)
Creates a layout from the given XML-resource binding to the givenbindingContext
using the givenas source for lifecycle events
. The bindingContext can be any object that implements the properties and methods used in the layout file.- Parameters:
viewController
- theUIViewController
giving the lifecycle events for a possibleLifecycleAware
bindingContextlayoutResource
- path of the MobileUI layout within the assets folderbindingContext
- object to use as bindingContext for the given layout
-
-
Method Detail
-
removeFromController
public void removeFromController()
-
didMoveToWindow
public void didMoveToWindow()
Internal API- Overrides:
didMoveToWindow
in classUIView
-
getContentView
public android.view.View<UIView> getContentView()
Internal API- Specified by:
getContentView
in classAbstractViewAdapter
- Returns:
- internal
-
onResourceUpdate
public void onResourceUpdate(String absoluteResourceName)
Internal API- Specified by:
onResourceUpdate
in interfaceio.nevernull.mobileui.core.ResourceUpdateListener
- Parameters:
absoluteResourceName
- internal
-
triggerReload
public void triggerReload()
-
firePropertyChanged
public void firePropertyChanged(@Nonnull String... properties)
Fire a property change for this layout and bindingContext.- Specified by:
firePropertyChanged
in interfaceio.nevernull.mobileui.core.PropertyFireListener
- Parameters:
properties
- list of property names that have been changed
-
getNativeView
public <T extends UIView> @Nullable T getNativeView(String id)
Returns theUIView
that is the delegate of theView
carrying the given ID. The ID has been given in the XML file with theid
attribute.- Type Parameters:
T
- This implementation will automatically cast to the return type. Please be aware, that the internal implementation of MobileUI might possibly change, leading toClassCastException
.- Parameters:
id
- ID as given in the XML file (id attribute)- Returns:
- the
UIView
belonging to theView
that is marked with the ID or null. - Throws:
ClassCastException
- if you try to assign the result to a wrong type.
-
onTemplateVariableChanged
public void onTemplateVariableChanged()
- Specified by:
onTemplateVariableChanged
in interfaceio.nevernull.mobileui.core.TemplateVariableChangeListener
-
-