Beispiel #1
0
        public static void UpdatePassBars(Grid.IGridList <View> bars, string pass)
        {
            PassStrength passStrength = GetPassStrength(pass);

            switch (passStrength)
            {
            case PassStrength.Invalid:
                SetPassBarsColors(bars, 4, Color.Gray);
                break;

            case PassStrength.Poor:
                SetPassBarsColors(bars, 1, Color.Red);
                break;

            case PassStrength.Average:
                SetPassBarsColors(bars, 2, Color.Orange);
                break;

            case PassStrength.Good:
                SetPassBarsColors(bars, 3, Color.Yellow);
                break;

            case PassStrength.Excelent:
                SetPassBarsColors(bars, 4, Color.Green);
                break;
            }
        }
Beispiel #2
0
        private void FocusNext(Grid.IGridList <View> entries, BorderlessEntry e, string input = "")
        {
            int index = entries.IndexOf(e);

            if (index > -1 && (index + 1) <= entries.Count)
            {
                var next = (BorderlessEntry)entries.ElementAt(index + 1);
                next?.Focus();
                next.Text = input;
            }
        }
Beispiel #3
0
 static void SetPassBarsColors(Grid.IGridList <View> bars, int barsCount, Color color)
 {
     for (int i = 0; i < bars.Count; i++)
     {
         if (i < barsCount)
         {
             bars[i].BackgroundColor = color;
         }
         else
         {
             bars[i].BackgroundColor = Color.Gray;
         }
     }
 }
Beispiel #4
0
        private void FocusBack(Grid.IGridList <View> entries, BorderlessEntry e, bool deleteValue = false)
        {
            MostRecentBackPress = null;
            int index = entries.IndexOf(e);

            if (index > -1 && (index - 1) >= 0)
            {
                var prev  = (BorderlessEntry)entries.ElementAt(index - 1);
                var input = prev.Text;
                prev?.Focus();
                if (deleteValue)
                {
                    prev.Text           = "";
                    MostRecentBackPress = new BackButtonEventArgs("", input);
                }
            }
        }
 public static void Add(this Grid.IGridList <View> gridList, ViewWithGridPosition v)
 {
     gridList.Add(v.View, v.Column, v.ColumnSpan + v.Column, v.Row, v.RowSpan + v.Row);
 }