Comments (6)
As you can see, I already gave unit tests a whirl with this branch. However, most of the other code has a very high complexity that makes it nearly impossible to write good unit tests. Do you think the productive code should be simplified so that we can test it, @adrcotfas ?
from goodtime.
Of course, simplifying the code is always welcome.
from goodtime.
Hi,
it's been quite some time since I opened this, so I wanted to give you a heads-up that I'm still working on this, and a quick update:
All of the logic regarding the interface is in the TimerActivity
, so I think testing it is very important. However it's also not easy, because tests need to test both the behavior ("is the timer running?") and the UI ("Is the button now visible?"). To get a better grip on this, I tried to split the class according to the standard design pattern for Android, Model-View-Presenter, and have both an TimerActivity
and a TimerPresenter
. Also, since the activity is both for the sidebar and the timer UI itself, I wanted to create a TimerFragment
containing only the timer UI. In theory, this means that each class has a single, well-defined responsibility, and testing should be much easier (the TimerPresenter
needs no Android-specific framework, for example, and the TimerFragment
should have no logic tests).
To ease the pain of dependencies, I wanted to use Dagger 2 which has no runtime cost. All of this seems to be best practice for Android apps, but I'm not sure - what do you think of this?
I tried to build a proof of concept for these ideas with some dirty refactorings, but it's not that easy - mostly because I don't have any experience with Dagger. While most of the separate classes look okay and have sane interfaces, there is still a circular dependency that I can't seem to resolve. I will keep trying to work this out, but I wanted your opinion on the whole design before I put more work into it. If you're interested in the code, I can push what I have.
Additionally, I've started this proof of concept more than a month ago, so I missed all your changes since then :( But I hope that a working prototype can be extended and polished quite easily.
from goodtime.
Hi,
You're plan sounds good and I look forward to see what you manage to refactor.
I don't have any experience with Dagger either but if you need any help, please let me know! You could split the work in small tasks in the issue page if you want.
In the past month the changes weren't too numerous I would say and I hope that they will not entangle you :)
from goodtime.
Thanks for your kind words and support! :)
I pushed the non-working proof of concept to a separate branch so you can have a look at it. Please remember that it is not good code, but so much copy-and-pasting and just generally prodding to test if it might work!
I think the best way forward would be to start the redesign all over again, but with much smaller and better defined steps - trying to do everything at once was a bad idea.
As you can see here, I rebased onto your latest changes and then moved some classes around to have a clearer package structure. From this I'm then going to implement a presenter for TimerActivity
. Only when this is working should we start to separate the TimerFragment
. How does this sound to you?
from goodtime.
Sounds good!
I left some comments to your changes.
BTW, I see I forgot to merge some of my recent changes and hopefully they will not affect your new branch too much. I left an explanation of the change here: 0791fc1.
I will merge it now to have the current state of the app on master.
from goodtime.
Related Issues (20)
- [Feature Request] Add ability to attach small text notes to sessions HOT 1
- Show label in notification
- Option to remember filters in statistics page
- Show sessions counter by label
- Improvements to labels
- Feature Request: Separate Label times when changed middle of a session (SubSession logic) HOT 1
- [Feature Request] Allow adding a pre defined amount of time after completion of work and break sessions HOT 2
- feature request: lock device by time intervals
- The minimum value of the time length cannot be 0
- Feature Request: Manual Stopwatch Mode HOT 2
- [Feature Request] Ability to manually set pomodori (completed sessions) for a specific day
- Long break after 4 completed pomodoros
- Option to hide Stop button from the notification
- Notification: Show remaining time even when paused
- Running vs paused icon
- Integration with todo.txt HOT 1
- Enable Combined Filter Options in Statistics
- wearos app
- suggestion
- build fail - jcenter bintray down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goodtime.