public static ButtonStroked CreateDeviceButton(BluetoothConnectionActivity activity, BluetoothDevice device, TetrisColor color, int minHeight, string text) { ButtonStroked button = new ButtonStroked(activity); button.Settings = DeviceButtonUI.Clone(); button.Settings.StrokeColor = Utils.getAndroidColor(color, button.Settings.StrokeShade); button.Settings.FillColor = Utils.getAndroidColor(color, button.Settings.FillShade); button.SetMinimumHeight(minHeight); int padding = Utils.GetPixelsFromDP(activity, button.Settings.Padding); button.SetPadding(padding, padding, padding, padding); button.Text = text; if(device != null) { button.Tag = device.Address; button.Click += delegate { activity.DeviceListClick(button); }; } else { button.Enabled = false; } return button; }
private static void SetBaseIconButton(ButtonStroked button, TetrisColor color, int height, int textsize) { button.Text = button.Tag.ToString(); button.SetMaxHeight(height); button.SetMinimumHeight(height); button.Settings.StrokeColor = Utils.getAndroidColor(color, button.Settings.StrokeShade); button.Settings.FillColor = Utils.getAndroidColor(color, button.Settings.FillShade); }