Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
My Videos - Selection and Deletion (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir authored Nov 23, 2016
1 parent 850bcca commit cb7d00d
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 369 deletions.
20 changes: 2 additions & 18 deletions Source/OEXMyVideosSubSectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#import "OEXDateFormatting.h"
#import "OEXInterface.h"
#import "OEXHelperVideoDownload.h"
#import "OEXStatusMessageViewController.h"
#import "OEXStyles.h"
#import "OEXUserDetails.h"
#import "OEXVideoPathEntry.h"
Expand All @@ -47,7 +46,7 @@ typedef NS_ENUM (NSUInteger, OEXAlertType) {
OEXAlertTypePlayBackContentUnAvailable
};

@interface OEXMyVideosSubSectionViewController () <UITableViewDelegate, OEXStatusMessageControlling>
@interface OEXMyVideosSubSectionViewController () <UITableViewDelegate>
{
NSIndexPath* clickedIndexpath;
}
Expand Down Expand Up @@ -81,16 +80,6 @@ @interface OEXMyVideosSubSectionViewController () <UITableViewDelegate, OEXStatu

@implementation OEXMyVideosSubSectionViewController

- (CGFloat)verticalOffsetForStatusController:(OEXStatusMessageViewController*)controller {
return CGRectGetMaxY(self.navigationController.navigationBar.frame);
}

- (NSArray*)overlayViewsForStatusController:(OEXStatusMessageViewController*)controller {
NSMutableArray* result = [[NSMutableArray alloc] init];
[result oex_safeAddObjectOrNil:self.selectAllButton];
return result;
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

Expand Down Expand Up @@ -919,8 +908,7 @@ - (void)updateNavigationItemButtons {

- (void)movieTimedOut {
if(!_videoPlayerInterface.moviePlayerController.isFullscreen) {
[[OEXStatusMessageViewController sharedInstance]
showMessage:[Strings timeoutCheckInternetConnection] onViewController:self];
[self showOverlayMessage:[Strings timeoutCheckInternetConnection]];
[_videoPlayerInterface.moviePlayerController stop];
}
else {
Expand Down Expand Up @@ -970,9 +958,6 @@ - (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)button
[self performSelector:@selector(pop) withObject:nil afterDelay:1.0];
}
else {
NSString* message = [Strings videosDeletedWithCount:deleteCount formatted:nil];
[[OEXStatusMessageViewController sharedInstance] showMessage:message onViewController:self];

// clear all objects form array after deletion.
// To obtain correct count on next deletion process.

Expand All @@ -981,7 +966,6 @@ - (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)button
[self.table_SubSectionVideos reloadData];
}

// [self disableDeleteButton];
[self cancelTableClicked:nil];
}
}
Expand Down
3 changes: 0 additions & 3 deletions Source/OEXMyVideosViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1222,9 +1222,6 @@ - (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)button
[self.table_RecentVideos reloadData];
[self.table_MyVideos reloadData];

NSString* message = [Strings videosDeletedWithCount:deleteCount formatted:nil];
[self showOverlayMessage:message];

// clear all objects form array after deletion.
// To obtain correct count on next deletion process.
[self.arr_SelectedObjects removeAllObjects];
Expand Down
55 changes: 0 additions & 55 deletions Source/OEXStatusMessageViewController.h

This file was deleted.

142 changes: 0 additions & 142 deletions Source/OEXStatusMessageViewController.m

This file was deleted.

39 changes: 0 additions & 39 deletions Source/OEXStatusMessageViewController.xib

This file was deleted.

10 changes: 9 additions & 1 deletion Source/UIViewController+Overlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private class StatusMessageView : UIView {
addSubview(messageLabel)

self.backgroundColor = OEXStyles.sharedStyles().neutralDark().colorWithAlphaComponent(0.75)
messageLabel.attributedText = OEXStatusMessageViewController.statusMessageStyle().attributedStringWithText(message)
messageLabel.attributedText = statusMessageStyle.attributedStringWithText(message)
messageLabel.snp_makeConstraints { make in
make.top.equalTo(self).offset(margin)
make.leading.equalTo(self).offset(margin)
Expand All @@ -38,6 +38,14 @@ private class StatusMessageView : UIView {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private var statusMessageStyle: OEXMutableTextStyle {
let style = OEXMutableTextStyle(weight: .Normal, size: .Base, color: UIColor.whiteColor())
style.alignment = .Center;
style.lineBreakMode = NSLineBreakMode.ByWordWrapping;
return style;

}
}

private let visibleDuration: NSTimeInterval = 5.0
Expand Down
1 change: 0 additions & 1 deletion Source/edX-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#import "OEXRemovable.h"
#import "OEXRouter.h"
#import "OEXSession.h"
#import "OEXStatusMessageViewController.h"
#import "OEXStyles.h"
#import "OEXTextStyle.h"
#import "OEXSwitchStyle.h"
Expand Down
Loading

0 comments on commit cb7d00d

Please sign in to comment.