Skip to content

Commit

Permalink
Gamepad navigation now works a lot better, plus some TV screen size a…
Browse files Browse the repository at this point in the history
…djustments and other bug fixes
  • Loading branch information
Kochamara committed Feb 26, 2017
1 parent 05d6678 commit af8eb1f
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public App()
if (Utilities.SystemInformationManager.IsTenFootExperience)
{
this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true);
// Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true);
}

this.Suspending += OnSuspending;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public async Task GetSearchResultsAsync(string query, bool isFirstTimeLoadingVid
var response = await GiantBombApi.Services.VideoRetrievalAgent.GetVideoSearchResultsAsync(_apiKey, query, _resultPageCurrentlyShown);
if ((response != null) && (response.Status == StatusCode.OK) && (response.Results != null) && (response.Results.Count() > 0))
{
ErrorText = null;
_numberOfVideosCurrentlyShown += response.Results.Count();

if (response.NumberOfTotalResults > _numberOfVideosCurrentlyShown)
Expand Down Expand Up @@ -223,5 +224,66 @@ public RelayCommand ShowMoreVideosCommand
}
private RelayCommand _showMoreVideosCommand;
#endregion

#region Navigation
public RelayCommand NavigateCategoriesPageCommand
{
get
{
return _navigateCategoriesPageCommand ?? (_navigateCategoriesPageCommand = new RelayCommand(
() =>
{
_navigationManager.Navigate(Views.CategoriesPage.PageKey);
}));
}
}
private RelayCommand _navigateCategoriesPageCommand;

public RelayCommand NavigateSettingsPageCommand
{
get
{
return _navigateSettingsPageCommand ?? (_navigateSettingsPageCommand = new RelayCommand(
() =>
{
_navigationManager.Navigate(Views.SettingsPage.PageKey);
}));
}
}
private RelayCommand _navigateSettingsPageCommand;

public RelayCommand NavigateQuickLooksPageCommand
{
get
{
return _navigateQuickLooksPageCommand ?? (_navigateQuickLooksPageCommand = new RelayCommand(
() =>
{
// So yeah, we're hard coding this ID because there's no explicit API request to get this specific page.
// It's not ideal.
_navigationManager.Navigate("CategoryPage", new GiantBombApi.Models.VideoCategory()
{
Name = "Quick Looks",
Deck = "Our editors provide commentary as they play through 20 minutes or more of uninterrupted gameplay.",
Id = "3",
});
}));
}
}
private RelayCommand _navigateQuickLooksPageCommand;

public RelayCommand NavigateHomeCommand
{
get
{
return _navigateHomeCommand ?? (_navigateHomeCommand = new RelayCommand(
() =>
{
_navigationManager.NavigateHome();
}));
}
}
private RelayCommand _navigateHomeCommand;
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@

<Grid Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}">
<Grid.RowDefinitions>
<RowDefinition Height=".6*" />
<RowDefinition Height=".2*" />
<RowDefinition Height=".4*" />
<RowDefinition Height=".2*" />
<RowDefinition Height=".2*" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="ms-appx:///Assets/JeffFrame.jpg" MaxWidth="400" MaxHeight="600" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ProgressRing Grid.Row="1" Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Top" Margin="0,50,0,0" />
<Image Grid.Row="1" Source="ms-appx:///Assets/JeffFrame.jpg" MaxWidth="400" MaxHeight="600" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ProgressRing Grid.Row="2" Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Center" />
</Grid>

<Grid Visibility="{Binding IsLoading, Converter={StaticResource NegatedBoolToVisibility}}">
Expand All @@ -79,13 +81,13 @@
<ColumnDefinition x:Name="ScrollViewerColumn" Width=".6*" />
</Grid.ColumnDefinitions>

<Grid Grid.Column="0" Height="800" VerticalAlignment="Center" HorizontalAlignment="Right">
<Grid Grid.Column="0" MaxHeight="800" VerticalAlignment="Center" HorizontalAlignment="Right">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="ms-appx:///Assets/JeffRunning.gif" Height="307" Margin="16" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Image Grid.Row="1" Source="ms-appx:///Assets/RyanRunning.gif" Height="307" Margin="16" Stretch="Uniform" HorizontalAlignment="Center" />
<Image Grid.Row="0" Source="ms-appx:///Assets/JeffRunning.gif" MaxHeight="307" Margin="16" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Image Grid.Row="1" Source="ms-appx:///Assets/RyanRunning.gif" MaxHeight="307" Margin="16" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>

<ScrollViewer Grid.Column="1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,38 @@
</Page.Resources>

<Grid Background="{StaticResource DarkestGrayBrush}">
<ScrollViewer>
<Grid>
<Grid Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}">
<Grid.RowDefinitions>
<RowDefinition Height=".6*" />
<RowDefinition Height=".4*" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="ms-appx:///Assets/JeffFrame.jpg" MaxWidth="400" MaxHeight="600" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ProgressRing Grid.Row="1" Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Top" Margin="0,50,0,0" />
</Grid>
<Grid Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}">
<Grid.RowDefinitions>
<RowDefinition Height=".2*" />
<RowDefinition Height=".4*" />
<RowDefinition Height=".2*" />
<RowDefinition Height=".2*" />
</Grid.RowDefinitions>
<Image Grid.Row="1" Source="ms-appx:///Assets/JeffFrame.jpg" MaxWidth="400" MaxHeight="600" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ProgressRing Grid.Row="2" Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Center" />
</Grid>

<StackPanel Visibility="{Binding IsLoading, Converter={StaticResource NegatedBoolToVisibility}}" Orientation="Vertical" Margin="40">
<TextBlock Text="{Binding CategoryTitle}" Style="{StaticResource HeaderTextStyle}" HorizontalAlignment="Center" TextAlignment="Center" Margin="16" />
<TextBlock Text="{Binding CategoryDescription}" Foreground="{StaticResource LightGrayBrush}" Style="{StaticResource SubHeaderTextStyle}" HorizontalAlignment="Center" TextAlignment="Center" Margin="16,0,16,16" />
<ScrollViewer Visibility="{Binding IsLoading, Converter={StaticResource NegatedBoolToVisibility}}">
<StackPanel Orientation="Vertical" Margin="40">
<TextBlock Text="{Binding CategoryTitle}" Style="{StaticResource HeaderTextStyle}" HorizontalAlignment="Center" TextAlignment="Center" Margin="16" />
<TextBlock Text="{Binding CategoryDescription}" Foreground="{StaticResource LightGrayBrush}" Style="{StaticResource SubHeaderTextStyle}" HorizontalAlignment="Center" TextAlignment="Center" Margin="16,0,16,16" />

<StackPanel Orientation="Vertical" Margin="40" Visibility="{Binding FoundVideos, Converter={StaticResource BoolToVisibility}}">
<ItemsControl ItemsSource="{Binding HeaderVideos}" Style="{StaticResource HeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding SubHeaderVideos}" Style="{StaticResource SubHeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding Videos}" Style="{StaticResource VideoListStyle}" />
<Button Content="Show more" Command="{Binding ShowMoreVideosCommand}" Style="{StaticResource NavigationButtonStyle}" HorizontalAlignment="Center" Margin="20" Visibility="{Binding AdditionalVideosFound, Converter={StaticResource BoolToVisibility}}" />
<ProgressRing Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Top" Margin="0,50,0,0" Visibility="{Binding AreAdditionalResultsBeingLoaded, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
<StackPanel Orientation="Vertical" Margin="40" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding FoundVideos, Converter={StaticResource NegatedBoolToVisibility}}">
<TextBlock Foreground="White" MaxWidth="600" TextAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource SubheaderTextBlockStyle}">
<StackPanel Orientation="Vertical" Margin="40" Visibility="{Binding FoundVideos, Converter={StaticResource BoolToVisibility}}">
<ItemsControl ItemsSource="{Binding HeaderVideos}" Style="{StaticResource HeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding SubHeaderVideos}" Style="{StaticResource SubHeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding Videos}" Style="{StaticResource VideoListStyle}" />
<Button Content="Show more" Command="{Binding ShowMoreVideosCommand}" Style="{StaticResource NavigationButtonStyle}" HorizontalAlignment="Center" Margin="20" Visibility="{Binding AdditionalVideosFound, Converter={StaticResource BoolToVisibility}}" />
<ProgressRing Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Top" Margin="0,50,0,0" Visibility="{Binding AreAdditionalResultsBeingLoaded, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
<StackPanel Orientation="Vertical" Margin="40" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding FoundVideos, Converter={StaticResource NegatedBoolToVisibility}}">
<TextBlock Foreground="White" MaxWidth="600" TextAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource SubheaderTextBlockStyle}">
<Run Text="Uh oh!"/>
<LineBreak />
<Run Text="No videos were found. Make sure you're connected to the internet and try again."/>
</TextBlock>
<Button Content="Refresh" Command="{Binding RefreshCommand}" Style="{StaticResource NavigationButtonStyle}" HorizontalAlignment="Center" Margin="40" />
</StackPanel>
</TextBlock>
<Button Content="Refresh" Command="{Binding RefreshCommand}" Style="{StaticResource NavigationButtonStyle}" HorizontalAlignment="Center" Margin="40" />
</StackPanel>
</Grid>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@

<Grid Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}">
<Grid.RowDefinitions>
<RowDefinition Height=".6*" />
<RowDefinition Height=".2*" />
<RowDefinition Height=".4*" />
<RowDefinition Height=".2*" />
<RowDefinition Height=".2*" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="ms-appx:///Assets/JeffFrame.jpg" MaxWidth="400" MaxHeight="600" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ProgressRing Grid.Row="1" Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Top" Margin="0,50,0,0" />
<Image Grid.Row="1" Source="ms-appx:///Assets/JeffFrame.jpg" MaxWidth="400" MaxHeight="600" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ProgressRing Grid.Row="2" Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Center" />
</Grid>

<Grid Visibility="{Binding IsLoading, Converter={StaticResource NegatedBoolToVisibility}}">
Expand All @@ -99,9 +101,9 @@
<ScrollViewer Grid.Column="1">
<Grid>
<StackPanel Orientation="Vertical" Margin="40" Visibility="{Binding FoundVideos, Converter={StaticResource BoolToVisibility}}">
<ItemsControl ItemsSource="{Binding HeaderVideos}" Style="{StaticResource HeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding SubHeaderVideos}" Style="{StaticResource SubHeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding Videos}" Style="{StaticResource VideoListStyle}" />
<ItemsControl ItemsSource="{Binding HeaderVideos}" Style="{StaticResource HeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding SubHeaderVideos}" Style="{StaticResource SubHeaderVideoListStyle}" />
<ItemsControl ItemsSource="{Binding Videos}" Style="{StaticResource VideoListStyle}" />
<Button Content="Show more" Command="{Binding ShowMoreVideosCommand}" Style="{StaticResource NavigationButtonStyle}" HorizontalAlignment="Center" Margin="20" Visibility="{Binding AdditionalVideosFound, Converter={StaticResource BoolToVisibility}}" />
<ProgressRing Style="{StaticResource ProgressRingStyle}" VerticalAlignment="Top" Margin="0,50,0,0" Visibility="{Binding AreAdditionalResultsBeingLoaded, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<ScrollViewer Background="{StaticResource DarkestGrayBrush}">
<ScrollViewer Background="{StaticResource DarkestGrayBrush}" IsTabStop="True">
<TextBlock x:Name="LicenseTextBlock" Style="{StaticResource BodyTextStyle}" Margin="100"/>
</ScrollViewer>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public async Task PopulateLicenseTextAsync()
}
}
}
}
}
Loading

0 comments on commit af8eb1f

Please sign in to comment.