Created
August 24, 2016 20:37
-
-
Save janishar/ec0c583bed360ff94e036db6217ebbfa to your computer and use it in GitHub Desktop.
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
@Parent | |
@SingleTop | |
@Layout(R.layout.feed_heading) | |
public class HeadingView { | |
@View(R.id.headingTxt) | |
private TextView headingTxt; | |
@View(R.id.toggleIcon) | |
private ImageView toggleIcon; | |
@Toggle(R.id.toggleView) | |
private LinearLayout toggleView; | |
@ParentPosition | |
private int mParentPosition; | |
private Context mContext; | |
private String mHeading; | |
public HeadingView(Context context, String heading) { | |
mContext = context; | |
mHeading = heading; | |
} | |
@Resolve | |
private void onResolved() { | |
toggleIcon.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_keyboard_arrow_up_white_24dp)); | |
headingTxt.setText(mHeading); | |
} | |
@Expand | |
private void onExpand(){ | |
toggleIcon.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_keyboard_arrow_down_white_24dp)); | |
} | |
@Collapse | |
private void onCollapse(){ | |
toggleIcon.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_keyboard_arrow_up_white_24dp)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment