react-native-video-trim 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,12 +3,9 @@
3
3
  @interface ProgressAlertController : UIViewController
4
4
 
5
5
  @property (nonatomic, copy) void (^onDismiss)(void);
6
- @property (nonatomic, strong) UILabel *titleLabel;
7
- @property (nonatomic, strong) UIProgressView *progressBar;
8
- @property (nonatomic, strong) UIButton *actionButton;
9
6
 
10
- - (void)setTitle:(NSString *)title;
11
- - (void)setCancelTitle:(NSString *)title;
7
+ - (void)setTitle:(NSString *)text;
8
+ - (void)setCancelTitle:(NSString *)text;
12
9
  - (void)setProgress:(float)progress;
13
10
  - (void)showCancelBtn;
14
11
 
@@ -1,7 +1,25 @@
1
1
  #import "ProgressAlertController.h"
2
2
 
3
+ @interface ProgressAlertController ()
4
+
5
+ @property (nonatomic, strong) UILabel *titleLabel;
6
+ @property (nonatomic, strong) UIProgressView *progressBar;
7
+ @property (nonatomic, strong) UIButton *actionButton;
8
+
9
+ @end
10
+
3
11
  @implementation ProgressAlertController
4
12
 
13
+ - (instancetype)init {
14
+ // init early because in VideoTrim.mm we call this before presenting the view controller (before viewDidLoad)
15
+ if (self = [super init]) {
16
+ self.titleLabel = [[UILabel alloc] init];
17
+ self.progressBar = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
18
+ self.actionButton = [UIButton buttonWithType:UIButtonTypeSystem];
19
+ }
20
+ return self;
21
+ }
22
+
5
23
  - (void)viewDidLoad {
6
24
  [super viewDidLoad];
7
25
  [self setupBackground];
@@ -14,26 +32,32 @@
14
32
 
15
33
  - (void)setupAlertView {
16
34
  UIView *alertView = [[UIView alloc] init];
17
- alertView.backgroundColor = [UIColor colorWithRed:28/255.0 green:28/255.0 blue:30/255.0 alpha:1.0];
35
+ alertView.backgroundColor = [UIColor colorWithRed:28.0/255.0 green:28.0/255.0 blue:30.0/255.0 alpha:1.0];
18
36
  alertView.layer.cornerRadius = 12;
19
37
  alertView.translatesAutoresizingMaskIntoConstraints = NO;
20
38
  [self.view addSubview:alertView];
39
+
40
+ // AlertView Constraints
21
41
  [NSLayoutConstraint activateConstraints:@[
22
42
  [alertView.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor],
23
43
  [alertView.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor],
24
44
  [alertView.widthAnchor constraintEqualToConstant:270]
25
45
  ]];
26
- self.titleLabel = [[UILabel alloc] init];
46
+
47
+ // Title Label
27
48
  self.titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
28
49
  self.titleLabel.textAlignment = NSTextAlignmentCenter;
29
50
  self.titleLabel.font = [UIFont systemFontOfSize:18];
30
51
  self.titleLabel.numberOfLines = 0;
31
52
  self.titleLabel.textColor = [UIColor whiteColor];
32
53
  [alertView addSubview:self.titleLabel];
33
- self.progressBar = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
54
+
55
+ // Progress Bar
34
56
  self.progressBar.translatesAutoresizingMaskIntoConstraints = NO;
35
57
  [alertView addSubview:self.progressBar];
36
- self.actionButton = [UIButton buttonWithType:UIButtonTypeSystem];
58
+
59
+ // Action Button
60
+
37
61
  [self.actionButton setTitle:@"Cancel" forState:UIControlStateNormal];
38
62
  [self.actionButton setTitleColor:[UIColor systemPinkColor] forState:UIControlStateNormal];
39
63
  self.actionButton.titleLabel.font = [UIFont systemFontOfSize:16];
@@ -41,13 +65,17 @@
41
65
  self.actionButton.translatesAutoresizingMaskIntoConstraints = NO;
42
66
  self.actionButton.hidden = YES;
43
67
  [alertView addSubview:self.actionButton];
68
+
69
+ // Constraints for titleLabel, progressBar, and actionButton
44
70
  [NSLayoutConstraint activateConstraints:@[
45
71
  [self.titleLabel.topAnchor constraintEqualToAnchor:alertView.topAnchor constant:16],
46
72
  [self.titleLabel.leadingAnchor constraintEqualToAnchor:alertView.leadingAnchor constant:16],
47
73
  [self.titleLabel.trailingAnchor constraintEqualToAnchor:alertView.trailingAnchor constant:-16],
74
+
48
75
  [self.progressBar.topAnchor constraintEqualToAnchor:self.titleLabel.bottomAnchor constant:16],
49
76
  [self.progressBar.leadingAnchor constraintEqualToAnchor:alertView.leadingAnchor constant:16],
50
77
  [self.progressBar.trailingAnchor constraintEqualToAnchor:alertView.trailingAnchor constant:-16],
78
+
51
79
  [self.actionButton.topAnchor constraintEqualToAnchor:self.progressBar.bottomAnchor constant:16],
52
80
  [self.actionButton.bottomAnchor constraintEqualToAnchor:alertView.bottomAnchor constant:-16],
53
81
  [self.actionButton.centerXAnchor constraintEqualToAnchor:alertView.centerXAnchor]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-video-trim",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "Video trimmer for your React Native app",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",