diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-04 13:08:15 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-04 13:08:15 +0100 |
| commit | 01de707ee0f6f47cfcb576f0e82e0c65ed8e418a (patch) | |
| tree | 96ebc206fa71d1864b32107685f2754bdcde3c69 /main/src/cgeo/geocaching/connector/UserAction.java | |
| parent | fd2664c70770a1670330b488eb01b3a976a06433 (diff) | |
| download | cgeo-01de707ee0f6f47cfcb576f0e82e0c65ed8e418a.zip cgeo-01de707ee0f6f47cfcb576f0e82e0c65ed8e418a.tar.gz cgeo-01de707ee0f6f47cfcb576f0e82e0c65ed8e418a.tar.bz2 | |
refactoring: make user actions depend on the connector
This enables the contacts addon and search by user/owner for all user
names (independent of the kind of cache). Of course, search by
user/owner still only works for GC, so one cannot find EC owner caches
that way.
Diffstat (limited to 'main/src/cgeo/geocaching/connector/UserAction.java')
| -rw-r--r-- | main/src/cgeo/geocaching/connector/UserAction.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/connector/UserAction.java b/main/src/cgeo/geocaching/connector/UserAction.java new file mode 100644 index 0000000..d0c97bb --- /dev/null +++ b/main/src/cgeo/geocaching/connector/UserAction.java @@ -0,0 +1,32 @@ +package cgeo.geocaching.connector; + +import cgeo.geocaching.utils.RunnableWithArgument; + +import org.eclipse.jdt.annotation.NonNull; + +import android.app.Activity; + +public class UserAction { + + public static class Context { + public final String userName; + public final Activity activity; + + public Context(String userName, Activity activity) { + this.userName = userName; + this.activity = activity; + } + } + + public final int displayResourceId; + private final @NonNull RunnableWithArgument<Context> runnable; + + public UserAction(int displayResourceId, final @NonNull RunnableWithArgument<UserAction.Context> runnable) { + this.displayResourceId = displayResourceId; + this.runnable = runnable; + } + + public void run(Context context) { + runnable.run(context); + } +} |
