Merge pull request #65 from nventive/dev/djo/history-flyout

Enable History flyout on phone layout
This commit is contained in:
David Oliver 2019-05-27 12:04:05 -04:00 committed by GitHub
commit a1ad61900e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 30 deletions

View file

@ -66,7 +66,7 @@
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.2</Version>
</PackageReference>
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1560" />
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" />
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />

View file

@ -85,7 +85,7 @@ namespace CalculatorApp
string m_openHistoryFlyoutAutomationName;
string m_closeHistoryFlyoutAutomationName;
public ICommand HistoryButtonPressed;
public ICommand HistoryButtonPressed;
Windows.UI.Xaml.Controls.PivotItem m_pivotItem;
bool m_IsDigit = false;
@ -598,7 +598,8 @@ namespace CalculatorApp
HistoryButton.Focus(FocusState.Programmatic);
}
FullscreenFlyoutClosed();
// UNO TODO
//FullscreenFlyoutClosed();
}
public void CloseHistoryFlyout()
@ -692,7 +693,8 @@ namespace CalculatorApp
MemoryButton.Focus(FocusState.Programmatic);
}
FullscreenFlyoutClosed();
// UNO TODO
//FullscreenFlyoutClosed();
}
Memory GetMemory()

View file

@ -1,6 +1,7 @@
<UserControl x:Class="CalculatorApp.HistoryList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:xamarin="http://platform.uno/xamarin"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:automation="using:CalculatorApp.Common.Automation"
xmlns:controls="using:CalculatorApp.Controls"
@ -12,7 +13,7 @@
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
AutomationProperties.AutomationId="HistoryList"
FlowDirection="LeftToRight"
mc:Ignorable="d">
mc:Ignorable="d xamarin">
<!-- UNO TODO x:Name="HistoryList"-->
@ -41,6 +42,12 @@
</ResourceDictionary.ThemeDictionaries>
<converters:ItemSizeToVisibilityNegationConverter x:Key="ItemSizeToVisibilityNegationConverter"/>
<converters:ItemSizeToVisibilityConverter x:Key="ItemSizeToVisibilityConverter"/>
<!--Workaround for nventive/Uno#935-->
<xamarin:Style x:Key="BodyTextBlockMediumStyle"
BasedOn="{StaticResource BodyTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}"/>
</xamarin:Style>
<!--UNO TODO-->
<win:MenuFlyout x:Key="HistoryContextMenu">

View file

@ -170,9 +170,8 @@
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}"
Glyph="&#xe946;" />
</NavigationViewItem.Icon>
<TextBlock Text=""
x:Name="AboutText" />
<NavigationViewItem.ContextFlyout>
<FlyoutBase.AttachedFlyout>
<Flyout x:Name="AboutPageFlyout"
x:Uid="AboutPageFlyout"
@ -183,7 +182,7 @@
<local:AboutFlyout x:Name="AboutPage"
x:Load="False" />
</Flyout>
</NavigationViewItem.ContextFlyout>
</FlyoutBase.AttachedFlyout>
</NavigationViewItem>
</NavigationViewList.Items>
</NavigationViewList>

View file

@ -62,22 +62,15 @@ namespace CalculatorApp
double sizeInInches = 0.0;
// UNO TODO
//if (SUCCEEDED(GetIntegratedDisplaySize(&sizeInInches)))
//{
// if (sizeInInches < 7.0) // If device's display size (diagonal length) is less than 7 inches then keep the calc always in Portrait mode only
// {
// DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.PortraitFlipped;
// }
//}
//UNO_TODO /Workaround to have both the Text localisation and the glyph working on all platforms
var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
if (AboutText != null)
{
AboutText.Text = resourceLoader.GetString("AboutButton/Content");
}
}
// UNO TODO
//if (SUCCEEDED(GetIntegratedDisplaySize(&sizeInInches)))
//{
// if (sizeInInches < 7.0) // If device's display size (diagonal length) is less than 7 inches then keep the calc always in Portrait mode only
// {
// DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.PortraitFlipped;
// }
//}
}
protected override void OnNavigatedTo(NavigationEventArgs e)
@ -508,7 +501,7 @@ namespace CalculatorApp
this.FindName("AboutPage");
}
AboutButton.ContextFlyout.ShowAt(AboutButton);
FlyoutBase.ShowAttachedFlyout(AboutButton);
}
void UnregisterEventHandlers()

View file

@ -9,7 +9,7 @@
<Version>4.3.1</Version>
</PackageReference>
<PackageReference Include="Uno.UI">
<Version>1.45.0-dev.1560</Version>
<Version>1.45.0-dev.1595</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>

View file

@ -44,7 +44,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1560" />
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.281" />
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" />
</ItemGroup>

View file

@ -208,7 +208,7 @@
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.2</Version>
</PackageReference>
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1560" />
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
</ItemGroup>