private Button moreButton;
private View controlsView;
+ private View controlsTop;
+ private View controlsBottom;
private View sliderView;
private View playbackButtonsView;
private MultiStateButton playButton;
StyleName = "AppBackground";
WidthResizePolicy = ResizePolicyType.FillToParent;
HeightResizePolicy = ResizePolicyType.FillToParent;
+ BackgroundColor = Color.Transparent;
AddPlayerBackground();
AddRightViewBackground();
playerContentView = new View()
{
controlsView = new View()
{
- WidthSpecification = ModifySize(640).SpToPx(),
- HeightSpecification = ModifySize(400).SpToPx(),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
Layout = new LinearLayout()
{
LinearOrientation = LinearLayout.Orientation.Vertical,
Margin = new Extents(0, 0, (ushort)ModifySize(40), 0).SpToPx(),
}
};
+
rightView.Add(controlsView);
AddControlElements();
rightView.BindingContextChanged += OnControlsViewContextChanged;
VerticalAlignment = VerticalAlignment.Center,
Ellipsis = true,
};
- controlsView.Add(titleLabel);
+ controlsTop.Add(titleLabel);
titleLabel.SetBinding(TextLabel.TextProperty, "TrackName");
}
VerticalAlignment = VerticalAlignment.Center,
Ellipsis = true,
};
- controlsView.Add(artistLabel);
+ controlsTop.Add(artistLabel);
artistLabel.SetBinding(TextLabel.TextProperty, "TrackArtist");
}
private void AddTextControlElements()
{
+ controlsTop = new View()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ SizeModeFactor = new Vector3(0.6f, 0.6f, 0.6f),
+ Layout = new LinearLayout
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ VerticalAlignment = VerticalAlignment.Center,
+ },
+ };
AddTitleLabel();
AddArtistLabel();
+ controlsView.Add(controlsTop);
}
private void AddShuffleButton()
{
playbackButtonsView = new View()
{
- WidthSpecification = LayoutParamPolicies.MatchParent,
- HeightSpecification = ModifySize(48).SpToPx(),
- Layout = new LinearLayout()
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ MaximumSize = new Size2D(600, 80).SpToPx(),
+ HeightSpecification = ModifySize(80).SpToPx(),
+ Layout = new FlexLayout()
{
- LinearOrientation = LinearLayout.Orientation.Horizontal,
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center,
- Margin = new Extents(0, 0, (ushort)ModifySize(100), (ushort)ModifySize(92)).SpToPx(),
- CellPadding = new Size2D(ModifySize(80), 0).SpToPx(),
- },
+ Direction = FlexLayout.FlexDirection.Row,
+ Justification = FlexLayout.FlexJustification.SpaceBetween,
+ Alignment = FlexLayout.AlignmentType.FlexEnd,
+ }
};
- controlsView.Add(playbackButtonsView);
+ controlsBottom.Add(playbackButtonsView);
AddShuffleButton();
AddPreviousButton();
AddPlayButton();
volumeSlider = new Slider("Slider")
{
ThemeChangeSensitive = true,
- Size2D = new Size2D(ModifySize(496), ModifySize(48)).SpToPx(),
+ SizeHeight = ModifySize(48).SpToPx(),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
ThumbSize = new Tizen.NUI.Size(ModifySize(36), ModifySize(36)).SpToPx(),
Direction = Slider.DirectionType.Horizontal,
MinValue = 0,
VerticalAlignment = VerticalAlignment.Center,
},
};
- controlsView.Add(volumeSliderView);
+ controlsBottom.Add(volumeSliderView);
AddLeftVolumeIcon();
AddVolumeSlider();
AddRightVolumeIcon();
private void AddControlElements()
{
AddTextControlElements();
+ controlsBottom = new View()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ SizeHeight = 150.SpToPx(),
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ }
+ };
AddButtonControlElements();
AddVolumeSliderElements();
+ controlsView.Add(controlsBottom);
}
private void AddPlaybackSliderEventHandler()