<Compile Include="Views\Gallery3ColumnGroupView.xaml.cs">
<DependentUpon>Gallery3ColumnGroupView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\GalleryGridItem.xaml.cs">
- <DependentUpon>GalleryGridItem.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\GalleryImageContent.xaml.cs">
<DependentUpon>GalleryImageContent.xaml</DependentUpon>
</Compile>
<Content Include="res\img_tizen_zoom_minimap_shadow.9.png" />
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="Views\GalleryGridItem.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
<EmbeddedResource Include="Views\Gallery3ColumnGroupView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
- <ProjectCorporateFlavorCfg />
+ <ProjectCommonFlavorCfg />
</FlavorProperties>
<FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
- <ProjectCorporateFlavorCfg />
+ <ProjectCommonFlavorCfg />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
* limitations under the License.
*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.ComponentModel;
+using Xamarin.Forms;
namespace TVMediaHub.Tizen.ViewModels
{
- class ImageTabViewModel
+
+ class ImageTabViewModel:INotifyPropertyChanged
{
+ int SelectedSource;
+ int SortBy;
+ bool imageDelMode;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public Command DeleteModeChangeCommand { get; set; }
+
+ public bool IsDeleteMode
+ {
+ set
+ {
+ if (imageDelMode != value)
+ {
+ imageDelMode = value;
+ OnPropertyChanged("IsDeleteMode");
+ }
+ }
+ get
+ {
+ return imageDelMode;
+ }
+ }
+
+ void GetImageData(int source, int sortby)
+ {
+
+ }
+
+ void OnSourceChanged(int source)
+ {
+
+ }
+
+ void OnSortbyChanged(int sortby)
+ {
+ if(SortBy != sortby)
+ {
+ SortBy = sortby;
+ }
+ }
+
+ void OnDeleteModeChanged()
+ {
+ if (IsDeleteMode == false)
+ {
+ IsDeleteMode = true;
+ }
+ else
+ {
+ IsDeleteMode = false;
+ }
+ }
+
+ void OnPropertyChanged(string propertyName)
+ {
+ PropertyChangedEventHandler handler = PropertyChanged;
+ if (handler != null)
+ {
+ handler(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+ public ImageTabViewModel()
+ {
+ DeleteModeChangeCommand = new Command(() =>
+ {
+ OnDeleteModeChanged();
+ });
+ }
+
}
+
+
}
<StackLayout xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TVMediaHub.Tizen.Views.Gallery3ColumnGroupView">
- <Label x:Name="groupTitle" Text="AAAAAA"/>
+ <StackLayout.Resources>
+ <ResourceDictionary>
+ <Style x:Key="GroupNameNormal" TargetType="Label">
+ <Setter Property="FontFamily" Value="Breeze Sans Light"/>
+ <Setter Property="TextColor" Value="#33FFFFFF"/>
+ </Style>
+ </ResourceDictionary>
+ </StackLayout.Resources>
+ <Label x:Name="groupTitle" Text="AAAAAA" Style="{StaticResource GroupNameNormal}"/>
<Grid x:Name="GroupContentArea" ColumnSpacing="2" RowSpacing="2" >
</Grid>
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Xamarin.Forms;
+using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TVMediaHub.Tizen.Views
public Gallery3ColumnGroupView()
{
InitializeComponent();
+ InitializeSize();
AddContentsView();
}
+ private void InitializeSize()
+ {
+ Margin = new Thickness(0, 0, Utils.SizeUtils.GetWidthSize(60), 0);
+ groupTitle.FontSize = Utils.SizeUtils.GetFontSize(30);
+ }
+
void AddContentsView()
{
+++ /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.GalleryGridItem">
-
- <Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
- <BoxView Grid.Row="0" Grid.Column="0" BackgroundColor="Orange" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
- <Image
- Grid.Row="0" Grid.Column="0"
- x:Name="ItemCheckedImage"
- VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
- Source="ic_tizen_apps_launcher_pinmark.png" />
- <Button Grid.Row="0" Grid.Column="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Clicked="OnItemTapped" Opacity="0"/>
- </Grid>
-</StackLayout>
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Input;
-using Xamarin.Forms;
-using Xamarin.Forms.Xaml;
-
-namespace TVMediaHub.Tizen.Views
-{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class GalleryGridItem : StackLayout
- {
-
-
- public static readonly BindableProperty CommandProperty =
- BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(GalleryGridItem), null, BindingMode.TwoWay);
-
- public ICommand Command
- {
- get { return (ICommand)GetValue(CommandProperty); }
- set { SetValue(CommandProperty, value); }
- }
- public String CommandParameter
- {
- get;
- set;
- }
-
- public GalleryGridItem()
- {
- InitializeComponent();
- }
-
- void OnItemTapped(object sender, EventArgs args)
- {
- Command?.Execute(CommandParameter);
- }
-
- }
-}
<?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.GalleryImageContent">
- <StackLayout.Resources>
- <ResourceDictionary>
+ x:Class="TVMediaHub.Tizen.Views.GalleryImageContent"
+ xmlns:Utils="clr-namespace:TVMediaHub.Tizen.Utils"
+ IsDeleteMode="{Binding IsDeleteMode}">
- </ResourceDictionary>
- </StackLayout.Resources>
- <Grid WidthRequest="180" HeightRequest="180">
- <Image x:Name="imgFocused" Grid.Row="0" Grid.Column="0" Source="ic_tizen_media_thumbnail_gradient_focused.9.png" IsVisible="False" />
+ <Grid x:Name="ImgContent" WidthRequest="180" HeightRequest="180">
+ <Image x:Name="imgFocused"
+ Grid.Row="0" Grid.Column="0"
+ Source="ic_tizen_media_thumbnail_gradient_focused.9.png"
+ IsVisible="False" />
<Image x:Name="ContentImage"
Grid.Row="0" Grid.Column="0"
Source=""/>
- <Label x:Name="duration" Grid.Row="0" Grid.Column="0" Text="06:28" HorizontalTextAlignment="End" VerticalTextAlignment="End"/>
- <Image x:Name="imgPlay" Grid.Row="0" Grid.Column="0" Source="btn_tizen_list_thumbnail_play.png" IsVisible="False" />
- <Image x:Name="imgDimmed" Grid.Row="0" Grid.Column="0" Source="img_tizen_dimmed_opacity85.9.png" IsVisible="False" />
- <Image x:Name="imgCheck" Grid.Row="0" Grid.Column="0" Source="ic_tizen_apps_launcher_pinmark.png" IsVisible="False" />
+ <Label x:Name="duration"
+ Grid.Row="0" Grid.Column="0"
+ Text="06:28"
+ VerticalOptions="End"
+ HorizontalOptions="End"/>
+ <Image x:Name="ImgPlay"
+ Grid.Row="0" Grid.Column="0"
+ Source="btn_tizen_list_thumbnail_play.png"
+ IsVisible="False" />
+ <Utils:NinePatch x:Name="ImgDimmed"
+ Grid.Row="0" Grid.Column="0"
+ Source="img_tizen_dimmed_opacity85.9.png"
+ BorderLeft="10"
+ BorderTop="10"
+ BorderRight="10"
+ BorderBottom="10"
+ IsVisible="False" />
+ <Image x:Name="ImgCheck"
+ Grid.Row="0" Grid.Column="0"
+ Source="ic_tizen_apps_launcher_pinmark.png"
+ IsVisible="False" />
+ <Button Grid.Row="0" Grid.Column="0"
+ Opacity="0"
+ Clicked="OnItemClicked"/>
</Grid>
</StackLayout>
\ No newline at end of file
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class GalleryImageContent : StackLayout
{
+ public static readonly BindableProperty IsDeleteModeProperty = BindableProperty.Create("IsDeleteMode", typeof(bool), typeof(GalleryImageContent), false);
+ static int NORMAL = 0;
+ static int SELECTED = 1;
+
+
List<Color> colorSet = new List<Color>{Color.Aqua, Color.Blue, Color.DeepSkyBlue, Color.Green, Color.IndianRed, Color.MediumVioletRed, Color.MediumTurquoise,
Color.MintCream, Color.Plum, Color.Tan};
+
+ int CurStatus;
+
+
+ public bool IsDeleteMode
+ {
+ set
+ {
+ SetValue(IsDeleteModeProperty, value);
+ }
+ get
+ {
+ return (bool)GetValue(IsDeleteModeProperty);
+ }
+ }
+
public GalleryImageContent()
{
InitializeComponent();
Random r = new Random();
ContentImage.BackgroundColor =colorSet.ElementAt(r.Next(10));
+
+ PropertyChanged += ImageTabPropertyChanged;
+ }
+
+
+
+ void OnItemClicked()
+ {
+ if (IsDeleteMode)
+ {
+ if (CurStatus == 0)
+ {
+ CurStatus = SELECTED;
+ }
+ else
+ {
+ CurStatus = NORMAL;
+ }
+
+ UpdateView();
+ } else
+ {
+ // play content
+ }
+ }
+
+ void UpdateView()
+ {
+ switch (CurStatus)
+ {
+ case 0:
+ ImgContent.WidthRequest = 180;
+ ImgContent.HeightRequest = 180;
+ ImgDimmed.IsVisible = false;
+ ImgCheck.IsVisible = false;
+ break;
+ case 1:
+ ImgContent.WidthRequest = 180;
+ ImgContent.HeightRequest = 180;
+ ImgDimmed.IsVisible = true;
+ ImgCheck.IsVisible = true;
+ break;
+ }
+ }
+
+
+ private void ImageTabPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if(e.PropertyName.CompareTo("IsDeleteMode") == 0)
+ {
+ if (!IsDeleteMode)
+ {
+ CurStatus = NORMAL;
+ UpdateView();
+ }
+ }
}
}
}
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TVMediaHub.Tizen.Views.ImageTab"
xmlns:Views="clr-namespace:TVMediaHub.Tizen.Views"
+ xmlns:ViewModels="clr-namespace:TVMediaHub.Tizen.ViewModels"
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.BindingContext>
+ <ViewModels:ImageTabViewModel/>
+ </RelativeLayout.BindingContext>
+ <ScrollView x:Name="ImageTabScrollView"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.855}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
Orientation="Horizontal">
- <StackLayout Orientation="Horizontal">
- <Views:GalleryGridItem HeightRequest="500" WidthRequest="500" Command="{Binding OnSeleteModeCommand}"/>
- <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 x:Name="GalleryContentView" Orientation="Horizontal">
</StackLayout>
</ScrollView>
- <!-- TODO : Remove Label -->
- <Label Text="Image 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}">
+ <Button x:Name="TestButton" Text="TestDeleteMode" Clicked="OnTestButtonClick" Command="{Binding DeleteModeChangeCommand}"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
* limitations under the License.
*/
+using System;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
{
public partial class ImageTab : RelativeLayout
{
+ bool IsDeleteMode;
+
public ImageTab()
{
InitializeComponent();
+ InitializeSize();
+ AddGroup();
+ }
+
+ void InitializeSize()
+ {
+ ImageTabScrollView.Margin = new Thickness(Utils.SizeUtils.GetWidthSize(96), Utils.SizeUtils.GetHeightSize(74), 0, Utils.SizeUtils.GetHeightSize(84));
+ }
+
+ void AddGroup()
+ {
+ int groupSize = 3;
+ Gallery3ColumnGroupView galleryGroup;
+
+ for (int i = 0; i < groupSize; i++)
+ {
+ galleryGroup = new Gallery3ColumnGroupView();
+ // set GroupView data
+ GalleryContentView.Children.Add(galleryGroup);
+ }
}
+
+ void GetImageData()
+ {
+
+ }
+
+ void OnTestButtonClick(object sender, EventArgs e)
+ {
+ IsDeleteMode = !IsDeleteMode;
+ if (IsDeleteMode)
+ {
+ TestButton.Text = "TestButton ON";
+ }
+ else
+ {
+ TestButton.Text = "TestButton OFF";
+ }
+ }
+
}
}
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
Orientation="Horizontal">
<StackLayout Orientation="Horizontal">
- <Views:GalleryGridItem HeightRequest="500" WidthRequest="500" Command="{Binding OnSeleteModeCommand}"/>
<BoxView BackgroundColor="Aqua" HeightRequest="500" WidthRequest="500"/>
<BoxView BackgroundColor="Bisque" HeightRequest="500" WidthRequest="500"/>
<BoxView BackgroundColor="SaddleBrown" HeightRequest="500" WidthRequest="500"/>