From 57191e3b9a965257b66246d7ecf01522720633d2 Mon Sep 17 00:00:00 2001 From: Diego Waxemberg Date: Sun, 26 Aug 2018 10:53:28 -0700 Subject: [PATCH] added a highlight state for focused views (can now see what's selected in tvOS) --- Moonlight TV/Base.lproj/Main.storyboard | 8 ++++---- Moonlight TV/ViewController.m | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Moonlight TV/Base.lproj/Main.storyboard b/Moonlight TV/Base.lproj/Main.storyboard index 30a2a6e..393f7fe 100644 --- a/Moonlight TV/Base.lproj/Main.storyboard +++ b/Moonlight TV/Base.lproj/Main.storyboard @@ -17,16 +17,16 @@ - + - + - - + + diff --git a/Moonlight TV/ViewController.m b/Moonlight TV/ViewController.m index 5430d22..c3c85bb 100644 --- a/Moonlight TV/ViewController.m +++ b/Moonlight TV/ViewController.m @@ -855,4 +855,12 @@ static NSMutableSet* hostList; [self beginForegroundRefresh]; } +- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator { + + if (context.nextFocusedView != nil) { + [context.nextFocusedView setAlpha:0.8]; + } + [context.previouslyFocusedView setAlpha:1.0]; +} + @end