Skip to content

Part-3: Compiler Warnings as Errors - WordPress Module - FragmentManager#19568

Merged
antonis merged 8 commits intowordpress-mobile:trunkfrom
07jasjeet:17253-compiler-warnings-part-3
Nov 22, 2023
Merged

Part-3: Compiler Warnings as Errors - WordPress Module - FragmentManager#19568
antonis merged 8 commits intowordpress-mobile:trunkfrom
07jasjeet:17253-compiler-warnings-part-3

Conversation

@07jasjeet
Copy link
Copy Markdown
Contributor

@07jasjeet 07jasjeet commented Nov 8, 2023

Fixes #17253 partially. (Sub-ticket of #17246)

To test:

  • RoleSelectDialogFragment.java:

    1. Have at least one site.
    2. Navigate to "My Site" tab.
    3. Click on "More".
    4. Click on "People".
    5. On top-left corner, click on the "+" button.
    6. You should have a form in-front of you that is used to invite people.
    7. Click on the "Role" field.
    8. A dialog should pop us as expected.
  • EditPostSettingsFragment.java:

    1. Have a site with a post.
    2. Navigate to "My Site" and click on "Posts" to see all your posts. Open any post in edit mode.
    3. Click on dropdown button on top-left.
    4. Click "Post settings".
    5. Test this screen out and click on various options to open dialogs or activities. Do not go further (Testing individual activity or dialog) as the testing those parts is redundant.
  • MyProfileFragment.java:

    1. Go to "Me" tab using bottom navigation.
    2. Click on "My Profile".
    3. Check every field with internet on and off to ensure toast message is displayed as intended.
  • SiteSettingsTagListActivity.java + SiteSettingsTagDetailFragment:

    1. Navigate to "My Site".
    2. Click on "More".
    3. Click on the option with "Site Settings".
    4. Find a setting called "Tags" and open it.
    5. Create a tag with any title and description if you don't have any.
    6. Click on a tag, navigate back, click on it again and delete the tag to verify the fragment's behaviour.
  • SiteSettingsFragment.java:

    No changes here as migrating to AndroidX Preference is the only way to migrate from getFragmentManager. This issue dictates the progress of the problem I just mentioned. So, for now, this file will remain as is.

  • ImageSettingsDialogFragment.java:

    1. This dialog isn't being used anywhere as of now. So, to test it, enter the following code below in MySiteFragment's onCreate.
    ImageSettingsDialogFragment imageSettingsDialogFragment = new ImageSettingsDialogFragment();
    imageSettingsDialogFragment.show(parentFragmentManager, 
    ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG);
    
    1. A Dialog should pop up as expected.

Regression Notes

  1. Potential unintended areas of impact
    None

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual Testing

  3. What automated tests I added (or what prevented me from doing so)
    None

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes testing checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@07jasjeet 07jasjeet marked this pull request as draft November 8, 2023 09:37
1) Usual changes
2) Removed unused show(T parentActivity) function as we want to encourage the use of childFragmentManager for DialogFragments.
1) Usual Fixes.
2) Replaced getSupportFragmentManager with getChildFragmentManager where Dialogs are used.
Since TextInputDialogFragment was used MyProfileFragment, it was also updated.

Updations (Removal of usage of TargetFragment) to TextInputDialogFragment led to updation of its usage in MySiteFragment.
1) Usual changes.
2) Refactored deprecated usage of optionsCreateMenu with menuProvider.
@07jasjeet 07jasjeet marked this pull request as ready for review November 10, 2023 09:29
@07jasjeet
Copy link
Copy Markdown
Contributor Author

@antonis PR ready for review.

@antonis antonis self-requested a review November 10, 2023 09:33
@antonis antonis added this to the 23.7 milestone Nov 10, 2023
@antonis
Copy link
Copy Markdown
Contributor

antonis commented Nov 10, 2023

Thank you for your contribution @07jasjeet 🙇

@antonis PR ready for review.

Heads up that I plan to review this PR on the week starting on November 20th since I will be out of office next week.

@antonis antonis modified the milestones: 23.7, 23.8 Nov 10, 2023
Copy link
Copy Markdown
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

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

Awesome work @07jasjeet 🏅
The code changes look good and the app behaved as expected in my tests 🎉
Thank you also for providing detailed test instructions 🙇

ImageSettingsDialogFragment.java:
This dialog isn't being used anywhere as of now.

Good catch 👍 I think this can be safely removed. This can be part of a separate PR though to be investigated and tested properly.

Thanks again for contributing to WordPress-Android 🙇‍♂️

@antonis antonis merged commit 8c89d32 into wordpress-mobile:trunk Nov 22, 2023
@antonis
Copy link
Copy Markdown
Contributor

antonis commented Nov 23, 2023

ImageSettingsDialogFragment.java:
This dialog isn't being used anywhere as of now.

Good catch 👍 I think this can be safely removed. This can be part of a separate PR though to be investigated and tested properly.

Heads up that I've opened a PR for this #19658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler Warnings as Errors - WordPress Module - FragmentManager

2 participants