// Path: annotations/src/main/java/com/mnayef/annotations/enums/ImageLibraries.java
// public enum ImageLibraries {
//     PICASSO, FRESCO
// }


import com.mnayef.annotations.Check;
import com.mnayef.annotations.Image;
import com.mnayef.annotations.Link;
import com.mnayef.annotations.Radio;
import com.mnayef.annotations.Text;
import com.mnayef.annotations.Video;
import com.mnayef.annotations.Visibility;
import com.mnayef.annotations.enums.ImageLibraries;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec;
import javax.lang.model.element.Modifier;
package com.mnayef.compiler;



/**
 * Created by Mohamed Hamdan on 2017-May-29.
 * mohamed.nayef95@gmail.com
 */
public class FindViewUtil {

    public static void findProgressBar(TypeSpec.Builder viewHolder, MethodSpec.Builder builder, String fieldName, Image image) {
        viewHolder.addField(FieldSpec.builder(ClassesNames.PROGRESS_BAR, fieldName + "Progress", Modifier.PRIVATE).build());
        builder.addStatement(fieldName + "Progress = ($T) itemView.findViewById($L)", ClassesNames.PROGRESS_BAR, image.progressId());
    }

    public static void findImageView(MethodSpec.Builder builder, String fieldName, Image image) {
// Path: annotations/src/main/java/com/mnayef/annotations/enums/ImageLibraries.java
// public enum ImageLibraries {
//     PICASSO, FRESCO
// }


// Path: compiler/src/main/java/com/mnayef/compiler/FindViewUtil.java
import com.mnayef.annotations.Check;
import com.mnayef.annotations.Image;
import com.mnayef.annotations.Link;
import com.mnayef.annotations.Radio;
import com.mnayef.annotations.Text;
import com.mnayef.annotations.Video;
import com.mnayef.annotations.Visibility;
import com.mnayef.annotations.enums.ImageLibraries;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec;
import javax.lang.model.element.Modifier;

package com.mnayef.compiler;



/**
 * Created by Mohamed Hamdan on 2017-May-29.
 * mohamed.nayef95@gmail.com
 */
public class FindViewUtil {

    public static void findProgressBar(TypeSpec.Builder viewHolder, MethodSpec.Builder builder, String fieldName, Image image) {
        viewHolder.addField(FieldSpec.builder(ClassesNames.PROGRESS_BAR, fieldName + "Progress", Modifier.PRIVATE).build());
        builder.addStatement(fieldName + "Progress = ($T) itemView.findViewById($L)", ClassesNames.PROGRESS_BAR, image.progressId());
    }

    public static void findImageView(MethodSpec.Builder builder, String fieldName, Image image) {
        ClassName imageClass = image.library() == ImageLibraries.FRESCO ? ClassesNames.SIMPLE_DRAWEE_VIEW : ClassesNames.IMAGE_VIEW;