- hostView & host card fixes: add unpaired offline host to collection
This commit is contained in:
1 parent
25c4ca01de
commit
f843acf12f
2 files changed
+15
-12
No files matched your search
+10
-4
@@ -573,8 +573,12 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
} else {
|
} else {
|
||||||
self.statusIcon.hidden = YES;
|
self.statusIcon.hidden = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hostPaired = host.pairState == PairStatePaired;
|
||||||
|
|
||||||
_hostIconView.tintColor = [ThemeManager lowProfileGray];
|
_hostIconView.tintColor = [ThemeManager lowProfileGray];
|
||||||
lockIconView.hidden = YES;
|
lockIconView.tintColor = [ThemeManager lowProfileGray];
|
||||||
|
lockIconView.hidden = hostPaired;
|
||||||
_appButton.hidden = YES;
|
_appButton.hidden = YES;
|
||||||
_launchButton.hidden = YES;
|
_launchButton.hidden = YES;
|
||||||
_pairButton.hidden = YES;
|
_pairButton.hidden = YES;
|
||||||
@@ -583,13 +587,15 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:buttonHeight/3.45 weight:UIImageSymbolWeightBold];
|
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:buttonHeight/3.45 weight:UIImageSymbolWeightBold];
|
||||||
UIImage *templateImage = [UIImage systemImageNamed:@"power" withConfiguration:config];
|
UIImage *templateImage = [UIImage systemImageNamed:@"power" withConfiguration:config];
|
||||||
UIImage *coloredImage = [templateImage imageWithTintColor:defaultBlue renderingMode:UIImageRenderingModeAlwaysOriginal];
|
UIImage *coloredImage = [templateImage imageWithTintColor:hostPaired ? defaultBlue : [ThemeManager textColorGray] renderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||||
[self.wakeupButton setImage:coloredImage forState:UIControlStateNormal];
|
[self.wakeupButton setImage:coloredImage forState:UIControlStateNormal];
|
||||||
} else {
|
} else {
|
||||||
// Fallback on earlier versions
|
// Fallback on earlier versions
|
||||||
}
|
}
|
||||||
self.wakeupButton.backgroundColor = [ThemeManager textTintColorWithAlpha];
|
|
||||||
[self.wakeupButton setTitleColor:defaultBlue forState:UIControlStateNormal];
|
self.wakeupButton.backgroundColor = hostPaired ? [ThemeManager textTintColorWithAlpha] : [[ThemeManager textColorGray] colorWithAlphaComponent:0.2];
|
||||||
|
[self.wakeupButton setTitleColor: hostPaired ? defaultBlue : [ThemeManager textColorGray] forState:UIControlStateNormal];
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case StateUnknown:
|
case StateUnknown:
|
||||||
_hostSpinner.color = [UIColor whiteColor];
|
_hostSpinner.color = [UIColor whiteColor];
|
||||||
|
|||||||
@@ -1544,9 +1544,10 @@ static NSMutableSet* hostList;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
[self updateTitle];
|
[self updateTitle];
|
||||||
// [self.view addSubview:hostScrollView];
|
|
||||||
|
|
||||||
// if ([hostList count] == 1) [self hostClicked:[hostList anyObject] view:nil]; // auto click for single host
|
[self retrieveSavedHosts];
|
||||||
|
|
||||||
|
_discMan = [[DiscoveryManager alloc] initWithHosts:[hostList allObjects] andCallback:self];
|
||||||
|
|
||||||
|
|
||||||
//if([SettingsViewController isLandscapeNow] != _streamConfig.width > _streamConfig.height)
|
//if([SettingsViewController isLandscapeNow] != _streamConfig.width > _streamConfig.height)
|
||||||
@@ -1809,11 +1810,6 @@ static NSMutableSet* hostList;
|
|||||||
[self.view addSubview:self.collectionView];
|
[self.view addSubview:self.collectionView];
|
||||||
[self initHostCollection];
|
[self initHostCollection];
|
||||||
if(!_enteredAppView) [self switchToHostView];
|
if(!_enteredAppView) [self switchToHostView];
|
||||||
|
|
||||||
[self retrieveSavedHosts];
|
|
||||||
|
|
||||||
_discMan = [[DiscoveryManager alloc] initWithHosts:[hostList allObjects] andCallback:self];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated
|
- (void)viewDidDisappear:(BOOL)animated
|
||||||
@@ -1903,7 +1899,8 @@ static NSMutableSet* hostList;
|
|||||||
NSArray* sortedHostList = [[hostList allObjects] sortedArrayUsingSelector:@selector(compareName:)];
|
NSArray* sortedHostList = [[hostList allObjects] sortedArrayUsingSelector:@selector(compareName:)];
|
||||||
for (TemporaryHost* comp in sortedHostList) {
|
for (TemporaryHost* comp in sortedHostList) {
|
||||||
|
|
||||||
if(comp.state == StateOnline || comp.pairState == PairStatePaired || comp.pairState == PairStateUnknown) [self.hostCollectionVC addHost:comp];
|
// if(comp.state == StateOnline || comp.pairState == PairStatePaired || comp.pairState == PairStateUnknown) [self.hostCollectionVC addHost:comp];
|
||||||
|
[self.hostCollectionVC addHost:comp];
|
||||||
|
|
||||||
// Start jobs to decode the box art in advance
|
// Start jobs to decode the box art in advance
|
||||||
for (TemporaryApp* app in comp.appList) {
|
for (TemporaryApp* app in comp.appList) {
|
||||||
|
|||||||
Reference in new issue
Block a user