-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I am making Java do things it feels uncomfortable doing. I had to eas…
…e it into it. First we went to the movies, then I took Java out to dinner. Now, she is coming back to my place to embrace the functionality that I will put forth. Ohhhhh, Java, take it
- Loading branch information
Alexander James Wallar
committed
Jan 21, 2014
1 parent
e0246f3
commit 9687576
Showing
10 changed files
with
409 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.locaudio.functional; | ||
|
||
public abstract class Function<T> { | ||
public abstract void run(T input); | ||
|
||
@SuppressWarnings("rawtypes") | ||
public static Function getEmptyFunction() { | ||
return new Function() { | ||
|
||
@Override | ||
public void run(Object input) { | ||
} | ||
|
||
}; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.locaudio.functional; | ||
|
||
import android.app.Activity; | ||
|
||
public abstract class UIFunction<T> extends Function<T> { | ||
|
||
private Activity activity; | ||
|
||
public UIFunction(Activity activity) { | ||
this.activity = activity; | ||
} | ||
|
||
public abstract void runUI(T input); | ||
|
||
public void run(final T input) { | ||
this.activity.runOnUiThread(new Runnable() { | ||
@Override | ||
public void run() { | ||
runUI(input); | ||
} | ||
}); | ||
} | ||
|
||
} |
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
Oops, something went wrong.