--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Tizen.Xamarin.Forms.Extension;
+
+namespace TVMediaHub.Tizen.DataModels
+{
+ public class ContextPopupSelectedEventArgs : EventArgs
+ {
+ public int Index { get; }
+ public ContextPopupItem Item { get; }
+
+ public ContextPopupSelectedEventArgs(int index, ContextPopupItem item)
+ {
+ Index = index;
+ Item = item;
+ }
+ }
+}
-using System;
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Tizen.Content.MediaContent;
-using TVMediaHub.Tizen.Utils;
namespace TVMediaHub.Tizen.Models
{
<Compile Include="Views\MusicTab.xaml.cs">
<DependentUpon>MusicTab.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\RecentlyWatchedVideoContent.xaml.cs">
- <DependentUpon>RecentlyWatchedVideoContent.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\VideoGroup.xaml.cs">
<DependentUpon>VideoGroup.xaml</DependentUpon>
</Compile>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="Views\RecentlyWatchedVideoContent.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
<EmbeddedResource Include="Views\VideoGroup.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
- <ProjectCommonFlavorCfg />
+ <ProjectCorporateFlavorCfg />
</FlavorProperties>
<FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
- <ProjectCommonFlavorCfg />
+ <ProjectCorporateFlavorCfg />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection.Emit;
-using System.Text;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System.Threading.Tasks;
using Xamarin.Forms;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using TVMediaHub.Tizen.Utils;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
-
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
-using System;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Tizen.Xamarin.Forms.Extension;
-using System.Collections.ObjectModel;
using TVMediaHub.Tizen.Utils;
-using Tizen;
+using TVMediaHub.Tizen.DataModels;
namespace TVMediaHub.Tizen.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FooterNormalStatus : RelativeLayout
{
+ public static readonly BindableProperty IsFooterEnabledProperty = BindableProperty.Create("IsFooterEnabled", typeof(bool), typeof(FooterNormalStatus), true);
+
+ public bool IsFooterEnabled
+ {
+ get { return (bool)GetValue(IsFooterEnabledProperty); }
+ set { SetValue(IsFooterEnabledProperty, value); }
+ }
+
/// <summary>
/// Identifies the SourceList bindable property
/// </summary
- public static readonly BindableProperty SourceListProperty = BindableProperty.Create("SourceList", typeof(IEnumerable<string>), typeof(VideoTab), default(IEnumerable<string>));
+ public static readonly BindableProperty SourceListProperty = BindableProperty.Create("SourceList", typeof(IEnumerable<string>), typeof(FooterNormalStatus), default(IEnumerable<string>));
/// <summary>
/// Gets or sets list about source of contents
/// <summary>
/// Identifies the SortOptions bindable property
/// </summary
- public static readonly BindableProperty SortOptionsProperty = BindableProperty.Create("SortOptions", typeof(IEnumerable<string>), typeof(VideoTab), default(IEnumerable<string>));
+ public static readonly BindableProperty SortOptionsProperty = BindableProperty.Create("SortOptions", typeof(IEnumerable<string>), typeof(FooterNormalStatus), default(IEnumerable<string>));
/// <summary>
/// Gets or sets sort options
/// <summary>
/// Identifies the OptionList bindable property
/// </summary
- public static readonly BindableProperty OptionListProperty = BindableProperty.Create("OptionList", typeof(IEnumerable<string>), typeof(VideoTab), default(IEnumerable<string>));
+ public static readonly BindableProperty OptionListProperty = BindableProperty.Create("OptionList", typeof(IEnumerable<string>), typeof(FooterNormalStatus), default(IEnumerable<string>));
/// <summary>
/// Gets or sets list about options
/// <summary>
/// A EventHandler for DropdownOption ItemSelected event
/// </summary>
- public EventHandler<SelectedItemChangedEventArgs> OnDropdownOptionItemSelected;
+ public EventHandler<ContextPopupSelectedEventArgs> OnSelectedOptionIndexChanged;
/// <summary>
/// A DropdownList for displaying sources of contents
private DropdownList DropdownSort;
/// <summary>
- /// A DropdownList for displaying page options
+ /// A Button for displaying page options
/// </summary>
- private DropdownList DropdownOption;
+ private Button ButtonOption;
+ private bool isPopupShowing;
/// <summary>
/// A Constructor
public FooterNormalStatus()
{
InitializeComponent();
- InitializeDropdownLists();
+ InitializeFooterItems();
PropertyChanged += FooterNormalStatusPropertyChanged;
}
{
DropdownSort.ItemsSource = SortOptions;
}
- else if (e.PropertyName.Equals("OptionList"))
+ else if (e.PropertyName.Equals("IsFooterEnabled"))
{
- DropdownOption.ItemsSource = OptionList;
+ DropdownSource.IsEnabled = IsFooterEnabled;
+ DropdownSort.IsEnabled = IsFooterEnabled;
+ ButtonOption.IsEnabled = IsFooterEnabled;
+ if (!IsFooterEnabled)
+ {
+ ButtonOption.Text = "";
+ }
+ else
+ {
+ ButtonOption.Text = "OPTION";
+ }
}
}
/// <summary>
- /// A method for initializing DropdownLists
+ /// A method for initializing footer items
/// </summary>
- private void InitializeDropdownLists()
+ private void InitializeFooterItems()
{
DropdownSource = new DropdownList();
DropdownSort = new DropdownList();
- DropdownOption = new DropdownList();
+ ButtonOption = new Button();
+
+ ButtonOption.Text = "OPTION";
+
+ DropdownSource.IsEnabled = IsFooterEnabled;
+ DropdownSort.IsEnabled = IsFooterEnabled;
+ ButtonOption.IsEnabled = IsFooterEnabled;
+
+
DropdownSource.ItemsSource = SourceList;
DropdownSort.ItemsSource = SortOptions;
- DropdownOption.ItemsSource = OptionList;
DropdownSource.ItemSelected += (s, e) =>
{
OnDropdownSortItemSelected?.Invoke(s, e);
};
- DropdownOption.ItemSelected += (s, e) =>
+ ButtonOption.Command = new Command(() =>
{
- OnDropdownOptionItemSelected?.Invoke(s, e);
- };
+ showContextPopup();
+ });
// TODO : Change yConstraint.
// Tab Size - 128
yConstraint: Constraint.Constant(SizeUtils.GetWidthSize(704)),
xConstraint: Constraint.Constant(SizeUtils.GetWidthSize(1226)));
- Children.Add(DropdownOption,
+ Children.Add(ButtonOption,
heightConstraint: Constraint.Constant(SizeUtils.GetHeightSize(80)),
widthConstraint: Constraint.Constant(SizeUtils.GetWidthSize(300)),
yConstraint: Constraint.Constant(SizeUtils.GetWidthSize(704)),
xConstraint: Constraint.Constant(SizeUtils.GetWidthSize(1526)));
}
+
+ private void showContextPopup()
+ {
+ if (isPopupShowing)
+ {
+ return;
+ }
+
+ ContextPopup popup = new ContextPopup
+ {
+ IsAutoHidingEnabled = true,
+ Orientation = ContextPopupOrientation.Vertical,
+ DirectionPriorities = new ContextPopupDirectionPriorities(ContextPopupDirection.Up, ContextPopupDirection.Right, ContextPopupDirection.Left, ContextPopupDirection.Down),
+ };
+
+ if (OptionList != null)
+ {
+ foreach(var item in OptionList)
+ {
+ popup.Items.Add(new ContextPopupItem(item));
+ }
+ }
+
+ //TODO: need to change the event callback
+ popup.SelectedIndexChanged += (s, args) =>
+ {
+ var index = popup.SelectedIndex;
+ var item = popup.SelectedItem as ContextPopupItem;
+ OnSelectedOptionIndexChanged.Invoke(s, new ContextPopupSelectedEventArgs(index, item));
+ popup.Dismiss();
+ };
+
+ popup.Dismissed += (s, args) =>
+ {
+ isPopupShowing = false;
+ };
+
+ popup.Show(ButtonOption);
+ isPopupShowing = true;
+ }
}
}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8" ?>
-<StackLayout xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="TVMediaHub.Tizen.Views.FooterSelectedStatus">
- <StackLayout.Orientation>Horizontal</StackLayout.Orientation>
- <Button Text="Select All" HorizontalOptions="Start"></Button>
- <Button Text="OK" HorizontalOptions="End"></Button>
- <Button Text="Cancel" HorizontalOptions="End"></Button>
-</StackLayout>
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Xamarin.Forms;
-using Xamarin.Forms.Xaml;
-
-namespace TVMediaHub.Tizen.Views
-{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FooterSelectedStatus : StackLayout
- {
- public FooterSelectedStatus()
- {
- InitializeComponent();
- }
- }
-}
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"/>
<Views:FooterNormalStatus x:Name="FooterNormal" IsVisible="True"
+ IsFooterEnabled="True"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
SourceList="{Binding SourceList}"
using System.ComponentModel;
using System.Threading.Tasks;
using System.Windows.Input;
+using Tizen.Xamarin.Forms.Extension;
+using TVMediaHub.Tizen.DataModels;
using TVMediaHub.Tizen.Models;
using TVMediaHub.Tizen.Utils;
using TVMediaHub.Tizen.ViewModels;
FooterNormal.OnDropdownSortItemSelected += OnSortOptionChanged;
- FooterNormal.OnDropdownOptionItemSelected += OnOptionSelected;
+ FooterNormal.OnSelectedOptionIndexChanged += OnOptionSelected;
FooterDelete.SelecteAllButtonEvent += OnSelectAllClicked;
FooterDelete.OKButtonEvent += OnOKClicked;
ChangeSortOptionCommand?.Execute(e.SelectedItem);
}
- private void OnOptionSelected(object sender, SelectedItemChangedEventArgs e)
+ private void OnOptionSelected(object sender, ContextPopupSelectedEventArgs e)
{
- if (e.SelectedItem.Equals("Delete"))
+ if (e.Item.Label.Equals("Delete"))
{
DeleteModeChangeCommand?.Execute("");
FooterNormal.IsVisible = false;
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TVMediaHub.Tizen.Views.MediaHubMainPage"
xmlns:Views="clr-namespace:TVMediaHub.Tizen.Views"
- Title="MediaHub"
+ Title="MEDIA HUB"
BackgroundColor="#E60F0F0F">
<Views:VideoTab/>
<Views:ImageTab/>
+ <Views:MusicTab/>
</TabbedPage>
x:Class="TVMediaHub.Tizen.Views.MusicTab"
xmlns:Views="clr-namespace:TVMediaHub.Tizen.Views"
Title="Music">
- <RelativeLayout
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
- <ScrollView RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.855}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- Orientation="Horizontal">
- <StackLayout Orientation="Horizontal">
- <BoxView BackgroundColor="Aqua" HeightRequest="500" WidthRequest="500"/>
- <BoxView BackgroundColor="Bisque" HeightRequest="500" WidthRequest="500"/>
- <BoxView BackgroundColor="SaddleBrown" HeightRequest="500" WidthRequest="500"/>
- <BoxView BackgroundColor="Coral" HeightRequest="500" WidthRequest="500"/>
- <BoxView BackgroundColor="GreenYellow" HeightRequest="500" WidthRequest="500"/>
- <BoxView BackgroundColor="SteelBlue" HeightRequest="500" WidthRequest="500"/>
- </StackLayout>
- </ScrollView>
- <!-- TODO : Remove Label -->
- <Label Text="Music Tab"></Label>
-
- <!-- TODO : Add Footer -->
- <RelativeLayout RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.145}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.855}">
- </RelativeLayout>
-
+ <!-- TODO : Fix to Guide -->
+ <RelativeLayout x:Name="NoContentsArea"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
+ <Views:FooterNormalStatus x:Name="Footer"
+ IsFooterEnabled="false"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"/>
+ <Label x:Name="NoContentsLabel"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ HorizontalOptions="Center"
+ VerticalOptions="Center"
+ Text="No Contents"
+ TextColor="White"/>
</RelativeLayout>
</ContentPage>
\ No newline at end of file
* limitations under the License.
*/
+using System;
+using TVMediaHub.Tizen.Utils;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
public MusicTab()
{
InitializeComponent();
+ InitializeSize();
+ }
+
+ private void InitializeSize()
+ {
+ // TODO : Fix to Guide
+ NoContentsLabel.FontSize = SizeUtils.GetFontSize(33);
}
}
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<Grid xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="TVMediaHub.Tizen.Views.RecentlyWatchedVideoContent">
- <Grid.RowDefinitions>
- <RowDefinition Height="124*"/>
- <RowDefinition Height="362*"/>
- <RowDefinition Height="24*"/>
- <RowDefinition Height="50*"/>
- <RowDefinition Height="6*"/>
- <RowDefinition Height="30*"/>
- <RowDefinition Height="156*"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*"/>
- </Grid.ColumnDefinitions>
- <Image x:Name="ContentImage"
- Source="recent_movie_test.png"
- Aspect="Fill"
- Grid.Row="1"
- Grid.Column="0"/>
- <Label x:Name="ContentTitle"
- Grid.Row="3"
- Grid.Column="0"
- Text="The Secret Life of Walter"/>
- <Label x:Name="ContentDescription"
- Grid.Row="5"
- Grid.Column="0"
- Text="Yesterday"/>
-</Grid>
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using TVMediaHub.Tizen.Utils;
-using Xamarin.Forms;
-
-namespace TVMediaHub.Tizen.Views
-{
- public partial class RecentlyWatchedVideoContent : Grid
- {
- public RecentlyWatchedVideoContent()
- {
- InitializeComponent();
- InitializeSize();
- }
-
- private void InitializeSize()
- {
- HeightRequest = SizeUtils.GetHeightSize(880);
- WidthRequest = SizeUtils.GetWidthSize(642);
-
- ContentTitle.FontSize = SizeUtils.GetFontSize(40);
- ContentTitle.TextColor = Color.FromRgb(255,255,255);
- ContentDescription.FontSize = SizeUtils.GetFontSize(22);
- ContentDescription.TextColor = Color.FromRgb(137,137,137);
- }
- }
-}
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"/>
<Views:FooterNormalStatus x:Name="FooterNormal" IsVisible="True"
+ IsFooterEnabled="True"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
SourceList="{Binding SourceList}"
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
+using Tizen.Xamarin.Forms.Extension;
+using TVMediaHub.Tizen.DataModels;
using TVMediaHub.Tizen.Models;
using TVMediaHub.Tizen.Utils;
using TVMediaHub.Tizen.ViewModels;
FooterNormal.OnDropdownSortItemSelected += OnSortOptionChanged;
- FooterNormal.OnDropdownOptionItemSelected += OnOptionSelected;
+ FooterNormal.OnSelectedOptionIndexChanged += OnOptionSelected;
FooterDelete.SelecteAllButtonEvent += OnSelectAllClicked;
FooterDelete.OKButtonEvent += OnOKClicked;
ChangeSortOptionCommand?.Execute(e.SelectedItem);
}
- private void OnOptionSelected(object sender, SelectedItemChangedEventArgs e)
+ private void OnOptionSelected(object sender, ContextPopupSelectedEventArgs e)
{
- if (e.SelectedItem.Equals("Delete"))
+ if (e.Item.Label.Equals("Delete"))
{
ChangeTabStatusCommand?.Execute("");
FooterNormal.IsVisible = false;