DEV Community

Cover image for Reflect for PR1 in Release 0.3
Tong Liu
Tong Liu

Posted on • Updated on

Reflect for PR1 in Release 0.3

Links

Issue link: #6152
Pull Request link: #6186

Which Repository and Issue I was working on?

Although Hacktoberfest has already officially been over, our contribution to GitHub will still be going on. In Release 0.3, we are going to make 2 pull requests, and 2 code reviews. For the first pull request I made, it is an open-source podcast app on Android which has 4.5K stars. The issue I was working on is a new feature adding.

In this issue, the issue reporter suggests adding a mechanism to remember the user’s decision to let the "remove all from inbox" confirmation dialog never show again. Since this was the last repository I was working on for Hacktoberfest 2022, I still remember the structure of this project, I don't need to spend a lot of time getting familiar with the code base, so I decided to work on this one.

How did I fix it?

To make the app remember the users’ decisions on Remove all from inbox dialog, the first solution I came up with was to add the popup dialog with a “never ask again” check box which users can click to check to inform the app that they do not want to see this confirmation again. To make this data persistent, I used the mechanism named “SharedPreference” which is provided by the Android system for developers to save the basic typed data into the app.

I also considered the situation where users may want to withdraw this decision since once the users have checked the “never ask again” check box, they will no longer be able to see this dialog to withdraw their decision. My solution is to add an extra option to the Setting Activity so that the users can toggle on or off the “never show remove all from inbox dialog again”, from which users can withdraw their previous selection.

After a few twitches here and there, this flow finally runs well. This is what this dialog now looks like.

Updated remove all from inbox

Lesson learned

Right before I made a PR, I sent a comment to the issue page to ask what the maintainer thinks about it. However, the maintainer did prefer the already-bloated setting page, since it will give more of a headache in finding the settings they want. He thought it is not necessary to give users a selection for them to withdraw this decision. Hence, I had to remove all the code related to settings.
From this experience, I learned that always make everything clear before starting coding, because I don't want to expect surprise and make the code that I have already written futile.

Top comments (0)