butterknife
Class Views

java.lang.Object
  extended by butterknife.Views

public class Views
extends Object

View injection utilities.


Nested Class Summary
static class Views.Finder
           
static class Views.InjectViewProcessor
           
static class Views.UnableToInjectException
           
 
Method Summary
static
<T extends android.view.View>
T
findById(android.app.Activity activity, int id)
          Simpler version of Activity.findViewById(int) which infers the target type.
static
<T extends android.view.View>
T
findById(android.view.View view, int id)
          Simpler version of View.findViewById(int) which infers the target type.
static void inject(android.app.Activity target)
          Inject fields annotated with InjectView in the specified Activity.
static void inject(Object target, android.app.Activity source)
          Inject fields annotated with InjectView in the specified source using the target Activity as the view root.
static void inject(Object target, android.view.View source)
          Inject fields annotated with InjectView in the specified source using the target View as the view root.
static void inject(android.view.View target)
          Inject fields annotated with InjectView in the specified View.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

inject

public static void inject(android.app.Activity target)
Inject fields annotated with InjectView in the specified Activity. The current content view is used as the view root.

Parameters:
target - Target activity for field injection.
Throws:
Views.UnableToInjectException - if injection could not be performed.

inject

public static void inject(android.view.View target)
Inject fields annotated with InjectView in the specified View. The view and its children are used as the view root.

Parameters:
target - Target view for field injection.
Throws:
Views.UnableToInjectException - if injection could not be performed.

inject

public static void inject(Object target,
                          android.app.Activity source)
Inject fields annotated with InjectView in the specified source using the target Activity as the view root.

Parameters:
target - Target class for field injection.
source - Activity on which IDs will be looked up.
Throws:
Views.UnableToInjectException - if injection could not be performed.

inject

public static void inject(Object target,
                          android.view.View source)
Inject fields annotated with InjectView in the specified source using the target View as the view root.

Parameters:
target - Target class for field injection.
source - View root on which IDs will be looked up.
Throws:
Views.UnableToInjectException - if injection could not be performed.

findById

public static <T extends android.view.View> T findById(android.view.View view,
                                                       int id)
Simpler version of View.findViewById(int) which infers the target type.


findById

public static <T extends android.view.View> T findById(android.app.Activity activity,
                                                       int id)
Simpler version of Activity.findViewById(int) which infers the target type.



Copyright © 2013 Square, Inc.. All Rights Reserved.