Ejemplo n.º 1
0
 public static void UpdateHorizontalTextAlignment(this UITextView textView, ITextAlignment textAlignment)
 {
     // We don't have a FlowDirection yet, so there's nothing to pass in here.
     // TODO ezhart Update this when FlowDirection is available
     // (or update the extension to take an IEditor instead of an alignment and work it out from there)
     textView.TextAlignment = textAlignment.HorizontalTextAlignment.ToPlatform(true);
 }
Ejemplo n.º 2
0
 public static void UpdateHorizontalTextAlignment(this TextBox textBox, ITextAlignment textAlignment)
 {
     // We don't have a FlowDirection yet, so there's nothing to pass in here.
     // TODO: Update this when FlowDirection is available
     // (or update the extension to take an ILabel instead of an alignment and work it out from there)
     textBox.TextAlignment = textAlignment.HorizontalTextAlignment.ToNative(true);
 }
Ejemplo n.º 3
0
 public static void UpdateHorizontalTextAlignment(this TextView textView, ITextAlignment text)
 {
     if (textView.Context !.HasRtlSupport())
     {
         // We want to use TextAlignment where possible because it doesn't conflict with the
         // overall gravity of the underlying control
         textView.TextAlignment = text.HorizontalTextAlignment.ToTextAlignment();
     }
        public static void UpdateHorizontalTextAlignment(this UITextField textField, ITextAlignment textAlignment)
        {
            bool isLtr;

            if (textAlignment is IView v && v.FlowDirection == FlowDirection.LeftToRight)
            {
                isLtr = true;
            }
Ejemplo n.º 5
0
        public static void UpdateHorizontalTextAlignment(this UITextField textField, ITextAlignment textAlignment)
        {
            if (textAlignment is IView view)
            {
                textField.TextAlignment = textAlignment.HorizontalTextAlignment.ToPlatformHorizontal().AdjustForFlowDirection(view);
                return;
            }

            textField.TextAlignment = textAlignment.HorizontalTextAlignment.ToPlatformHorizontal();
        }
Ejemplo n.º 6
0
 public static void UpdateHorizontalTextAlignment(this TextView textView, ITextAlignment text)
 {
     if (Rtl.IsSupported)
     {
         // We want to use TextAlignment where possible because it doesn't conflict with the
         // overall gravity of the underlying control
         textView.TextAlignment = text.HorizontalTextAlignment.ToTextAlignment();
     }
     else
     {
         // But if RTL support is not available for some reason, we have to resort
         // to gravity, because Android will simply ignore text alignment
         textView.Gravity = Android.Views.GravityFlags.Top | text.HorizontalTextAlignment.ToHorizontalGravityFlags();
     }
 }
Ejemplo n.º 7
0
 public static void UpdateVerticalTextAlignment(this TextBox textBox, ITextAlignment textAlignment) =>
 MauiTextBox.SetVerticalTextAlignment(textBox, textAlignment.VerticalTextAlignment.ToNativeVerticalAlignment());
Ejemplo n.º 8
0
 public static void UpdateVerticalTextAlignment(this TextView textView, ITextAlignment textAlignment)
 {
     textView.UpdateVerticalAlignment(textAlignment.VerticalTextAlignment);
 }
Ejemplo n.º 9
0
 public static void UpdateVerticalTextAlignment(this UITextField textField, ITextAlignment textAlignment)
 {
     textField.VerticalAlignment = textAlignment.VerticalTextAlignment.ToPlatformVertical();
 }
Ejemplo n.º 10
0
 public static void UpdateVerticalTextAlignment(this Entry platformEntry, ITextAlignment entry)
 {
     platformEntry.SetVerticalTextAlignment(entry.VerticalTextAlignment.ToPlatformDouble());
     platformEntry.SetVerticalPlaceHolderTextAlignment(entry.VerticalTextAlignment.ToPlatformDouble());
 }
Ejemplo n.º 11
0
 public static void UpdateHorizontalTextAlignment(this Entry platformEntry, ITextAlignment entry)
 {
     platformEntry.HorizontalTextAlignment = entry.HorizontalTextAlignment.ToPlatform();
 }
Ejemplo n.º 12
0
 public static void UpdateVerticalTextAlignment(this EditText editText, ITextAlignment entry)
 {
     editText.UpdateVerticalAlignment(entry.VerticalTextAlignment);
 }
Ejemplo n.º 13
0
 public static void UpdateHorizontalTextAlignment(this EditText editText, ITextAlignment textAlignment)
 {
     editText.UpdateHorizontalAlignment(textAlignment.HorizontalTextAlignment);
 }
Ejemplo n.º 14
0
 public static void UpdateHorizontalTextAlignment(this EditText editText, ITextAlignment textAlignment)
 {
     editText.UpdateHorizontalAlignment(textAlignment.HorizontalTextAlignment, editText.Context != null && editText.Context.HasRtlSupport());
 }
Ejemplo n.º 15
0
 public static void UpdateVerticalTextAlignment(this Control platformControl, ITextAlignment textAlignment)
 {
     platformControl.VerticalAlignment = textAlignment.VerticalTextAlignment.ToPlatformVerticalAlignment();
 }