Permalink
Browse files

updated minimal template for 2.0

  • Loading branch information...
purplecabbage committed Jul 19, 2012
1 parent 70ab24d commit 451ab5a4fd2a190e64d04930094103f0edb3b382
@@ -32,7 +32,7 @@
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
-namespace GapExample
+namespace $safeprojectname$
{
public partial class App : Application
{
@@ -89,19 +89,17 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</ApplicationDefinition>
- <Page Include="MainPage.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
</ItemGroup>
<ItemGroup>
<Content Include="BuildManifestProcessor.js" />
<Content Include="CordovaSourceDictionary.xml" />
<Content Include="www\cordova-2.0.0.js" />
+ <Content Include="www\css\index.css" />
+ <Content Include="www\js\index.js" />
+ <Content Include="www\img\cordova.png" />
<Content Include="www\index.html">
<SubType>Designer</SubType>
</Content>
- <Content Include="www\master.css" />
<None Include="Properties\AppManifest.xml">
<SubType>Designer</SubType>
</None>
@@ -128,6 +126,12 @@
<ItemGroup>
<Folder Include="Plugins\" />
</ItemGroup>
+ <ItemGroup>
+ <Page Include="MainPage.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -17,7 +17,7 @@
under the License.
-->
<phone:PhoneApplicationPage
- x:Class="GapExample.MainPage"
+ x:Class="$safeprojectname$.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
@@ -27,6 +27,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">
@@ -36,8 +37,16 @@
</Grid.RowDefinitions>
<my:CordovaView HorizontalAlignment="Stretch"
Margin="0,0,0,0"
- Name="PGView"
+ x:Name="CordovaView"
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>
@@ -34,19 +34,39 @@
using System.Windows.Resources;
-namespace GapExample
+namespace $safeprojectname$
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
+ this.CordovaView.Loaded += CordovaView_Loaded;
}
- private void GapBrowser_Loaded(object sender, RoutedEventArgs e)
+ private void CordovaView_Loaded(object sender, RoutedEventArgs e)
{
-
+ this.CordovaView.Loaded -= CordovaView_Loaded;
+ // first time load will have an animation
+ 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);
}
}
}
@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Jasmine Spec Runner</title>
-
- <!-- jasmine source -->
- <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
- <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
- <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
- <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
-
- <!-- include source files here... -->
- <script type="text/javascript" src="js/index.js"></script>
-
- <!-- include spec files here... -->
- <script type="text/javascript" src="spec/helper.js"></script>
- <script type="text/javascript" src="spec/index.js"></script>
-
- <script type="text/javascript">
- (function() {
- var jasmineEnv = jasmine.getEnv();
- jasmineEnv.updateInterval = 1000;
-
- var htmlReporter = new jasmine.HtmlReporter();
-
- jasmineEnv.addReporter(htmlReporter);
-
- jasmineEnv.specFilter = function(spec) {
- return htmlReporter.specFilter(spec);
- };
-
- var currentWindowOnload = window.onload;
-
- window.onload = function() {
- if (currentWindowOnload) {
- currentWindowOnload();
- }
- execJasmine();
- };
-
- function execJasmine() {
- jasmineEnv.execute();
- }
- })();
- </script>
- </head>
- <body>
- <div id="stage" style="display:none;"></div>
- </body>
-</html>
@@ -1,11 +0,0 @@
-afterEach(function() {
- document.getElementById('stage').innerHTML = '';
-});
-
-var helper = {
- trigger: function(obj, name) {
- var e = document.createEvent('Event');
- e.initEvent(name, true, true);
- obj.dispatchEvent(e);
- }
-};
@@ -1,49 +0,0 @@
-describe('app', function() {
- describe('initialize', function() {
- it('should bind deviceready', function() {
- runs(function() {
- spyOn(app, 'deviceready');
- app.initialize();
- helper.trigger(window.document, 'deviceready');
- });
-
- waitsFor(function() {
- return (app.deviceready.calls.length > 0);
- }, 'deviceready should be called once', 500);
-
- runs(function() {
- expect(app.deviceready).toHaveBeenCalled();
- });
- });
- });
-
- describe('deviceready', function() {
- it('should report that it fired', function() {
- spyOn(app, 'report');
- app.deviceready();
- expect(app.report).toHaveBeenCalledWith('deviceready');
- });
- });
-
- describe('report', function() {
- beforeEach(function() {
- var el = document.getElementById('stage');
- el.innerHTML = ['<div id="deviceready">',
- ' <p class="status pending">Pending</p>',
- ' <p class="status complete hide">Complete</p>',
- '</div>'].join('\n');
- });
-
- it('should show the completion state', function() {
- app.report('deviceready');
- var el = document.querySelector('#deviceready .complete:not(.hide)');
- expect(el).toBeTruthy();
- });
-
- it('should hide the pending state', function() {
- app.report('deviceready');
- var el = document.querySelector('#deviceready .pending.hide');
- expect(el).toBeTruthy();
- });
- });
-});
@@ -1,20 +0,0 @@
-Copyright (c) 2008-2011 Pivotal Labs
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Oops, something went wrong.

0 comments on commit 451ab5a

Please sign in to comment.