Skip to content

Commit

Permalink
Merge branch 'master' into statusBarAlerts
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhajas committed Apr 10, 2011
2 parents 5e23aaf + 8ae4c9b commit 07f66dd
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 37 deletions.
1 change: 1 addition & 0 deletions Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ MobileNotifier Authors

Peter Hajas
Ryan Petrich
Tim Horton
Conrad Kramer
Tim Novinger
2 changes: 0 additions & 2 deletions MNAlertDashboardViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
UIButton *clearAllButton;

UITableView *alertListView;

UIImageView *alertListViewBackground;

bool dashboardShowing;

Expand Down
29 changes: 10 additions & 19 deletions MNAlertDashboardViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,9 @@ -(id)initWithDelegate:(id)__delegate;
alertListView.delegate = self;
alertListView.dataSource = self;
[alertListView setAlpha:1.0];
alertListView.backgroundColor = [UIColor clearColor];
alertListView.backgroundColor = [UIColor whiteColor];
alertListView.layer.cornerRadius = 10;

//Background for the alertListView
alertListViewBackground = [[UIImageView alloc] initWithFrame:CGRectMake(16.5,112,287,325)];
alertListViewBackground.image = [UIImage imageWithContentsOfFile:@"/Library/Application Support/MobileNotifier/listViewBackground.png"];
[alertListViewBackground setAlpha:1.0];

//Dashboard background image
dashboardBackground = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,screenBounds.size.width,screenBounds.size.height)];
dashboardBackground.image = [UIImage imageWithContentsOfFile:@"/Library/Application Support/MobileNotifier/dashboardBackground.png"];
Expand Down Expand Up @@ -97,14 +92,12 @@ -(id)initWithDelegate:(id)__delegate;
dashboardShowing = NO;
[window addSubview:dashboardBackground];
[window addSubview:returnToApplicationButton];
[window addSubview:alertListViewBackground];
[window addSubview:alertListView];
[window addSubview:clearAllButton];

//Release stuff we don't need to hang on to

[alertListView release];
[alertListViewBackground release];
[dashboardBackground release];

[UIView setAnimationDidStopSelector:@selector(animationDidStop:didFinish:inContext:)];
Expand All @@ -118,24 +111,26 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
{
//Dismiss the alert
[_delegate dismissedAlertAtIndex:indexPath.row];

//Delete row from tableview
[alertListView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];
//Update ourselves
[alertListView reloadData];
}
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//Take action on the alert
[_delegate actionOnAlertAtIndex:indexPath.row];
//Update ourselves
[alertListView reloadData];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MNTableViewCell *cell = [[[MNTableViewCell alloc] init] autorelease];
MNTableViewCell *cell = (MNTableViewCell *) [tableView dequeueReusableCellWithIdentifier:@"notificationTableCell"];

if (cell == nil)
{
cell = [[[MNTableViewCell alloc] init] autorelease];
}

MNAlertData *dataObj = [[_delegate getPendingAlerts] objectAtIndex:indexPath.row];

Expand Down Expand Up @@ -219,7 +214,6 @@ -(void)fadeDashboardAway

// Shrink the elements and fade out
// to create a zoom out effect
alertListViewBackground.transform = CGAffineTransformMakeScale(0.1,0.1);
alertListView.transform = CGAffineTransformMakeScale(0.1,0.1);
clearAllButton.transform = CGAffineTransformMakeScale(0.1,0.1);

Expand All @@ -240,7 +234,6 @@ -(void)showDashboard
dashboardShowing = YES;

// Restore previously transformed elements
alertListViewBackground.transform = CGAffineTransformIdentity;
alertListView.transform = CGAffineTransformIdentity;
clearAllButton.transform = CGAffineTransformIdentity;

Expand All @@ -265,7 +258,6 @@ -(void)clearDashboardPushed:(id)sender
// Temporarily reposition window and elements
// to cover up the application switcher drawer
[window setFrame:CGRectMake(0,0,320,480)];
[alertListViewBackground setFrame:CGRectMake(15,20,290,322)];
[alertListView setFrame:CGRectMake(16,20,287,322)];
[clearAllButton setAlpha:0];

Expand All @@ -274,14 +266,14 @@ -(void)clearDashboardPushed:(id)sender
{
[clearActionSheet removeFromSuperview];
[clearActionSheet showInView:window];
[clearActionSheet setFrame:CGRectMake(0,320,320,165)];
[clearActionSheet setFrame:CGRectMake(0,300,320,185)];
[window addSubview:clearActionSheet];
}
else
{
//If they're on an older device, do some fancy footwork to get the UIActionSheet to show up
[clearActionSheet showInView:window];
[clearActionSheet setFrame:CGRectMake(0,320,320,165)];
[clearActionSheet setFrame:CGRectMake(0,300,320,185)];
}
}

Expand All @@ -301,7 +293,6 @@ -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)

// Restore window and elements to original positions
[window setFrame:CGRectMake(0,-92,320,480)];
[alertListViewBackground setFrame:CGRectMake(15,112,290,322)];
[alertListView setFrame:CGRectMake(16,112,287,322)];
[clearAllButton setAlpha:1.0];
}
Expand Down
6 changes: 3 additions & 3 deletions MNLockScreenViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ -(id)initWithDelegate:(id)__delegate;
backgroundImageView.image = [UIImage imageWithContentsOfFile:@"/Library/Application Support/MobileNotifier/lockscreenbg.png"];
backgroundImageView.opaque = NO;

numberOfPendingAlertsLabel = [[UILabel alloc] initWithFrame:CGRectMake(265,18,35,22)];
numberOfPendingAlertsLabel = [[UILabel alloc] initWithFrame:CGRectMake(265,21,35,22)];
numberOfPendingAlertsLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
numberOfPendingAlertsLabel.textAlignment = UITextAlignmentCenter;
numberOfPendingAlertsLabel.textColor = [UIColor blackColor];
numberOfPendingAlertsLabel.backgroundColor = [UIColor clearColor];
numberOfPendingAlertsLabel.opaque = NO;

numberOfPendingAlertsBackground = [[UIImageView alloc] initWithFrame:CGRectMake(270,20,27,20)];
numberOfPendingAlertsBackground = [[UIImageView alloc] initWithFrame:CGRectMake(270,22,27,20)];
numberOfPendingAlertsBackground.image = [UIImage imageWithContentsOfFile:@"/Library/Application Support/MobileNotifier/lockscreen-count-bg.png"];
numberOfPendingAlertsBackground.opaque = NO;

mobileNotifierTextLabel = [[UILabel alloc] initWithFrame:CGRectMake(60,20,180,22)];
mobileNotifierTextLabel.text = @"MobileNotifier";
mobileNotifierTextLabel.text = @"Missed Notifications";
mobileNotifierTextLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:18];
mobileNotifierTextLabel.textAlignment = UITextAlignmentLeft;
mobileNotifierTextLabel.textColor = [UIColor whiteColor];
Expand Down
22 changes: 10 additions & 12 deletions MNTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ @implementation MNTableViewCell

-(id)init
{
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"notificationTableCell"];
if(self != nil)
{
CGRect aframe = self.frame;
self.frame = CGRectMake(aframe.origin.x,aframe.origin.y,290,60);
CGRect frame = CGRectMake(self.frame.origin.x,self.frame.origin.y,290,60);

backgroundImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 287.5, 60.0)];
backgroundImageView = [[UIImageView alloc] initWithFrame:frame];
backgroundImageView.image = [UIImage imageWithContentsOfFile:@"/Library/Application Support/MobileNotifier/row_bg.png"];

backgroundShadowImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 287.5, 60.0)];
backgroundShadowImageView = [[UIImageView alloc] initWithFrame:frame];
backgroundShadowImageView.userInteractionEnabled = NO;

iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(13.5, 13.5, 33.0, 33.0)];
Expand All @@ -37,13 +36,12 @@ -(id)init
iconImageView.layer.cornerRadius = 5.5;
iconImageView.layer.masksToBounds = YES;

//Add everything to our view

[self addSubview:backgroundImageView];
[self addSubview:iconImageView];
[self addSubview:alertTextLabel];
[self addSubview:headerLabel];
[self addSubview:backgroundShadowImageView];
//Add everything to the table view cell
[self.contentView addSubview:backgroundImageView];
[self.contentView addSubview:iconImageView];
[self.contentView addSubview:alertTextLabel];
[self.contentView addSubview:headerLabel];
[self.contentView addSubview:backgroundShadowImageView];

self.clipsToBounds = YES;

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
MODULES=congruence
include $(THEOS)/makefiles/common.mk

TWEAK_NAME = MobileNotifier
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ Jay Freeman - saurik.com - for MobileSubstrate, Cydia, Cycript, Veency and count
Kyle Adams - kyleadams.org - for his work on the user interface for the project and prerelease testing

Tim Novinger - timnovinger.com - for his work on modernizing animations, cleaning up the interface and tons of other improvements

Tim Horton - hortont.com - for his help with debugging and testing
14 changes: 14 additions & 0 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,20 @@ PHACInterface *phacinterface;
}
}

-(BOOL)toggleMediaControls
{
BOOL returnValue = %orig;
if([self isShowingMediaControls])
{
[manager hideLockscreen];
}
else
{
[manager showLockscreen];
}
return returnValue;
}

%end

%hook SBUIController
Expand Down

0 comments on commit 07f66dd

Please sign in to comment.