UniRegensburg / unsere-app-fur-die-universitat-regensburg-bib-buddy

Bib Buddy - deine App für eine konzentrierte, offene Literaturarbeit!
0 stars 0 forks source link

Fix and clean note related features #149

Closed xSabrina closed 3 years ago

xSabrina commented 3 years ago

Description

This merges fix a bug when alignment changes have not been saved correctly so on editting notes they were resetted. This is fixed by fetching the entire content to convert to html (without cutting anything off - see the notes below) and manually replacing the alignment-declarations with a style-text-alignment tag.

They also contain a simplification of the DateConverter and separate date-converting methods have been replaced by its usages.

Additionally some code cleans up like removing unnecessary code , insert blank lines for better readability and adjust the commenting on some classes have been done. Please take note of that unnecessary setter-methods have been removed from the note-class since we never manually asign those to note-objects, but always create note-objects with the according params fetched from the database. Also regard that as clean up in the TextNoteEditorFragment layout the RichTextEditor element has been moved out of the relative layout for the format toolbar.

Affects

Mainly a bug @LuisMossburger noticed and comment text in format and content, so he should take a look.

Notes for Reviewer

The alignment related bug was caused by the way the Html.toHtml() was fetching the elements (it only fetched everything inside \<p> elements before) and how it works in general when converting spans to html-tags. Setting a text-alignment different to the normal (left) one shows up as simple align="center" or align="right" in the html-element (even when using gravity etc for it) and that is how it is saved in the database string as well - you can check that for your regEx-adjustments by printing the Html.toHtml()-output in the logs by yourself if necessary.

Please review & comment/approve. Thanks!