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
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary change
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()).
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
Sorry for the long wait ! College work has been keeping me busy. |
Loving the feature. But I'm hoping we can replace the tokenautocomplete library with something better. |
No description provided.