You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/04/21 03:17:27 UTC
[2/4] wp7 commit: splash image is animated away on load
splash image is animated away on load
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/37e19cbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/37e19cbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/37e19cbf
Branch: refs/heads/master
Commit: 37e19cbf82839d509a22801925190b726f8924ec
Parents: cea4bc5
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Apr 20 18:01:53 2012 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Apr 20 18:01:53 2012 -0700
----------------------------------------------------------------------
templates/full/MainPage.xaml | 11 ++++++++++-
templates/full/MainPage.xaml.cs | 21 ++++++++++++++++++++-
2 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/37e19cbf/templates/full/MainPage.xaml
----------------------------------------------------------------------
diff --git a/templates/full/MainPage.xaml b/templates/full/MainPage.xaml
index 424acac..57d76fb 100644
--- a/templates/full/MainPage.xaml
+++ b/templates/full/MainPage.xaml
@@ -9,6 +9,7 @@
mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
+ Background="Black"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="True" d:DesignHeight="768" d:DesignWidth="480"
xmlns:my="clr-namespace:WP7CordovaClassLib;assembly=WP7CordovaClassLib">
@@ -20,6 +21,14 @@
Margin="0,0,0,0"
Name="PGView"
VerticalAlignment="Stretch" />
+ <Image Source="SplashScreenImage.jpg"
+ x:Name="SplashImage"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Stretch">
+ <Image.Projection>
+ <PlaneProjection x:Name="SplashProjector" CenterOfRotationX="0"/>
+ </Image.Projection>
+ </Image>
</Grid>
-</phone:PhoneApplicationPage>
\ No newline at end of file
+</phone:PhoneApplicationPage>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/37e19cbf/templates/full/MainPage.xaml.cs
----------------------------------------------------------------------
diff --git a/templates/full/MainPage.xaml.cs b/templates/full/MainPage.xaml.cs
index 106331a..9fc9a63 100644
--- a/templates/full/MainPage.xaml.cs
+++ b/templates/full/MainPage.xaml.cs
@@ -23,11 +23,30 @@ namespace GapExample
public MainPage()
{
InitializeComponent();
+ this.PGView.Loaded += GapBrowser_Loaded;
}
private void GapBrowser_Loaded(object sender, RoutedEventArgs e)
{
-
+ this.PGView.Loaded -= GapBrowser_Loaded;
+ Storyboard _storyBoard = new Storyboard();
+ DoubleAnimation animation = new DoubleAnimation()
+ {
+ From = 0,
+ Duration = TimeSpan.FromSeconds(0.6),
+ To = 90
+ };
+ Storyboard.SetTarget(animation, SplashProjector);
+ Storyboard.SetTargetProperty(animation, new PropertyPath("RotationY"));
+ _storyBoard.Children.Add(animation);
+ _storyBoard.Begin();
+ _storyBoard.Completed += Splash_Completed;
+ }
+
+ void Splash_Completed(object sender, EventArgs e)
+ {
+ (sender as Storyboard).Completed -= Splash_Completed;
+ LayoutRoot.Children.Remove(SplashImage);
}
}
}
\ No newline at end of file