use of com.mindorks.placeholderview.listeners.ItemRemovedListener in project Grupp by tmoronta1208.
the class VenueVoteSwipeActivity method loadSwipeView.
public void loadSwipeView(final List<Venue> venueVoteList) {
mSwipeView.getBuilder().setDisplayViewCount(3).setSwipeDecor(new SwipeDecor().setPaddingTop(20).setRelativeScale(0.01f).setSwipeInMsgLayoutId(R.layout.card_swipe_in_msg_view).setSwipeOutMsgLayoutId(R.layout.card_swipe_out_msg_view));
mSwipeView.addItemRemoveListener(new ItemRemovedListener() {
@Override
public void onItemRemoved(int count) {
Log.d(TAG, "item removed");
if (count == 0) {
// currentEvent.setVenue_map(venueHashMap);
String id = currentEvent.getEvent_id();
EventGuest currentGuest = currentEvent.getEvent_guest_map().get(CurrentUser.userID);
currentGuest.setVoted(true);
CurrentUserPost.getInstance().postEventGuest(eventID, CurrentUser.userID, currentGuest);
Intent eventIntent = new Intent(VenueVoteSwipeActivity.this, EventActivity.class);
eventIntent.putExtra("eventID", eventID);
eventIntent.putExtra("eventType", eventType);
startActivity(eventIntent);
finish();
}
}
});
for (Venue venue : venueVoteList) {
mSwipeView.addView(new VenueCardView(mContext, venue, mSwipeView, eventID));
}
findViewById(R.id.rejectBtn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mSwipeView.doSwipe(false);
}
});
findViewById(R.id.acceptBtn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mSwipeView.doSwipe(true);
}
});
}
use of com.mindorks.placeholderview.listeners.ItemRemovedListener in project android-mvp-architecture by MindorksOpenSource.
the class MainActivity method setupCardContainerView.
private void setupCardContainerView() {
int screenWidth = ScreenUtils.getScreenWidth(this);
int screenHeight = ScreenUtils.getScreenHeight(this);
mCardsContainerView.getBuilder().setDisplayViewCount(3).setHeightSwipeDistFactor(10).setWidthSwipeDistFactor(5).setSwipeDecor(new SwipeDecor().setViewWidth((int) (0.90 * screenWidth)).setViewHeight((int) (0.75 * screenHeight)).setPaddingTop(20).setSwipeRotationAngle(10).setRelativeScale(0.01f));
mCardsContainerView.addItemRemoveListener(new ItemRemovedListener() {
@Override
public void onItemRemoved(int count) {
if (count == 0) {
// reload the contents again after 1 sec delay
new Handler(getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
mPresenter.onCardExhausted();
}
}, 800);
}
}
});
}
Aggregations