Skip to content

Instantly share code, notes, and snippets.

@janishar
Created August 24, 2016 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janishar/e12e0afdbe4f7a799726c8714be4ccf5 to your computer and use it in GitHub Desktop.
Save janishar/e12e0afdbe4f7a799726c8714be4ccf5 to your computer and use it in GitHub Desktop.
@Layout(R.layout.feed_item)
public class InfoView {
@ParentPosition
private int mParentPosition;
@ChildPosition
private int mChildPosition;
@View(R.id.titleTxt)
private TextView titleTxt;
@View(R.id.captionTxt)
private TextView captionTxt;
@View(R.id.timeTxt)
private TextView timeTxt;
@View(R.id.imageView)
private ImageView imageView;
private Info mInfo;
private Context mContext;
public InfoView(Context context, Info info) {
mContext = context;
mInfo = info;
}
@Resolve
private void onResolved() {
titleTxt.setText(mInfo.getTitle());
captionTxt.setText(mInfo.getCaption());
timeTxt.setText(mInfo.getTime());
Glide.with(mContext).load(mInfo.getImageUrl()).into(imageView);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment