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

Add #504 feature request #543

Merged

Conversation

robercoding
Copy link
Contributor

Added requested feature #504
I haven't created any UI Tests because it was giving me that issue with other already implemented UI tests.

package com.github.ashutoshgngwr.noice

object Constants {
const val SELECTED_PRESET_ID = "selectedPresetID"
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this constant to WakeUpTimerFragment's companion? A separate object to declare constants seems unnecessary since only a single class is using the constant in question.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, that solution is much better.

@ashutoshgngwr
Copy link
Member

ashutoshgngwr commented Mar 5, 2021

@robercoding I had to force-push your local fork to remove the translation commit. You'll need to reset your local branch to your local fork's origin.

PS, don't run the following if you have commits saved locally but missing in your fork. It will remove those commits but the changes will remain in your working tree.

git fetch --all
git checkout master
git reset origin/master

PS, you can also add the faulty test-case you mentioned in the issue.

@robercoding
Copy link
Contributor Author

Hey @ashutoshgngwr I did reset my local branch with my fork, and now it shows me that local files are in unstaged state. What should I do there? Do I commit them or?

And yeah, I will add the test-case.

@ashutoshgngwr
Copy link
Member

ashutoshgngwr commented Mar 5, 2021

If these unstaged files are the values (strings) files from the commit that I removed, you can discard them by using:

git checkout -- app/src/main/res

If any file contains your changes, you should commit it. Discard it otherwise.

fix(app) Remove selectedPresetID from Shared Prefs once user delete the preset.
clean(app) Improve code by setting the management of SelectedPresetID on Shared Preferences in WakeUpTimerManager.kt
test(app) Add tests for features "Load Saved Preset", "Load First Preset" in WakeUpTimerFragmentTest.kt
@robercoding
Copy link
Contributor Author

I have made some changes that I believe that are much better than before and then added the tests, tell me if you approve them or want some other changes ✌️.

@ashutoshgngwr ashutoshgngwr marked this pull request as ready for review March 9, 2021 09:50
Copy link
Member

@ashutoshgngwr ashutoshgngwr left a comment

Choose a reason for hiding this comment

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

This is good work. It requires a small change.

Suggestion: We can remove PresetFragment's dependency on WakeUpTimerManager. Instead of removing the preference from storage on deleting a preset, we can use Preset.findByID(...) in WakeUpTimerManager.getSharedPrefsSelectedPresetID(...) to check if it still exists.

I am still running the UI tests on my machine. I don't know if they work, but I'll fix them from my end if they don't. :)

@ashutoshgngwr
Copy link
Member

ashutoshgngwr commented Mar 9, 2021

@robercoding Hey, I am in the middle of making changes. I'll make the ones I left in review as well. I'll request a review from you once I am done.

@ashutoshgngwr
Copy link
Member

@robercoding Can you review the last two commits? GitHub won't allow assigning PR authors as reviewers. 😅

@robercoding
Copy link
Contributor Author

Hey @ashutoshgngwr don't worry, just saw the notification to review but I was kinda late, changes seem pretty good and I see you added new stuff like some unit tests and improved code, so all good 😉✌️.

@ashutoshgngwr ashutoshgngwr merged commit 5f9bfc7 into trynoice:refactor/idk-what-i-am-doing Mar 9, 2021
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.

None yet

2 participants