-
-
Notifications
You must be signed in to change notification settings - Fork 86
Fixes the CardView customization mentioned in #1582 #1595
Conversation
To include support card
084c317
to
292f560
Compare
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 try to not format the whole file in the future - either use a different PR for reformatting / adapt the formatting rules in your IDE to the previously used version. That also happens to me every time :D
Some of your commit messages can be more intuitive ;)
Add some sort of comment (e.g. "Value is only written in the editor, changes are not yet copied back in the shared preferences.") to line 118 in card.kt
to make obvious that the changes are not yet applied. I cannot annotate the function with a comment myself since there are no changes. Afterwards it should be ready to merge!
app/src/main/java/de/tum/in/tumcampusapp/component/ui/overview/MainFragment.kt
Outdated
Show resolved
Hide resolved
Are you refering to the first |
The code is great! TCA_weird_reload_beahvior.webm |
I was able to fix both issues. However, the fix for the visibility of the news card does not fix the root cause described here #1597. But it will work perfectly for the startpage without further issues. |
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.
Amazing, thank you for looking into it! I could not spot any bug anymore.
Issue
This fixes the following issue(s):
What it does
This PR rewrites the way Cards handle its discard and alyways hide functionality. It moves all information stored for the card in regards to the discard functionality into one SharedPreference per Card. This shared preference can then be completly wiped when restoring the card. The alyways hide functionality is set in the default SharedPreferences by a key defined in the new CardType enum. This key is stored in the String resource file making it easy to use across the Application and preventing accidental differnces in these keys. The usage of String resource also allows for seamless integration into the Settings.xml ensuring synchronity between the state of the Card. Also settings option for every Card were added because previously there was no way to restore these once alyawys hide was pressed. The CardTypes enum and the combination with the string resource also makes the addition of new Cards less error prone as it is more centralized. The PR also fixes a bug when refreshing the CardView leading to an error when using doAsync from Anko and a crash when using coroutines as mentioned here.
Why this is useful for all students
This PR fixes the issues mentioned in #1582. Thus enhancing the user experience by restoring the excepted functionality.