Skip to content

Commit

Permalink
Add right-click and hold gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremie Corpinot committed May 1, 2017
1 parent 5556cec commit 79414e2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Citations 365/Citations 365/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<value>Update app tile periodically</value>
</data>
<data name="DynamicTileTitle.Text" xml:space="preserve">
<value>Tuile dynamique</value>
<value>Dynamic tile</value>
</data>
<data name="Favorite.Text" xml:space="preserve">
<value>Favorite</value>
Expand Down
25 changes: 15 additions & 10 deletions Citations 365/Citations 365/Views/HomePage_Desktop.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

<DataTemplate x:Key="QuoteTemplate" x:DataType="data:Quote">
<Grid x:Name="QuoteGrid"
Margin="0,25,0,35"
Loaded="Quote_Loaded">
Margin="0,25,0,35"
RightTapped="Quote_RightTapped"
Loaded="Quote_Loaded">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="17"/>
Expand All @@ -40,7 +41,7 @@
Margin="0,7"
Fill="{x:Bind IsFavorite, Mode=OneWay, Converter={StaticResource FavoriteColor}}"/>

<Button Grid.Row="2"
<Button x:Name="MoreButton" Grid.Row="2"
Background="Transparent"
HorizontalAlignment="Right">
<Button.Content>
Expand All @@ -67,7 +68,9 @@
</DataTemplate>

<DataTemplate x:Key="HeroQuoteTemplate" x:DataType="data:Quote">
<Grid x:Name="QuoteGrid" Margin="0,25,0,25" Loaded="Quote_Loaded">
<Grid x:Name="QuoteGrid" Margin="0,25,0,25"
RightTapped="Quote_RightTapped"
Loaded="Quote_Loaded">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="17"/>
Expand All @@ -91,7 +94,8 @@
Margin="0,7"
Fill="{x:Bind IsFavorite, Mode=OneWay, Converter={StaticResource FavoriteColor}}"/>

<Button Grid.Row="2"
<Button x:Name="MoreButton"
Grid.Row="2"
Background="Transparent"
HorizontalAlignment="Right">
<Button.Content>
Expand Down Expand Up @@ -135,7 +139,7 @@
</Image>
</Border>

<Grid>
<Grid Canvas.ZIndex="2">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
Expand All @@ -153,7 +157,7 @@
Grid.Row="1">
<ScrollViewer Margin="0,0,0,100"
VerticalScrollBarVisibility="Hidden">
<Grid>
<Grid RightTapped="Quote_RightTapped">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30"/>
Expand Down Expand Up @@ -181,9 +185,10 @@
FontWeight="Light"/>
</StackPanel>

<Button Grid.Row="2"
Background="Transparent"
HorizontalAlignment="Right">
<Button x:Name="MoreButton"
Grid.Row="2"
Background="Transparent"
HorizontalAlignment="Right">
<Button.Content>
<FontIcon Glyph="&#xE10C;"/>
</Button.Content>
Expand Down
6 changes: 6 additions & 0 deletions Citations 365/Citations 365/Views/HomePage_Desktop.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,12 @@ private void HeroContent_Tapped(object sender, TappedRoutedEventArgs e) {
Frame.Navigate(typeof(AuthorPage_Desktop), quote);
}

private void Quote_RightTapped(object sender, RightTappedRoutedEventArgs e) {
var container = (Grid)sender;
var MoreButton = (Button)container.FindName("MoreButton");
var flyout = MoreButton.Flyout;
flyout.ShowAt(MoreButton);
}
#endregion Quote Events

#region appbar
Expand Down
9 changes: 6 additions & 3 deletions Citations 365/Citations 365/Views/HomePage_Mobile.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Grid x:Name="QuoteGrid"
Opacity="0"
Margin="0,25,0,35"
Holding="Quote_Holding"
Loaded="Quote_Loaded">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
Expand All @@ -38,7 +39,7 @@
Margin="0,7"
Fill="{x:Bind IsFavorite, Mode=OneWay, Converter={StaticResource FavoriteColor}}"/>

<Button Grid.Row="2"
<Button x:Name="MoreButton" Grid.Row="2"
Background="Transparent"
HorizontalAlignment="Right">
<Button.Content>
Expand All @@ -65,7 +66,9 @@
</DataTemplate>

<DataTemplate x:Key="HeroQuoteTemplate" x:DataType="data:Quote">
<Grid x:Name="QuoteGrid" Margin="0,25,0,25" Loaded="Quote_Loaded">
<Grid x:Name="QuoteGrid" Margin="0,25,0,25"
Holding="Quote_Holding"
Loaded="Quote_Loaded">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="17"/>
Expand All @@ -89,7 +92,7 @@
Margin="0,7"
Fill="{x:Bind IsFavorite, Mode=OneWay, Converter={StaticResource FavoriteColor}}"/>

<Button Grid.Row="2"
<Button x:Name="MoreButton" Grid.Row="2"
Background="Transparent"
HorizontalAlignment="Right">
<Button.Content>
Expand Down
8 changes: 8 additions & 0 deletions Citations 365/Citations 365/Views/HomePage_Mobile.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ private void Quote_Tapped(object sender, TappedRoutedEventArgs e) {
}
}

private void Quote_Holding(object sender, HoldingRoutedEventArgs e) {
var container = (Grid)sender;
var moreButton = (Button)container.FindName("MoreButton");
var flyout = moreButton.Flyout;
flyout.ShowAt(moreButton);
}

private void ListRecent_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args) {
if (args.ItemIndex == 0) {
InitializeHeroQuote(args);
Expand Down Expand Up @@ -551,5 +558,6 @@ private void AttachBackgroundBlurAnimation() {
//blurSprite.Brush.Properties.StartAnimation("Blur.BlurAmount", backgroundBlurAnimation);
}
#endregion background

}
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Read meaningful quotes everyday.
# screenshots
## on mobile
### home
<img src="screenshot_mobile.png" alt="citations365" height="400" />
<img src="screenshot_mobile.png" alt="citations365" height="400" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" />

### lockscreen
<img src="lockscreen.png" alt="lockscreen" height="400" />
<img src="lockscreen.png" alt="lockscreen" height="400" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" />


## on desktop
### home
<img src="screenshot_desktop.png" alt="citations365" height="400" />
<img src="screenshot_desktop.png" alt="citations365" height="400" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" />

### author page
<img src="screenshot_author_desktop.png" alt="citations365" height="400" />
<img src="screenshot_author_desktop.png" alt="citations365" height="400" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" />

## tile animation
<img src="./livetile.gif"/>
<img src="./livetile.gif" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"/>

# features
* new quotes every day
Expand Down
Binary file modified screenshot_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79414e2

Please sign in to comment.