forked from plusonelabs/calendar-widget
-
Notifications
You must be signed in to change notification settings - Fork 19
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 support for filtering subtasks #105
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/src/main/java/org/andstatus/todoagenda/prefs/HideSubtasks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.andstatus.todoagenda.prefs; | ||
|
||
import androidx.annoation.StringRes; | ||
|
||
import org.andstatus.todoagenda.R; | ||
|
||
/** | ||
* See https://github.com/andstatus/todoagenda/issues/104 | ||
* @author [email protected] | ||
*/ | ||
public enum HideSubtasks { | ||
SHOW_ALL("show_all", R.string.pref_hide_subtasks_show_all), | ||
HIDE_ALL("hide_all", R.string.pref_hide_subtasks_hide_all); | ||
|
||
public final static HideSubtasks defaultValue = SHOW_ALL; | ||
|
||
public final String value; | ||
@StringRes | ||
public final int valueResId; | ||
|
||
HideSubtasks(String value, int valueResId) { | ||
this.value = value; | ||
this.valueResId = valueResId; | ||
} | ||
|
||
public static HideSubtasks fromValue(String value) { | ||
for (HideSubtasks item : HideSubtasks.values()) { | ||
if (item.value.equals(value)) { | ||
return item; | ||
} | ||
} | ||
return defaultValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi @Zocker1999NET Thanks for the contribution.
The strange thing is that your code has lots of compilation errors :-)
Do you use Android Studio for development? I mean it shows all errors and it's easy to fix them...
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.
No :), yesterday I wasn't home while coding, so I wrote the first version in VS Code without any Android/Java plugins applied (otherwise my laptop battery would have been died way too quick). That's why I haven't checked for compile errors for now xD.
I thought I marked this as draft and not as a "ready to merge" PR, but either I missed something or GitHub forgot that … It is not ready to merge yet, I just wanted that you and other collaborators can check on the progress and maybe hint on conceptional errors as early as possible.
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.
As I see, you do most of additions using analogy with adjacent code, so everything is OK so far.
You didn't do all necessary additions for your first step yet, I think,
and this means that adding the new setting to existing tests will allow to show this.
So please don't postpone tests addition to the next implementation step.