Exemple #1
0
        void CreateShapeDrawable(MvvmAspire.Controls.SearchBar element)
        {
            GradientDrawable shape = new GradientDrawable();

            shape.SetShape(ShapeType.Rectangle);
            shape.SetCornerRadius(BaseUIHelper.ConvertDPToPixels(element.CornerRadius));

            if (Element.BackgroundColor != Xamarin.Forms.Color.Default)
            {
                shape.SetColor(Element.BackgroundColor.ToAndroid());
            }

            Control.Background = shape;
        }
Exemple #2
0
        void SetTextInputTypes(MvvmAspire.Controls.SearchBar element)
        {
            switch (element.TextInputType)
            {
            case TextInputType.Normal: editText.InputType = InputTypes.TextVariationNormal; break;

            case TextInputType.EmailAddress: editText.InputType = InputTypes.TextVariationEmailAddress; break;

            case TextInputType.Password: editText.InputType = InputTypes.TextVariationPassword; break;

            case TextInputType.Phone: editText.InputType = InputTypes.ClassPhone; break;

            case TextInputType.Number: editText.InputType = InputTypes.ClassNumber; break;

            case TextInputType.PersonName: editText.InputType = InputTypes.TextVariationPersonName | InputTypes.TextFlagCapSentences; break;
            }
        }