Created
July 22, 2014 19:56
-
-
Save snadjafi/dd7748f1e3b51d33c7bd to your computer and use it in GitHub Desktop.
custom view with butterknife exmaple
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 PhotoQuestionAnswer extends FrameLayout { | |
@InjectView(R.id.photo) PicassoImageView photoIv; | |
public PhotoQuestionAnswer(Context context) { | |
this(context, null); | |
} | |
public PhotoQuestionAnswer(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public PhotoQuestionAnswer(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
init(); | |
} | |
private void init() { | |
LayoutInflater.from(getContext()).inflate(R.layout.view_photo_question_answer, this, true); | |
ButterKnife.inject(this); | |
} | |
public void setImageBitmap(Bitmap bm) { | |
photoIv.setImageBitmap(bm); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment