congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FieldAnnotationParser.setViewFields
Code IndexAdd Tabnine to your IDE (free)

How to use
setViewFields
method
in
uk.co.ribot.easyadapter.annotations.FieldAnnotationParser

Best Java code snippets using uk.co.ribot.easyadapter.annotations.FieldAnnotationParser.setViewFields (Showing top 6 results out of 315)

origin: ribot/easy-adapter

/**
 * @param view the parent view where the held views reside
 */
public ViewHolder(View view) {
  mView = view;
  FieldAnnotationParser.setViewFields(this, view);
}
origin: ribot/easy-adapter

/**
 * Constructs a ActivityViewHolder using an activity
 *
 * @param activity the Activity where the held views reside
 */
public ActivityViewHolder(Activity activity) {
  mActivity = activity;
  FieldAnnotationParser.setViewFields(this, activity);
}
origin: ribot/easy-adapter

/**
 * Parse {@link ViewId} annotation and try to assign the view with that id to the annotated field.
 * It will throw a {@link ClassCastException} if the field and the view with the given ID have different types.
 *
 * @param object object where the annotation is.
 * @param view   parent view that contains a view with the viewId given in the annotation.
 */
public static void setViewFields(final Object object, final View view) {
  setViewFields(object, new ViewFinder() {
    @Override
    public View findViewById(int viewId) {
      return view.findViewById(viewId);
    }
  });
}
origin: ribot/easy-adapter

/**
 * Parse {@link ViewId} annotation and try to assign the view with that id to the annotated field.
 * It will throw a {@link ClassCastException} if the field and the view with the given ID have different types.
 *
 * @param object   object where the annotation is.
 * @param activity activity that contains a view with the viewId given in the annotation.
 */
public static void setViewFields(final Object object, final Activity activity) {
  setViewFields(object, new ViewFinder() {
    @Override
    public View findViewById(int viewId) {
      return activity.findViewById(viewId);
    }
  });
}
origin: ribot/easy-adapter

@Test public void testSetViewFields() throws Exception {
  TestObjectWithAnnotations testObject = new TestObjectWithAnnotations();
  FieldAnnotationParser.setViewFields(testObject, createTestLinearLayout());
  Assert.assertNotNull(testObject.textView);
  Assert.assertNotNull(testObject.imageView);
}
origin: ribot/easy-adapter

@Test public void testSetViewFieldsActivity() throws Exception {
  Activity testActivity = Robolectric.buildActivity(TestActivity.class).create().get();
  TestObjectWithAnnotations testObject = new TestObjectWithAnnotations();;
  FieldAnnotationParser.setViewFields(testObject, testActivity);
  Assert.assertNotNull(testObject.textView);
  Assert.assertNotNull(testObject.imageView);
}
uk.co.ribot.easyadapter.annotationsFieldAnnotationParsersetViewFields

Javadoc

Parse ViewId annotation and try to assign the view with that id to the annotated field. It will throw a ClassCastException if the field and the view with the given ID have different types.

Popular methods of FieldAnnotationParser

    Popular in Java

    • Reactive rest calls using spring rest template
    • onCreateOptionsMenu (Activity)
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • getExternalFilesDir (Context)
    • BufferedImage (java.awt.image)
      The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
    • URLConnection (java.net)
      A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
    • Connection (java.sql)
      A connection represents a link from a Java application to a database. All SQL statements and results
    • Hashtable (java.util)
      A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
    • Timer (java.util)
      Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
    • Annotation (javassist.bytecode.annotation)
      The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
    • Top plugins for Android Studio
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now