コード例 #1
0
ファイル: UtilsUI.cs プロジェクト: lea-and-anthony/Tetrim
        public static ButtonStroked CreateDeviceButton(BluetoothConnectionActivity activity, BluetoothDevice device, TetrisColor color, int minHeight, int defaultText)
        {
            if(device == null)
            {
                return CreateDeviceButton(activity, device, color, minHeight, activity.Resources.GetString(defaultText));
            }

            return CreateDeviceButton(activity, device, color, minHeight, device.Name);
        }
コード例 #2
0
ファイル: UtilsUI.cs プロジェクト: lea-and-anthony/Tetrim
 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;
 }
コード例 #3
0
ファイル: Receiver.cs プロジェクト: lea-and-anthony/Tetrim
 //--------------------------------------------------------------
 // CONSTRUCTORS
 //--------------------------------------------------------------
 public Receiver(BluetoothConnectionActivity activity)
 {
     _activity = activity;
 }