{
static CollectionView mDeviceView = null;
static DeviceSource mDeviceSource = null;
+ static View mBtOffMessage = null;
private static CollectionView CreateCollectionView(DeviceSource source, bool isPairedDeviceView = false)
{
{
Log.Info(SettingBluetooth.LogTag, "Add device view");
+ RemoveBTOffMessage(view);
mDeviceSource = new DeviceSource();
mDeviceView = CreateCollectionView(mDeviceSource);
view.Add(mDeviceView);
BtModel.GetBondedDevices();
}
+ public static View CreateBTOffMessage()
+ {
+ TextLabel messageText = new TextLabel()
+ {
+ AccessibilityHidden = true,
+ ThemeChangeSensitive = true,
+ Text = Resources.IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH,
+ TextColor = new Color("#CACACA"),
+ PixelSize = 22.SpToPx(),
+ };
+
+ return messageText;
+ }
+
+ internal static void AddBTOffMessage(View view)
+ {
+ mBtOffMessage = CreateBTOffMessage();
+ view.Add(mBtOffMessage);
+ }
+ internal static void RemoveBTOffMessage(View view)
+ {
+ if (mBtOffMessage != null)
+ {
+ view.Remove(mBtOffMessage);
+ mBtOffMessage = null;
+ }
+ }
+
internal static void RemoveDeviceView(View view)
{
Log.Info(SettingBluetooth.LogTag, "Remove device view");
view.Remove(mDeviceView);
mDeviceView = null;
}
+ AddBTOffMessage(view);
}
internal static void RemoveAllSearchedDevices()
static public string IDS_BT_SK_DISCONNECT = "Disconnect";
static public string IDS_BT_HEADER_DISCONNECT_DEVICE_ABB = "Disconnect device";
static public string IDS_WMGR_POP_THIS_WILL_END_YOUR_CONNECTION_WITH_PS = "This will end your connection with {0}.";
+ static public string IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH
+ = "Turn on Bluetooth to see a list of devices you can pair with or have already paired with.";
}
}