Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add drag and drop functionality to the recipient views #2451

Closed
wants to merge 3 commits into from

Conversation

rhari991
Copy link

No description provided.

@Valodim Valodim self-assigned this Mar 30, 2017
Copy link
Contributor

@Valodim Valodim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the look & feel of this are fine now, nice work! code structure still needs some work though :)

@@ -121,7 +209,7 @@ private View inflateLayout() {
return layoutInflater.inflate(R.layout.recipient_token_item, null, false);
}

private void bindObjectView(Recipient recipient, View view) {
private void bindObjectView(final Recipient recipient, View view) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted, sorrry.

@@ -54,6 +54,10 @@
private final ViewAnimator recipientExpanderContainer;
private final ViewAnimator cryptoSpecialModeIndicator;
private RecipientPresenter presenter;
private boolean dragTakingPlace = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an MvpView class, meaning it should strictly contain "setContent" style methods, and as little logic or state as possible

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved all of the state code to the presenter.

dragListener = listener;
}

private void addDragAndDropFunctionality(Context context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this functionality deserves a class of its own, something like RecipientDragAndDropUseCase, that on creation receives the state it needs and a reference to the MvpView to do UI things, and exists as long as a drag is going on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean a reference to the RecipientSelectView ? There is very little interaction between RecipientMvpView and RecipientSelectView for drag and drop (only one call to onClickRecipientExpander()).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've implemented this, but I'm sure if I've done it correctly.

@@ -1797,4 +1808,13 @@ public int getTitleResource() {
return titleResource;
}
}

private class RecipientDropListener implements View.OnDragListener {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be part of DragAndDropUseCase (see below)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to do this.

@rhari991
Copy link
Author

rhari991 commented Apr 25, 2017

@Valodim I made the changes in PR #2511

@rhari991
Copy link
Author

Sorry for the long wait ! College work has been keeping me busy.

@cketti
Copy link
Member

cketti commented Jan 8, 2020

Loving the feature. But I'm hoping we can replace the tokenautocomplete library with something better.

@cketti cketti closed this Jan 8, 2020
@cketti cketti deleted the playground-draggable branch January 28, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants