Skip to content

Commit

Permalink
Version 1.0.0.0: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
grp committed Dec 7, 2010
0 parents commit 98d99a5
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions ListLauncher.plist
@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
9 changes: 9 additions & 0 deletions Makefile
@@ -0,0 +1,9 @@

export GO_EASY_ON_ME=1

TWEAK_NAME = ListLauncher
ListLauncher_FILES = Tweak.xm
ListLauncher_FRAMEWORKS = UIKit

include theos/makefiles/common.mk
include $(THEOS_MAKE_PATH)/tweak.mk
84 changes: 84 additions & 0 deletions Tweak.xm
@@ -0,0 +1,84 @@

static id apps = nil;

static int compare_apps(id a, id b, void *c) { return [[a displayName] caseInsensitiveCompare:[b displayName]]; }

%hook SBSearchController
%new(c@:)
- (BOOL)shouldGTFO { return ![[[[self searchView] searchBar] text] isEqualToString:@""];; }
- (BOOL)_hasSearchResults { return YES; }
- (float)tableView:(id)tv heightForRowAtIndexPath:(id)ip { return 44.0f; }
- (id)tableView:(id)tv cellForRowAtIndexPath:(id)ip {
if ([self shouldGTFO]) return %orig;

int s = [ip section];

id cell = [tv dequeueReusableCellWithIdentifier:@"dude"];
if (cell) {
[cell clearContents];
} else {
cell = [[[objc_getClass("SBSearchTableViewCell") alloc] initWithStyle:(UITableViewCellStyle)0 reuseIdentifier:@"dude"] autorelease];
MSHookIvar<float>(cell, "_sectionHeaderWidth") = 39.0f;
[cell setEdgeInset:0];
}

[cell setBadged:NO];
[cell setBelowTopHit:YES];
[cell setUsesAlternateBackgroundColor:NO];
if ([ip section] == 0) [cell setFirstInTableView:YES];
else [cell setFirstInTableView:NO];

[cell setTitle:[[apps objectAtIndex:s] displayName]];
//[cell setAuxiliaryTitle:];
//[cell setSubtitle:];
[cell setFirstInSection:YES];

[[[self searchView] tableView] setScrollEnabled:YES];
[cell setNeedsDisplay];

return cell;
}
- (void)tableView:(id)tv didSelectRowAtIndexPath:(id)ip {
if ([self shouldGTFO]) { %orig; return; }

id a = [apps objectAtIndex:[ip section]];
[[objc_getClass("SBUIController") sharedInstance] activateApplicationAnimated:a];
[tv deselectRowAtIndexPath:ip animated:YES];
}
- (int)tableView:(id)tv numberOfRowsInSection:(int)s {
if ([self shouldGTFO]) return %orig;
else return 1;
}
- (int)numberOfSectionsInTableView:(id)tv {
if ([self shouldGTFO]) return %orig;

if (!apps) {
apps = [[objc_getClass("SBApplicationController") sharedInstance] allApplications];
id x = [[NSMutableArray array] retain];
for (id app in apps) if (![[app tags] containsObject:@"hidden"]) [x addObject:app];
apps = x;
[apps sortUsingFunction:compare_apps context:NULL];
}

return [apps count];
}
- (id)tableView:(id)tv viewForHeaderInSection:(int)s {
if ([self shouldGTFO]) return %orig;

id v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 39.0f, 44.0f)];
id m = [[[objc_getClass("SBIconModel") sharedInstance] applicationIconForDisplayIdentifier:[[apps objectAtIndex:s] displayIdentifier]] getIconImage:0];
id i = [[objc_getClass("UIImageView") alloc] initWithImage:m];
CGRect r = [i frame];
r.size = [m size];
r.origin.y = ([v frame].size.height - r.size.height) / 2;
r.origin.x = ([v frame].size.width - r.size.width) / 2;
[i setFrame:r];
[v addSubview:i];
[v setOpaque:0];
[v setUserInteractionEnabled:NO];

return v;
}
%end


15 changes: 15 additions & 0 deletions control
@@ -0,0 +1,15 @@
Author: chpwn <listlauncher@chpwn.com>
Maintainer: BigBoss <bigboss@thebigboss.org>
Name: ListLauncher
Package: com.chpwn.listlauncher
Section: Tweaks
Pre-Depends: firmware (>= 4.0)
Depends: mobilesubstrate
Version: 1.0.0.0
Architecture: iphoneos-arm
Description: Scrolling list of all your apps for quick access!
Depiction: http://chpwn.com/cydia/listlauncher.html
Homepage: http://chpwn.com/cydia/listlauncher.html
Sponsor: thebigboss.org <http://thebigboss.org>
Tag: cydia::commercial, purpose::extension
dev: chpwn

0 comments on commit 98d99a5

Please sign in to comment.