Created
August 28, 2016 21:30
-
-
Save janishar/7d9375f7bb1d4dccc97226af37738a22 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
@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