private const int IconSize = 48;
private const int TopBarSize = 120;
private const int ControlViewWidth = 640;
- private const int ControlViewHeight = 384;
+ private const int ControlViewHeightLandscape = 386;
+ private const int ControlViewHeightPortrait = 438;
private const int ControlViewMargin = 315;
private const int TitleLabelHeight = 48;
private const int ArtistLabelHeight = 36;
- private const int TopBarButtonsY = (TopBarSize / 2 - IconSize / 2);
private View playerBackgroundView;
+ private View playerContentView;
+ private View contentView;
private View leftView;
private View rightView;
private View rightViewBackground;
+ private View topView;
private Button backButton;
private Button moreButton;
private View controlsView;
private View sliderView;
+ private View playbackButtonsView;
private MultiStateButton playButton;
private Button prevButton;
private Button nextButton;
private MultiStateButton repeatButton;
private Slider volumeSlider;
private Slider playbackSlider;
+ private View playbackSliderTextView;
private TextLabel titleLabel;
private TextLabel artistLabel;
private TextLabel currentTime;
private TextLabel totalTime;
-
+ private View volumeSliderView;
private ImageView leftVolumeIcon;
private ImageView rightVolumeIcon;
+ private View topRightView;
private ImageView thumb;
+ private View actionButtonView;
private Button listButton;
private Button playlistButton;
private MultiStateButton favouriteButton;
StyleName = "AppBackground";
WidthResizePolicy = ResizePolicyType.FillToParent;
HeightResizePolicy = ResizePolicyType.FillToParent;
-
AddPlayerBackground();
+ AddRightViewBackground();
+ playerContentView = new View()
+ {
+ BackgroundColor = Color.Transparent,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification =LayoutParamPolicies.MatchParent,
+ Layout = new FlexLayout()
+ {
+ Direction = FlexLayout.FlexDirection.Column,
+ Justification = FlexLayout.FlexJustification.FlexStart,
+ ItemsAlignment = FlexLayout.AlignmentType.Center,
+ Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(),
+ },
+ };
+ Add(playerContentView);
viewState = PlayerViewState.AlbumArt;
- leftView = CreateLeftView();
- rightView = CreateRightView();
- AddRightViewBackground();
-
- AddTopButtons();
- AddControlView();
- AddControlElements();
- AddPlaybackSlider();
- AddListActionButtons();
- AddThumbnail();
- AddLyricsView();
+ AddTopView();
+ AddContentView();
+ AddPlaybackSliderView();
TouchEvent += (object source, TouchEventArgs e) => false;
}
public void ShowView()
{
+ viewModel.UpdateAlbumArtAnimationState();
Show();
}
};
WidthResizePolicy = ResizePolicyType.FillToParent;
HeightResizePolicy = ResizePolicyType.FillToParent;
- base.Add(playerBackgroundView);
+ Add(playerBackgroundView);
playerBackgroundView.BackgroundColor = Color.Transparent;
playerBackgroundView.BindingContext = viewModel;
playerBackgroundView.SetBinding(BackgroundProperty, "PlayerBackground");
}
- private View CreateLeftView()
+ private void AddContentView()
{
- View leftView = new View()
+ contentView = new View()
{
- BackgroundColor = Color.Transparent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- SizeWidth = Window.Instance.WindowSize.Width / 2,
- Position2D = new Position2D(0, 0),
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = DeviceInfo.IsPortrait ? LinearLayout.Orientation.Vertical : LinearLayout.Orientation.Horizontal,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Top,
+ },
};
- base.Add(leftView);
- return leftView;
+ playerContentView.Add(contentView);
+ FlexLayout.SetFlexGrow(contentView, 1);
+ FlexLayout.SetFlexShrink(contentView, 1);
+ CreateLeftView();
+ CreateRightView();
}
- private View CreateRightView()
+ private void CreateLeftView()
{
- View rightView = new View()
+ leftView = new View()
{
- BackgroundColor = Color.Transparent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- SizeWidth = Window.Instance.WindowSize.Width / 2,
- Position2D = new Position2D(Window.Instance.WindowSize.Width / 2, 0),
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Top,
+ },
+ Weight = 0.5f,
};
- base.Add(rightView);
- return rightView;
+ contentView.Add(leftView);
+ if(DeviceInfo.IsPortrait)
+ {
+ AddActionButtonAndThumbnail();
+ }
+ else
+ {
+ leftView.Layout.Padding = (new Extents(0, 64, 0, 0)).DpToPx();
+ }
+ AddLyricsView();
}
- private void AddRightViewBackground()
+ private void CreateRightView()
{
- rightViewBackground = new View()
+ rightView = new View()
{
- BackgroundColor = Color.Transparent,
- SizeWidth = Window.Instance.WindowSize.Width / 2,
- SizeHeight = Window.Instance.WindowSize.Height,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Top,
+ },
+ Weight = 0.5f,
};
- rightView.Add(rightViewBackground);
+ contentView.Add(rightView);
+ if (DeviceInfo.IsPortrait == false)
+ {
+ AddActionButtonAndThumbnail();
+ }
+ AddControlView();
+ }
+
+ private void AddRightViewBackground()
+ {
+ rightViewBackground = new View();
+ if(DeviceInfo.IsPortrait)
+ {
+ rightViewBackground.Size2D = new Size2D(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height / 2);
+ rightViewBackground.Position2D = new Position2D(0, 0);
+ }
+ else
+ {
+ rightViewBackground.Size2D = new Size2D(Window.Instance.WindowSize.Width / 2, Window.Instance.WindowSize.Height);
+ rightViewBackground.Position2D = new Position2D(Window.Instance.WindowSize.Width / 2, 0);
+ }
+ Add(rightViewBackground);
rightViewBackground.BindingContext = viewModel;
rightViewBackground.SetBinding(BackgroundProperty, "PlayerBackground");
rightViewBackground.Hide();
}
}
- private void AddTopButtons()
+ private void AddTopView()
{
+ topView = new View()
+ {
+ Layout = new RelativeLayout(),
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = 120.DpToPx(),
+ MaximumSize = new Size2D(Window.Instance.WindowSize.Width, (int)(Window.Instance.WindowSize.Height*0.111f))
+ };
+ playerContentView.Add(topView);
+ FlexLayout.SetFlexGrow(topView, 0);
+ FlexLayout.SetFlexShrink(topView, 0);
backButton = new Button("BackButton")
{
ThemeChangeSensitive = true,
- Position2D = new Position2D(LayoutPadding, TopBarButtonsY)
};
- leftView.Add(backButton);
+ topView.Add(backButton);
+ RelativeLayout.SetHorizontalAlignment(backButton, RelativeLayout.Alignment.Start);
+ RelativeLayout.SetVerticalAlignment(backButton, RelativeLayout.Alignment.Center);
backButton.Clicked += (object sender, ClickedEventArgs clickedEventArgs) =>
{
Unparent();
moreButton = new Button("MoreButton")
{
ThemeChangeSensitive = true,
- Position2D = new Position2D(Window.Instance.WindowSize.Width / 2 - LayoutPadding - IconSize, TopBarButtonsY)
};
- rightView.Add(moreButton);
+ topView.Add(moreButton);
+ RelativeLayout.SetLeftRelativeOffset(moreButton, 1.0f);
+ RelativeLayout.SetRightRelativeOffset(moreButton, 1.0f);
+ RelativeLayout.SetHorizontalAlignment(moreButton, RelativeLayout.Alignment.End);
+ RelativeLayout.SetVerticalAlignment(moreButton, RelativeLayout.Alignment.Center);
moreButton.Clicked += OnMoreButtonClicked;
}
{
controlsView = new View()
{
- BackgroundColor = Color.Transparent,
- Size2D = new Size2D(ControlViewWidth, ControlViewHeight),
- Position2D = new Position2D((Window.Instance.WindowSize.Width / 4 - ControlViewWidth / 2), TopBarSize + ControlViewMargin),
+ WidthSpecification = 640.DpToPx(),
+ HeightSpecification = (DeviceInfo.IsPortrait ? ControlViewHeightPortrait : ControlViewHeightLandscape).DpToPx(),
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ Margin = (new Extents(0, 0, 115, 0)).DpToPx(),
+ }
};
rightView.Add(controlsView);
+ AddControlElements();
}
private void AddTitleLabel()
{
StyleName = "LabelText",
ThemeChangeSensitive = true,
- Size2D = new Size2D(ControlViewWidth, TitleLabelHeight),
- Position2D = new Position2D(0, 0),
- PixelSize = 36,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = TitleLabelHeight.DpToPx(),
+ PixelSize = 36.DpToPx(),
FontFamily = "BreezeSans",
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
{
StyleName = "LabelText",
ThemeChangeSensitive = true,
- Size2D = new Size2D(ControlViewWidth, ArtistLabelHeight),
- Position2D = new Position2D(0, 62),
- PixelSize = 28,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = ArtistLabelHeight.DpToPx(),
+ PixelSize = 28.DpToPx(),
FontFamily = "BreezeSans",
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
{
shuffleButton = new MultiStateButton()
{
- Size2D = new Size2D(IconSize, IconSize),
- Position2D = new Position2D(0, 196),
+ Size2D = new Size2D(IconSize, IconSize).DpToPx(),
+ Margin = new Extents(0, 40, 0, 0).DpToPx(),
IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
{
{
{
viewModel.ShuffleChanged();
};
- controlsView.Add(shuffleButton);
+ playbackButtonsView.Add(shuffleButton);
}
private void AddPreviousButton()
{
prevButton = new Button("PrevButton")
{
- Position2D = new Position2D(168, 196),
ThemeChangeSensitive = true
};
// TODO need to implement command instead
};
prevButton.BindingContext = viewModel;
prevButton.SetBinding(Button.IsEnabledProperty, "HasPreviousTrack");
- controlsView.Add(prevButton);
+ playbackButtonsView.Add(prevButton);
}
private void AddPlayButton()
{
playButton = new MultiStateButton()
{
- Size2D = new Size2D(IconSize, IconSize),
- Position2D = new Position2D(296, 196),
+ Size2D = new Size2D(IconSize, IconSize).DpToPx(),
BackgroundColor = Color.Transparent,
IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
{
};
playButton.BindingContext = viewModel;
playButton.SetBinding(MultiStateButton.CustomStateProperty, "PlayButtonState");
- controlsView.Add(playButton);
+ playbackButtonsView.Add(playButton);
// TODO need to implement command instead
playButton.Clicked += (object sender, ClickedEventArgs e) =>
{
{
nextButton = new Button("NextButton")
{
- Position2D = new Position2D(424, 196),
ThemeChangeSensitive = true
};
// TODO need to implement command instead
};
nextButton.BindingContext = viewModel;
nextButton.SetBinding(Button.IsEnabledProperty, "HasNextTrack");
- controlsView.Add(nextButton);
+ playbackButtonsView.Add(nextButton);
}
private void AddRepeatButton()
{
repeatButton = new MultiStateButton()
{
- Size2D = new Size2D(IconSize, IconSize),
- Position2D = new Position2D(592, 196),
+ Size2D = new Size2D(IconSize, IconSize).DpToPx(),
+ Margin = new Extents(40, 0, 0, 0).DpToPx(),
IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
{
{
};
repeatButton.BindingContext = viewModel.playingListViewModel;
repeatButton.SetBinding(MultiStateButton.CustomStateProperty, "RepeatButtonState");
- controlsView.Add(repeatButton);
+ playbackButtonsView.Add(repeatButton);
// TODO need to implement command instead
repeatButton.Clicked += (object sender, ClickedEventArgs e) =>
{
private void AddButtonControlElements()
{
+ playbackButtonsView = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = 48.DpToPx(),
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center,
+ Margin = (DeviceInfo.IsPortrait ? new Extents(0, 0, 140, 104) : new Extents(0, 0, 100, 92)).DpToPx(),
+ CellPadding = new Size2D(80, 0).DpToPx(),
+ },
+ };
+ controlsView.Add(playbackButtonsView);
AddShuffleButton();
AddPreviousButton();
AddPlayButton();
ThemeChangeSensitive = true,
StyleName = "LeftVolume",
};
- controlsView.Add(leftVolumeIcon);
+ volumeSliderView.Add(leftVolumeIcon);
}
private void AddRightVolumeIcon()
ThemeChangeSensitive = true,
StyleName = "RightVolume",
};
- controlsView.Add(rightVolumeIcon);
+ volumeSliderView.Add(rightVolumeIcon);
}
private void AddVolumeSliderEventHandlers()
volumeSlider = new Slider("Slider")
{
ThemeChangeSensitive = true,
- Size2D = new Size2D(496, 48),
- Position2D = new Position2D(72, 336),
- ThumbSize = new Tizen.NUI.Size(36, 36),
+ Size2D = new Size2D(496, 48).DpToPx(),
+ ThumbSize = new Tizen.NUI.Size(36, 36).DpToPx(),
Direction = Slider.DirectionType.Horizontal,
MinValue = 0,
MaxValue = AudioManager.VolumeController.MaxLevel[AudioVolumeType.Media],
CurrentValue = AudioManager.VolumeController.Level[AudioVolumeType.Media]
};
- controlsView.Add(volumeSlider);
+ volumeSliderView.Add(volumeSlider);
volumeSlider.BindingContext = viewModel;
volumeSlider.SetBinding(Slider.CurrentValueProperty, "VolumeLevel");
AddVolumeSliderEventHandlers();
private void AddVolumeSliderElements()
{
+ volumeSliderView = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = 48.DpToPx(),
+ Layout = new LinearLayout()
+ {
+ CellPadding = (new Size2D(24, 0)).DpToPx(),
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center,
+ },
+ };
+ controlsView.Add(volumeSliderView);
AddLeftVolumeIcon();
- AddRightVolumeIcon();
AddVolumeSlider();
+ AddRightVolumeIcon();
}
private void AddControlElements()
};
}
- private void AddPlaybackSlider(View sliderView)
+ private void AddPlaybackSlider()
{
playbackSlider = new Slider("Slider")
{
ThemeChangeSensitive = true,
MinValue = 0.0f,
MaxValue = 1.0f,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- SizeHeight = 44,
- ThumbSize = new Tizen.NUI.Size(36, 36),
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = 44.DpToPx(),
+ ThumbSize = new Tizen.NUI.Size(36, 36).DpToPx(),
Direction = Slider.DirectionType.Horizontal,
};
playbackSlider.SetBinding(Slider.CurrentValueProperty, "ElapsedTime");
AddPlaybackSliderEventHandler();
}
- private void AddCurrentTimeLabel(View sliderView)
+ private void AddCurrentTimeLabel()
{
currentTime = new TextLabel()
{
StyleName = "LabelText",
ThemeChangeSensitive = true,
- Size2D = new Size2D(400, 32),
- Position2D = new Position2D(0, 48),
- PixelSize = 24,
+ Size2D = new Size2D(400, 32).DpToPx(),
+ PixelSize = 24.DpToPx(),
FontFamily = "BreezeSans",
Text = "00::00:00",
HorizontalAlignment = HorizontalAlignment.Begin,
};
currentTime.SetBinding(TextLabel.TextProperty, "PlayingTime");
- sliderView.Add(currentTime);
+ playbackSliderTextView.Add(currentTime);
+ RelativeLayout.SetHorizontalAlignment(currentTime, RelativeLayout.Alignment.Start);
+ RelativeLayout.SetLeftRelativeOffset(currentTime, 0.0f);
}
- private void AddTotalTimeLabel(View sliderView)
+ private void AddTotalTimeLabel()
{
totalTime = new TextLabel()
{
StyleName = "LabelText",
ThemeChangeSensitive = true,
- Size2D = new Size2D(400, 32),
- Position2D = new Position2D(1792 - 400, 48),
- PixelSize = 24,
+ Size2D = new Size2D(400, 32).DpToPx(),
+ PixelSize = 24.DpToPx(),
FontFamily = "BreezeSans",
HorizontalAlignment = HorizontalAlignment.End,
Text = "59:59:59",
};
totalTime.SetBinding(TextLabel.TextProperty, "TrackLength");
- sliderView.Add(totalTime);
+ playbackSliderTextView.Add(totalTime);
+ RelativeLayout.SetHorizontalAlignment(totalTime, RelativeLayout.Alignment.End);
+ RelativeLayout.SetRightRelativeOffset(totalTime, 1.0f);
}
- private void AddPlaybackSlider()
+ private void AddPlaybackSliderView()
{
sliderView = new View()
{
- Size2D = new Size2D(1792, 80),
- Position2D = new Position2D(64, 950),
- BackgroundColor = Color.Transparent,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = 84.DpToPx(),
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center,
+ },
};
- Add(sliderView);
+ playerContentView.Add(sliderView);
+ FlexLayout.SetFlexShrink(sliderView, 0);
+ FlexLayout.SetFlexGrow(sliderView, 0);
+ AddPlaybackSlider();
+ AddPlaybackSliderTextLabel();
+ }
- AddPlaybackSlider(sliderView);
- AddCurrentTimeLabel(sliderView);
- AddTotalTimeLabel(sliderView);
- UpdatePlaybackSliderPosition(viewState);
+ private void AddPlaybackSliderTextLabel()
+ {
+ playbackSliderTextView = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = 32.DpToPx(),
+ Layout = new RelativeLayout()
+ {
+ Margin = (new Extents(0, 0, 8, 0)).DpToPx(),
+ },
+ };
+ sliderView.Add(playbackSliderTextView);
+ AddCurrentTimeLabel();
+ AddTotalTimeLabel();
}
- private void UpdatePlaybackSliderPosition(PlayerViewState state)
+ private void UpdateActionButtonView()
{
- if(state == PlayerViewState.AlbumArt)
+ topRightView.Remove(actionButtonView);
+ topRightView.Remove(thumb);
+ if (DeviceInfo.IsPortrait && viewState == PlayerViewState.AlbumArt)
{
- sliderView.Size2D = new Size2D(1792, 80);
- sliderView.Position2D = new Position2D(64, 950);
- currentTime.Size2D = new Size2D(400, 32);
- currentTime.Position2D = new Position2D(0, 48);
- totalTime.Size2D = new Size2D(400, 32);
- totalTime.Position2D = new Position2D(1392, 48);
+ topRightView.Margin = new Extents(0, 0, 0, 24).DpToPx();
+ leftView.Add(topRightView);
+ topRightView.HeightSpecification = 48.DpToPx();
+ AddListActionButtons();
}
else
{
- sliderView.Size2D = new Size2D(640, 80);
- sliderView.Position2D = new Position2D(1120, 950);
- currentTime.Size2D = new Size2D(180, 32);
- currentTime.Position2D = new Position2D(0, 48);
- totalTime.Size2D = new Size2D(180, 32);
- totalTime.Position2D = new Position2D(460, 48);
+ rightView.Add(topRightView);
+ topRightView.HeightSpecification = 200.DpToPx();
+ AddThumbnail();
+ AddListActionButtons();
}
}
+ private void AddActionButtonAndThumbnail()
+ {
+ topRightView = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ HorizontalAlignment = HorizontalAlignment.End,
+ VerticalAlignment = VerticalAlignment.Top,
+ CellPadding = new Size2D(92, 0).DpToPx(),
+ },
+ };
+ UpdateActionButtonView();
+ }
+
private void AddListActionButtons()
{
- View actionButtonView = new View()
+ actionButtonView = new View()
{
- Size2D = new Size2D(224, 48),
- Position2D = new Position2D((Window.Instance.WindowSize.Width / 2 - 224 - LayoutPadding), 120),
+ WidthSpecification = 224.DpToPx(),
+ HeightSpecification = 48.DpToPx(),
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ CellPadding = new Size2D(40, 0).DpToPx(),
+ },
BackgroundColor = Color.Transparent,
};
- rightView.Add(actionButtonView);
+ topRightView.Add(actionButtonView);
listButton = new Button("ListButton")
{
ThemeChangeSensitive = true,
};
- listButton.Clicked += (object sender, ClickedEventArgs e) =>
- {
- if(viewState == PlayerViewState.AlbumArt)
- {
- Tizen.Log.Debug(AppConstants.LogTag, "Adding Playing list view");
- viewState = PlayerViewState.TrackList;
- RemoveLyricsView();
- AddPlayingListView();
- thumb.Show();
- }
- else
- {
- Tizen.Log.Debug(AppConstants.LogTag, "Adding album art view");
- viewState = PlayerViewState.AlbumArt;
- RemovePlayingListView();
- AddLyricsView();
- thumb.Hide();
- }
- UpdatePlaybackSliderPosition(viewState);
- UpdatePlayerViewBackground(viewState);
- };
+ listButton.Clicked += OnListButtonClicked;
actionButtonView.Add(listButton);
playlistButton = new Button("PlaylistButton")
favouriteButton = new MultiStateButton()
{
- Size2D = new Size2D(IconSize, IconSize),
- Position2D = new Position2D(176, 0),
+ Size2D = new Size2D(IconSize, IconSize).DpToPx(),
IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
{
{
};
}
+ private void OnListButtonClicked(object sender, ClickedEventArgs e)
+ {
+ if (viewState == PlayerViewState.AlbumArt)
+ {
+ Tizen.Log.Debug(AppConstants.LogTag, "Adding Playing list view");
+ viewState = PlayerViewState.TrackList;
+ RemoveLyricsView();
+ playerContentView.Remove(sliderView);
+ if (DeviceInfo.IsPortrait)
+ {
+ sliderView.Margin = new Extents(32, 32, 0, 0).DpToPx();
+ rightView.Remove(controlsView);
+ contentView.Remove(rightView);
+ contentView.Remove(leftView);
+ contentView.Add(rightView);
+ contentView.Add(leftView);
+ UpdateActionButtonView();
+ controlsView.Margin = new Extents(0, 0, 40, 0).DpToPx();
+ rightView.Add(controlsView);
+ }
+ else
+ {
+ leftView.Padding = new Extents(0, 64, 0, 64).DpToPx();
+ sliderView.Margin = new Extents(0, 0, 84, 0).DpToPx();
+ sliderView.WidthSpecification = 640.DpToPx();
+ }
+ rightView.Add(sliderView);
+ AddPlayingListView();
+ thumb.Show();
+ }
+ else
+ {
+ Tizen.Log.Debug(AppConstants.LogTag, "Adding album art view");
+ viewState = PlayerViewState.AlbumArt;
+ RemovePlayingListView();
+ thumb.Hide();
+ rightView.Remove(sliderView);
+ if (DeviceInfo.IsPortrait)
+ {
+ controlsView.Margin = new Extents(0, 0, 115, 0).DpToPx();
+ sliderView.Margin = new Extents(0, 0, 0, 0).DpToPx();
+ contentView.Remove(leftView);
+ contentView.Remove(rightView);
+ contentView.Add(leftView);
+ contentView.Add(rightView);
+ UpdateActionButtonView();
+ }
+ else
+ {
+ leftView.Padding = new Extents(0, 64, 0, 0).DpToPx();
+ sliderView.Margin = new Extents(0, 0, 0, 0).DpToPx();
+ sliderView.WidthSpecification = LayoutParamPolicies.MatchParent;
+ }
+ playerContentView.Add(sliderView);
+ AddLyricsView();
+ }
+ //UpdatePlaybackSliderPosition(viewState);
+ UpdatePlayerViewBackground(viewState);
+ }
+
private void OnPlaylistAdd()
{
if(isPlaylistAddViewCreated)
thumb = new ImageView()
{
BackgroundColor = Color.Cyan,
- Size2D = new Size2D(200, 200),
- Position2D = new Position2D(380, 120),
+ Size2D = new Size2D(200, 200).DpToPx(),
BoxShadow = new Shadow(6.0f, Color.Black, new Vector2(0, 3)),
};
thumb.SetBinding(ImageView.ResourceUrlProperty, "ThumbnailPath");
- rightView.Add(thumb);
+ topRightView.Add(thumb);
thumb.Hide();
}
private void AddPlayingListView()
{
if (currentListView == null)
+ {
currentListView = new PlayingListView(viewModel.CurrentPlayingListViewModel);
+ }
- currentListView.Size2D = new Size2D(832, 900);
- currentListView.Position2D = new Position2D(64, 108);
+ currentListView.WidthSpecification = LayoutParamPolicies.MatchParent;
+ currentListView.HeightSpecification = LayoutParamPolicies.MatchParent;
leftView.Add(currentListView);
currentListView.Show();
}
lyricsView = new LyricsView(viewModel.lyricsViewModel);
}
- lyricsView.Size2D = new Size2D(784, 784);
- lyricsView.Position2D = new Position2D(88, 120);
leftView.Add(lyricsView);
lyricsView.Show();
}