Closed vabene1111 closed 6 years ago
Works like a charm! And design isn't bad at all. Maybe I'll tweak text size a bit. I :100: like the idea of using emojis instead of images.
I do not mind using singleton in this case. The only thing that I don't like is the fact of losing the history after switching the app's theme (it's not promotion for using TinyDB, just my concerns:)
Changes
LogActivity.java
and some corresponding classesSingleton.java
following standard Singleton Pattern for Log and Context storageCountersFragment
,EditCounterActivity
andCountersViewModel
History(log)
into the menu corresponding toCountersFragment
Notes
I am no design hero so the log view could be spiced up a little, but i think the unicode symbols work quite well. Screenshot light theme Screenshot darktheme
I use a Singleton to store the logs. We could use the already existent TinyDB but i thought nobody really needs to keep the logs for long, they are just to verify recent changes (at least for me) so i choose a non persistent option. If you dislike the singleton pattern for some reason or want to have the logs stored in the tinyDB please tell me and i will change it.
The Singleton also stores a context wich can be used instead of injecting the context into things like adapters, this is probably not the best practice but i see no problems in this case, if you dont like it i can change it.
I tested it a few times and found nothing broken but if you find a case i missed i will correct it.