private TextLabel titleLabel;
private TextLabel artistLabel;
+ private View leftView;
private View controlsView;
private View sliderView;
private MultiStateButton playButton;
};
if(DeviceInfo.IsPortrait)
{
- baseView.Padding = new Extents(33, 33, 24, 8).SpToPx();
+ baseView.Padding = new Extents(32, 32, 24, 8).SpToPx();
baseView.HeightSpecification = 108.SpToPx();
}
Add(baseView);
+ AddLeftView();
AddTrackDetails();
AddControlElements();
AddSliderElements();
Add(separator);
}
+ private void AddLeftView()
+ {
+ leftView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ VerticalAlignment = VerticalAlignment.Center,
+ },
+ BackgroundColor = Color.Transparent,
+ HeightSpecification = 76.SpToPx(),
+ WidthSpecification = DeviceInfo.IsPortrait ? Window.Instance.Size.Width - 64 : (int)((Window.Instance.Size.Width - 128) * 0.65f),
+ };
+ baseView.Add(leftView);
+ }
+
private void AddTrackDetails()
{
trackInfo = new View()
{
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ WidthSpecification = (int)(leftView.SizeWidth * 0.6),
Layout = new LinearLayout()
{
LinearOrientation = LinearLayout.Orientation.Horizontal,
},
BackgroundColor = Color.Transparent,
};
- trackInfo.WidthSpecification = (DeviceInfo.IsPortrait ? 536 : 622).SpToPx();
- trackInfo.HeightSpecification = 76.SpToPx();
- baseView.Add(trackInfo);
+ leftView.Add(trackInfo);
AddThumbnail();
AddTrackTextLabels();
}
LinearOrientation = LinearLayout.Orientation.Vertical,
},
HeightSpecification = 76.SpToPx(),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ Margin = (DeviceInfo.IsPortrait ? new Extents(24, 0, 0, 0) : new Extents(30, 0, 0, 0)).SpToPx(),
};
- if(DeviceInfo.IsPortrait)
- {
- trackTextView.WidthSpecification = 436.SpToPx();
- trackTextView.Margin = new Extents(24, 0, 0, 0);
- }
- else
- {
- trackTextView.WidthSpecification = 516.SpToPx();
- trackTextView.Margin = new Extents(30, 0, 0, 0);
- }
trackInfo.Add(trackTextView);
AddTrackName();
AddArtistName();
{
controlsView = new View()
{
- WidthSpecification = 304.SpToPx(),
+ WidthSpecification = (int)(leftView.SizeWidth * 0.4),
Layout = new LinearLayout()
{
LinearOrientation = LinearLayout.Orientation.Horizontal,
- HorizontalAlignment = HorizontalAlignment.Begin,
+ HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
- CellPadding = new Size2D(80, 0).SpToPx(),
+ CellPadding = (DeviceInfo.IsPortrait ? new Size2D(20, 0) : new Size2D(50, 0)).SpToPx(),
},
- Margin = new Extents(120, 120, 0, 0).SpToPx(),
+ Margin = new Extents(10, 10, 0, 0).SpToPx(),
BackgroundColor = Color.Transparent,
};
- baseView.Add(controlsView);
+ leftView.Add(controlsView);
AddPreviousButton();
AddPlayButton();
AddNextButton();
Padding = new Extents(33, 33, 0, 8).SpToPx(),
};
sliderView.SizeHeight = 61.SpToPx();
- base.Add(sliderView);
+ Add(sliderView);
currentTime.WidthSpecification = 72.SpToPx();
sliderView.Add(currentTime);
- playbackSlider.WidthSpecification = 872.SpToPx();
+ playbackSlider.WidthSpecification = Window.Instance.Size.Width - 208.SpToPx();
sliderView.Add(playbackSlider);
totalTime.WidthSpecification = 72.SpToPx();
sliderView.Add(totalTime);
ThemeChangeSensitive = true,
MinValue = 0.0f,
MaxValue = 1.0f,
- WidthSpecification = 626.SpToPx(),
+ WidthSpecification = (int)((Window.Instance.Size.Width - 128) * 0.35),
HeightSpecification = SliderHeight.SpToPx(),
- ThumbSize = new Tizen.NUI.Size(30, 30).SpToPx(),
+ ThumbSize = new Size(30, 30).SpToPx(),
Direction = Slider.DirectionType.Horizontal,
};
playbackSlider.SetBinding(Slider.CurrentValueProperty, "ElapsedTime");