This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface StatusItemController : NSObject { | |
NSStatusItem *statusItem; | |
NSMenu *statusMenu; | |
int secondsPassed; | |
} | |
@property (nonatomic, retain) NSMenu *theMenu; | |
@property (nonatomic, retain) NSStatusItem *statusItem; | |
- (void)updateLabel:(id)sender; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation StatusItemController | |
@synthesize theMenu; | |
@synthesize statusItem; | |
- (id)init { | |
if ((self = [super init])) { | |
secondsPassed = 0; | |
NSStatusBar *bar = [NSStatusBar systemStatusBar]; | |
statusItem = [bar statusItemWithLength:NSVariableStatusItemLength]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property Docs : "Macintosh HD:Users:<YOUR NAME>:Downloads:Docs" | |
property Music : "Macintosh HD:Users:<YOUR NAME>:Downloads:Music" | |
property Videos : "Macintosh HD:Users:<YOUR NAME>:Downloads:Videos" | |
property Images : "Macintosh HD:Users:<YOUR NAME>:Downloads:Images" | |
property Profiles : "Macintosh HD:Users:<YOUR NAME>:Downloads:iPhone:Profiles" | |
on adding folder items to thefolder after receiving theAddedItems | |
repeat with eachitem in theAddedItems | |
tell application "Finder" | |
if (name of eachitem ends with ".png") then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property Downloads : "Macintosh HD:Users:clayallsopp:Downloads:" | |
on run | |
tell application "Finder" | |
set d to Downloads as alias | |
set folder_contents to every file in d | |
repeat with eachitem in folder_contents | |
if (name of eachitem ends with ".html") then | |
move eachitem to folder WebDev | |
end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.clayallsopp.isawesome; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class OfflineListActivity extends Activity { | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
> | |
<TextView | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:text="@string/hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.clayallsopp.isawesome; | |
import android.app.ListActivity; | |
import android.os.Bundle; | |
public class OfflineListActivity extends ListActivity { | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<ListView | |
android:id="@android:id/list" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OfflineListActivity extends ListActivity { | |
String[] brocabs = {"Brotocol","Brobot","Theodore Broosevelt"}; | |
ArrayList<String> brocabList = new ArrayList<String>(Arrays.asList(brocabs)); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// EDIT: Shoutout to Cyril Mottier for pointing out that this setContentView isn't necessary | |
// "When using a ListActivity, Android will automatically creates a ListView that fills the screen." | |
// setContentView(R.layout.main); | |
setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,brocabList)); | |
} |
OlderNewer