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

adding a custom dialog #74

Merged
merged 4 commits into from
May 8, 2024
Merged

Conversation

Devansh111
Copy link
Contributor

Adding a custom dialog to be shown before the feedback flow dialog fragment

Comment on lines 204 to 205
public void setCustomDialog(@NonNull DialogFragment fragment) {
customFragment = fragment;

Choose a reason for hiding this comment

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

wouldn't it make more sense to add this field to the ShakeDelegate? It's giving me the vibe that communicating little customizations like this is the purpose of the delegate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if you look at the current flow altogether, you can only alter the dialog title and message and not the button text or behavior. And also, the delegate starts the feedback flow whereas we are adding a feature that could be run before the feedback flow if a custom dialog is provided

Comment on lines 189 to 192
sendFeedbackDialog.show(activity.getFragmentManager(), SEND_FEEDBACK_TAG);
if (customFragment != null) {
customFragment.show(activity.getFragmentManager(), CUSTOM_DIALOG_TAG);

Choose a reason for hiding this comment

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

tiny nit - it seems like a lot of the logic above this line could probably go in the else block since we're not actually doing anything with the sendFeedbackDialog right? And then similar question for the shakyFlowCallback on 171 and on 197.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the code as close to existing code as possible and i feel a more condensed if else loop would increase readability and understanding of the logic a lot easier. If it's not a logic breaking change and just for aesthetics, I really appreciate the suggestion but would like to keep the code this way so the PR is short too and easy to track down for other developers

@kkoser kkoser merged commit e97ee45 into linkedin:main May 8, 2024
2 checks passed
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.

4 participants