Created
June 13, 2012 19:58
-
-
Save LeastFixedPoint/2926103 to your computer and use it in GitHub Desktop.
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 FindView { | |
public static In in(final View view) { | |
return new In() { | |
@Override | |
@SuppressWarnings("unchecked") | |
public View byId(final int id) { | |
return view.findViewById(id); | |
} | |
}; | |
} | |
public static In in(final Activity activity) { | |
return new In() { | |
@Override | |
@SuppressWarnings("unchecked") | |
public View byId(final int id) { | |
return activity.findViewById(id); | |
} | |
}; | |
} | |
public interface In { | |
<T extends View> T byId(int id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment