Skip to content

Commit bfac379

Browse files
Updated demo UI
1 parent 067034f commit bfac379

File tree

5 files changed

+44
-38
lines changed

5 files changed

+44
-38
lines changed

PhotoGallery/AlbumCollectionPage.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
x:Class="PhotoGallery.AlbumCollectionPage"
66
Title="{Binding AlbumName}">
77
<Grid>
8-
<listView:SfListView x:Name="listView" ItemsSource="{Binding Photos}" ItemSize="200" ItemSpacing="10"
9-
ItemTapped="OnPhotosItemTapped">
8+
<listView:SfListView x:Name="listView" ItemsSource="{Binding Photos}" SelectionMode="None"
9+
ItemSize="90" ItemSpacing="5" ItemTapped="OnPhotosItemTapped">
1010
<listView:SfListView.ItemsLayout>
11-
<listView:GridLayout SpanCount="3" />
11+
<listView:GridLayout SpanCount="4" />
1212
</listView:SfListView.ItemsLayout>
1313
<listView:SfListView.ItemTemplate>
1414
<DataTemplate>
15-
<Image Source="{Binding Image}" Aspect="AspectFill"/>
15+
<Image Source="{Binding Image}" Aspect="AspectFill" HeightRequest="88" WidthRequest="88"/>
1616
</DataTemplate>
1717
</listView:SfListView.ItemTemplate>
1818
</listView:SfListView>

PhotoGallery/AlbumCollectionPage.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ public AlbumCollectionPage(GalleryViewModel viewModel)
2424
{
2525
return "Today";
2626
}
27+
else if (item.DateTime.Date == DateTime.Now.Date.AddDays(-1))
28+
{
29+
return "Yesterday";
30+
}
2731
else if (item.DateTime.Year == DateTime.Now.Year)
2832
{
29-
return item.DateTime.ToString("MMM dd", CultureInfo.InvariantCulture);
33+
return item.DateTime.ToString("ddd, dd MMM", CultureInfo.InvariantCulture);
3034
}
3135
else
3236
{
33-
return item.DateTime.ToString("MMM dd yyyy", CultureInfo.InvariantCulture);
37+
return item.DateTime.ToString("ddd, dd MMM, yyyy", CultureInfo.InvariantCulture);
3438
}
3539
}
3640
else

PhotoGallery/ImagePage.xaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
<Grid RowDefinitions="*,60">
1616
<Image Source="{Binding Image}" Aspect="AspectFit"/>
17-
<HorizontalStackLayout VerticalOptions="End" Spacing="10" HorizontalOptions="Center">
17+
<HorizontalStackLayout VerticalOptions="End" Spacing="20" HorizontalOptions="Center">
1818

1919
<Border StrokeThickness="0" HeightRequest="60" WidthRequest="60">
2020
<Border.StrokeShape>
21-
<RoundRectangle CornerRadius="25"/>
21+
<RoundRectangle CornerRadius="30"/>
2222
</Border.StrokeShape>
2323
<effects:SfEffectsView TouchDownEffects="Highlight">
2424
<effects:SfEffectsView.GestureRecognizers>
@@ -33,46 +33,46 @@
3333

3434
<Border StrokeThickness="0" HeightRequest="60" WidthRequest="60">
3535
<Border.StrokeShape>
36-
<RoundRectangle CornerRadius="25"/>
36+
<RoundRectangle CornerRadius="30"/>
3737
</Border.StrokeShape>
3838
<effects:SfEffectsView TouchDownEffects="Highlight">
3939
<effects:SfEffectsView.GestureRecognizers>
40-
<TapGestureRecognizer Tapped="OnFavoriteTapped"/>
40+
<TapGestureRecognizer Tapped="OnEditTapped"/>
4141
</effects:SfEffectsView.GestureRecognizers>
4242
<VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
43-
<Label Text="{Binding IsFavorite, Converter={StaticResource FavoriteToIconConverter}}"
44-
FontFamily="PhotoGallery" FontSize="24" HorizontalOptions="Center"/>
45-
<Label Text="Favorite" />
43+
<Label Text="&#xE701;" FontFamily="PhotoGallery" FontSize="24" HorizontalOptions="Center"/>
44+
<Label Text="Edit" />
4645
</VerticalStackLayout>
4746
</effects:SfEffectsView>
4847
</Border>
4948

5049
<Border StrokeThickness="0" HeightRequest="60" WidthRequest="60">
5150
<Border.StrokeShape>
52-
<RoundRectangle CornerRadius="25"/>
51+
<RoundRectangle CornerRadius="30"/>
5352
</Border.StrokeShape>
5453
<effects:SfEffectsView TouchDownEffects="Highlight">
5554
<effects:SfEffectsView.GestureRecognizers>
56-
<TapGestureRecognizer Tapped="OnEditTapped"/>
55+
<TapGestureRecognizer Tapped="OnFavoriteTapped"/>
5756
</effects:SfEffectsView.GestureRecognizers>
5857
<VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
59-
<Label Text="&#xE701;" FontFamily="PhotoGallery" FontSize="24" HorizontalOptions="Center"/>
60-
<Label Text="Edit" />
58+
<Label Text="{Binding IsFavorite, Converter={StaticResource FavoriteToIconConverter}}"
59+
FontFamily="PhotoGallery" FontSize="24" HorizontalOptions="Center"/>
60+
<Label Text="Favorite" />
6161
</VerticalStackLayout>
6262
</effects:SfEffectsView>
6363
</Border>
6464

6565
<Border StrokeThickness="0" HeightRequest="60" WidthRequest="60">
6666
<Border.StrokeShape>
67-
<RoundRectangle CornerRadius="25"/>
67+
<RoundRectangle CornerRadius="30"/>
6868
</Border.StrokeShape>
6969
<effects:SfEffectsView TouchDownEffects="Highlight">
7070
<effects:SfEffectsView.GestureRecognizers>
7171
<TapGestureRecognizer Tapped="OnDeleteTapped"/>
7272
</effects:SfEffectsView.GestureRecognizers>
7373
<VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
7474
<Label Text="&#xE700;" FontFamily="PhotoGallery" FontSize="24" HorizontalOptions="Center"/>
75-
<Label Text="Delete" />
75+
<Label Text="Bin" />
7676
</VerticalStackLayout>
7777
</effects:SfEffectsView>
7878
</Border>

PhotoGallery/MainPage.xaml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
Color="{Binding Source={x:Reference photosTab},Path=TextColor}"
4040
FontFamily="PhotoGallery"/>
4141
</tabView:SfTabItem.ImageSource>
42-
<listView:SfListView x:Name="listViewPhotos" ItemsSource="{Binding Photos}" ItemSize="200" ItemSpacing="10"
43-
ItemTapped="OnPhotosItemTapped">
42+
<listView:SfListView x:Name="listViewPhotos" ItemsSource="{Binding Photos}" SelectionMode="None"
43+
ItemSize="90" ItemSpacing="5" ItemTapped="OnPhotosItemTapped">
4444

4545
<listView:SfListView.ItemsLayout>
46-
<listView:GridLayout SpanCount="3" />
46+
<listView:GridLayout SpanCount="4" />
4747
</listView:SfListView.ItemsLayout>
4848
<listView:SfListView.ItemTemplate>
4949
<DataTemplate>
50-
<Image Source="{Binding Image}" Aspect="AspectFill"/>
50+
<Image Source="{Binding Image}" Aspect="AspectFill" HeightRequest="88" WidthRequest="88"/>
5151
</DataTemplate>
5252
</listView:SfListView.ItemTemplate>
5353
</listView:SfListView>
@@ -60,17 +60,17 @@
6060
FontFamily="PhotoGallery"/>
6161
</tabView:SfTabItem.ImageSource>
6262

63-
<listView:SfListView ItemsSource="{Binding Albums}" ItemSize="200" ItemSpacing="10"
64-
ItemTapped="OnAlbumsItemTapped">
63+
<listView:SfListView ItemsSource="{Binding Albums}" ItemSize="230"
64+
ItemTapped="OnAlbumsItemTapped" SelectionMode="None">
6565
<listView:SfListView.ItemsLayout>
66-
<listView:GridLayout SpanCount="3" />
66+
<listView:GridLayout SpanCount="2" />
6767
</listView:SfListView.ItemsLayout>
6868
<listView:SfListView.ItemTemplate>
6969
<DataTemplate>
7070
<Grid RowDefinitions="*,20,20">
71-
<Image Source="{Binding CoverImage}" Aspect="AspectFill" />
72-
<Label Text="{Binding AlbumName}" FontSize="15" Grid.Row="1"/>
73-
<Label Text="{Binding Count}" FontSize="12" Grid.Row="2" />
71+
<Image Source="{Binding CoverImage}" Aspect="Fill" HeightRequest="180" WidthRequest="180"/>
72+
<Label Text="{Binding AlbumName}" FontSize="15" Margin="10,0,0,0" Grid.Row="1"/>
73+
<Label Text="{Binding Count, StringFormat='{0} items'}" Margin="10,0,0,0" FontSize="12" Grid.Row="2" />
7474
</Grid>
7575
</DataTemplate>
7676
</listView:SfListView.ItemTemplate>
@@ -83,15 +83,13 @@
8383
Color="{Binding Source={x:Reference favoritesTab},Path=TextColor}"
8484
FontFamily="PhotoGallery"/>
8585
</tabView:SfTabItem.ImageSource>
86-
<listView:SfListView ItemsSource="{Binding Favorites, Mode=TwoWay}" ItemSize="300" ItemSpacing="10"
87-
ItemTapped="OnPhotosItemTapped">
88-
<listView:SfListView.ItemsLayout>
89-
<listView:GridLayout SpanCount="2" />
90-
</listView:SfListView.ItemsLayout>
86+
<listView:SfListView x:Name="listViewFavorites" ItemsSource="{Binding Favorites, Mode=TwoWay}" ItemSpacing="10"
87+
SelectionMode="None" AutoFitMode="Height" ItemTapped="OnPhotosItemTapped">
9188
<listView:SfListView.ItemTemplate>
9289
<DataTemplate>
93-
<Grid RowDefinitions="20,*">
94-
<Label Text="{Binding DateTime, StringFormat='{0:ddd, dd MMM, yyyy}'}" />
90+
<Grid RowDefinitions="30,*">
91+
<Label Text="{Binding DateTime, StringFormat='{0:ddd, dd MMM, yyyy}'}"
92+
FontAttributes="Bold" FontSize="15" />
9593
<Image Source="{Binding Image}" Aspect="AspectFill" Grid.Row="1"/>
9694
</Grid>
9795
</DataTemplate>

PhotoGallery/MainPage.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ public MainPage()
2121
{
2222
return "Today";
2323
}
24+
else if (item.DateTime.Date == DateTime.Now.Date.AddDays(-1))
25+
{
26+
return "Yesterday";
27+
}
2428
else if (item.DateTime.Year == DateTime.Now.Year)
2529
{
26-
return item.DateTime.ToString("MMM dd", CultureInfo.InvariantCulture);
30+
return item.DateTime.ToString("ddd, dd MMM", CultureInfo.InvariantCulture);
2731
}
2832
else
2933
{
30-
return item.DateTime.ToString("MMM dd yyyy", CultureInfo.InvariantCulture);
34+
return item.DateTime.ToString("ddd, dd MMM, yyyy", CultureInfo.InvariantCulture);
3135
}
3236
}
3337
else

0 commit comments

Comments
 (0)