-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Used Dialog Fragment to create Remove Group Dialog #3839
Used Dialog Fragment to create Remove Group Dialog #3839
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.
Small naming change! I think the bigger change to how the activity and fragment communicate can come later.
} | ||
|
||
public interface DeleteRepeatDialogCallback { | ||
void deleteGroup(); |
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 should be deleteRepeat
because it does not apply to general groups.
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.
By the way, the delete_repeat
string resource and other related ones are super confusing because they use the word "Group". I think we should change that but it's a separate thing.
..._app/src/main/java/org/odk/collect/android/formentry/repeats/DeleteRepeatDialogFragment.java
Outdated
Show resolved
Hide resolved
bff2d4e
to
f88d23a
Compare
collect_app/src/main/java/org/odk/collect/android/activities/FormEntryActivity.java
Outdated
Show resolved
Hide resolved
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.
ViewModel
structure causes activity leak.
85fce01
to
b9910e4
Compare
PMD issue and then this is ready for QA! |
Hi @lognaturel! Sorry for the pmd issue, just fixed that. |
@SaumiaSinghal I'm a bit confused. Am I right that this fix concerns only Also, Collect crashes when I click on the |
@getodk-bot unlabel "needs testing" |
Hi @mmarciniak90! Sorry for the confusing title. This PR concerns the I will open a PR for |
622c28f
to
14005c4
Compare
Sure @SaumiaSinghal, here is the form: nested-repeats.xml.txt |
Hi @mmarciniak90! Can you test again please? Thanks |
@getodk-bot label "needs testing" |
@SaumiaSinghal I can confirm that crash does not occur but right now when I click on 'Remove Group' accepting button, nothing happens. The group which I try to remove is still there. @getodk-bot unlabel "needs testing" |
Hi @mmarciniak90! I tested it again and it works on my device.:/ I'm attaching the video of the screen recorder here. |
@SaumiaSinghal here is my case: |
} | ||
|
||
public static class TestActivity extends FragmentActivity implements DeleteRepeatDialogFragment.DeleteRepeatDialogCallback { | ||
|
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.
@lognaturel I changed the tests a little bit so as to avoid using protected scope for callback. I like this approach better than directly approaching the interface in the fragment.
Sorry @mmarciniak90! I missed something. Thanks for attaching the gif. I hope it works fine now. |
@SaumiaSinghal I have noticed that when following scenario with don't keep activities turned on:
crash is visible, stacktrace: The crash is not visible for the same scenario and remove response dialog. It is also not visible on master, Could you please take a look? |
9b9c631
to
02f974f
Compare
Hi @kkrawczyk123! Thanks for reporting the crash. It is fixed now. I tested it. |
@SaumiaSinghal I have the latest changes and right now removing the group seems to be broken. Could you please take a look? |
@getodk-bot unlabel "needs testing" |
@SaumiaSinghal are you making sure to run the connected tests for repeat removal after you make a change? Are there tests that catch these regressions? If not, please add coverage as you make the fixes to reduce the risk of future regressions. |
I'm sorry @mmarciniak90 for multiple testings requests. I really hope everything is fine now. |
@SaumiaSinghal I noticed one more crash. Repro steps:
@getodk-bot unlabel "needs testing" |
@mmarciniak90 I fixed the crash, seems like it was because I was using |
@getodk-bot label "needs testing" |
Tested with success Verified on Android: 7.0, 8.1, 9.0 Verified cases:
|
Verified on Androids 5.1, 7.1 and 10. @getodk-bot unlabel "needs testing" |
Work towards #3612
What has been done to verify that this works as intended?
This PR contains the fix for Remove Response Dialog. I tested it.
Why is this the best possible solution? Were any other approaches considered?
I shifted the creating of Alert Dialog to Dialog Fragment and wrote tests for the same.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
No regression risks.
Do we need any specific form for testing your changes? If so, please attach one.
nested-repeats.xml would work (nested-repeats.xml.txt)
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.