{
static CollectionView mDeviceView = null;
static DeviceSource mDeviceSource = null;
- static View mBtOffMessage = null;
+ static TextLabel mBtOffMessage = null;
private static CollectionView CreateCollectionView(DeviceSource source, bool isPairedDeviceView = false)
{
{
Log.Info(SettingBluetooth.LogTag, "Add device view");
- RemoveBTOffMessage(view);
+ ShowBtOnMessage();
mDeviceSource = new DeviceSource();
mDeviceView = CreateCollectionView(mDeviceSource);
view.Add(mDeviceView);
BtModel.GetBondedDevices();
}
- public static View CreateBTOffMessage()
+ public static void CreateBtMessageView(View view)
{
- TextLabel messageText = new TextLabel()
+ View messageView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ },
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.WrapContent,
+ };
+
+ mBtOffMessage = 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"),
+ TextColor = Color.Grey,
PixelSize = 22.SpToPx(),
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ Margin = new Extents(16, 0, 0, 0).SpToPx(),
};
- return messageText;
+ messageView.Add(mBtOffMessage);
+ view.Add(messageView);
}
- internal static void AddBTOffMessage(View view)
+ internal static void ShowBtOffMessage()
{
- mBtOffMessage = CreateBTOffMessage();
- view.Add(mBtOffMessage);
+ mBtOffMessage.Text = Resources.IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH;
}
- internal static void RemoveBTOffMessage(View view)
+
+ internal static void ShowBtOnMessage()
{
- if (mBtOffMessage != null)
- {
- view.Remove(mBtOffMessage);
- mBtOffMessage = null;
- }
+ mBtOffMessage.Text = string.Format(Resources.IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES, BtModel.Name);
}
internal static void RemoveDeviceView(View view)
view.Remove(mDeviceView);
mDeviceView = null;
}
- AddBTOffMessage(view);
+
+ ShowBtOffMessage();
}
internal static void RemoveAllSearchedDevices()