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; } }
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; } }
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; } } }
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); }