Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Winium/TestApp.StoreApps/TestApp.WindowsPhone/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
<TextBox InputScope="Number" AutomationProperties.AutomationId="NumericInput"/>
</StackPanel>
</PivotItem>
<PivotItem Header="third" AutomationProperties.AutomationId="ThirdTab">
<StackPanel>
<WebView Height="400"
DefaultBackgroundColor="Azure"
Source="https://google.com"></WebView>
</StackPanel>
</PivotItem>
</Pivot>
<Page.BottomAppBar>
<CommandBar AutomationProperties.AutomationId="BottomAppBar" Opened="AppBarOnOpened" Closed="AppBarOnClosed">
Expand Down
2 changes: 1 addition & 1 deletion Winium/TestApp.Test/py-functional/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
DESIRED_CAPABILITIES = {
"app": os.path.abspath(os.path.join(BASE_DIR, APPX_PATH)),
"deviceName": "Emulator 8.1",
"debugConnectToRunningApp": False
"debugConnectToRunningApp": True
}
7 changes: 7 additions & 0 deletions Winium/WebViewApp/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Application
x:Class="WebViewApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WebViewApp">

</Application>
87 changes: 87 additions & 0 deletions Winium/WebViewApp/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
namespace WebViewApp
{
#region

using System;

using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;

#endregion

public sealed partial class App
{
private TransitionCollection transitions;

public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}

#endif

var rootFrame = Window.Current.Content as Frame;

if (rootFrame == null)
{
rootFrame = new Frame
{
CacheSize = 1,
Language = Windows.Globalization.ApplicationLanguages.Languages[0]
};

Window.Current.Content = rootFrame;
}

if (rootFrame.Content == null)
{
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}

rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrameFirstNavigated;

if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}

Window.Current.Activate();
}

private static void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();

deferral.Complete();
}

private void RootFrameFirstNavigated(object sender, NavigationEventArgs e)
{
var rootFrame = sender as Frame;
rootFrame.ContentTransitions = this.transitions
?? new TransitionCollection() { new NavigationThemeTransition() };
rootFrame.Navigated -= this.RootFrameFirstNavigated;
}
}
}
Binary file added Winium/WebViewApp/Assets/Logo.scale-240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Winium/WebViewApp/Assets/SmallLogo.scale-240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Winium/WebViewApp/Assets/StoreLogo.scale-240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Winium/WebViewApp/Assets/WideLogo.scale-240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions Winium/WebViewApp/Html/css/phone.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@media all and (orientation:portrait) {
@-ms-viewport {
width:device-width;
user-zoom: fixed;
max-zoom: 1;
min-zoom: 1;
}
}

@media all and (orientation:landscape) {
@-ms-viewport {
width:device-height;
user-zoom: fixed;
max-zoom: 1;
min-zoom: 1;
}
}

html, body {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
}

body {
font-size: 11pt;
font-family: "Segoe WP";
letter-spacing: 0.02em;
background-color: #000000;
color: #ffffff;
margin-left: 24px;
margin-top: 26px;
}

#page-title {
font-family: "Segoe WP SemiLight";
font-size: 41pt;
}
16 changes: 16 additions & 0 deletions Winium/WebViewApp/Html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="css/phone.css" />
<title>Windows Phone</title>
</head>
<body>
<div>
MY APPLICATION
</div>
<div id="page-title">
page title
</div>
</body>
</html>
36 changes: 36 additions & 0 deletions Winium/WebViewApp/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Page
x:Class="WebViewApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WebViewApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Loaded="MainPageOnLoaded">

<WebView x:Name="WebViewControl"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
NavigationCompleted="BrowserNavigationCompleted" />

<Page.BottomAppBar>
<CommandBar>
<CommandBar.PrimaryCommands>
<AppBarButton
x:Name="ForwardAppBarButton"
x:Uid="ForwardAppBarButton"
Click="ForwardAppBarButtonClick"
Icon="Forward"
Label="forward"/>
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>
<AppBarButton
x:Name="HomeAppBarButton"
x:Uid="HomeAppBarButton"
Click="HomeAppBarButtonClick"
Label="home"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
</Page>
78 changes: 78 additions & 0 deletions Winium/WebViewApp/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// The WebView Application template is documented at http://go.microsoft.com/fwlink/?LinkID=391641
namespace WebViewApp
{
#region

using System;
using System.Diagnostics;

using Windows.Phone.UI.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

using Winium.StoreApps.InnerServer;

#endregion

public sealed partial class MainPage : Page
{
private static readonly Uri HomeUri = new Uri("https://github.com/2gis/Winium.Mobile", UriKind.Absolute);

public MainPage()
{
this.InitializeComponent();

this.NavigationCacheMode = NavigationCacheMode.Required;
}

protected override void OnNavigatedFrom(NavigationEventArgs e)
{
HardwareButtons.BackPressed -= this.MainPageBackPressed;
}

protected override void OnNavigatedTo(NavigationEventArgs e)
{
this.WebViewControl.Navigate(HomeUri);

HardwareButtons.BackPressed += this.MainPageBackPressed;
}

private void BrowserNavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
{
if (!args.IsSuccess)
{
Debug.WriteLine("Navigation to this page failed, check your internet connection.");
}
}

private void ForwardAppBarButtonClick(object sender, RoutedEventArgs e)
{
if (this.WebViewControl.CanGoForward)
{
this.WebViewControl.GoForward();
}
}

private void HomeAppBarButtonClick(object sender, RoutedEventArgs e)
{
this.WebViewControl.Navigate(HomeUri);
}

private void MainPageBackPressed(object sender, BackPressedEventArgs e)
{
if (!this.WebViewControl.CanGoBack)
{
return;
}

this.WebViewControl.GoBack();
e.Handled = true;
}

private void MainPageOnLoaded(object sender, RoutedEventArgs e)
{
AutomationServer.Instance.InitializeAndStart();
}
}
}
44 changes: 44 additions & 0 deletions Winium/WebViewApp/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">

<Identity Name="ccabd246-682e-48d8-8aa1-fabd27216fd0"
Publisher="CN=n.abalov"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="ccabd246-682e-48d8-8aa1-fabd27216fd0" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>WebViewApp</DisplayName>
<PublisherDisplayName>n.abalov</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="WebViewApp.App">
<m3:VisualElements
DisplayName="WebViewApp"
Square150x150Logo="Assets\Logo.png"
Square44x44Logo="Assets\SmallLogo.png"
Description="WebViewApp"
ForegroundText="light"
BackgroundColor="transparent">
<m3:DefaultTile Wide310x150Logo="Assets\WideLogo.png" Square71x71Logo="Assets\Square71x71Logo.png"/>
<m3:SplashScreen Image="Assets\SplashScreen.png"/>
</m3:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
</Capabilities>
</Package>
29 changes: 29 additions & 0 deletions Winium/WebViewApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WebViewApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebViewApp")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
Loading