static View mDetailView;
static ContentPage mDetailPage;
static Device mDevice;
+ private static ScrollableBase mScrollableInfo;
private static TextField mDeviceNameField;
private static readonly Color underlineColor = new Color("#FF6200");
HeightSpecification = LayoutParamPolicies.MatchParent,
};
+ mScrollableInfo = new ScrollableBase()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ HideScrollbar = false,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+
+ };
+
CreateDeviceNameView(device.Name);
var unpairButton = new DefaultLinearItem()
};
mDetailView.Add(unpairButton);
- var connOption = new DefaultLinearItem()
+ var useForHeader = new DefaultLinearItem()
{
WidthSpecification = LayoutParamPolicies.MatchParent,
- Text = Resources.IDS_BT_BODY_CONNECTION_OPTIONS,
+ Text = Resources.IDS_BT_BODY_USE_FOR,
+ Margin = new Extents(8, 0, 0, 0).SpToPx(),
};
- mDetailView.Add(connOption);
+ useForHeader.Label.TextColor = Color.Grey;
+ mDetailView.Add(useForHeader);
if (device.BtDevice.IsA2dpSupported)
{
- var mediaAudioItem = new DefaultLinearItem()
- {
- WidthSpecification = LayoutParamPolicies.MatchParent,
- Text = Resources.IDS_BT_BODY_MEDIA_AUDIO,
- };
- var mediaAudioSwitch = new Switch()
- {
- IsSelected = device.BtDevice.IsA2dpConnected ? true : false,
- };
- mediaAudioSwitch.SelectedChanged += (obj, ev) =>
- {
- if (ev.IsSelected)
- {
- DeviceController.ConnectA2dp(device.BtDevice);
- }
- else
- {
- DeviceController.DisconnectA2dp(device.BtDevice, false);
- }
- };
- mediaAudioItem.Extra = mediaAudioSwitch;
- mDetailView.Add(mediaAudioItem);
+ CreateMediaAudio();
}
+ mDetailView.Add(mScrollableInfo);
mDetailPage = new ContentPage()
{
AppBar = CreateAppBar(),
window.GetDefaultNavigator().Push(mDetailPage);
}
+ private static void CreateMediaAudio()
+ {
+ var mediaAudioItem = new DefaultLinearItem()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ Text = Resources.IDS_BT_BODY_MEDIA_AUDIO,
+ };
+ var mediaAudioSwitch = new Switch()
+ {
+ IsSelected = mDevice.BtDevice.IsA2dpConnected ? true : false,
+ };
+ mediaAudioSwitch.SelectedChanged += (obj, ev) =>
+ {
+ if (ev.IsSelected)
+ {
+ DeviceController.ConnectA2dp(mDevice.BtDevice);
+ }
+ else
+ {
+ DeviceController.DisconnectA2dp(mDevice.BtDevice, false);
+ }
+ };
+ mediaAudioItem.Extra = mediaAudioSwitch;
+ mScrollableInfo.Add(mediaAudioItem);
+ }
+
private static void CreateDeviceNameView(string deviceName)
{
var label = new TextLabel