Skip to content

Instantly share code, notes, and snippets.

@janishar
Created August 28, 2016 21:30
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/7d9375f7bb1d4dccc97226af37738a22 to your computer and use it in GitHub Desktop.
Save janishar/7d9375f7bb1d4dccc97226af37738a22 to your computer and use it in GitHub Desktop.
@Layout(R.layout.tinder_card_view)
public class TinderCard {
@View(R.id.profileImageView)
private ImageView profileImageView;
@View(R.id.nameAgeTxt)
private TextView nameAgeTxt;
@View(R.id.locationNameTxt)
private TextView locationNameTxt;
private Profile mProfile;
private Context mContext;
private SwipePlaceHolderView mSwipeView;
public TinderCard(Context context, Profile profile, SwipePlaceHolderView swipeView) {
mContext = context;
mProfile = profile;
mSwipeView = swipeView;
}
@Resolve
private void onResolved(){
Glide.with(mContext).load(mProfile.getImageUrl()).into(profileImageView);
nameAgeTxt.setText(mProfile.getName() + ", " + mProfile.getAge());
locationNameTxt.setText(mProfile.getLocation());
}
@SwipeOut
private void onSwipedOut(){
Log.d("EVENT", "onSwipedOut");
mSwipeView.addView(this);
}
@SwipeCancelState
private void onSwipeCancelState(){
Log.d("EVENT", "onSwipeCancelState");
}
@SwipeIn
private void onSwipeIn(){
Log.d("EVENT", "onSwipedIn");
}
@SwipeInState
private void onSwipeInState(){
Log.d("EVENT", "onSwipeInState");
}
@SwipeOutState
private void onSwipeOutState(){
Log.d("EVENT", "onSwipeOutState");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment