Skip to content

Commit

Permalink
Merge branch 'release/3.0.2-332'
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby committed May 28, 2020
2 parents c03b520 + eb72d52 commit 8f8e451
Show file tree
Hide file tree
Showing 50 changed files with 775 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
/* Introductory title for information notifications */
"Information" = "Informazioni";

/* Label on recently played livestreams */
"Last played" = "Ultimo contenuto visionato";

/* Accessibility introductory text for the logged in user */
"Logged in user: %@" = "Utente connesso: %@";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

/* Label of the button to close the media long-press menu
Label of the button to close the media sharing menu
Label of the button to close the module long-press menu
Label of the button to close the show long-press menu
Title of a cancel button
Title of the cancel button in the alert view when deleting a download in the player view */
Expand Down Expand Up @@ -198,6 +199,9 @@
/* Title of the alert view to keep autoplay permanently */
"Keep autoplay?" = "Mantenere l'autoplay attivo?";

/* Label on recently played livestreams */
"Last played" = "Ultimo contenuto visionato";

/* Introductory text for the most recent data synchronization date */
"Last synchronization: %@" = "Ultima sincronizzazione: %@";

Expand Down Expand Up @@ -312,6 +316,7 @@

/* Button label to open a media from the start from the long-press menu
Button label to open a media from the start from the preview window
Button label to open a module from the from the long-press menu
Button label to open a module from the preview window
Button label to open a show from the from the long-press menu
Button label to open a show from the preview window */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
/* Introductory title for information notifications */
"Information" = "Infurmaziun";

/* Label on recently played livestreams */
"Last played" = "Ultim guardà";

/* Accessibility introductory text for the logged in user */
"Logged in user: %@" = "Utilisader annunzià: %@";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

/* Label of the button to close the media long-press menu
Label of the button to close the media sharing menu
Label of the button to close the module long-press menu
Label of the button to close the show long-press menu
Title of a cancel button
Title of the cancel button in the alert view when deleting a download in the player view */
Expand Down Expand Up @@ -198,6 +199,9 @@
/* Title of the alert view to keep autoplay permanently */
"Keep autoplay?" = "Tegnair autoplay?";

/* Label on recently played livestreams */
"Last played" = "Ultim guardà";

/* Introductory text for the most recent data synchronization date */
"Last synchronization: %@" = "Ultima sincronisaziun: %@";

Expand Down Expand Up @@ -312,6 +316,7 @@

/* Button label to open a media from the start from the long-press menu
Button label to open a media from the start from the preview window
Button label to open a module from the from the long-press menu
Button label to open a module from the preview window
Button label to open a show from the from the long-press menu
Button label to open a show from the preview window */
Expand Down Expand Up @@ -537,7 +542,7 @@
"Total space used: %@" = "Spazi: %@";

/* Title label used to present trending TV videos */
"Trending videos" = "Videos da trend";
"Trending videos" = "Videos en trend";

/* Title label to present main TV livestreams */
"TV channels" = "Chanals da tv";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
/* Introductory title for information notifications */
"Information" = "Information";

/* Label on recently played livestreams */
"Last played" = "Joué en dernier";

/* Accessibility introductory text for the logged in user */
"Logged in user: %@" = "Utilisateur connecté : %@";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

/* Label of the button to close the media long-press menu
Label of the button to close the media sharing menu
Label of the button to close the module long-press menu
Label of the button to close the show long-press menu
Title of a cancel button
Title of the cancel button in the alert view when deleting a download in the player view */
Expand Down Expand Up @@ -198,6 +199,9 @@
/* Title of the alert view to keep autoplay permanently */
"Keep autoplay?" = "Garder la lecture automatique ?";

/* Label on recently played livestreams */
"Last played" = "Joué en dernier";

/* Introductory text for the most recent data synchronization date */
"Last synchronization: %@" = "Dernière synchronisation : %@";

Expand Down Expand Up @@ -312,6 +316,7 @@

/* Button label to open a media from the start from the long-press menu
Button label to open a media from the start from the preview window
Button label to open a module from the from the long-press menu
Button label to open a module from the preview window
Button label to open a show from the from the long-press menu
Button label to open a show from the preview window */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
/* Introductory title for information notifications */
"Information" = "Information";

/* Label on recently played livestreams */
"Last played" = "Zuletzt abgespielt";

/* Accessibility introductory text for the logged in user */
"Logged in user: %@" = "Angemeldeter Nutzer: %@";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* The amount of episodes available for a show */
"%@ episodes" = "%@ Sendungen";
"%@ episodes" = "%@ Folgen";

/* Message displayed at the top of the screen when adding a media to the watch later list. Quotes around the content placeholder are managed by the application. */
"%@ has been added to \"Watch later\"" = "%@ wurde zu Später schauen hinzugefügt";
Expand Down Expand Up @@ -97,6 +97,7 @@

/* Label of the button to close the media long-press menu
Label of the button to close the media sharing menu
Label of the button to close the module long-press menu
Label of the button to close the show long-press menu
Title of a cancel button
Title of the cancel button in the alert view when deleting a download in the player view */
Expand Down Expand Up @@ -198,6 +199,9 @@
/* Title of the alert view to keep autoplay permanently */
"Keep autoplay?" = "Autoplay aktivert behalten?";

/* Label on recently played livestreams */
"Last played" = "Zuletzt abgespielt";

/* Introductory text for the most recent data synchronization date */
"Last synchronization: %@" = "Letzte Synchronisierung: %@";

Expand Down Expand Up @@ -312,6 +316,7 @@

/* Button label to open a media from the start from the long-press menu
Button label to open a media from the start from the preview window
Button label to open a module from the from the long-press menu
Button label to open a module from the preview window
Button label to open a show from the from the long-press menu
Button label to open a show from the preview window */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
/* Introductory title for information notifications */
"Information" = "Information";

/* Label on recently played livestreams */
"Last played" = "Last played";

/* Accessibility introductory text for the logged in user */
"Logged in user: %@" = "Logged in user: %@";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

/* Label of the button to close the media long-press menu
Label of the button to close the media sharing menu
Label of the button to close the module long-press menu
Label of the button to close the show long-press menu
Title of a cancel button
Title of the cancel button in the alert view when deleting a download in the player view */
Expand Down Expand Up @@ -198,6 +199,9 @@
/* Title of the alert view to keep autoplay permanently */
"Keep autoplay?" = "Keep autoplay?";

/* Label on recently played livestreams */
"Last played" = "Last played";

/* Introductory text for the most recent data synchronization date */
"Last synchronization: %@" = "Last synchronization: %@";

Expand Down Expand Up @@ -312,6 +316,7 @@

/* Button label to open a media from the start from the long-press menu
Button label to open a media from the start from the preview window
Button label to open a module from the from the long-press menu
Button label to open a module from the preview window
Button label to open a show from the from the long-press menu
Button label to open a show from the preview window */
Expand Down
2 changes: 1 addition & 1 deletion Application/Sources/Application/PlayAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[Download removeUnusedDownloadedFiles];

// Setup view controller hierarchy
self.window.rootViewController = [[TabBarController alloc] init];
[self.window makeKeyAndVisible];
self.window.rootViewController = [[TabBarController alloc] init];

[self checkForForcedUpdates];

Expand Down
4 changes: 2 additions & 2 deletions Application/Sources/Helpers/ApplicationSectionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ OBJC_EXPORT ApplicationSectionOptionKey const ApplicationSectionOptionShowByDate
+ (ApplicationSectionInfo *)applicationSectionInfoWithApplicationSection:(ApplicationSection)applicationSection radioChannel:(nullable RadioChannel *)radioChannel options:(nullable NSDictionary<ApplicationSectionOptionKey, id> *)options;

/**
* Return the profile section infos available for the current configuration.
* Return the profile section infos available for the current configuration (with optional inlined notification preview).
*/
@property (class, nonatomic, readonly) NSArray<ApplicationSectionInfo *> *profileApplicationSectionInfos;
+ (NSArray<ApplicationSectionInfo *> *)profileApplicationSectionInfosWithNotificationPreview:(BOOL)notificationPreview;

/**
* Properties.
Expand Down
12 changes: 7 additions & 5 deletions Application/Sources/Helpers/ApplicationSectionInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,19 @@ + (ApplicationSectionInfo *)applicationSectionInfoWithNotification:(Notification
options:@{ ApplicationSectionOptionNotificationKey : notification }];
}

+ (NSArray<ApplicationSectionInfo *> *)profileApplicationSectionInfos
+ (NSArray<ApplicationSectionInfo *> *)profileApplicationSectionInfosWithNotificationPreview:(BOOL)notificationPreview
{
NSMutableArray<ApplicationSectionInfo *> *sectionInfos = [NSMutableArray array];
if (@available(iOS 10, *)) {
if (PushService.sharedService.enabled) {
[sectionInfos addObject:[self applicationSectionInfoWithApplicationSection:ApplicationSectionNotifications radioChannel:nil]];

NSArray<Notification *> *unreadNotifications = Notification.unreadNotifications;
NSArray<Notification *> *previewNotifications = [unreadNotifications subarrayWithRange:NSMakeRange(0, MIN(3, unreadNotifications.count))];
for (Notification *notification in previewNotifications) {
[sectionInfos addObject:[self applicationSectionInfoWithNotification:notification]];
if (notificationPreview) {
NSArray<Notification *> *unreadNotifications = Notification.unreadNotifications;
NSArray<Notification *> *previewNotifications = [unreadNotifications subarrayWithRange:NSMakeRange(0, MIN(3, unreadNotifications.count))];
for (Notification *notification in previewNotifications) {
[sectionInfos addObject:[self applicationSectionInfoWithNotification:notification]];
}
}
}
}
Expand Down
17 changes: 0 additions & 17 deletions Application/Sources/Helpers/Categories/UICollectionView+PlaySRG.h

This file was deleted.

17 changes: 0 additions & 17 deletions Application/Sources/Helpers/Categories/UICollectionView+PlaySRG.m

This file was deleted.

37 changes: 24 additions & 13 deletions Application/Sources/Home/HomeMediaListTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

#import "HomeMediaListTableViewCell.h"

#import "ApplicationSettings.h"
#import "HomeLiveMediaCollectionViewCell.h"
#import "HomeMediaCollectionHeaderView.h"
#import "HomeMediaCollectionViewCell.h"
#import "Layout.h"
#import "MediaPlayerViewController.h"
#import "SRGModule+PlaySRG.h"
#import "UICollectionView+PlaySRG.h"
#import "SwimlaneCollectionViewLayout.h"
#import "UIColor+PlaySRG.h"
#import "UIViewController+PlaySRG.h"

Expand Down Expand Up @@ -87,7 +88,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
[self.contentView addSubview:wrapperView];
self.wrapperView = wrapperView;

UICollectionViewFlowLayout *collectionViewLayout = [[UICollectionViewFlowLayout alloc] init];
SwimlaneCollectionViewLayout *collectionViewLayout = [[SwimlaneCollectionViewLayout alloc] init];
collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
collectionViewLayout.minimumLineSpacing = LayoutStandardMargin;
collectionViewLayout.minimumInteritemSpacing = LayoutStandardMargin;
Expand All @@ -98,6 +99,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
collectionView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
collectionView.alwaysBounceHorizontal = YES;
collectionView.directionalLockEnabled = YES;
collectionView.decelerationRate = UIScrollViewDecelerationRateFast;
// Important. If > 1 view on-screen is found on iPhone with this property enabled, none will scroll to top
collectionView.scrollsToTop = NO;
collectionView.delegate = self;
Expand Down Expand Up @@ -148,16 +150,12 @@ - (void)setHomeSectionInfo:(HomeSectionInfo *)homeSectionInfo featured:(BOOL)fea

self.moduleBackgroundView.backgroundColor = homeSectionInfo.module.play_backgroundColor;

dispatch_async(dispatch_get_main_queue(), ^{
if (homeSectionInfo) {
// Restore position in rows when scrolling vertically and returning to a previously scrolled row
CGPoint maxContentOffset = self.collectionView.play_maximumContentOffset;
CGPoint contentOffset = CGPointMake(fmaxf(fminf(homeSectionInfo.contentOffset.x, maxContentOffset.x), 0.f),
homeSectionInfo.contentOffset.y);
[self.collectionView setContentOffset:contentOffset animated:NO];
}
self.collectionView.scrollEnabled = (homeSectionInfo.items.count != 0);
});
if (homeSectionInfo) {
// Restore position in rows when scrolling vertically and returning to a previously scrolled row
CGPoint contentOffset = [self.collectionView.collectionViewLayout targetContentOffsetForProposedContentOffset:homeSectionInfo.contentOffset];
[self.collectionView setContentOffset:contentOffset animated:NO];
}
self.collectionView.scrollEnabled = (homeSectionInfo.items.count != 0);
}

#pragma mark UICollectionViewDataSource protocol
Expand Down Expand Up @@ -216,7 +214,20 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
{
if (! [self isEmpty]) {
SRGMedia *media = self.homeSectionInfo.items[indexPath.row];
[self.nearestViewController play_presentMediaPlayerWithMedia:media position:nil airPlaySuggestions:YES fromPushNotification:NO animated:YES completion:nil];

HomeSection homeSection = self.homeSectionInfo.homeSection;
if (homeSection == HomeSectionTVLive) {
ApplicationSettingSetLastSelectedTVLivestreamURN(media.URN);
}
else if (homeSection == HomeSectionRadioLive) {
ApplicationSettingSetLastSelectedRadioLivestreamURN(media.URN);
}
[self.nearestViewController play_presentMediaPlayerWithMedia:media position:nil airPlaySuggestions:YES fromPushNotification:NO animated:YES completion:^(PlayerType playerType) {
// Reset scrolling to the origin after playing a livestream, as the last played item is presented first
if (homeSection == HomeSectionTVLive || homeSection == HomeSectionRadioLive) {
self.collectionView.contentOffset = CGPointMake(0.f, self.collectionView.contentOffset.y);
}
}];
}
}

Expand Down
Loading

0 comments on commit 8f8e451

Please sign in to comment.