internal static bool UpdateFlowDirection(this UIView view, IVisualElementController controller)
        {
            if (controller == null || view == null || !Forms.IsiOS9OrNewer)
            {
                return(false);
            }

            if (controller is IView v)
            {
                var current = view.SemanticContentAttribute;
                view.UpdateFlowDirection(v);
                return(current != view.SemanticContentAttribute);
            }

            UISemanticContentAttribute updateValue = view.SemanticContentAttribute;

            if (controller.EffectiveFlowDirection.IsRightToLeft())
            {
                updateValue = UISemanticContentAttribute.ForceRightToLeft;
            }
            else if (controller.EffectiveFlowDirection.IsLeftToRight())
            {
                updateValue = UISemanticContentAttribute.ForceLeftToRight;
            }

            if (updateValue != view.SemanticContentAttribute)
            {
                view.SemanticContentAttribute = updateValue;
                return(true);
            }

            return(false);
        }
예제 #2
0
		internal static bool UpdateFlowDirection(this UIView view, IVisualElementController controller)
		{
			if (controller == null || view == null || !Forms.IsiOS9OrNewer)
				return false;

			UISemanticContentAttribute updateValue = view.SemanticContentAttribute;

			if (controller.EffectiveFlowDirection.IsRightToLeft())
				updateValue = UISemanticContentAttribute.ForceRightToLeft;
			else if (controller.EffectiveFlowDirection.IsLeftToRight())
				updateValue = UISemanticContentAttribute.ForceLeftToRight;

			if (updateValue != view.SemanticContentAttribute)
			{
				view.SemanticContentAttribute = updateValue;
				return true;
			}

			return false;
		}
예제 #3
0
        public static void UpdateFlowDirection(this UIView nativeView, IView view)
        {
            UISemanticContentAttribute updateValue = nativeView.SemanticContentAttribute;

            if (view.FlowDirection == view.Handler?.MauiContext?.GetFlowDirection() ||
                view.FlowDirection == FlowDirection.MatchParent)
            {
                updateValue = UISemanticContentAttribute.Unspecified;
            }
            else if (view.FlowDirection == FlowDirection.RightToLeft)
            {
                updateValue = UISemanticContentAttribute.ForceRightToLeft;
            }
            else if (view.FlowDirection == FlowDirection.LeftToRight)
            {
                updateValue = UISemanticContentAttribute.ForceLeftToRight;
            }

            if (updateValue != nativeView.SemanticContentAttribute)
            {
                nativeView.SemanticContentAttribute = updateValue;
            }
        }
예제 #4
0
        public static void UpdateFlowDirection(this UIView platformView, IView view)
        {
            UISemanticContentAttribute updateValue = platformView.SemanticContentAttribute;

            switch (view.FlowDirection)
            {
            case FlowDirection.MatchParent:
                updateValue = UISemanticContentAttribute.Unspecified;
                break;

            case FlowDirection.LeftToRight:
                updateValue = UISemanticContentAttribute.ForceLeftToRight;
                break;

            case FlowDirection.RightToLeft:
                updateValue = UISemanticContentAttribute.ForceRightToLeft;
                break;
            }

            if (updateValue != platformView.SemanticContentAttribute)
            {
                platformView.SemanticContentAttribute = updateValue;
            }
        }
예제 #5
0
 internal extern static IntPtr IntPtr_objc_msgSend(IntPtr receiver, IntPtr selector, UISemanticContentAttribute arg1);