-
Notifications
You must be signed in to change notification settings - Fork 15
Starred Issues #236
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
base: master
Are you sure you want to change the base?
Starred Issues #236
Conversation
dektar
left a comment
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.
Thanks for working on this! I agree with the way you've implemented the behavior -- I like leaving the issue title off the issue activity and putting the star in there again. I like the drawable on the right that pushes over issue title only when needed, but the contrast isn't sufficient right now (more below).
I have some high-level comments about how we merge starred issues within issues adapter, and about not deleting old starred issues. I will take a more detailed look after these are addressed.
I'd love if we could add some integration tests for showing/hiding the starred issues in the filter. however, we don't have any filtering tests like this yet anyway so if it's not feasible then we can wait until I get those set up.
Thanks again for working on this!
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.
We should be able to add the star as a svg without having to add all these png assets in different directories -- it'll keep the app binary size from increasing as much and reduce overhead for us if we change it in the future. You can download the star from here: https://fonts.google.com/icons?selected=Material+Symbols+Outlined:star:FILL@0;wght@400;GRAD@0;opsz@24&icon.size=24&icon.color=%23e8eaed
To fill it I think you can make an XML using that SVG and then set the android:fillColor.
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 icon isn't high enough contrast. Can we make the star one of the app colors, like dark blue or red or bright blue instead?
5calls/app/src/main/java/org/a5calls/android/a5calls/model/DatabaseHelper.java
Show resolved
Hide resolved
| starredIssues = AppSingleton.getInstance(getApplicationContext()) | ||
| .getDatabaseHelper().getStarredIssues(); | ||
| Log.d(TAG, starredIssues.toString()); | ||
| mIssuesAdapter.setStarredIssues(starredIssues); |
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.
In the DBHelper file, I suggested:
Can we instead say getStarredIssues(List ids) and have the DB lookup just look through the starred ones?
I suggest that getting starred issues from an existing list might also be handy because it means we won't have to call notifyDataSetChanged, instead we can just update our mIssues and notifyItemChanged for each issue that is starred.
In other words, this class will do a lot less work and we'll won't need to redraw the issues list a second time.
5calls/app/src/main/java/org/a5calls/android/a5calls/controller/IssueActivity.java
Show resolved
Hide resolved
| super.onSaveInstanceState(outState); | ||
| outState.putParcelable(KEY_ISSUE, mIssue); | ||
| outState.putBoolean(KEY_IS_LOW_ACCURACY, mIsLowAccuracy); | ||
| outState.putBoolean(KEY_IS_STARRED, mIsStarred); |
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.
If we annotate mIssue with isStarred you wouldn't need to set/get this in the state.
5calls/app/src/main/java/org/a5calls/android/a5calls/model/DatabaseHelper.java
Show resolved
Hide resolved
| } | ||
|
|
||
| public void removeStarredIssue(String issueId) { | ||
| getWritableDatabase().delete( |
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.
please add a test that there's no issue if we remove an issue that's not in in the starred issues DB.
| } | ||
|
|
||
| public void addStarredIssue(String issueId) { | ||
| ContentValues values = new ContentValues(); |
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.
please add a test that adding the same issue twice doesn't cause trouble.
What type of PR is this? (check all applicable)
Description
Implements a starred issue feature. Adds an icon to the app bar in
IssueActivitythat toggles a starred state. This state is stored in a new database table that is fetched during onResume inMainActivityand "trimmed" when the issues list is received from the API.Another notable change, I removed the app bar title from
IssueActivityas it was already being truncated on my phone and adding another icon just further shortened it. Considering the text that was there (the issue title) is directly below I felt that having the first Xteen whatever characters of it in the app bar seemed silly.Were the changes tested?
DatabaseHelperTest.java